openapi: 3.0.2
info:
version: 17.12.1
title: Sunshine Conversations API
termsOfService: https://www.zendesk.com/company/customers-partners/master-subscription-agreement/
description: |
# Introduction
Welcome to the Sunshine Conversations API. The API allows you to craft entirely unique messaging experiences for your app and website as well as talk to any backend or external service.
The Sunshine Conversations API is designed according to REST principles. The API accepts JSON in request bodies and requires that the `content-type: application/json` header be specified for
all such requests. The API will always respond with an object. Depending on context, resources may be returned as single objects or as arrays of objects, nested within the response object.
## Regions
Licensed Zendesk customers should use the following API host for all API requests, unless otherwise specified:
```
https://{subdomain}.zendesk.com/sc
```
For legacy Sunshine Conversations customers, see [regions](https://docs.smooch.io/guide/regions/) for the list of supported base URLs.
## Errors
Sunshine Conversations uses standard HTTP status codes to communicate errors. In general, a `2xx` status code indicates success while `4xx` indicates an error, in which case, the response body includes a JSON object which includes an array of errors, with a text `code` and `title` containing more details. Multiple errors can only be included in a `400 Bad Request`. A `5xx` status code indicates that something went wrong on our end.
```javascript
{
"errors": [
{
"code": "unauthorized",
"title": "Authorization is required"
}
]
}
```
## API Version
The latest version of the API is v2. Version v1.1 is still supported and you can continue using it but we encourage you to upgrade to the latest version. To learn more about API versioning at Sunshine Conversations, including instructions on how to upgrade to the latest version, [visit our docs](https://developer.zendesk.com/documentation/conversations/references/api-versioning/).
## API Pagination and Records Limits
All paginated endpoints support cursor-based pagination.
### Cursor Pagination
Cursor-based pagination is a common pagination strategy that avoids many of the pitfalls of offset–limit pagination. It works by returning a pointer to a specific item in the dataset. On subsequent requests, the server returns results after the given pointer.
A `page[after]` or `page[before]` query string parameter may be provided, they are cursors pointing to a record id.
The `page[after]` cursor indicates that only records **subsequent** to it should be returned.
The `page[before]` cursor indicates that only records **preceding** it should be returned.
**Only one** of `page[after]` or `page[before]` may be provided in a query, not both.
In most endpoints, an optional `page[size]` query parameter may be passed to control the number of records returned by the request.
## API Libraries
Sunshine Conversations provides an official API library for [Java](https://github.com/zendesk/sunshine-conversations-java), with more languages to come. These helpful libraries wrap calls to the API and can make interfacing with Sunshine Conversations easier.
## Postman Collection
In addition to API libraries, Sunshine Conversations also has a Postman collection that can be used for development or testing purposes. See the [guide](https://developer.zendesk.com/documentation/conversations/references/openapi-specification/) for information on how to install and use the collection in your Postman client.
## Rate Limits
Sunshine Conversations APIs are subject to rate limiting. If the rate limit is exceeded a `429 Too Many Requests` HTTP status code may be returned. We apply rate limits to prevent abuse, spam, denial-of-service attacks, and similar issues. Our goal is to keep the limits high enough so that any application using the platform as intended will not encounter them. However usage spikes do occur and encountering a rate limit may be unavoidable. In order to avoid production outages, you should implement `429` retry logic using exponential backoff and jitter.
## Conversation Size Limits
Conversations are limited to 30,000 messages. Once you reach this maximum, a `423 Locked` HTTP status code is returned when trying to post a new message. To allow more messages to be sent to the affected conversation, you must [delete all messages](https://developer.zendesk.com/api-reference/conversations/#operation/DeleteAllMessages) to make room.
## Request Size Limits
The Sunshine Conversations API imposes the following size limits on HTTP requests:
| Request Type | Limit |
| ------------ | ----- |
| JSON | 100kb |
| File upload | 50mb |
## Authorization
This is an overview of how authorization works with the Sunshine Conversations API. Sunshine Conversations allows basic authentication or JSON Web Tokens (JWTs) as authentication methods for server-to-server calls. [See below](#section/Introduction/Authentication) for more details.
There are three authorization scopes available for the v2 API: `integration`, `app`, and `account`.
| Scope | Availability | Authorized Methods |
| ----------- | ------------------------------------------- | ----------------------------------------------- |
| account | Sunshine Conversations direct accounts only | All methods |
| app | All account types | All methods besides Account Provisioning |
| integration | All account types | Users, Conversations, Attachments, and Webhooks |
## Authentication
To authenticate requests to the API, you will need an API key, composed of a key id and a secret.
For an overview of how authentication works in Sunshine Conversations and instructions on how to generate an API key, see [API authentication](https://developer.zendesk.com/documentation/conversations/getting-started/api-authentication/).
API requests can be authenticated in two ways:
- With Basic authentication you can make requests using an API key directly.
- With JSON Web Tokens (JWTs) you sign tokens with an API key, which are then used to authenticate with the API. See [When to Use JWTs](https://developer.zendesk.com/documentation/conversations/getting-started/api-authentication/#when-to-use-jwts) to learn if JWTs are relevant for your usage.
- Before using an API key in production, make sure to familiarize yourself with best practices on how to [securely handle credentials](https://developer.zendesk.com/documentation/conversations/getting-started/api-authentication/#secure-credential-handling).
### Basic Authentication
API requests can be authenticated with [basic authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) using an API key. The key id is used as the username and the secret as the password. The scope of access is determined by the owner of the API key. See the [guide](https://developer.zendesk.com/documentation/conversations/getting-started/api-authentication/#access-scopes) for more details.
### JWTs
JSON Web Tokens (JWTs) are an industry standard authentication method. The full specification is described [here](https://tools.ietf.org/html/rfc7519), and a set of supported JWT libraries for a variety of languages and platforms can be found at http://jwt.io. To summarize, a JWT is composed of a header, a payload, and a signature. The payload contains information called claims which describe the subject to whom the token was issued.
The JWT itself is transmitted via the HTTP `authorization` header. The token should be prefixed with “Bearer” followed by a space. For example: `Bearer your-jwt`.
To generate a JWT, you need an API key, which is composed of a key ID and a secret. The key ID is included in a JWT’s header, as the `kid` property, while the secret is used to sign the JWT.
For more in-depth coverage, see the [guide](https://developer.zendesk.com/documentation/conversations/getting-started/api-authentication/#jwt-authentication).
#### Header
The JWT header must contain the key id (kid) of the API key that is used to sign it. The algorithm (alg) used should be HS256. Unsigned JWTs are not accepted.
```javascript
{
"alg": "HS256",
"typ": "JWT",
"kid": "act_5963ceb97cde542d000dbdb1"
}
```
#### Payload
The JWT payload must include a scope claim which specifies the caller’s scope of access.
- account-scoped JWTs must be generated with an API key associated with a Sunshine Conversations account (act*) or service account (svc*).
```javascript
{
"scope": "account"
}
```
- app-scoped JWTs can be generated with an API key associated with an app (app\_).
```javascript
{
"scope": "app"
}
```
x-logo:
url: sunco_logo.svg
altText: Sunshine Conversations
href: https://developer.zendesk.com/documentation/conversations/
servers:
- url: https://{subdomain}.zendesk.com/sc
description: Your Zendesk subdomain
- url: https://api.smooch.io
description: United States server (for legacy Sunshine Conversations only)
- url: https://api.eu-1.smooch.io
description: European Union server (for legacy Sunshine Conversations only)
security:
- bearerAuth:
- app
- account
- basicAuth:
- app
- account
tags:
- name: Apps
x-displayName: Apps
description: "If you're looking to enable messaging inside your product for your customers, with as much control over the experience as you'd like, you can create and control Sunshine Conversations apps programmatically using [Account Provisioning](https://docs.smooch.io/guide/intro-to-account-provisioning/).\n### Authentication\nAccount Provisioning endpoints require `account` scope. See the [authorization](#section/Introduction/Authorization) and [authentication](#section/Introduction/Authentication) sections for information.\nA user account API key (key id that starts with `act_`) can access all account provisioning routes. You can create an account key by going to your account page.\nA service account API key (key id that starts with `svc_`) may be used to manage apps, but not service accounts or service account keys.\n\n| Key Type | Authorized Methods |\n| -------------- | ----------------------------------------------------------------- |\n| act | All Core and Account Provisioning methods. |\n| svc \t | All Core methods, App Management methods, and App Keys methods. |\n\n### Service Accounts\nService Account schema and endpoints used for provisioning service accounts. A service account represents an API user, with its own set of credentials, that has only access to a certain subset of apps. For software makers that create apps on behalf of separate customers or businesses, service accounts can be used to generate and distribute credentials that only have access to a single business's data.\n\n### App settings\nApps have a number of optional settings that can be used to customize specific behaviors. See\nthe `settings` object described below for more information.\n"
- name: App Keys
x-displayName: App Keys
description: This set of endpoints is used to provision and revoke API keys for a Sunshine Conversations app. An app can have a maximum of 10 keys.
- name: Attachments
x-displayName: Attachments
description: |
You can upload files of any type that can then be used to send a file, image or carousel message to a user.
## Attachments for Messages
The attachments API allows you to upload a file for the purpose of sending a message.
Using the for parameter, you can signal to Sunshine Conversations that your upload will be used to send a message to a user.
Knowing this, Sunshine Conversations will safely delete the attachment when the message, conversation or user is deleted.
x-zoas-docs:
ignoreCanonicalSchema: true
- name: Conversations
x-displayName: Conversations
description: A stored history of messages sent to and received from a `user`. This set of endpoints is used to provision and manage conversations.
- name: Participants
x-displayName: Participants
description: Endpoints used for managing conversation [participants](https://developer.zendesk.com/documentation/conversations/getting-started/key-concepts/#participant).
- name: Messages
x-displayName: Messages
description: Endpoints used for managing [messages](https://developer.zendesk.com/documentation/conversations/getting-started/key-concepts/#message).
- name: Activities
x-displayName: Activities
description: Notify Sunshine Conversations of different conversation activities.
x-zoas-docs:
ignoreCanonicalSchema: true
- name: Switchboard Actions
x-displayName: Switchboard Actions
description: Manage which switchboard integration has control over a conversation.
x-zoas-docs:
ignoreCanonicalSchema: true
- name: Integrations
x-displayName: Integrations
description: |
This set of endpoints is used to configure and manage various front-end messaging channels.
- name: CustomIntegrationApiKeys
x-displayName: Custom Integration API Keys
description: This set of endpoints is used to provision and revoke API keys for a Sunshine Conversations integration. An integration can have a maximum of 10 keys. This endpoint is only available for integrations of type custom. An error will be returned when attempting to provision API keys for any other integration type.
- name: Switchboards
x-displayName: Switchboards
description: Switchboard operations
- name: Switchboard Integrations
x-displayName: Switchboard Integrations
description: Switchboard Integrations operations
- name: Users
x-displayName: Users
description: This set of endpoints is used to manage users.
- name: Clients
x-displayName: Clients
description: Endpoints used for provisioning [clients](https://developer.zendesk.com/documentation/conversations/getting-started/key-concepts/#client).
- name: Devices
x-displayName: Devices
description: Endpoints used for fetching a user's [devices](https://developer.zendesk.com/documentation/conversations/getting-started/key-concepts/#device).
- name: Webhooks
description: |
Endpoints for managing webhooks associated to a Sunshine Conversations Connect integration or a custom integration. Webhooks are a fantastic way to extend the Sunshine Conversations platform beyond the built-in feature set. You can use webhooks to build your own Sunshine Conversations chat clients, to integrate more deeply with your favorite CRM, or to build a bot.
A webhook can only operate within the scope of a single Sunshine Conversations app.
## Webhook Triggers
When a webhook trigger is triggered, a POST request will be made to the URL configured in your webhook object along with a JSON payload specific for the event type.
| Trigger | Description |
| ------------------------------------- | -------------------------------------------------------------------- |
| client:add | When initiating a channel link or when an SDK client is created. |
| client:remove | When a client is removed. This can happen when:
1. directly using the API
2. removing the client using the SDK
3. transferring a client due to a channel link
4. failing or cancelling a channel link |
| client:update | When a client is updated. This can happen when:
1. a channel finds a user that matches the information provided
2. a client is activated
3. a user unsubscribes from a conversation or blocks the app |
| conversation:create | When a new conversation is created. |
| conversation:join | When a new participant joins a `sdkGroup` conversation. |
| conversation:leave | When a participant leaves a `sdkGroup` conversation. |
| conversation:remove | When a conversation is deleted. |
| conversation:message | When a new message was sent in the conversation. |
| conversation:message:delivery:channel | When a message is successfully delivered to a channel. |
| conversation:message:delivery:failure | When a new message fails to be delivered in the conversation. |
| conversation:message:delivery:user | When a new message is successfully delivered to a user. |
| conversation:postback | When a user clicks on a postback action button. |
| conversation:read | When a user has read the conversation. |
| conversation:referral | When a user is referred to a conversation. See the conversation referrals guide for more details. |
| passthrough:messaging | When a message is received with information that should be forwarded as-is. |
| conversation:typing | When a user starts or stops typing. This trigger applies only to end users, not agents. |
| switchboard:acceptControl | When a switchboard integration accepts control of a conversation. |
| switchboard:acceptControl:failure | When control of a conversation fails to be accepted by a switchboard integration. |
| switchboard:offerControl | When a switchboard integration has been offered control of the conversation. |
| switchboard:offerControl:failure | When control of a conversation can't be offered to another switchboard integration. |
| switchboard:passControl | When a switchboard integration gives control of the conversation to another switchboard integration. |
| switchboard:passControl:failure | When changing a switchboard integration to active fails. |
| switchboard:releaseControl | When a switchboard integration releases control of the conversation. |
| user:merge | When two or more users are merged into one. |
| user:update | When a user is updated. (Currently, when a user's identification is updated.)|
| user:remove | When a user is deleted. |
## Securing Sunshine Conversations Webhooks
When a webhook is created, a shared secret will be generated for it. The secret can be used to determine the veracity of a request to your webhook route. It is included as an `X-API-Key` header with each webhook request sent to the target URL.
That secret is available in the response to the POST request used to generate the webhook, or through a GET request to the webhook route.
## Retry policy
A webhook call will be attempted up to 5 times over a 15 minute window. The attempts will happen at an exponentially increasing interval if the target responds with anything but a success (2XX) or a [non-recoverable error](#non-recoverable-errors). If no response is received within 20 seconds, the call will be considered a failure and will also be reattempted.
### Non-recoverable Errors
The following status codes are deemed to be non-recoverable and Sunshine Conversations will not reattempt a call when receiving a response with them:
- 400: The target exists, but can’t process the payload.
- 401: The target is behind authentication or doesn’t recognize the webhook secret.
- 403: Sunshine Conversations should not be calling the target.
- 404: The target doesn’t exist.
- 406: The target exists, and rejected the webhook intentionally.
- name: OAuth Endpoints
x-displayName: OAuth
description: "Endpoints used to power the OAuth flow for Zendesk Technology Partner integrations. Learn how to [build a marketplace bot](https://developer.zendesk.com/documentation/conversations/how-to-guides/building-a-marketplace-bot/) in the Zendesk developer docs.\n\nIssued access tokens use `integration` scope. The access token grants permission to get and create users and conversations associated with the connected app. The token also grants permission to create webhooks, however only webhooks created for the calling integration will be visible. An access token with integration scope cannot see or modify webhooks that were created by other integrations.\n\n| API\t | Access\t|\n| -------- | ------- |\n| [/v2/apps/:appId/users/\\*](#tag/Users)\t| Yes\t|\n| [/v2/apps/:appId/conversations/\\*](#tag/Conversations)\t| Yes\t|\n| [/v2/apps/:appId/integrations/me/webhooks/\\*](#tag/Webhooks)\t| Yes\t|\n| [/v2/apps/:appId/switchboards/\\*](#tag/Switchboards) | No |\n| [/v2/apps/\\*](#tag/Apps) | No |\n"
x-zoas-docs:
ignoreCanonicalSchema: true
paths:
/v2/apps:
post:
tags:
- Apps
summary: Create App
operationId: CreateApp
description: Creates a new app. When using [service account](#service-accounts) credentials, the service account is automatically granted access to the app.
security:
- basicAuth:
- account
- bearerAuth:
- account
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/appCreateBody'
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/appResponse'
examples:
default:
$ref: '#/components/examples/createApp'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: bad_request
title: should have required property 'displayName'
'402':
description: Payment required
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: payment_required
title: Your account has reached the maximum number of apps for your subscription plan
get:
tags:
- Apps
summary: List Apps
operationId: ListApps
description: |
Lists all apps that a user is part of. This API is paginated through [cursor pagination](#section/Introduction/API-Pagination-and-Records-Limits).
```shell
/v2/apps?page[after]=5e1606762556d93e9c176f69&page[size]=10
```
security:
- basicAuth:
- account
- bearerAuth:
- account
parameters:
- $ref: '#/components/parameters/pageQuery'
- $ref: '#/components/parameters/appFilterQuery'
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/appListResponse'
examples:
default:
$ref: '#/components/examples/listApps'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: bad_request
title: Invalid page query parameters
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: forbidden
title: The serviceAccountId provided does not match supplied credentials
/v2/apps/{appId}:
parameters:
- $ref: '#/components/parameters/appId'
get:
tags:
- Apps
summary: Get App
operationId: GetApp
description: Fetches an individual app.
security:
- basicAuth:
- app
- account
- bearerAuth:
- app
- account
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/appResponseWithSubdomain'
examples:
default:
$ref: '#/components/examples/getApp'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: app_not_found
title: App not found
patch:
tags:
- Apps
summary: Update App
operationId: UpdateApp
description: Updates an app.
security:
- basicAuth:
- app
- account
- bearerAuth:
- app
- account
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/appUpdateBody'
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/appResponse'
examples:
default:
$ref: '#/components/examples/updateApp'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: bad_request
title: App metadata is limited to 4096 bytes in size.
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: app_not_found
title: App not found
delete:
tags:
- Apps
summary: Delete App
operationId: DeleteApp
description: Removes the specified app, including all its enabled integrations.
security:
- basicAuth:
- account
- bearerAuth:
- account
responses:
'200':
description: Ok
content:
application/json:
schema:
type: object
examples:
default:
$ref: '#/components/examples/emptyResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: app_not_found
title: App not found
/v2/apps/{appId}/keys:
parameters:
- $ref: '#/components/parameters/appId'
post:
tags:
- App Keys
summary: Create App Key
operationId: CreateAppKey
description: |
Creates an API key for the specified app. The response body will include a secret
as well as its corresponding id, which you can use to generate JSON Web Tokens to
securely make API calls on behalf of the app.
security:
- basicAuth:
- account
- bearerAuth:
- account
requestBody:
required: true
content:
application/json:
schema:
type: object
title: AppKeyCreateBody
properties:
displayName:
allOf:
- $ref: '#/components/schemas/displayName'
nullable: false
description: The name of the API key.
example: Key 1
required:
- displayName
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/appKeyResponse'
examples:
default:
$ref: '#/components/examples/createAppKey'
get:
tags:
- App Keys
summary: List App Keys
operationId: ListAppKeys
description: Lists all API keys for a given app.
security:
- basicAuth:
- account
- bearerAuth:
- account
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/appKeyListResponse'
examples:
default:
$ref: '#/components/examples/listAppKeys'
/v2/apps/{appId}/keys/{keyId}:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/keyId'
get:
tags:
- App Keys
summary: Get App Key
operationId: GetAppKey
description: Returns an API key.
security:
- basicAuth:
- account
- bearerAuth:
- account
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/appKeyResponse'
examples:
default:
$ref: '#/components/examples/getAppKey'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: not_found
title: Resource not found
delete:
tags:
- App Keys
summary: Delete App Key
operationId: DeleteAppKey
description: Removes an API key.
security:
- basicAuth:
- account
- bearerAuth:
- account
responses:
'200':
description: Ok
content:
application/json:
schema:
type: object
examples:
default:
$ref: '#/components/examples/emptyResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: app_not_found
title: App not found
/v2/apps/{appId}/attachments:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/accessQuery'
- $ref: '#/components/parameters/forQuery'
- $ref: '#/components/parameters/conversationIdQuery'
post:
tags:
- Attachments
summary: Upload Attachment
operationId: UploadAttachment
description: |
Upload an attachment to Sunshine Conversations to use in future messages. Files are uploaded using the multipart/form-data content type. Use the returned mediaUrl to send a file, image or carousel message.
security:
- basicAuth:
- integration
- app
- account
- bearerAuth:
- integration
- app
- account
requestBody:
required: true
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/attachmentUploadBody'
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/attachmentResponse'
examples:
default:
$ref: '#/components/examples/uploadAttachment'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: bad_request
title: Bad request
/v2/apps/{appId}/attachments/remove:
parameters:
- $ref: '#/components/parameters/appId'
post:
tags:
- Attachments
summary: Delete Attachment
operationId: DeleteAttachment
description: |
Remove an attachment uploaded to Sunshine Conversations through the Upload attachment API.
See [Attachments for Messages](#section/Attachments-for-Messages) to have attachments automatically deleted when deleting messages, conversations or users.
security:
- basicAuth:
- integration
- app
- account
- bearerAuth:
- integration
- app
- account
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/attachmentDeleteBody'
responses:
'200':
description: Ok
content:
application/json:
schema:
type: object
examples:
default:
$ref: '#/components/examples/emptyResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: bad_request
title: 'Unsupported media URL for attachment deletion: https://badhost.com/image.png'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: not_found
title: Attachment not found
/v2/apps/{appId}/conversations:
parameters:
- $ref: '#/components/parameters/appId'
post:
tags:
- Conversations
summary: Create Conversation
operationId: CreateConversation
description: Create a conversation for the specified user(s).
security:
- basicAuth:
- integration
- app
- account
- bearerAuth:
- integration
- app
- account
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/conversationCreateBody'
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/conversationResponse'
examples:
default:
$ref: '#/components/examples/createConversation'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: app_not_found
title: App not found
get:
tags:
- Conversations
summary: List Conversations
operationId: ListConversations
description: |
Lists all conversations that a user is part of. This API is paginated through [cursor pagination](#section/Introduction/API-Pagination-and-Records-Limits).
```shell
/v2/apps/:appId/conversations?filter[userId]=42589ad070d43be9b00ff7e5
```
security:
- basicAuth:
- integration
- app
- account
- bearerAuth:
- integration
- app
- account
parameters:
- $ref: '#/components/parameters/pageQuery'
- $ref: '#/components/parameters/conversationFilterQuery'
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/conversationListResponse'
examples:
default:
$ref: '#/components/examples/listConversations'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: bad_request
title: Invalid page query parameters
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: user_not_found
title: User not found
/v2/apps/{appId}/conversations/{conversationId}:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/conversationId'
get:
tags:
- Conversations
summary: Get Conversation
operationId: GetConversation
description: Fetches an individual conversation.
security:
- basicAuth:
- integration
- app
- account
- bearerAuth:
- integration
- app
- account
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/conversationResponse'
examples:
default:
$ref: '#/components/examples/getConversation'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: conversation_not_found
title: Conversation not found
patch:
tags:
- Conversations
summary: Update Conversation
operationId: UpdateConversation
description: Updates a conversation record.
security:
- basicAuth:
- integration
- app
- account
- bearerAuth:
- integration
- app
- account
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/conversationUpdateBody'
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/conversationResponse'
examples:
default:
$ref: '#/components/examples/updateConversation'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: conversation_not_found
title: Conversation not found
delete:
tags:
- Conversations
summary: Delete Conversation
operationId: DeleteConversation
description: Delete an entire conversation record, along with its messages and attachments. Note that the default conversation cannot be deleted, but the messages contained [can be](#operation/DeleteAllMessages).
security:
- basicAuth:
- integration
- app
- account
- bearerAuth:
- integration
- app
- account
responses:
'200':
description: Ok
content:
application/json:
schema:
type: object
examples:
default:
$ref: '#/components/examples/emptyResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: bad_request
title: Conversation c93bb9c14dde8ffb94564eae cannot be deleted because it is the default.
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: conversation_not_found
title: Conversation not found
/v2/apps/{appId}/conversations/{conversationId}/join:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/conversationId'
post:
tags:
- Participants
summary: Join Conversation
operationId: JoinConversation
description: |
Adds a user to a conversation using either their userId or userExternalId. The endpoint only
supports adding a participant to a sdkGroup conversation.
security:
- basicAuth:
- integration
- app
- account
- bearerAuth:
- integration
- app
- account
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/participantJoinBody'
examples:
default:
value:
userId: 67a11490f0305f4a391e9f8a
subscribeSDKClient: true
responses:
'201':
description: Created
content:
application/json:
schema:
type: object
title: ParticipantResponse
description: The created participant.
properties:
participant:
$ref: '#/components/schemas/participant'
examples:
default:
$ref: '#/components/examples/joinConversation'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: bad_request
title: Too many participants
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: conversation_not_found
title: Conversation not found
/v2/apps/{appId}/conversations/{conversationId}/participants:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/conversationId'
get:
tags:
- Participants
summary: List Participants
operationId: ListParticipants
description: |
Lists all the participants of a particular conversation. This API is paginated through [cursor pagination](#section/Introduction/API-Pagination-and-Records-Limits).
```shell
/v2/apps/:appId/conversations/:conversationId/participants?page[before]=26508c10541a4b0ff472e5e2
```
security:
- basicAuth:
- integration
- app
- account
- bearerAuth:
- integration
- app
- account
parameters:
- $ref: '#/components/parameters/pageQuery'
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/participantListResponse'
examples:
default:
$ref: '#/components/examples/listParticipants'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: bad_request
title: Invalid page query parameters
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: conversation_not_found
title: Conversation not found
/v2/apps/{appId}/conversations/{conversationId}/leave:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/conversationId'
post:
tags:
- Participants
summary: Leave Conversation
operationId: LeaveConversation
description: |
Removes a user from a conversation using either their userId, userExternalId, or participantId.
security:
- basicAuth:
- integration
- app
- account
- bearerAuth:
- integration
- app
- account
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/participantLeaveBody'
examples:
default:
value:
userId: 67a11490f0305f4a391e9f8a
responses:
'200':
description: Ok
content:
application/json:
schema:
type: object
examples:
default:
$ref: '#/components/examples/emptyResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: not_found
title: User is not a member of the conversation
/v2/apps/{appId}/conversations/{conversationId}/messages:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/conversationId'
post:
tags:
- Messages
summary: Post Message
operationId: PostMessage
description: Send a message in a particular conversation.
security:
- basicAuth:
- integration
- app
- account
- bearerAuth:
- integration
- app
- account
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/messagePost'
examples:
default:
$ref: '#/components/examples/text'
text:
$ref: '#/components/examples/text'
carousel:
$ref: '#/components/examples/carousel'
file:
$ref: '#/components/examples/file'
form:
$ref: '#/components/examples/form'
image:
$ref: '#/components/examples/image'
list:
$ref: '#/components/examples/list'
location:
$ref: '#/components/examples/location'
whatsapp template:
$ref: '#/components/examples/whatsappTemplate'
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/messagePostResponse'
examples:
default:
$ref: '#/components/examples/text-2'
text:
$ref: '#/components/examples/text-2'
carousel:
$ref: '#/components/examples/carousel-2'
file:
$ref: '#/components/examples/file-2'
form:
$ref: '#/components/examples/form-2'
image:
$ref: '#/components/examples/image-2'
list:
$ref: '#/components/examples/list-2'
location:
$ref: '#/components/examples/location-2'
'423':
description: |
Message limit reached
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: locked
title: Message limit of 30000 per conversation reached.
get:
tags:
- Messages
summary: List Messages
operationId: ListMessages
description: |
List all messages for a particular conversation. This API is paginated through
[cursor pagination](#section/Introduction/API-Pagination-and-Records-Limits), in the _backwards_ direction, with the
most recent (i.e. last) page of messages being returned by default. The `hasMore` flag indicates whether more messages
exist in the direction you are currently paginating through. To page backwards in the history, use the `beforeCursor` or follow the `prev`
link. The page size limit is fixed at 100 messages per page.
```shell
/v2/apps/:appId/conversations/:conversationId/messages?page[before]=5f32b88acf6bf25073b2be56
```
security:
- basicAuth:
- integration
- app
- account
- bearerAuth:
- integration
- app
- account
parameters:
- $ref: '#/components/parameters/pageQuery'
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/messageListResponse'
examples:
default:
$ref: '#/components/examples/listMessages'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: not_found
title: Resource not found
delete:
tags:
- Messages
summary: Delete All Messages
operationId: DeleteAllMessages
description: Delete all messages of a particular conversation.
security:
- basicAuth:
- integration
- app
- account
- bearerAuth:
- integration
- app
- account
responses:
'200':
description: Ok
content:
application/json:
schema:
type: object
examples:
default:
$ref: '#/components/examples/emptyResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: conversation_not_found
title: Conversation not found
/v2/apps/{appId}/conversations/{conversationId}/messages/{messageId}:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/conversationId'
- $ref: '#/components/parameters/messageId'
delete:
tags:
- Messages
summary: Delete Message
operationId: DeleteMessage
description: Delete a single message of a particular conversation.
security:
- basicAuth:
- integration
- app
- account
- bearerAuth:
- integration
- app
- account
responses:
'200':
description: Ok
content:
application/json:
schema:
type: object
examples:
default:
$ref: '#/components/examples/emptyResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: conversation_not_found
title: Conversation not found
/v2/apps/{appId}/conversations/{conversationId}/activity:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/conversationId'
post:
tags:
- Activities
summary: Post Activity
operationId: PostActivity
description: |
Notify Sunshine Conversations of different conversation activities. Supported activity types are:
* Typing activity
* Conversation read event
security:
- basicAuth:
- integration
- app
- account
- bearerAuth:
- integration
- app
- account
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/activityPost'
examples:
default:
value:
author:
type: user
userId: 5963c0d619a30a2e00de36b8
type: conversation:read
responses:
'200':
description: Ok
content:
application/json:
schema:
type: object
examples:
default:
$ref: '#/components/examples/emptyResponse'
/v2/apps/{appId}/conversations/{conversationId}/passControl:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/conversationId'
post:
tags:
- Switchboard Actions
summary: Pass Control
operationId: PassControl
description: The passControl action marks the selected switchboard integration as active and transitions all the other switchboard integrations to standby status. For information about the idempotency of this API, see the [switchboard guide](https://developer.zendesk.com/documentation/conversations/messaging-platform/programmable-conversations/switchboard/#pass-control).
security:
- basicAuth:
- integration
- app
- account
- bearerAuth:
- integration
- app
- account
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/passControlBody'
responses:
'200':
description: Ok
content:
application/json:
schema:
type: object
examples:
default:
$ref: '#/components/examples/emptyResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: conversation_not_found
title: Conversation not found
/v2/apps/{appId}/conversations/{conversationId}/releaseControl:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/conversationId'
post:
tags:
- Switchboard Actions
summary: Release Control
operationId: ReleaseControl
description: |
The releaseControl action releases the control of the conversation by nullifying its switchboard state. For more
information, see the [switchboard guide](https://developer.zendesk.com/documentation/conversations/messaging-platform/programmable-conversations/switchboard/#release-control).
When using integration auth scope, a 403 is returned if the authenticated integration is not currently active in the
switchboard.
security:
- basicAuth:
- integration
- app
- account
- bearerAuth:
- integration
- app
- account
requestBody:
required: false
content:
application/json:
schema:
$ref: '#/components/schemas/releaseControlBody'
responses:
'200':
description: Ok
content:
application/json:
schema:
type: object
examples:
default:
$ref: '#/components/examples/emptyResponse'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: forbidden
title: Forbidden
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: conversation_not_found
title: Conversation not found
/v2/apps/{appId}/conversations/{conversationId}/offerControl:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/conversationId'
post:
tags:
- Switchboard Actions
summary: Offer Control
operationId: OfferControl
description: The offerControl action will invite a switchboard integration to accept control of the conversation (changing its status to pending), and trigger a webhook signal to that integration indicating that they have been offered control of the conversation. Invalidates previous offerControl actions.
security:
- basicAuth:
- integration
- app
- account
- bearerAuth:
- integration
- app
- account
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/offerControlBody'
responses:
'200':
description: Ok
content:
application/json:
schema:
type: object
examples:
default:
$ref: '#/components/examples/emptyResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: conversation_not_found
title: Conversation not found
/v2/apps/{appId}/conversations/{conversationId}/acceptControl:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/conversationId'
post:
tags:
- Switchboard Actions
summary: Accept Control
operationId: AcceptControl
description: The acceptControl action transfers the control of the conversation to the pending switchboard integration. When using integration auth scope, a 403 is returned if the pending switchboard integration is not the authenticated integration.
security:
- basicAuth:
- integration
- app
- account
- bearerAuth:
- integration
- app
- account
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/acceptControlBody'
responses:
'200':
description: Ok
content:
application/json:
schema:
type: object
examples:
default:
$ref: '#/components/examples/emptyResponse'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: forbidden
title: Forbidden
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: conversation_not_found
title: Conversation not found
/v2/apps/{appId}/conversations/{conversationId}/download:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/conversationId'
post:
tags:
- Conversations
summary: Download Message Ref
operationId: DownloadMessageRef
description: When a third party channel provides a reference of a data, this API can be used to download the reference and fetch the full data. Currently, only apple channel is supported.
security:
- basicAuth:
- integration
- app
- account
- bearerAuth:
- integration
- app
- account
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/downloadMessageRefBody'
examples:
default:
value:
userId: 6e416caac6a5e9544e3fb6d7
apple:
interactiveDataRef:
url: https://p61-content.icloud.com/M58C0A1A2EB62B6E899B4F28996E8DA229E1914295299C39944B2F2CA7482AE50.C01USN00
bid: com.apple.messages.MSMessageExtensionBalloonPlugin:0000000000:com.apple.icloud.apps.messages.business.extension
key: 00c0d1827fdc858fe7b42421de1fb289c2ee0a9463d787ce4f118506f970bd6e38
signature: 81a619c81da5a01c6139219a5d20e17430c631e1eb
owner: M58C0A2A1EB62B4E859B4F28996E8DA229E1914295299C39944B2F2CA7482AE50.C01USN00
responses:
'200':
description: Ok
content:
application/json:
schema:
type: object
additionalProperties: true
examples:
default:
$ref: '#/components/examples/emptyResponse'
/v2/apps/{appId}/conversations/{conversationId}/conversionEvents:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/conversationId'
post:
tags:
- Conversations
summary: Post Conversion Events
operationId: PostConversionEvents
description: This API can be used to track your end user's interactions with third party channels.
security:
- basicAuth:
- integration
- app
- account
- bearerAuth:
- integration
- app
- account
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/conversionEventsBody'
examples:
default:
value:
instagram:
payload:
data:
- action_source: business_messaging
event_name: TestEvent
event_time: 1752161233
messaging_channel: instagram
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/conversionEventsResponse'
examples:
default:
$ref: '#/components/examples/conversionEvents'
/v2/apps/{appId}/integrations:
parameters:
- $ref: '#/components/parameters/appId'
post:
tags:
- Integrations
summary: Create Integration
operationId: CreateIntegration
description: The Create Integration endpoint allows you to provision apps with front-end messaging channels. Selecting a `custom` integration allows the creation of webhooks.
security:
- basicAuth:
- app
- account
- bearerAuth:
- app
- account
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/integration'
responses:
'201':
description: Created
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/integrationResponse'
description: The created integration.
examples:
default:
$ref: '#/components/examples/createIntegration'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: bad_request
title: Invalid integration type
get:
tags:
- Integrations
summary: List Integrations
operationId: ListIntegrations
description: |
List available integrations. This API is paginated through [cursor pagination](#section/Introduction/API-Pagination-and-Records-Limits).
```shell
/v2/apps/:appId/integrations?page[after]=5e1606762556d93e9c176f69&page[size]=10&filter[types]=custom,web
```
security:
- basicAuth:
- app
- account
- bearerAuth:
- app
- account
parameters:
- $ref: '#/components/parameters/pageQuery'
- $ref: '#/components/parameters/integrationFilterQuery'
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/integrationListResponse'
examples:
default:
$ref: '#/components/examples/listIntegrations'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: bad_request
title: Invalid query parameters
/v2/apps/{appId}/integrations/{integrationId}:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/integrationId'
get:
tags:
- Integrations
summary: Get Integration
operationId: GetIntegration
description: Get integration.
security:
- basicAuth:
- app
- account
- bearerAuth:
- app
- account
responses:
'200':
description: Ok
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/integrationResponse'
description: The fetched integration.
examples:
default:
$ref: '#/components/examples/getIntegration'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: integration_not_found
title: Integration not found
patch:
tags:
- Integrations
summary: Update Integration
operationId: UpdateIntegration
description: Allows you to update certain fields of existing integrations. If updating a specific property is not supported, you must delete the integration and re-create it with the new data.
security:
- basicAuth:
- app
- account
- bearerAuth:
- app
- account
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/integrationUpdate'
examples:
default:
value:
displayName: My Test Integration
responses:
'200':
description: Ok
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/integrationResponse'
description: The updated integration.
examples:
default:
$ref: '#/components/examples/updateIntegration'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: integration_not_found
title: Integration not found
delete:
tags:
- Integrations
summary: Delete Integration
operationId: DeleteIntegration
description: Delete the specified integration.
security:
- basicAuth:
- app
- account
- bearerAuth:
- app
- account
responses:
'200':
description: Ok
content:
application/json:
schema:
type: object
examples:
default:
$ref: '#/components/examples/emptyResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: bad_request
title: SDK integrations configured on Admin Center cannot be deleted
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: integration_not_found
title: Integration not found
/v2/apps/{appId}/integrations/{integrationId}/keys:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/integrationId'
post:
tags:
- CustomIntegrationApiKeys
summary: Create Integration Key
operationId: CreateCustomIntegrationKey
description: Creates an API key for the specified custom integration. The response body will include a secret as well it’s corresponding id, which you can use to generate JSON Web Tokens to securely make API calls on behalf of the integration.
security:
- basicAuth:
- app
- account
- bearerAuth:
- app
- account
requestBody:
required: true
content:
application/json:
schema:
type: object
title: IntegrationApiKey
properties:
displayName:
type: string
description: The name of the API key.
example: My custom key
required:
- displayName
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/integrationApiKeyResponse'
examples:
default:
$ref: '#/components/examples/createIntegrationKey'
get:
tags:
- CustomIntegrationApiKeys
summary: List Integration Keys
operationId: ListCustomIntegrationKeys
description: Lists all API keys for a given integration.
security:
- basicAuth:
- app
- account
- bearerAuth:
- app
- account
responses:
'200':
description: Ok
content:
application/json:
schema:
type: object
title: IntegrationApiKeyListResponse
properties:
keys:
type: array
description: Integration keys of the supplied integration.
items:
$ref: '#/components/schemas/apiKey'
examples:
default:
$ref: '#/components/examples/listIntegrationKeys'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: bad_request
title: API keys are available only for custom integrations
/v2/apps/{appId}/integrations/{integrationId}/keys/{keyId}:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/integrationId'
- $ref: '#/components/parameters/keyId'
get:
tags:
- CustomIntegrationApiKeys
summary: Get Integration Key
operationId: GetCustomIntegrationKey
description: Get the specified API key.
security:
- basicAuth:
- app
- account
- bearerAuth:
- app
- account
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/integrationApiKeyResponse'
examples:
default:
$ref: '#/components/examples/getIntegrationKey'
delete:
tags:
- CustomIntegrationApiKeys
summary: Delete Integration Key
operationId: DeleteCustomIntegrationKey
description: Removes an API key.
security:
- basicAuth:
- app
- account
- bearerAuth:
- app
- account
responses:
'200':
description: Ok
content:
application/json:
schema:
type: object
examples:
default:
$ref: '#/components/examples/emptyResponse'
/v2/apps/{appId}/integrations/{integrationId}/webhooks:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/integrationId'
post:
tags:
- Webhooks
summary: Create Webhook
operationId: CreateWebhook
description: Creates a new webhook associated with a Sunshine Conversations Connect integration or a custom integration.
security:
- basicAuth:
- integration
- app
- bearerAuth:
- integration
- app
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/webhookCreateBody'
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/webhookResponse'
examples:
default:
$ref: '#/components/examples/createWebhook'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: bad_request
title: Bad request
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: forbidden
title: Forbidden
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: integration_not_found
title: Integration not found
get:
tags:
- Webhooks
summary: List Webhooks
operationId: ListWebhooks
description: Lists all webhooks for a given Sunshine Conversations Connect integration or custom integration.
security:
- basicAuth:
- integration
- app
- bearerAuth:
- integration
- app
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/webhookListResponse'
examples:
default:
$ref: '#/components/examples/listWebhooks'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: forbidden
title: Forbidden
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: integration_not_found
title: Integration not found
/v2/apps/{appId}/integrations/{integrationId}/webhooks/{webhookId}:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/integrationId'
- $ref: '#/components/parameters/webhookId'
get:
tags:
- Webhooks
summary: Get Webhook
operationId: GetWebhook
description: Gets the specified webhook associated with a Sunshine Conversations Connect integration or a custom integration.
security:
- basicAuth:
- integration
- app
- bearerAuth:
- integration
- app
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/webhookResponse'
examples:
default:
$ref: '#/components/examples/getWebhook'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: not_found
title: Resource not found
patch:
tags:
- Webhooks
summary: Update Webhook
operationId: UpdateWebhook
description: Updates the specified webhook associated with a Sunshine Conversations Connect integration or a custom integration.
security:
- basicAuth:
- integration
- app
- bearerAuth:
- integration
- app
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/webhookBody'
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/webhookResponse'
examples:
default:
$ref: '#/components/examples/updateWebhook'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: bad_request
title: Bad request
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: not_found
title: Resource not found
delete:
tags:
- Webhooks
summary: Delete Webhook
operationId: DeleteWebhook
description: Deletes the specified webhook associated with a Sunshine Conversations Connect integration or a custom integration.
security:
- basicAuth:
- integration
- app
- bearerAuth:
- integration
- app
responses:
'200':
description: Ok
content:
application/json:
schema:
type: object
examples:
default:
$ref: '#/components/examples/emptyResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: not_found
title: Resource not found
/v2/apps/{appId}/switchboards:
parameters:
- $ref: '#/components/parameters/appId'
post:
tags:
- Switchboards
summary: Create Switchboard
operationId: CreateSwitchboard
description: Create a switchboard.
security:
- basicAuth:
- app
- account
- bearerAuth:
- app
- account
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/switchboardResponse'
examples:
default:
$ref: '#/components/examples/createSwitchboard'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: bad_request
title: Only one switchboard can be created per app
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: app_not_found
title: App not found
get:
tags:
- Switchboards
summary: List Switchboards
operationId: ListSwitchboards
description: |
Lists all switchboards belonging to the app.
security:
- basicAuth:
- app
- account
- bearerAuth:
- app
- account
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/switchboardListResponse'
examples:
default:
$ref: '#/components/examples/listSwitchboards'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: app_not_found
title: App not found
/v2/apps/{appId}/switchboards/{switchboardId}:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/switchboardId'
patch:
tags:
- Switchboards
summary: Update Switchboard
operationId: UpdateSwitchboard
description: Updates a switchboard record.
security:
- basicAuth:
- app
- account
- bearerAuth:
- app
- account
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/switchboardUpdateBody'
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/switchboardResponse'
examples:
default:
$ref: '#/components/examples/updateSwitchboard'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: switchboard_not_found
title: Switchboard not found
delete:
tags:
- Switchboards
summary: Delete Switchboard
operationId: DeleteSwitchboard
description: Deletes the switchboard and all its switchboard integrations. The integrations linked to these switchboard integrations are not deleted and will start receiving all conversation events.
security:
- basicAuth:
- app
- account
- bearerAuth:
- app
- account
responses:
'200':
description: Ok
content:
application/json:
schema:
type: object
examples:
default:
$ref: '#/components/examples/emptyResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: switchboard_not_found
title: Switchboard not found
/v2/apps/{appId}/switchboards/{switchboardId}/switchboardIntegrations:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/switchboardId'
post:
tags:
- Switchboard Integrations
summary: Create Switchboard Integration
operationId: CreateSwitchboardIntegration
description: Create a switchboard integration.
security:
- basicAuth:
- app
- account
- bearerAuth:
- app
- account
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/switchboardIntegrationCreateBody'
examples:
default:
value:
name: bot
integrationType: zd:agentWorkspace
deliverStandbyEvents: true
nextSwitchboardIntegrationId: 5ef21b86e933b7355c11c606
messageHistoryCount: 5
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/switchboardIntegrationResponse'
examples:
default:
$ref: '#/components/examples/createSwitchboardIntegration'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: too_many_switchboard_integrations
title: Switchboard has reached the max number of switchboard integrations (10)
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: switchboard_not_found
title: Switchboard not found
get:
tags:
- Switchboard Integrations
summary: List Switchboard Integrations
operationId: ListSwitchboardIntegrations
description: |
Lists all switchboard integrations linked to the switchboard.
security:
- basicAuth:
- app
- account
- bearerAuth:
- app
- account
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/switchboardIntegrationListResponse'
examples:
default:
$ref: '#/components/examples/listSwitchboardIntegrations'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: switchboard_not_found
title: Switchboard not found
/v2/apps/{appId}/switchboards/{switchboardId}/switchboardIntegrations/{switchboardIntegrationId}:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/switchboardId'
- $ref: '#/components/parameters/switchboardIntegrationId'
patch:
tags:
- Switchboard Integrations
summary: Update Switchboard Integration
operationId: UpdateSwitchboardIntegration
description: Updates a switchboard integration record.
security:
- basicAuth:
- app
- account
- bearerAuth:
- app
- account
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/switchboardIntegrationUpdateBody'
examples:
default:
value:
deliverStandbyEvents: true
nextSwitchboardIntegrationId: 5ef21b86e933b7355c11c606
messageHistoryCount: 5
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/switchboardIntegrationResponse'
examples:
default:
$ref: '#/components/examples/updateSwitchboardIntegration'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: switchboard_integration_not_found
title: Enabled switchboard must have an associated default switchboardIntegration
delete:
tags:
- Switchboard Integrations
summary: Delete Switchboard Integration
operationId: DeleteSwitchboardIntegration
description: Deletes the switchboard integration. If the deleted switchboard integration had an active status for some conversations, the active switchboard integration will be re-selected following the default integration assignment rules to replace it next time the conversation has activity. Note that it is forbidden to delete a switchboard integration if it's the default one (a new one must be chosen first) or if another switchboard integration's `nextSwitchboardIntegrationId` refers to it. The integration that was linked to the deleted switchboard integration will start receiving all conversation events, regardless of the switchboard status.
security:
- basicAuth:
- app
- account
- bearerAuth:
- app
- account
responses:
'200':
description: Ok
content:
application/json:
schema:
type: object
examples:
default:
$ref: '#/components/examples/emptyResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: switchboard_integration_not_found
title: SwitchboardIntegration not found
/v2/apps/{appId}/users:
parameters:
- $ref: '#/components/parameters/appId'
post:
tags:
- Users
summary: Create User
operationId: CreateUser
description: Creates a new user.
security:
- basicAuth:
- account
- app
- integration
- bearerAuth:
- account
- app
- integration
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/userCreateBody'
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/userResponse'
examples:
default:
$ref: '#/components/examples/createUser'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: conflict
title: User already exists
get:
tags:
- Users
summary: List Users
operationId: ListUsers
description: |
Lists users by their email identity. The `identities.email` filter parameter is required, and it will match users based on emails found in the `identities` array. This endpoint will not match against emails stored in `profile.email`.
```shell
/v2/apps/:appId/users?filter[identities.email]=sue@example.org
```
security:
- basicAuth:
- account
- app
- integration
- bearerAuth:
- account
- app
- integration
parameters:
- $ref: '#/components/parameters/userFilterQuery'
- $ref: '#/components/parameters/brandIdQuery'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/userListResponse'
examples:
default:
$ref: '#/components/examples/listUsers'
/v2/apps/{appId}/users/{userIdOrExternalId}:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/userIdOrExternalId'
- $ref: '#/components/parameters/brandIdQuery'
get:
tags:
- Users
summary: Get User
operationId: GetUser
description: Fetches an individual user.
security:
- basicAuth:
- app
- account
- integration
- bearerAuth:
- app
- account
- integration
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/userResponse'
examples:
default:
$ref: '#/components/examples/getUser'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: user_not_found
title: User not found
patch:
tags:
- Users
summary: Update User
operationId: UpdateUser
description: Updates a user.
security:
- basicAuth:
- app
- account
- integration
- bearerAuth:
- app
- account
- integration
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/userUpdateBody'
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/userResponse'
examples:
default:
$ref: '#/components/examples/updateUser'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: user_not_found
title: User not found
delete:
tags:
- Users
summary: Delete User
operationId: DeleteUser
description: Delete a user, its clients and its conversation history. The user is considered completely deleted once the `user:delete` webhook is fired. To only delete a user’s personal information, see [Delete User Personal Information](#operation/DeleteUserPersonalInformation).
security:
- basicAuth:
- app
- account
- integration
- bearerAuth:
- app
- account
- integration
responses:
'200':
description: Ok
content:
application/json:
schema:
type: object
examples:
default:
$ref: '#/components/examples/emptyResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: user_not_found
title: User not found
/v2/apps/{appId}/users/{userIdOrExternalId}/clients:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/userIdOrExternalId'
- $ref: '#/components/parameters/brandIdQuery'
post:
tags:
- Clients
summary: Create Client
operationId: CreateClient
description: Create a client and link it to a channel specified by the `matchCriteria.type`. Note that the client is initially created with a `pending` status. The status of the linking request can be tracked by listening to the `client:add`, `client:update` and `client:removed` webhooks. For more information, see [channel transfer](https://developer.zendesk.com/documentation/conversations/messaging-platform/programmable-conversations/channel-transfer/).
security:
- basicAuth:
- app
- account
- integration
- bearerAuth:
- app
- account
- integration
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/clientCreate'
examples:
default:
$ref: '#/components/examples/whatsapp'
mailgun:
$ref: '#/components/examples/mailgun'
messagebird:
$ref: '#/components/examples/messagebird'
twilio:
$ref: '#/components/examples/twilio'
whatsapp:
$ref: '#/components/examples/whatsapp'
responses:
'201':
description: Created
content:
application/json:
schema:
type: object
title: ClientResponse
properties:
client:
$ref: '#/components/schemas/client'
examples:
default:
$ref: '#/components/examples/createClient'
get:
tags:
- Clients
summary: List Clients
operationId: ListClients
description: |
Get all the clients for a particular user, including both linked clients and pending clients.
This API is paginated through [cursor pagination](#section/Introduction/API-Pagination-and-Records-Limits).
```shell
/v2/apps/:appId/users/:userId/clients?page[after]=5ebee0975ac5304b664a12fa
```
security:
- basicAuth:
- app
- account
- integration
- bearerAuth:
- app
- account
- integration
parameters:
- $ref: '#/components/parameters/pageQuery'
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/clientListResponse'
examples:
default:
$ref: '#/components/examples/listClients'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: bad_request
title: Invalid page query parameters
/v2/apps/{appId}/users/{userIdOrExternalId}/clients/{clientId}:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/userIdOrExternalId'
- $ref: '#/components/parameters/clientId'
- $ref: '#/components/parameters/brandIdQuery'
delete:
tags:
- Clients
summary: Remove Client
operationId: RemoveClient
description: Remove a particular client and unsubscribe it from all connected conversations.
security:
- basicAuth:
- app
- account
- integration
- bearerAuth:
- app
- account
- integration
responses:
'200':
description: Ok
content:
application/json:
schema:
type: object
examples:
default:
$ref: '#/components/examples/emptyResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: bad_request
title: Cannot remove a client of type 'sdk'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: client_not_found
title: Client not found
/v2/apps/{appId}/users/{userIdOrExternalId}/devices:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/userIdOrExternalId'
- $ref: '#/components/parameters/brandIdQuery'
get:
tags:
- Devices
summary: List Devices
operationId: ListDevices
description: |
Get all the devices for a particular user.
The Devices are sorted based on last seen time.
security:
- basicAuth:
- app
- account
- integration
- bearerAuth:
- app
- account
- integration
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/deviceListResponse'
examples:
default:
$ref: '#/components/examples/listDevices'
/v2/apps/{appId}/users/{userIdOrExternalId}/devices/{deviceId}:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/userIdOrExternalId'
- $ref: '#/components/parameters/deviceId'
- $ref: '#/components/parameters/brandIdQuery'
get:
tags:
- Devices
summary: Get Device
operationId: GetDevice
description: |
Fetches a specific Device.
security:
- basicAuth:
- app
- account
- integration
- bearerAuth:
- app
- account
- integration
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/deviceResponse'
examples:
default:
$ref: '#/components/examples/getDevice'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: device_not_found
title: Device not found
/v2/apps/{appId}/users/{userIdOrExternalId}/personalinformation:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/userIdOrExternalId'
- $ref: '#/components/parameters/brandIdQuery'
delete:
tags:
- Users
summary: Delete User Personal Information
operationId: DeleteUserPersonalInformation
description: Delete a user’s personal information. Calling this API will clear `givenName`, `surname`, `email` and `avatarUrl` and every custom property for the specified user. For every client owned by the user, it will also clear `displayName`, `avatarUrl` and any channel specific information stored in the info and raw fields. Calling this API doesn’t delete the user’s conversation history. To fully delete the user, see [Delete User](#operation/DeleteUser).
security:
- basicAuth:
- app
- account
- integration
- bearerAuth:
- app
- account
- integration
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/userResponse'
examples:
default:
$ref: '#/components/examples/deleteUserPersonalInformation'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/errorResponse'
examples:
default:
value:
errors:
- code: user_not_found
title: User not found
/v2/apps/{appId}/users/{zendeskId}/sync:
parameters:
- $ref: '#/components/parameters/appId'
- $ref: '#/components/parameters/zendeskId'
post:
tags:
- Users
summary: Synchronize User
operationId: SyncUser
description: |-
Synchronize a messaging user with its core Zendesk user counterpart. Messaging users are separate objects linked to a core Zendesk user record by `zendeskId`. It is possible for changes to be made to the core Zendesk user record in a way that causes the messaging user to fall out of sync. The core Zendesk user might have their primary email changed, for example. This endpoint can be used to update the messaging user with the `profile.givenName`, `profile.surname`, `externalId`, and primary email identity of its core Zendesk user counterpart.
It is also possible for two Zendesk users to be merged. In such a case, this API can be used to apply that merger on the messaging side. The surviving Zendesk user id can be specified via the `survivingZendeskId` parameter of the request body, and the outgoing `zendeskId` is specified in the request path.
security:
- basicAuth:
- app
- account
- integration
- bearerAuth:
- app
- account
- integration
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/syncUserBody'
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/userResponse'
examples:
default:
$ref: '#/components/examples/syncUser'
/v2/tokenInfo:
get:
tags:
- OAuth Endpoints
summary: Get Token Info
operationId: GetTokenInfo
description: |
This endpoint can be used to retrieve the app linked to the OAuth token. Typically used after receiving an access
token via OAuth, in order to retrieve the app's `id` and `subdomain` to be used in future calls. May also be used
to confirm that the credentials are still valid.
Use `oauth-bridge.zendesk.com/sc` as the base URL when invoking this endpoint.
```
GET https://oauth-bridge.zendesk.com/sc/v2/tokenInfo
```
security: []
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/appResponseWithSubdomain'
/oauth/authorize:
get:
tags:
- OAuth Endpoints
summary: Authorize
operationId: Authorize
description: |
This endpoint begins the OAuth flow. It relies on a browser session for authentication.
If the user is not logged in to Zendesk they will be redirected to the login page.
If the user has many Zendesk accounts, they will first be prompted to select the one
they wish to integrate with. They will then be presented with an Allow/Deny dialog,
describing details of the access your integration is requesting.
Use `oauth-bridge.zendesk.com/sc` as the base URL when redirecting the user to this endpoint.
```
https://oauth-bridge.zendesk.com/sc/oauth/authorize?response_type=code&client_id={client_id}
```
security: []
parameters:
- $ref: '#/components/parameters/clientIdQuery'
- $ref: '#/components/parameters/responseTypeQuery'
- $ref: '#/components/parameters/stateQuery'
- $ref: '#/components/parameters/redirectUriQuery'
responses:
'302':
description: Found
content:
text/plain:
schema:
type: string
example: Found. Redirecting to https://oauth-bridge.zendesk.com/oauth_bridge/start?response_type=code&client_id=some_id
/oauth/token:
post:
tags:
- OAuth Endpoints
summary: Get Token
operationId: GetToken
description: |
This endpoint is used to exchange an authorization code for an access token.
It should only be used in server-to-server calls.
Use `oauth-bridge.zendesk.com/sc` as the base URL when invoking this endpoint.
```
POST https://oauth-bridge.zendesk.com/sc/oauth/token
```
security: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
code:
type: string
description: The authorization code received via the OAuth flow
example: '658965'
grant_type:
type: string
description: Must be set to the string `authorization_code`
example: authorization_code
client_id:
type: string
description: Your OAuth client ID, provisioned during the partner application process
example: 5e4af71a81966cfff3ef6550
client_secret:
type: string
description: Your OAuth client secret, provisioned during the partner application process
example: 5XJ85yjUtRcaQu_pDINblPZb
required:
- code
- grant_type
- client_id
- client_secret
responses:
'200':
description: Ok
content:
application/json:
schema:
properties:
access_token:
type: string
description: An access token that can now be used to call Sunshine Conversations APIs.
token_type:
type: string
description: Bearer. All issued tokens are of this type.
examples:
default:
$ref: '#/components/examples/getToken'
/oauth/authorization:
delete:
tags:
- OAuth Endpoints
summary: Revoke Access
operationId: RevokeAccess
description: |
This endpoint is used to revoke your integration's access to the user's app. Revoking access means your integration will no longer be able to interact with the app, and any webhooks the integration had previously configured will be removed.
Calling this endpoint is equivalent to the user removing your integration manually. Your integration's `removeUrl` (if configured) will also be called when an integration is removed in this way.
security:
- basicAuth:
- integration
- bearerAuth:
- integration
responses:
'200':
description: Ok
content:
application/json:
schema:
type: object
examples:
default:
$ref: '#/components/examples/emptyResponse'
x-webhooks:
Webhook Event:
post:
tags:
- Webhooks
description: |
A webhook payload contains an array of events, which may or may not originate from the same user
or conversation. When processing webhook payloads, your application should take care to process
each event in the array.
summary: Webhook Events
operationId: EventWebhooks
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
app:
$ref: '#/components/schemas/appSubSchema'
webhook:
$ref: '#/components/schemas/webhookSubSchema'
events:
type: array
description: The list of events that occurred.
items:
anyOf:
- $ref: '#/components/schemas/clientAddEvent'
- $ref: '#/components/schemas/clientRemoveEvent'
- $ref: '#/components/schemas/clientUpdateEvent'
- $ref: '#/components/schemas/conversationCreateEvent'
- $ref: '#/components/schemas/conversationJoinEvent'
- $ref: '#/components/schemas/conversationLeaveEvent'
- $ref: '#/components/schemas/conversationRemoveEvent'
- $ref: '#/components/schemas/conversationMessageDeliveryChannelEvent'
- $ref: '#/components/schemas/conversationMessageDeliveryFailureEvent'
- $ref: '#/components/schemas/conversationMessageDeliveryUserEvent'
- $ref: '#/components/schemas/conversationMessageEvent'
- $ref: '#/components/schemas/conversationPostbackEvent'
- $ref: '#/components/schemas/conversationReadEvent'
- $ref: '#/components/schemas/conversationReferralEvent'
- $ref: '#/components/schemas/conversationTypingEvent'
- $ref: '#/components/schemas/switchboardAcceptControl'
- $ref: '#/components/schemas/switchboardAcceptControlFailure'
- $ref: '#/components/schemas/switchboardOfferControl'
- $ref: '#/components/schemas/switchboardOfferControlFailure'
- $ref: '#/components/schemas/switchboardPassControl'
- $ref: '#/components/schemas/switchboardPassControlFailure'
- $ref: '#/components/schemas/switchboardReleaseControl'
- $ref: '#/components/schemas/userMergeEvent'
- $ref: '#/components/schemas/userUpdateEvent'
- $ref: '#/components/schemas/userRemoveEvent'
examples:
client:add:
$ref: '#/components/examples/clientAddEvent'
client:remove:
$ref: '#/components/examples/clientRemoveEvent'
client:update:
$ref: '#/components/examples/clientUpdateEvent'
conversation:create:
$ref: '#/components/examples/conversationCreateEvent'
conversation:join:
$ref: '#/components/examples/conversationJoinEvent'
conversation:leave:
$ref: '#/components/examples/conversationLeaveEvent'
conversation:remove:
$ref: '#/components/examples/conversationRemoveEvent'
conversation:message:delivery:channel:
$ref: '#/components/examples/conversationMessageDeliveryChannelEvent'
conversation:message:delivery:failure:
$ref: '#/components/examples/conversationMessageDeliveryFailureEvent'
conversation:message:delivery:user:
$ref: '#/components/examples/conversationMessageDeliveryUserEvent'
conversation:message:
$ref: '#/components/examples/conversationMessageEvent'
conversation:postback:
$ref: '#/components/examples/conversationPostbackEvent'
conversation:read:
$ref: '#/components/examples/conversationReadEvent'
conversation:referral:
$ref: '#/components/examples/conversationReferralEvent'
conversation:typing:
$ref: '#/components/examples/conversationTypingEvent'
switchboard:acceptControl:
$ref: '#/components/examples/switchboardAcceptControlEvent'
switchboard:acceptControl:failure:
$ref: '#/components/examples/switchboardAcceptControlFailureEvent'
switchboard:offerControl:
$ref: '#/components/examples/switchboardOfferControlEvent'
switchboard:offerControl:failure:
$ref: '#/components/examples/switchboardOfferControlFailureEvent'
switchboard:passControl:
$ref: '#/components/examples/switchboardPassControlEvent'
switchboard:passControl:failure:
$ref: '#/components/examples/switchboardPassControlFailureEvent'
switchboard:releaseControl:
$ref: '#/components/examples/switchboardReleaseControlEvent'
user:merge:
$ref: '#/components/examples/userMergeEvent'
user:update:
$ref: '#/components/examples/userUpdateEvent'
user:remove:
$ref: '#/components/examples/userRemoveEvent'
responses:
'200':
description: Ok
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
basicAuth:
type: http
scheme: basic
schemas:
page:
type: object
properties:
after:
type: string
description: |
A record id. Results will only contain the records that come after the specified record.
Only one of `after` or `before` can be provided, not both.
example: 5e1606762556d93e9c176f69
minLength: 24
maxLength: 24
before:
type: string
description: |
A record id. Results will only contain the records that come before the specified record.
Only one of `after` or `before` can be provided, not both.
example: 5e1606762556d93e9c176f69
minLength: 24
maxLength: 24
size:
type: integer
description: The number of records to return. Does not apply to the `listMessages` endpoint.
default: 25
example: 10
minimum: 1
maximum: 100
displayName:
type: string
nullable: true
minLength: 1
maxLength: 100
appSettings:
type: object
description: Customizable app settings.
properties:
conversationRetentionSeconds:
type: integer
description: |
Number of seconds of inactivity before a conversation’s messages
will be automatically deleted. See
[Conversation Retention Seconds](https://docs.smooch.io/guide/creating-and-managing-apps/#conversation-retention-seconds)
for more information.
minimum: 0
maskCreditCardNumbers:
type: boolean
description: |
A boolean specifying whether credit card numbers should be masked
when sent through Sunshine Conversations.
useAnimalNames:
type: boolean
description: |
A boolean specifying whether animal names should be used for
unnamed users. See the
[user naming guide](https://developer.zendesk.com/documentation/conversations/messaging-platform/programmable-conversations/receiving-messages/#message-author-name)
for details.
echoPostback:
type: boolean
description: |
A boolean specifying whether a message should be added to the conversation
history when a postback button is clicked. See
[Echo Postbacks](https://docs.smooch.io/guide/creating-and-managing-apps/#echo-postbacks)
for more information.
ignoreAutoConversationStart:
type: boolean
description: |
A boolean specifying whether a non message event coming from a channel will
trigger a
[start conversation](https://developer.zendesk.com/api-reference/conversations/#section/Webhook-Triggers)
event and count as a monthly active user (MAU).
multiConvoEnabled:
type: boolean
description: |
A boolean specifying whether users are allowed to be part of several conversations.
Enabling `multiConvo` is **irreversible**.
example: true
appLocalizationEnabled:
type: boolean
description: |
A boolean specifying whether the messages authored by the Sunshine Conversations platform should be localized.
endSessionEnabled:
type: boolean
description: |
A boolean specifying whether users can manually end (close) their conversation session via an "End Session" button on SDK.
disableConversationReopen:
type: boolean
description: |
A boolean specifying whether users can reopen conversations that have been ended.
metadata:
type: object
nullable: true
description: |
Flat object containing custom properties. Strings, numbers and booleans
are the only supported format that can be passed to metadata.
The metadata is limited to 4KB in size.
additionalProperties: true
example:
lang: en-ca
app:
type: object
x-resourceId: Apps
properties:
id:
type: string
description: A canonical ID that can be used to retrieve the Sunshine Conversations app.
example: 5d8cff3cd55b040010928b5b
displayName:
allOf:
- $ref: '#/components/schemas/displayName'
description: The friendly name of the app.
example: My App
settings:
$ref: '#/components/schemas/appSettings'
metadata:
$ref: '#/components/schemas/metadata'
meta:
type: object
description: Response metadata.
properties:
hasMore:
type: boolean
description: A flag that indicates if there are more records that can be fetched.
afterCursor:
type: string
description: |
A record id that can be used as a `page[after]` parameter in a new request to get the next page.
Not specified if there are no subsequent pages.
example: 55c8d9758590aa1900b9b9f6
beforeCursor:
type: string
description: |
A record id that can be used as a `page[before]` parameter in a new request to get the previous page.
Not specified if there are no previous pages.
example: 55c8d9758590aa1900b9b9f6
links:
type: object
description: Previous and next page links, if they exist.
properties:
prev:
type: string
description: A link to the previous page. Not specified if there are no previous pages.
example: https://{subdomain}.zendesk.com/sc/v2/apps?page[before]=fcafad804c39a39648004af9
next:
type: string
description: A link to the next page. Not specified if there are no subsequent pages.
example: https://{subdomain}.zendesk.com/sc/v2/apps?page[after]=5ea868f862cdd24abf010b38
appListResponse:
type: object
properties:
apps:
type: array
description: List of returned apps.
items:
$ref: '#/components/schemas/app'
meta:
$ref: '#/components/schemas/meta'
links:
$ref: '#/components/schemas/links'
error:
type: object
properties:
code:
type: string
description: Error code used for classifying similar error types
example: not_found
title:
type: string
description: Description of the error
example: Resource not found
errorResponse:
type: object
properties:
errors:
type: array
description: List of errors that occurred.
items:
$ref: '#/components/schemas/error'
appCreateBody:
type: object
title: AppCreateBody
properties:
displayName:
allOf:
- $ref: '#/components/schemas/displayName'
nullable: false
description: The friendly name of the app.
example: My App
settings:
$ref: '#/components/schemas/appSettings'
metadata:
$ref: '#/components/schemas/metadata'
required:
- displayName
appResponse:
type: object
title: AppResponse
properties:
app:
allOf:
- $ref: '#/components/schemas/app'
description: The app.
appSubdomain:
type: object
x-resourceId: Apps
properties:
subdomain:
type: string
description: The subdomain of the app.
example: test-domain
appResponseWithSubdomain:
type: object
title: AppResponse
properties:
app:
allOf:
- $ref: '#/components/schemas/app'
- $ref: '#/components/schemas/appSubdomain'
description: The app.
appUpdateBody:
type: object
properties:
displayName:
allOf:
- $ref: '#/components/schemas/displayName'
nullable: false
description: The friendly name of the app.
example: My App
settings:
$ref: '#/components/schemas/appSettings'
metadata:
$ref: '#/components/schemas/metadata'
appKey:
type: object
x-resourceId: App Keys
properties:
id:
type: string
description: The unique ID of the API key, used when signing JWTs or accessing the API using Basic Authentication.
example: app_5723a347f82ba0516cb4ea34
displayName:
type: string
description: The name of the API key.
example: Key 1
secret:
type: string
description: The secret of the API key, used when signing JWTs or accessing the API using Basic Authentication
example: 5XJ85yjUtRcaQu_pDINblPZb
appKeyListResponse:
type: object
properties:
keys:
type: array
description: List of returned keys.
items:
$ref: '#/components/schemas/appKey'
appKeyResponse:
type: object
title: AppKeyResponse
properties:
key:
allOf:
- $ref: '#/components/schemas/appKey'
description: The created key object.
attachmentUploadBody:
type: object
properties:
source:
type: string
format: binary
required:
- source
attachmentSchema:
type: object
properties:
mediaUrl:
type: string
description: |
Uploaded attachment’s url.
example: https://smooch.io/rocks.smooch.media-dev/apps/5ec41c54fe13cc5ac404bedc/conversations/c616a583e4c240a871818541/TmYMVQUBNsQRItX4fKf4aC-T/Screen%20Shot%202020-09-02%20at%204.04.41%20PM.png
mediaType:
type: string
description: Uploaded attachment's media type
example: image/png
attachmentResponse:
type: object
title: AttachmentResponse
properties:
attachment:
allOf:
- $ref: '#/components/schemas/attachmentSchema'
description: The uploaded attachment object.
attachmentDeleteBody:
type: object
properties:
mediaUrl:
type: string
description: The media URL used for a file or image message.
example: https://s3.amazonaws.com/document.pdf
required:
- mediaUrl
conversationType:
type: string
description: The type of the conversation.
enum:
- personal
- sdkGroup
example: personal
name:
type: string
description: Identifier for use in control transfer protocols. Restricted to alphanumeric characters, `-` and `_`.
maxLength: 128
example: bot
switchboardIntegrationId:
type: string
description: Id of the integration that should deliver events routed by the switchboard.
example: 5ef21b86e933b7355c11c605
switchboardIntegrationType:
type: string
description: Type of integration that should deliver events routed by the switchboard. If referencing an OAuth integration, the clientId issued by Sunshine Conversations during the OAuth partnership process will be the value of integrationType.
example: zd:agentWorkspace
switchboardIntegrationWebhook:
type: object
properties:
id:
type: string
description: The unique ID of the switchboard integration.
example: 5ef21b86e933b7355c11c604
name:
$ref: '#/components/schemas/name'
integrationId:
$ref: '#/components/schemas/switchboardIntegrationId'
integrationType:
$ref: '#/components/schemas/switchboardIntegrationType'
conversationTruncated:
type: object
properties:
id:
type: string
description: The unique ID of the conversation.
example: c93bb9c14dde8ffb94564eae
type:
$ref: '#/components/schemas/conversationType'
metadata:
$ref: '#/components/schemas/metadata'
activeSwitchboardIntegration:
allOf:
- $ref: '#/components/schemas/switchboardIntegrationWebhook'
description: The current switchboard integration that is in control of the conversation. This field is omitted if no `activeSwitchboardIntegration` exists for the conversation.
nullable: true
pendingSwitchboardIntegration:
allOf:
- $ref: '#/components/schemas/switchboardIntegrationWebhook'
description: The switchboard integration that is awaiting control. This field is omitted if no switchboard integration has been previously offered control.
nullable: true
description:
type: string
nullable: true
minLength: 1
maxLength: 100
description: A short text describing the conversation.
example: Conversation between Rogers and Carl.
icon:
type: string
nullable: true
format: uri
minLength: 1
maxLength: 2048
description: A custom conversation icon url. The image must be in either JPG, PNG, or GIF format
example: https://www.gravatar.com/image.jpg
conversation:
allOf:
- $ref: '#/components/schemas/conversationTruncated'
- type: object
x-resourceId: Conversations
properties:
isDefault:
type: boolean
description: |
Whether the conversation is the default conversation for the user. Will be
true for the first personal conversation created for the user, and false in
all other cases.
example: false
displayName:
allOf:
- $ref: '#/components/schemas/displayName'
description: |
A friendly name for the conversation, may be displayed to the business or
the user.
example: My conversation
description:
$ref: '#/components/schemas/description'
iconUrl:
$ref: '#/components/schemas/icon'
businessLastRead:
type: string
description: |
A datetime string with the format YYYY-MM-DDThh:mm:ss.SSSZ
representing the moment the conversation was last marked as read with
role business.
nullable: true
example: '2020-06-23T14:33:47.492Z'
lastUpdatedAt:
type: string
description: |
A datetime string with the format YYYY-MM-DDThh:mm:ss.SSSZ
representing the moment the last message was received in the
conversation, or the creation time if no messages have been received yet.
nullable: true
example: '2020-06-26T14:33:47.120Z'
createdAt:
type: string
description: |
A datetime string with the format YYYY-MM-DDThh:mm:ss.SSSZ
representing the creation time of the conversation.
example: '2020-06-20T11:26:07.001Z'
conversationListResponse:
type: object
properties:
conversations:
type: array
description: List of returned conversations.
items:
$ref: '#/components/schemas/conversation'
meta:
$ref: '#/components/schemas/meta'
links:
$ref: '#/components/schemas/links'
participantSubSchema:
anyOf:
- type: object
title: ParticipantWithUserId
properties:
userId:
type: string
description: The id of the user that will be participating in the conversation. It will return `404` if the user can’t be found. One of `userId` or `userExternalId` is required, but not both.
example: 42589ad070d43be9b00ff7e5
subscribeSDKClient:
description: When passed as true, the SDK client of the concerned participant will be subscribed to the conversation. The user will start receiving push notifications for this conversation right away, without having to view the conversation on the SDK beforehand. An SDK client will be created for users that don’t already have one. This field is required if the conversation is of type `sdkGroup`.
type: boolean
example: false
- type: object
title: ParticipantWithUserExternalId
properties:
userExternalId:
type: string
description: The `externalId` of the user that will be participating in the conversation. It will return `404` if the user can’t be found. One of `userId` or `userExternalId` is required, but not both.
example: your-own-user-id
subscribeSDKClient:
description: When passed as true, the SDK client of the concerned participant will be subscribed to the conversation. The user will start receiving push notifications for this conversation right away, without having to view the conversation on the SDK beforehand. An SDK client will be created for users that don’t already have one. This field is required if the conversation is of type `sdkGroup`.
type: boolean
example: false
conversationCreateBody:
type: object
title: ConversationCreateBody
properties:
type:
$ref: '#/components/schemas/conversationType'
participants:
type: array
description: |
The users participating in the conversation. For `personal` conversations, this field is required with a length of exactly 1. For `sdkGroup` conversations, must have a length less than or equal to 10.
Can be omitted to have a conversation with no participants if the type is `sdkGroup`.
items:
$ref: '#/components/schemas/participantSubSchema'
maxItems: 10
displayName:
allOf:
- $ref: '#/components/schemas/displayName'
description: |
A friendly name for the conversation, may be displayed to the business or
the user.
example: My conversation
description:
$ref: '#/components/schemas/description'
iconUrl:
$ref: '#/components/schemas/icon'
metadata:
$ref: '#/components/schemas/metadata'
required:
- type
conversationResponse:
type: object
title: ConversationResponse
properties:
conversation:
allOf:
- $ref: '#/components/schemas/conversation'
description: The conversation.
conversationUpdateBody:
type: object
properties:
displayName:
allOf:
- $ref: '#/components/schemas/displayName'
description: |
A friendly name for the conversation, may be displayed to the business or
the user.
example: My conversation
description:
$ref: '#/components/schemas/description'
iconUrl:
$ref: '#/components/schemas/icon'
metadata:
$ref: '#/components/schemas/metadata'
participantJoinBody:
allOf:
- $ref: '#/components/schemas/participantSubSchema'
clientType:
type: string
description: The type of integration that the client represents. Can be any of the supported integration types, or sdk for integrations of type ios, android, unity and web.
enum:
- apple
- gbm
- googlercs
- instagram
- kakao
- line
- mailgun
- messagebird
- messenger
- slackconnect
- sdk
- telegram
- twilio
- twitter
- viber
- wechat
- whatsapp
example: telegram
clientAssociation:
type: object
properties:
type:
$ref: '#/components/schemas/clientType'
clientId:
type: string
description: The id of the client being referenced.
example: 42589ad070d43be9b00ff7e5
participant:
type: object
x-resourceId: Participants
properties:
id:
type: string
description: The unique ID of the participant.
example: c93bb9c14dde8ffb94564eae
userId:
type: string
description: The id of the associated user.
example: 42589ad070d43be9b00ff7e5
unreadCount:
type: integer
description: Number of messages the user has not yet read.
example: 0
clientAssociations:
type: array
description: |
Represents the clients that are active in the conversation for a particular
user. A participant can have multiple clientAssociations in the case of
channel transfer, business initiated conversations, or identified users.
The order of the array indicates how recently a client has interacted with
the conversation, with the most recent client first. The first item in the
array is considered to be the user's primary client for that conversation,
and will be selected first for message delivery.
items:
$ref: '#/components/schemas/clientAssociation'
userExternalId:
type: string
description: The externalId of the associated user.
example: your-own-id
nullable: true
lastRead:
type: string
description: A datetime string with the format YYYY-MM-DDThh:mm:ss.SSSZ representing the latest message the user has read.
example: '2019-01-14T18:55:12.515Z'
nullable: true
participantListResponse:
type: object
description: List of returned participants.
properties:
participants:
type: array
items:
$ref: '#/components/schemas/participant'
meta:
$ref: '#/components/schemas/meta'
links:
$ref: '#/components/schemas/links'
participantLeaveBody:
oneOf:
- type: object
title: ParticipantLeaveBodyUserId
properties:
userId:
type: string
description: |
The id of the user that will be removed from the conversation. It will
return 404 if the user can’t be found.
example: 42589ad070d43be9b00ff7e5
- type: object
title: ParticipantLeaveBodyUserExternalId
properties:
userExternalId:
type: string
description: |
The externalId of the user that will be removed from the conversation. It
will return 404 if the user can’t be found.
example: your-own-user-id
- type: object
title: ParticipantLeaveBodyParticipantId
properties:
participantId:
type: string
description: |
The participantId of the user that will be removed from the conversation.
It will return 404 if the user can’t be found.
example: 42589ad070d43be9b00ff7e5
author:
type: object
description: The author of the message.
properties:
type:
type: string
description: |
The author type. Either "user" (representing the end user)
or "business" (sent on behalf of the business).
enum:
- business
- user
example: business
subtypes:
type: array
description: |
A string array that indicates the author's subtypes. Messages from "business" type with an "AI" subtype
are generated by AI and a disclaimer is appended to the text of the message sent to the customer.
For third-party channels, the disclaimer is applied for image, file, and text message types.
Message with an "activity" subtype are generated by system activities.
Message with an "agent" subtype are generated by human agents (available in responses only).
Message with a "bot" subtype are generated by bot agents (available in responses only).
items:
type: string
enum:
- AI
- activity
- agent
- bot
uniqueItems: true
minItems: 1
maxItems: 1
userId:
type: string
description: The id of the user. Only supported when `type` is user.
example: 5963c0d619a30a2e00de36b8
userExternalId:
type: string
description: The externalId of the user. Only supported when `type` is user.
writeOnly: true
example: your-own-id
brandId:
type: string
nullable: true
minLength: 1
maxLength: 24
description: |
The brandId of the user. Required when `userExternalId` is used and the target user is brand-separated, and should be omitted otherwise.
example: '9477922990333'
writeOnly: true
displayName:
type: string
description: The display name of the message author.
example: Steve
avatarUrl:
allOf:
- $ref: '#/components/schemas/icon'
nullable: false
description: A custom message icon URL. The image must be JPG, PNG, or GIF format.
required:
- type
ticketClosed:
type: object
properties:
type:
type: string
enum:
- ticket:closed
description: The type of system activity that generated the message. The value of this field determines the dynamic content that is rendered to the end-user / agent when viewing this message. Each `type` value will have a set of pre-defined, localized strings that describe the activity.
default: ticket:closed
data:
type: object
description: No additional data is supplied with the "ticket:closed" activity type at this time.
additionalProperties: true
required:
- type
readOnly: true
transferToEmail:
type: object
properties:
type:
type: string
enum:
- ticket:transfer:email
description: The type of system activity that generated the message. The value of this field determines the dynamic content that is rendered to the end-user / agent when viewing this message. Each `type` value will have a set of pre-defined, localized strings that describe the activity.
default: ticket:transfer:email
data:
type: object
description: No additional data is supplied with the "ticket:transfer:email" activity type at this time.
additionalProperties: true
required:
- type
readOnly: true
endedByUser:
type: object
properties:
type:
type: string
enum:
- conversation:endedByUser
description: The type of system activity that generated the message. The value of this field determines the dynamic content that is rendered to the end-user / agent when viewing this message. Each `type` value will have a set of pre-defined, localized strings that describe the activity.
default: conversation:endedByUser
data:
type: object
description: No additional data is supplied with the "conversation:endedByUser" activity type at this time.
additionalProperties: true
required:
- type
readOnly: true
activityMessage:
oneOf:
- $ref: '#/components/schemas/ticketClosed'
- $ref: '#/components/schemas/transferToEmail'
- $ref: '#/components/schemas/endedByUser'
discriminator:
propertyName: type
mapping:
ticket:closed: '#/components/schemas/ticketClosed'
ticket:transfer:email: '#/components/schemas/transferToEmail'
conversation:endedByUser: '#/components/schemas/endedByUser'
htmlText:
type: string
description: |-
HTML text content of the message. Can be provided in place of `text`. Cannot be used with `markdownText`.
If no `text` is provided, will be converted to `text` upon reception to be displayed on channels that do not support rich text.
See [rich text](https://developer.zendesk.com/documentation/conversations/messaging-platform/programmable-conversations/structured-messages/#rich-text) documentation for more information.
maxLength: 4096
example: