External API
Create a ticket
Create a ticket in Proto from your own system, as if your AI agent's Create ticket action had run.
Creates a ticket from your own system, as your AI agent would with its Create ticket action – for example, when a customer fills in a complaint form on your website. It can assign the ticket, tag it and email the customer. Not sure how to send a request? See Make your first request.
Request
Send a POST request to:
https://v3-api.proto.cx/api/platform/v1/conversations/YOUR_TEAMSPACE_ID/YOUR_AI_AGENT_ID/YOUR_CHANNEL_ID/create-ticket-action
Every ticket belongs to an AI agent and one of its channels. Take their IDs from your browser’s address bar: in the sidebar, select AI agents, choose yours, select the Publish tab, then the channel, such as Default Webchat. The address ends with /chatbots/YOUR_AI_AGENT_ID/channels/webchat/YOUR_CHANNEL_ID.
Important: the App ID on a Webchat channel’s install screen isn’t the channel ID. Use the ID from the address.
In the body, send at least a subject, customer_full_name and customer_email. In the address and the body, replace anything starting with YOUR_ with your own:
{
"subject": "Refund for order 1042",
"customer_full_name": "Amara Okafor",
"customer_email": "amara.okafor@example.com",
"customer_phone": "+2348031234567",
"description": "The parcel arrived damaged. Customer wants a refund.",
"assignee_user_id": "YOUR_USER_ID",
"assigned_team_ids": ["YOUR_TEAM_ID"],
"applied_tags": ["YOUR_TAG_ID"],
"applied_tag_groups": ["YOUR_TAG_GROUP_ID"],
"custom_fields": [{ "id": "YOUR_FIELD_ID", "value": "1042" }],
"customer_email_template_id": "YOUR_EMAIL_TEMPLATE_ID",
"assignee_email_template_id": "YOUR_EMAIL_TEMPLATE_ID",
"attachment_ids": ["YOUR_FILE_ID"],
"from_email_sender_id": "YOUR_EMAIL_SENDER_ID",
"is_custom_subject": true,
"linked_conversation_id": "YOUR_LIVECHAT_ID",
"created_at": "2026-11-17T09:15:22Z"
}
| Field | Required | What it is |
|---|---|---|
subject | Yes | The ticket’s subject |
customer_full_name | Yes | The customer’s name |
customer_email | Yes | The customer’s email address. Replies to the ticket go here. |
customer_phone | No | The customer’s phone number |
description | No | What the ticket is about |
assignee_user_id | No | The user ID of the live agent to assign, from List users by status. The ticket is Open if you send one, otherwise Pending. |
assigned_team_ids | No | IDs of teams to assign, from Find a team by name. Each team’s automatic tags are added too. |
applied_tags | No | IDs of tags to add |
applied_tag_groups | No | IDs of tag groups to add |
custom_fields | No | Ticket custom fields to fill in. Required for any field your teamspace makes mandatory. |
customer_email_template_id | No | An email template to send the customer. It becomes the ticket’s first message. Leave it out to send nothing. |
assignee_email_template_id | No | An email template to send the assignee and everyone in the assigned teams. Leave it out to send nothing. |
attachment_ids | No | IDs of files already uploaded to Proto. They’re attached to the emails Proto sends. |
from_email_sender_id | No | The email sender to send from. Its domain must be verified. Leave it out to use Proto’s default sender. |
is_custom_subject | No | Defaults to true: emails use your subject as it is. Set false to add [Ticket #short_id] to the front. |
linked_conversation_id | No | A livechat to link the ticket to, from List livechats. It must be on the same channel. Its custom field values are copied to the ticket. |
created_at | No | When the ticket was created, such as 2026-11-17T09:15:22Z, for importing old tickets. Defaults to now. |
Each item in custom_fields has:
| Field | Required | What it is |
|---|---|---|
id | Yes | The custom field’s ID, from List custom fields |
value | No | The value to fill in. Defaults to an empty value. |
When is_custom_subject is true, you can put {short_id} or {id} in subject, and emails show the ticket’s number there. To use any other curly brackets, double them, such as {{ and }} – single ones make the request fail.
Important: each request creates a new customer, even if one with the same email is already in Proto. Sending the same request twice creates two tickets.
If Mandatory custom fields is on, in Settings, under Teamspace, then Tickets, every mandatory field needs a valid value – sent in custom_fields or copied from the linked livechat. Otherwise Proto creates nothing and replies 400.
Response
Proto replies 200 OK with the new ticket:
{
"id": "01JD2X7Q8M3N4P5R6S7T8V9W0X",
"short_id": "6S7T8V9W0X",
"customer_id": "01JD2X7Q7A1B2C3D4E5F6G7H8J",
"description": "The parcel arrived damaged. Customer wants a refund.",
"bot_id": "01HZY3K4M5N6P7Q8R9S0T1U2V3",
"channel_id": "01HZY3K9A8B7C6D5E4F3G2H1J0",
"custom_fields": { "Order number": "1042" },
"assignee_type": "user",
"assignee_id": "01HX5A6B7C8D9E0F1G2H3J4K5M",
"linked_conversation_id": null
}
| Field | What it is |
|---|---|
id | The ticket’s ID. Keep it – you need it to reply to the ticket or change its status. |
short_id | The ticket’s short number, used in email subjects such as [Ticket #6S7T8V9W0X] |
customer_id | The new customer Proto created for the ticket |
custom_fields | Every ticket custom field in your teamspace, by name, with the value you sent or the field’s default. Values copied from a linked livechat aren’t shown. |
assignee_type | user if a live agent is assigned, otherwise chatbot |
assignee_id | The assigned live agent’s user ID, or empty if no one’s assigned |
Errors
| You get | What it means |
|---|---|
400 | A tag, tag group, team, user, email template, custom field or linked livechat isn’t in your teamspace, a custom field value is wrong or a mandatory custom field is missing. The message says which. |
403 | Your workspace has an unpaid invoice, or has reached its interaction limit. |
404 | The AI agent or channel isn’t in your teamspace, or the email sender isn’t found or its domain isn’t verified. |
500 | subject has curly brackets other than {id} and {short_id}. |
When custom fields are the problem, the 400 reply lists each one in data.errors:
{
"detail": "One or more custom field values are invalid.",
"code": "INVALID_INPUT",
"data": {
"errors": [
{
"custom_field_id": "01J0ABCDEF1234567890ABCDEH",
"value": null,
"detail": "This custom field is mandatory and must be provided.",
"field": "custom_field_id",
"custom_field_type": "text",
"reason": "missing"
}
]
}
}
value is what you sent, or null if you sent nothing. field is custom_field_id if the field is missing, or value if its value is the problem. reason is one of:
missing– a mandatory field wasn’t sentempty– a mandatory field was sent emptyinvalid– the value doesn’t fit the field, such as an option that doesn’t exist
If a step after creating the ticket fails, such as sending the customer email, Proto still replies 200. Check the ticket in Tickets.
For errors any request can return, see If something goes wrong.