API reference
Tickets
The helpdesk's tickets: whose move it is, who has it, and closing it.
GET /tickets
List tickets
The workspace's tickets, newest first: whose move it is (status), who has it, the conversation it belongs to, the team's own fields in custom, the tags the helpdesk rules wrote (narrow with tag), and how long the first answer and the resolution took.
Scope: tickets:read
Parameters
limitoptional in the query ·integerRows per page, 1 to 100.
cursoroptional in the query ·stringThe next_cursor of the previous page.
agent_idoptional in the query ·stringOnly tickets of this agent.
statusoptional in the query ·"new" | "on_you" | "on_customer" | "on_hold" | "closed"Only tickets in this status.
assignee_user_idoptional in the query ·stringOnly tickets held by this member (a user id).
tagoptional in the query ·stringOnly tickets carrying this tag (one the workspace's helpdesk rules wrote; see
tagson the ticket).
Returns Ticket
idrequiredstringId
agent_idrequiredstringAgent Id
conversation_idoptionalstringConversation Id
contact_idoptionalstringContact Id
statusrequiredstringnew (nobody has replied), on_you (the customer wrote last), on_customer (the team wrote last), on_hold or closed.
priorityrequiredstringlow, normal or high.
assignee_user_idoptionalstringThe member who has it; null for nobody.
team_idoptionalstringTeam Id
subjectrequiredstringSubject
channelrequiredstringThe conversation's channel when the ticket opened: website, hosted, api, email, slack or voice_web.
languagerequiredstringThe visitor's language: en or ar.
sourcerequiredstringWhat opened it: handoff, or conversation (the every-conversation option).
customoptionalobjectThe workspace's ticket fields, by key.
tagsoptionalstring[]The tags the workspace's helpdesk rules set on it.
handoff_atoptionalstringWhen a person was last asked in.
first_response_atoptionalstringFirst Response At
first_response_secondsoptionalintegerFrom the handoff (or the ticket's start) to the first reply by a person.
last_customer_message_atoptionalstringLast Customer Message At
last_agent_message_atoptionalstringLast Agent Message At
closed_atoptionalstringClosed At
closed_byoptionalstringThe member who closed it; null when a key did.
resolution_secondsoptionalintegerFrom the ticket's start to its close.
csat_scoreoptionalintegerThe visitor's rating after the ticket closed: 1 good, -1 bad.
csat_commentoptionalstringWhat the visitor added to the rating, if anything.
csat_atoptionalstringWhen the visitor rated.
created_atrequiredstringCreated At
updated_atrequiredstringUpdated At
Responses
200Successful Response401Missing, invalid, revoked or expired key. Leaving the workspace, or being removed from it, revokes the keys a teammate made; a key whose maker's membership ended any other way answerskey_maker_left.403The plan has no API, the key lacks the scope, or the role of the teammate who made the key no longer allows it (maker_role_limit; a publishable key saysinsufficient_scope).404Nothing by that id in this workspace.413The request body is larger than this route accepts (1 MB; 3 MB for a text source). On a source:plan_text_limit, the agent's plan cannot hold more text (limit_chars,used_chars).422The request did not validate;detailslists the fields.429Rate limit reached; waitRetry-Afterseconds.500Our fault; quoterequest_idto support.
curl https://www.bidii.ai/api/v2/tickets \
-H "Authorization: Bearer bidi_sk_YOUR_KEY"GET /tickets/{ticket_id}
Get a ticket
One ticket by id.
Scope: tickets:read
Parameters
ticket_idrequired in the path ·string
Returns Ticket
idrequiredstringId
agent_idrequiredstringAgent Id
conversation_idoptionalstringConversation Id
contact_idoptionalstringContact Id
statusrequiredstringnew (nobody has replied), on_you (the customer wrote last), on_customer (the team wrote last), on_hold or closed.
priorityrequiredstringlow, normal or high.
assignee_user_idoptionalstringThe member who has it; null for nobody.
team_idoptionalstringTeam Id
subjectrequiredstringSubject
channelrequiredstringThe conversation's channel when the ticket opened: website, hosted, api, email, slack or voice_web.
languagerequiredstringThe visitor's language: en or ar.
sourcerequiredstringWhat opened it: handoff, or conversation (the every-conversation option).
customoptionalobjectThe workspace's ticket fields, by key.
tagsoptionalstring[]The tags the workspace's helpdesk rules set on it.
handoff_atoptionalstringWhen a person was last asked in.
first_response_atoptionalstringFirst Response At
first_response_secondsoptionalintegerFrom the handoff (or the ticket's start) to the first reply by a person.
last_customer_message_atoptionalstringLast Customer Message At
last_agent_message_atoptionalstringLast Agent Message At
closed_atoptionalstringClosed At
closed_byoptionalstringThe member who closed it; null when a key did.
resolution_secondsoptionalintegerFrom the ticket's start to its close.
csat_scoreoptionalintegerThe visitor's rating after the ticket closed: 1 good, -1 bad.
csat_commentoptionalstringWhat the visitor added to the rating, if anything.
csat_atoptionalstringWhen the visitor rated.
created_atrequiredstringCreated At
updated_atrequiredstringUpdated At
Responses
200Successful Response401Missing, invalid, revoked or expired key. Leaving the workspace, or being removed from it, revokes the keys a teammate made; a key whose maker's membership ended any other way answerskey_maker_left.403The plan has no API, the key lacks the scope, or the role of the teammate who made the key no longer allows it (maker_role_limit; a publishable key saysinsufficient_scope).404Nothing by that id in this workspace.413The request body is larger than this route accepts (1 MB; 3 MB for a text source). On a source:plan_text_limit, the agent's plan cannot hold more text (limit_chars,used_chars).422The request did not validate;detailslists the fields.429Rate limit reached; waitRetry-Afterseconds.500Our fault; quoterequest_idto support.
curl https://www.bidii.ai/api/v2/tickets/TICKET_ID \
-H "Authorization: Bearer bidi_sk_YOUR_KEY"PATCH /tickets/{ticket_id}
Update a ticket
Change any of: status (on_hold, closed, or open to release a hold or reopen), priority, assignee_user_id (null for nobody) and custom (merged by key and checked against the workspace's ticket fields). Send at least one. Every change emits ticket.updated; closing emits ticket.closed as well and hands the visitor back to the assistant.
Scope: tickets:write
Parameters
ticket_idrequired in the path ·string
Request body
statusoptional"open" | "on_hold" | "closed"on_hold holds it, closed closes it, open releases a hold or reopens.
priorityoptional"low" | "normal" | "high"Priority
assignee_user_idoptionalstringA member who can answer on the ticket's agent; null gives it to nobody.
customoptionalobjectMerged into the ticket's fields by key; a null removes a key.
Returns Ticket
idrequiredstringId
agent_idrequiredstringAgent Id
conversation_idoptionalstringConversation Id
contact_idoptionalstringContact Id
statusrequiredstringnew (nobody has replied), on_you (the customer wrote last), on_customer (the team wrote last), on_hold or closed.
priorityrequiredstringlow, normal or high.
assignee_user_idoptionalstringThe member who has it; null for nobody.
team_idoptionalstringTeam Id
subjectrequiredstringSubject
channelrequiredstringThe conversation's channel when the ticket opened: website, hosted, api, email, slack or voice_web.
languagerequiredstringThe visitor's language: en or ar.
sourcerequiredstringWhat opened it: handoff, or conversation (the every-conversation option).
customoptionalobjectThe workspace's ticket fields, by key.
tagsoptionalstring[]The tags the workspace's helpdesk rules set on it.
handoff_atoptionalstringWhen a person was last asked in.
first_response_atoptionalstringFirst Response At
first_response_secondsoptionalintegerFrom the handoff (or the ticket's start) to the first reply by a person.
last_customer_message_atoptionalstringLast Customer Message At
last_agent_message_atoptionalstringLast Agent Message At
closed_atoptionalstringClosed At
closed_byoptionalstringThe member who closed it; null when a key did.
resolution_secondsoptionalintegerFrom the ticket's start to its close.
csat_scoreoptionalintegerThe visitor's rating after the ticket closed: 1 good, -1 bad.
csat_commentoptionalstringWhat the visitor added to the rating, if anything.
csat_atoptionalstringWhen the visitor rated.
created_atrequiredstringCreated At
updated_atrequiredstringUpdated At
Responses
200Successful Response401Missing, invalid, revoked or expired key. Leaving the workspace, or being removed from it, revokes the keys a teammate made; a key whose maker's membership ended any other way answerskey_maker_left.403The plan has no API, the key lacks the scope, or the role of the teammate who made the key no longer allows it (maker_role_limit; a publishable key saysinsufficient_scope).404Nothing by that id in this workspace.413The request body is larger than this route accepts (1 MB; 3 MB for a text source). On a source:plan_text_limit, the agent's plan cannot hold more text (limit_chars,used_chars).422The request did not validate;detailslists the fields.429Rate limit reached; waitRetry-Afterseconds.500Our fault; quoterequest_idto support.409conflict: the ticket cannot move to that status from where it is.
curl -X PATCH https://www.bidii.ai/api/v2/tickets/TICKET_ID \
-H "Authorization: Bearer bidi_sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"priority": "high"}'