This document provides an exhaustive list of changes between the v1.1 and v2 API suites. The full v2 API specification can be found here.
This document is continuously updated as backward compatible changes are made to the v2 API and new endpoints are added. Below you can see when the document was last edited:
author
schema and conversation
schemaclient:add
, client:update
and client:remove
user:merge
webhook eventuser:update
webhook eventconversation:referral
webhook eventpassControl
action is now idempotentThe v2 API is a new set of APIs with extended capabilities to the v1 suite. Many of the existing v1 API endpoints have equivalent v2 API endpoints, however many request and response payloads have been significantly modified in the new API. A summary of the biggest differences is provided below. For more details, consult the documentation of each specific endpoint.
_id
field has been renamed to id
appUser
is no longer supported for server-to-server calls/v1.1/appusers/{id}
) has been removed. All app resources are now only accessible with paths including the app ID (/v2/apps/:appId/…
)YYYY-MM-DDThh:mm:ss.SSSZ
errors
array in the response instead of an error
objectPATCH
HTTP verb instead of PUT
. The behaviour remains unchanged between PUT
and PATCH
metadata
field now allows partial updates. Values within metadata
can now be unset with null
serviceAccountId
query parameter used to return only the apps that the service account has access to was replaced by filter[serviceAccountId]
appUserId
or a userId
in the query parameters it is now replaced with conversationId
mediaUrl
and mediaType
in the response body have been moved under a top-level object attachment
to match the style of other API responses/conversations
instead of /appusers
, and a conversation ID must be supplied instead of a user IDauthor
, source
, and content
. See the message schema changes below for more detailsmessages
rather than a single message
object and an array of extraMessages
conversation
objectauthor
object in the body, rather than the previous role
fieldauthor.role: 'user'
Updated validation on certain fields when posting messages
actions
array now has has a max size of 10, and a minimum size of 1. The field remains optional if no actions are desired for the messagemediaType
can no longer be specified when posting a message. The type of the file will always be inferred from the mediaUrl
webview_height_ratio
and fallback_url
are no longer considered for webview
in Facebook Messenger. Use the size
and fallback
properties of the webview action insteaddestination
, integration types apn
and fcm
have been replaced by ios
and android
, respectivelytext
type messages. Syntax passed in the text
field of other message types will be ignoredinvalidFile
error will replace the generic badRequest
error when invalid media is sentNot migrated to v2 yet
fcm
have been replaced by the new type android
. The senderId
and serverKey
properties are no longer required when creating an android
integrationapn
have been replaced by the new type ios
. The certificate
property is no longer required when creating an ios
integrationcustom
has been introduced to replace the functionality of the previous webhooks API suite. All existing webhooks have been automatically upgraded to belong to custom integrations in the APIdisplayName
property (if passed) now has a minimum length of 1signingKey
is now required when creating an integration of type messagebird
types
query parameter used to return only integrations of a specific type was replaced by filter[types]
Removed in v2
Not migrated to v2 yet
Not migrated to v2 yet
appUser
has been renamed to user
in all API paths and request/response bodiesandroid
, ios
and web
are now unified under a single client with type sdk
. Existing clients have been converted to devices
devices
to replace the per-device tracking of metadata and push notification tokens that used to be handled by SDK clients/channels
APIs have been removed in favor of Create/List/Remove Client APIs/profile
endpoint has been renamed to DELETE /personalinformation
metadata
field now allows unsetting all its values at once with null
Updated validation on certain fields when creating / updating users:
externalId
, givenName
, surname
, email
, avatarUrl
and signedUpAt
fields are validated in regards to their type and lengthcustom
. Existing webhooks have been automatically upgraded to belong to custom integrations in the APIcustom
can be created with the integrations API /integrations
, and require a webhooks
array to be passed in the request. Once the custom integration is created, webhooks can be managed with the webhooks API /integrations/:integrationId/webhooks
id
different from the custom integration id
, which can be used to retrieve, update or delete the webhookname
field has been renamed to displayName
appToken
fieldname
field has been renamed to displayName
platform
has been renamed to type
status
of pending
has been introduced to distinguish clients that have not been confirmed yet (previously called pendingClients
)blocked
and active
which were marked as deprecated in v1.1. Use status
insteadid
, deviceId
, pushNotificationToken
and appVersion
. These are now properties of the device schemaprimary
property is removed. To know the primary client of a user in relation to a conversation, use the List Participants API. The first item of a participant’s clientAssociations
array represents the primary clienttype
field. Possible values are personal
and sdkGroup
unreadCount
and lastRead
. Use the equivalent fields of each participant insteadmetadata
, lastUpdatedAt
, displayName
and description
appMakerLastRead
is now a stringified date instead of a unix timestampappMakerLastRead
property was renamed to businessLastRead
name
property to displayName
type
has been renamed to integrationType
destination
object must include either integrationId
or integrationType
, not bothdescription
has been renamed to title
ios
, android
, and custom
apn
and fcm
as supported types, they are now exposed as ios
and android
messageSchema
has been renamed to schema
received
is now a stringified date instead of a unix timestampauthorId
has been renamed to userId
and is no longer returned for business
messagesappUser
role has been renamed to user
email
field when posting a message. Use avatarUrl
insteadThe previous message structure has been re-organized and composed into multiple top-level objects
author
object has been introduced replacing the top-level properties role
, name
, authorId
and avatarUrl
. See the Messages section of the v2 API spec for more detailsid
, received
, source
, destination
, metadata
, deleted
, override
, schema, and quotedMessage
remain at the root of the message objectcontent
objectapi
and notifications
for a message’s source.type
have been changed to api:conversations
and api:notifications
respectivelycontent
no longer include an _id
(i.e. actions
or items
)client
and device
may now be included in webhook payloads when includeFullSource
is enabled for the webhookoriginalMessageTimestamp
is now a stringified date instead of a unix timestampuserId
has been renamed to externalId
properties
has been renamed to metadata
clients
and pendingClients
. Use the List Clients API insteadconversationStarted
fieldprofile
sub-object that holds the givenName
, surname
, avatarUrl
(this is a new property) and email
propertiescredentialRequired
field is no longer acceptedcustom
, or integrations created via Sunshine Conversations Connectversion
can have a new value v2
includeFullAppUser
has been renamed to includeFullUser
includeClient
has been renamed to includeFullSource
*
). Triggers must all be individually selectedv1.x trigger | Equivalent v2 trigger | Notes |
---|---|---|
merge:appUser | user:merge | |
message:appUser | conversation:message | Subscribes to both
user
and
business
messages |
message:appMaker | conversation:message | Subscribes to both
user
and
business
messages |
message:delivery:channel | conversation:message:delivery:channel | |
message:delivery:failure | conversation:message:delivery:failure | |
message:delivery:user | conversation:message:delivery:user | |
conversation:read | conversation:read | |
typing:appUser | conversation:typing | |
conversation:start | conversation:create | Now triggers when a conversation is created for any reason, not just in response to a start conversation event.
The creationReason
may be used to determine why the conversation was created. |
conversation:referral | conversation:referral | Now this is triggered for everytime when
conversation:referral
and
conversation:start
used to be triggered, except when
conversation:create
is triggered. |
postback | conversation:postback | The message and action linked to a postback event are no longer included in the webhook payload. |
client:add | client:add | This event is now triggered for the following reasons: upon initiating a channel link, when logging in the sdk for the first time and when initiating an SDK device with an
authCode
. |
client:block | client:update | The payload will include a
reason
with the value
blocked
. |
client:remove | client:remove | The payload now includes the conversation whenever it is available. |
link:failure | client:remove | The payload will include a
reason
with either
linkCancelled
or
linkFailure
. |
link:success | client:update | The payload will include a
reason
field with the value
confirmed
. |
link:match | client:update | The payload will include a
reason
field with the value
matched
. |