---
title: "Open a support ticket"
method: POST
path: "/tickets"
tags: ["tickets"]
---

# Open a support ticket

`POST /tickets`

## Request

- Base URL: `https://api.instruxi.dev/api/v1/enforcer`
- URL: `https://api.instruxi.dev/api/v1/enforcer/tickets`
- Auth: one of:
  - API key in header `Authorization`
  - API key in header `X-API-Key`

Create a ticket (with its first message) as the authenticated account. Notifies the tenant's support inbox.

Support staff (a `tenant_read` holder in the tenant, i.e. the `developer` role and up) may pass `requester_account_id` to open the ticket ON BEHALF OF another account in the same tenant — the agent-on-a-call path. The ticket then belongs to that customer, so `GET /tickets?requester=` finds it and the customer's own owner-baseline read can see it; the first message is still authored by the agent who typed it. A non-staff caller passing someone else's id gets 403, and an unknown or cross-tenant id gets 400.

## Request body

- InternalDeliveryHttpHandlerTicketCreateRequest
  - `body` string
  - `priority` string
  - `requester_account_id` string
  - `subject` string

## Response `201`

Created

- InternalDeliveryHttpHandlerTicketResponse
  - `data` EnforcerV3InternalDomainTicketTicket
    - `assignee_account_id` string
    - `closed_at` string
    - `created_at` string
    - `external_key` string: ExternalKey is the FILING SYSTEM's own id for the thing this ticket is about — a payment id, a refund id — set only when a service raised it. It exists because Kafka is at-least-once: a redelivered message, a DLQ replay or two consumer replicas racing would each open a fresh ticket for one payout, and three copies of a problem is worse than none — the second agent works a ticket the first already answered. Unique per tenant (partial index, migration 000090), so a re-file returns the existing row. Read-only to clients: a requester cannot claim a service's key.
    - `id` string
    - `priority` string
    - `requester_account_id` string
    - `source` string
    - `status` string
    - `subject` string
    - `tenant_id` string
    - `ticket_number` integer: TicketNumber is the human reference ("ticket #1042") — DB-generated identity, global across tenants (see migration 000061).
    - `updated_at` string
  - `success` boolean

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `500`: Internal Server Error

---

[API](https://skmtc.dev/instruxi/apis/enforcer-api.md) · [All operations](https://skmtc.dev/instruxi/apis/enforcer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/instruxi/apis/enforcer-api/revisions/fa82bc1becc0?raw)
