Add
[POST] .../v1/ticket/add
Creates a CRM ticket. Create or reuse a CRM support ticket for a client and channel. Requires client_id, channel_id and CRM ticket add permission; direction defaults to Inbound. An explicitly assigned responsible user must have an active work session and not be on break; otherwise channel routing selects the responsible user. An optional audio_recording_file_id must identify an existing audio file. Mentioned users must already be in the ticket context unless mention_options.add_missing_users_to_context is true. A new ticket receives participants, a linked chat and channel SLA deadlines. If an open ticket already exists for the same client and channel, returns its id, may update SLA, custom fields and the audio recording and rejects description_mentions. Returns new_id and sends the applicable ticket, chat and SLA webhooks. Invalid or unavailable related data, denied access, custom-field or mention validation failures, assignment restrictions and storage failures return HTTP 200 ErrorResult.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| audio_recording_file_id | Int64 | Optional | Linked audio recording file ID. Optional; when supplied, it must point to an existing audio file. |
| channel_id | Int64 | Required | Channel ID. |
| client_id | Int64 | Required | Client ID. |
| description | String | Optional | Ticket description. |
| description_mentions | Array of CommonMentionInput | Optional | Structured user mentions in description. |
| direction | String | Optional | Direction: Inbound or Outbound. Default value is Inbound. Allowed values: Default, Inbound, Outbound. |
| external_dialog_id | String | Optional | External dialog ID. Maximum length is 150 characters. |
| fields | Array of FieldValueAdd | Optional | Custom field values. |
| mention_options | CommonMentionOptions | Optional | Mention processing options. |
| participant_user_ids | Array of Int64 | Optional | Ticket participant IDs. |
| responsible_user_id | Int64 | Optional | Responsible user ID. |
| subject | String | Optional | Ticket subject. Maximum length is 300 characters. |
Request Example
{
"client_id": 501,
"channel_id": 22,
"direction": "Inbound",
"external_dialog_id": "web-778",
"audio_recording_file_id": 918,
"subject": "Delivery question",
"description": "Client asks about delivery date",
"responsible_user_id": 31,
"participant_user_ids": [
18
],
"fields": []
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Insert | Created record result. |
Response Example
{
"ok": true,
"result": {
"new_id": 610
}
}