answerLoopsanswerLoops Docs
ReferenceAgent API

Open a new support ticket on behalf of a user

Runs through the same AI triage/answer pipeline as every other channel (Discord, Slack, email) — the ticket may get auto-answered if confidence is high, otherwise it queues for human review.

POST
/api/v1/agent/tickets

Authorization

bearerAuth tickets:write
AuthorizationBearer <token>

Org-scoped API key generated in Settings → API Keys (al_live_ prefix). Shared with the MCP server — the same key authenticates both surfaces. A key carries a set of least-privilege scopes; each operation lists the scope it requires. A key missing a required scope gets 403 with a WWW-Authenticate: Bearer error="insufficient_scope" header. Scope catalogue: see the x-api-scopes object and /.well-known/oauth-protected-resource.

In: header

Scope: tickets:write

Header Parameters

Idempotency-Key?string

Retrying with the same key returns the original ticket instead of opening a duplicate. Equivalent to the request body's idempotencyKey field — this header takes precedence when both are sent.

Lengthlength <= 200

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/agent/tickets" \  -H "Content-Type: application/json" \  -d '{    "content": "string"  }'
{  "ticket_id": 0,  "duplicate": true}
{  "error": {    "message": "string",    "code": "rate_limited"  }}
{  "error": {    "message": "string",    "code": "rate_limited"  }}
{  "error": {    "message": "string",    "code": "rate_limited"  }}
{  "error": {    "message": "string",    "code": "rate_limited"  }}