Server API: Support
Your users’ conversations and tickets, read, started and written in their name by your servers.
| What it does | Route |
|---|---|
| List a person’s conversations | GET /server/v1/contacts/{external_id}/conversations |
| Start a conversation for a person | POST /server/v1/contacts/{external_id}/conversations |
| Read a person’s conversation | GET /server/v1/contacts/{external_id}/conversations/{conversation_id} |
| Write in a person’s conversation | POST /server/v1/contacts/{external_id}/conversations/{conversation_id}/messages |
| List a person’s tickets | GET /server/v1/contacts/{external_id}/tickets |
| Open a ticket for a person | POST /server/v1/contacts/{external_id}/tickets |
| Read a person’s ticket | GET /server/v1/contacts/{external_id}/tickets/{ticket_id} |
| Write on a person’s ticket | POST /server/v1/contacts/{external_id}/tickets/{ticket_id}/messages |
| List the ticket forms | GET /server/v1/ticket-forms |
List a person’s conversations
Section titled “List a person’s conversations”GET /server/v1/contacts/{external_id}/conversations
Newest first, a page at a time, as the person sees them in the messenger. Needs the conversations scope.
Needs: a server key (Authorization: Bearer crm_sk_…). See Connect your backend.
Parameters
| Name | In | Description |
|---|---|---|
external_id (required) | path | Your id for the person: 1 to 200 characters, the same id your users’ tokens carry as their subject. |
before | query | Where the page starts: the next_before (or before) of the page before it. |
limit | query | How many to answer, at most. |
Answers
| Status | Body | Meaning |
|---|---|---|
| 200 | ConversationPage | OK |
| 400 | problem | The request could not be read: the problem names the field. |
| 401 | problem | No credential, or one that is not right. |
| 403 | problem | Refused: the app is switched off, or this is not allowed. |
| 404 | problem | Not found, or the part is switched off. |
| 429 | problem | Too many requests: wait for Retry-After. |
Start a conversation for a person
Section titled “Start a conversation for a person”POST /server/v1/contacts/{external_id}/conversations
Starts a conversation in the person’s name with their first message, as they would from the messenger: from a form on your own site, say. A person PurrCRM has not seen is made. Needs the conversations scope.
Needs: a server key (Authorization: Bearer crm_sk_…). See Connect your backend.
Parameters
| Name | In | Description |
|---|---|---|
external_id (required) | path | Your id for the person: 1 to 200 characters, the same id your users’ tokens carry as their subject. |
Idempotency-Key | header | Your own id for this send (at most 200 bytes): sent again after a timeout, it is kept once. |
Body (application/json): StartBody
| Field | Type | Description |
|---|---|---|
attachment_ids | array of string | |
button | string | The id of the opening’s button the guest tapped, with no words or pictures; empty when they wrote. |
opening | OpeningRef | The opening the guest was shown when they wrote or tapped; nil for none. |
text (always) | string |
Answers
| Status | Body | Meaning |
|---|---|---|
| 201 | Conversation | Made |
| 400 | problem | The request could not be read: the problem names the field. |
| 401 | problem | No credential, or one that is not right. |
| 403 | problem | Refused: the app is switched off, or this is not allowed. |
| 404 | problem | Not found, or the part is switched off. |
| 409 | problem | Refused as things stand: the problem says why. |
| 422 | problem | A value that is not right: the problem says which. |
| 429 | problem | Too many requests: wait for Retry-After. |
Read a person’s conversation
Section titled “Read a person’s conversation”GET /server/v1/contacts/{external_id}/conversations/{conversation_id}
The conversation with every part the person may see. Needs the conversations scope.
Needs: a server key (Authorization: Bearer crm_sk_…). See Connect your backend.
Parameters
| Name | In | Description |
|---|---|---|
external_id (required) | path | Your id for the person: 1 to 200 characters, the same id your users’ tokens carry as their subject. |
conversation_id (required) | path | The conversation’s id. |
Answers
| Status | Body | Meaning |
|---|---|---|
| 200 | Conversation | OK |
| 400 | problem | The request could not be read: the problem names the field. |
| 401 | problem | No credential, or one that is not right. |
| 403 | problem | Refused: the app is switched off, or this is not allowed. |
| 404 | problem | Not found, or the part is switched off. |
| 429 | problem | Too many requests: wait for Retry-After. |
Write in a person’s conversation
Section titled “Write in a person’s conversation”POST /server/v1/contacts/{external_id}/conversations/{conversation_id}/messages
Adds a message in the person’s name. Needs the conversations scope.
Needs: a server key (Authorization: Bearer crm_sk_…). See Connect your backend.
Parameters
| Name | In | Description |
|---|---|---|
external_id (required) | path | Your id for the person: 1 to 200 characters, the same id your users’ tokens carry as their subject. |
conversation_id (required) | path | The conversation’s id. |
Idempotency-Key | header | Your own id for this send (at most 200 bytes): sent again after a timeout, it is kept once. |
Body (application/json): MessageBody
| Field | Type | Description |
|---|---|---|
attachment_ids | array of string | Pictures uploaded through an AttachmentUpload and not yet sent. |
text (always) | string |
Answers
| Status | Body | Meaning |
|---|---|---|
| 201 | Part | Made |
| 400 | problem | The request could not be read: the problem names the field. |
| 401 | problem | No credential, or one that is not right. |
| 403 | problem | Refused: the app is switched off, or this is not allowed. |
| 404 | problem | Not found, or the part is switched off. |
| 409 | problem | Refused as things stand: the problem says why. |
| 422 | problem | A value that is not right: the problem says which. |
| 429 | problem | Too many requests: wait for Retry-After. |
List a person’s tickets
Section titled “List a person’s tickets”GET /server/v1/contacts/{external_id}/tickets
Needs the tickets scope.
Needs: a server key (Authorization: Bearer crm_sk_…). See Connect your backend.
Parameters
| Name | In | Description |
|---|---|---|
external_id (required) | path | Your id for the person: 1 to 200 characters, the same id your users’ tokens carry as their subject. |
Answers
| Status | Body | Meaning |
|---|---|---|
| 200 | SupportTicketPage | OK |
| 400 | problem | The request could not be read: the problem names the field. |
| 401 | problem | No credential, or one that is not right. |
| 403 | problem | Refused: the app is switched off, or this is not allowed. |
| 404 | problem | Not found, or the part is switched off. |
| 429 | problem | Too many requests: wait for Retry-After. |
Open a ticket for a person
Section titled “Open a ticket for a person”POST /server/v1/contacts/{external_id}/tickets
Opens a ticket from one of the ticket forms in the person’s name, as they would themselves. A person PurrCRM has not seen is made. Needs the tickets scope.
Needs: a server key (Authorization: Bearer crm_sk_…). See Connect your backend.
Parameters
| Name | In | Description |
|---|---|---|
external_id (required) | path | Your id for the person: 1 to 200 characters, the same id your users’ tokens carry as their subject. |
Idempotency-Key | header | Your own id for this send (at most 200 bytes): sent again after a timeout, it is kept once. |
Body (application/json): NewTicketBody
| Field | Type | Description |
|---|---|---|
fields | array of TicketField | |
text | string | |
title (always) | string | |
type_id (always) | string |
Answers
| Status | Body | Meaning |
|---|---|---|
| 201 | SupportTicket | Made |
| 400 | problem | The request could not be read: the problem names the field. |
| 401 | problem | No credential, or one that is not right. |
| 403 | problem | Refused: the app is switched off, or this is not allowed. |
| 404 | problem | Not found, or the part is switched off. |
| 409 | problem | Refused as things stand: the problem says why. |
| 422 | problem | A value that is not right: the problem says which. |
| 429 | problem | Too many requests: wait for Retry-After. |
Read a person’s ticket
Section titled “Read a person’s ticket”GET /server/v1/contacts/{external_id}/tickets/{ticket_id}
The ticket, where it has got to, and its conversation. Needs the tickets scope.
Needs: a server key (Authorization: Bearer crm_sk_…). See Connect your backend.
Parameters
| Name | In | Description |
|---|---|---|
external_id (required) | path | Your id for the person: 1 to 200 characters, the same id your users’ tokens carry as their subject. |
ticket_id (required) | path | The ticket’s id. |
Answers
| Status | Body | Meaning |
|---|---|---|
| 200 | SupportTicket | OK |
| 400 | problem | The request could not be read: the problem names the field. |
| 401 | problem | No credential, or one that is not right. |
| 403 | problem | Refused: the app is switched off, or this is not allowed. |
| 404 | problem | Not found, or the part is switched off. |
| 429 | problem | Too many requests: wait for Retry-After. |
Write on a person’s ticket
Section titled “Write on a person’s ticket”POST /server/v1/contacts/{external_id}/tickets/{ticket_id}/messages
Adds a message in the person’s name. Needs the tickets scope.
Needs: a server key (Authorization: Bearer crm_sk_…). See Connect your backend.
Parameters
| Name | In | Description |
|---|---|---|
external_id (required) | path | Your id for the person: 1 to 200 characters, the same id your users’ tokens carry as their subject. |
ticket_id (required) | path | The ticket’s id. |
Idempotency-Key | header | Your own id for this send (at most 200 bytes): sent again after a timeout, it is kept once. |
Body (application/json): MessageBody
| Field | Type | Description |
|---|---|---|
attachment_ids | array of string | Pictures uploaded through an AttachmentUpload and not yet sent. |
text (always) | string |
Answers
| Status | Body | Meaning |
|---|---|---|
| 201 | Part | Made |
| 400 | problem | The request could not be read: the problem names the field. |
| 401 | problem | No credential, or one that is not right. |
| 403 | problem | Refused: the app is switched off, or this is not allowed. |
| 404 | problem | Not found, or the part is switched off. |
| 409 | problem | Refused as things stand: the problem says why. |
| 422 | problem | A value that is not right: the problem says which. |
| 429 | problem | Too many requests: wait for Retry-After. |
List the ticket forms
Section titled “List the ticket forms”GET /server/v1/ticket-forms
The kinds of ticket a person may open, with the fields each asks for. Needs the tickets scope.
Needs: a server key (Authorization: Bearer crm_sk_…). See Connect your backend.
Answers
| Status | Body | Meaning |
|---|---|---|
| 200 | TicketForms | OK |
| 400 | problem | The request could not be read: the problem names the field. |
| 401 | problem | No credential, or one that is not right. |
| 403 | problem | Refused: the app is switched off, or this is not allowed. |
| 404 | problem | Not found, or the part is switched off. |
| 429 | problem | Too many requests: wait for Retry-After. |