Gladly API (1.0)

Download OpenAPI specification:Download

Introducing the Gladly API

At Gladly, we believe that customer service is best when it's a conversation. That means more than just helping customers with one-off questions or issues: it's about making them feel known, valued, and respected for the individuals they are.

The Gladly API was built to help facilitate those relationships, providing agents with the rich customer context they need to deliver seamless experiences that make customers feel like they're more than just a number in a sea of others.

Overview

You can integrate easily with Gladly by calling Gladly's REST API and implementing the Lookup API to provide data from your own services.

Some examples of what you do through Gladly APIs include managing customer profile data, interacting with a customer's timeline, providing the latest information about a customer's orders, and more.

REST API

Clients can access the REST API via HTTPS at your organization's Gladly domain (e.g. https://{organization}.gladly.com).

Resources follow REST semantics and utilize industry-standard HTTP verbs, response codes, and authentication schemes. In addition, all responses and payloads are in JSON with consistent error codes and formats.

Lookup API

The Gladly Lookup API allows your organization to provide data services to power the agent's experience with a complete view of your customers' information, transactions, and activity. You can provide a web service that implements the Lookup API and Gladly will call it when that data is needed.

Like the REST API, the Lookup API is specified using REST semantics, and exchanges JSON requests and responses authenticated and signed with secure keys.

Gladly will perform lookups when certain activities occur within Gladly, such as when a customer's profile is loaded.

A detailed overview of Lookup Adaptor architecture, requests, resposnes and more can be found here.

Testing

Test the myriad possibilities of the Gladly API in a safe, secure space. We'll enable the Gladly API in a separate sandbox environment, so you can experiment freely without impacting your production environment (or vice versa).

Your sandbox environment is accessible at https://{organization}.gladly.qa, where organization is your company name. For specific API endpoints, see documentation below.

Getting Started

Think of this section as getting the keys to unlocking your access to the Gladly APIs. First, you'll need to set up an account with the necessary API permissions. With these permissions, you can then go on to create the API Token(s) you need to access Gladly's API resources.

Permissions

Gladly Administrators can set API permissions on an agent-by-agent basis. We'll discuss how this maps to API access in the section on authentication below.

To allow a user to create API tokens and access the API:

  1. Log in to your Gladly instance.
  2. Open the menu on the top left-hand corner of the page.
  3. Navigate to Settings > *Users
  4. Search and click the user profile you wish to give access to.
  5. You'll see a permission called API User. Select it, while making sure to keep the user's Agent role intact.
  6. Hit Save to give access.

Agent profile screen

We recommend creating a dedicated user to make API calls, whose account won't be used for agent and organization management. This will help you with any future audits of API activity vs. agent activity.

Creating API Tokens

You must create an API token to access Gladly API resources (see above Permissions). If your profile already has access to the API User permission, you'll see a menu item titled More settings. Click More settings:

API Token Menu

Click API Tokens, then the Create Token button on the upper right-hand corner of the page:

API Token Add

A token will be generated and named, by default, New Token (though depending on whether you have existing tokens, it may be named New Token 2, or New Token 3, etc.). You can rename the token to something more easily referenceable by clicking the name to edit.

This token will be associated with your agent profile, which we refer to as the API User in this document.

API Token View

For security purposes, you'll only see a new token once before you navigate away from the page.

Replacing/Rotating API Tokens

Should you lose this token, or wish to rotate your application keys, you can do the following:

  1. Generate a new token.
  2. Store the new token in a secure location.
  3. Delete the old token.
  4. Update your applications/scripts with the new token.

Authentication

BasicAuth

Gladly API uses token-based Basic Authentication. API tokens are associated with designated Gladly users. To create and use an API token, your user must have the API User permission. An API token can be used to perform any API request without restriction.

user name password
agent email API token

The credentials must be passed via an Authorization HTTP header. All requests must be made over HTTPS.

curl -u user@organization.com:$GLADLY_API_TOKEN \
https://organization.gladly.com/api/v1/organization
Security Scheme Type HTTP
HTTP Authorization Scheme basic

Agents

An Agent represents the user profile of a person who helps customers in Gladly. The API allows you to lookup Agents who participated in conversations with customers.

List Agents

Returns a list of agents.

Responses

200

Agents

get /api/v1/agents
https://organization.gladly.com/api/v1/agents

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get Agent

Get an agent profile by their unique id.

path Parameters
agentId
required
string
Example: WmeA3Y51Q5ayCAaZ1AotIA

id of the agent

Responses

200

Agent

get /api/v1/agents/{agentId}
https://organization.gladly.com/api/v1/agents/{agentId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "WmeA3Y51Q5ayCAaZ1AotIA",
  • "name": "Amy Agent",
  • "emailAddress": "amy.agent@company.com"
}

Get Agent CallRecorder

Get an agent call recording status.

path Parameters
agentId
required
string
Example: WmeA3Y51Q5ayCAaZ1AotIA OR agent@customer.com

Gladly ID or Gladly email address of the agent

Responses

200

CallRecorder

404

Agent not found

get /api/v1/agents/{agentId}/call-recorder
https://organization.gladly.com/api/v1/agents/{agentId}/call-recorder

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "agentId": "WmeA3Y51Q5ayCAaZ1AotIA",
  • "customerId": "ZcyobierQhucTS5GV1R2Fw",
  • "conversationItemId": "g6UatsvAQC69AcDpOKF-yQ",
  • "recording": "true"
}

Update Agent CallRecorder

Update an agent's active call recording status. This API allows changing the recording property.

path Parameters
agentId
required
string
Example: WmeA3Y51Q5ayCAaZ1AotIA OR agent@customer.com

Gladly ID or Gladly email address of the agent

Request Body schema: application/json

JSON patch of CallRecorder

agentId
string

Id of the agent

customerId
string

Id of the customer on the call, if the agent is on a call. If the agent is not on a call this is omitted

conversationItemId
string

Id of the conversation item of the call, if the agent is on a call. If the agent is not on a call this is omitted

recording
boolean

If the call is currently being recorded or not

Responses

204

Call recording updated. If an agent is not on a call the update will do nothing.

404

Agent not found

patch /api/v1/agents/{agentId}/call-recorder
https://organization.gladly.com/api/v1/agents/{agentId}/call-recorder

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "recording": false
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "errors":
    {
    }
}

Answers

A Public Answer in Gladly represents a consumer-facing Answer.

Answers API allows you to search and retrieve Public Answers (created directly in the Gladly UI), which you can display in the Glad App web widget, use to build your website's help center/FAQ page, or publish on any page on your website.

This API can be used without an API token because it only provides access to public content. You may also work with Gladly Support to enable CORS access so the API can be used directly from client-side javascript.

How a user creates a public answer in Gladly

How that answer is searched and displayed on the Glad App Web widget

Search public answers

Returns a list of answers that match the provided query string.

path Parameters
orgId
required
string
Example: ihKsWxiZCDVtXg1iwVmT9Q

id of your organization

You can look up the ID using the Get organization API.

query Parameters
q
string
Example: q=reset%20password

search term

lng
string
Example: lng=en-us

language code

audienceId
string
Example: audienceId=en-us

Audience ID. The Audience ID can be retrieved by going to Settings > Audiences in Gladly, then clicking on the Edit button next to the Audience in question. The ID will be in the page URL.

Responses

200

found answers

get /api/v1/orgs/{orgId}/answers-search?q=search+terms
https://organization.gladly.com/api/v1/orgs/{orgId}/answers-search?q=search+terms

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

List public answers

Returns the first 1000 public answers sorted alphabetically by name.

path Parameters
orgId
required
string
Example: ihKsWxiZCDVtXg1iwVmT9Q

id of your organization

You can look up the ID using the Get organization API.

query Parameters
lng
string
Example: lng=es-419

Language of the answers returned

Defaults to en-us

audienceId
string
Example: audienceId=ihKsWxiZCDVtXg1iwVmT9Q

Audience ID for answers returned - optional. The Audience ID can be retrieved by going to Settings > Audiences in Gladly, then clicking on the Edit button next to the Audience in question. The ID will be in the page URL.

Responses

200

answers

get /api/v1/orgs/{orgId}/answers?lng={lng}&audienceId={audienceId}
https://organization.gladly.com/api/v1/orgs/{orgId}/answers?lng={lng}&audienceId={audienceId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

List Help Center Answer Titles

Returns an array of answers configured in Help Center sections with their ID and name

path Parameters
orgId
required
string
Example: ihKsWxiZCDVtXg1iwVmT9Q

id of your organization

You can look up the ID using the Get organization API.

helpCenterId
required
string
Example: ihKsWxiZCDVtXg1iwVmT9Q

Help Center ID

You can look up the ID by going to Settings > Help Center in Gladly, then clicking on the 3 dots next to the Help Center and selecting Configure. Help Center ID will be in the URL

query Parameters
lng
string
Example: lng=es-419

Language of the answers returned

Defaults to en-us

audienceId
string
Example: audienceId=ihKsWxiZCDVtXg1iwVmT9Q

Audience ID for answers returned - optional. The Audience ID can be retrieved by going to Settings > Audiences in Gladly, then clicking on the Edit button next to the Audience in question. The ID will be in the page URL.

Responses

200

answers

get /api/v1/orgs/{orgId}/help-center/{helpCenterId}/answer-titles?lng={lng}&audienceId={audienceId}
https://organization.gladly.com/api/v1/orgs/{orgId}/help-center/{helpCenterId}/answer-titles?lng={lng}&audienceId={audienceId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get public answer

Returns the answer with the provided id.

path Parameters
orgId
required
string
Example: ihKsWxiZCDVtXg1iwVmT9Q

id of your organization

You can look up the ID using the Get organization API.

answerId
required
string
Example: 1grfSzATQLa334VDLCWc4A

id of the answer

query Parameters
lng
string
Example: lng=en-us

language code

Responses

200

answer

get /api/v1/orgs/{orgId}/answers/{answerId}
https://organization.gladly.com/api/v1/orgs/{orgId}/answers/{answerId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "1grfSzATQLa334VDLCWc4A",
  • "name": "How to reset your password",
  • "bodyHtml": "<div><a href=\"/reset-password\">Click here</a> to reset your password</div>",
  • "language": "en-us",
  • "updatedAt": "2023-05-22T10:00:00.000Z"
}

Communications

Communications API enables you to programmatically send SMS messages to your customers and receive messages from a custom channel integration.

Agent View

Agent View

Consumer View

Customer View

Send SMS

To send an SMS message to a customer specified by a mobile phone number.

Gladly can send outbound SMS messages globally. By default, your organization is set up to only allow access to your home country. To send SMS messages to other countries, please contact Gladly Support with a P4 designation.

Please be aware that:

  • Any automated outbound text messages must comply with carrier acceptable use policies (e.g.: if sending automated messages about order status, make sure customers can explicitly opt-in to text messages), including registering your SMS use cases carriers.
  • Text messages send in segments and you pay per segment. We highly recommend using the segment calculator when crafting automated outbound text messages.
  • Each type of phone number has a Message Segments per Second limit.
Request Body schema: application/json

SMS to send

customer
required
object (customer with mobile number)
from
required
string (mobile number)
body
required
string (SMS message)

Responses

200

the customer and conversation item ID

400

Invalid field(s) in request body

post /api/v1/communications/sms
https://organization.gladly.com/api/v1/communications/sms

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "customer":
    {
    },
  • "from": "+14152223316",
  • "body": "hello, this is a sample SMS message!"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "customerId": "gHufx-U3QqOmhvFuViceTw",
  • "conversationItemId": "pOVVdzweSumI4bFxjlT8LA"
}

Receive Custom Channel messages

Custom Channels allows for building custom channel integration with Gladly. This functionality is deactivated by default.

Note that the intended use case for custom channels is any non Gladly messaging based supported channel.

Please contact Gladly Support if you would like to activate this API and believe you have a valid use case.

To receive a Custom Channel message, you must first create a Custom Channel and a Custom Channel Entry Point in Gladly Settings -> Custom Channels page. This API will accept messages from the channel integration and process them similarly to built-in messaging channels.

path Parameters
customChannelId
required
string

The ID of the Custom Channel. To find the Custom Channel ID, you must open the overflow menu of a Custom Channel Entry Point and select the "View Integration Data" option.

Request Body schema: application/json

Custom Channel message

sender
required
object
to
required
string

The address of the recipient of the message. This should correspond to the Entry Point Address created for the Custom Channel in Gladly.

type
required
string
Enum: "TEXT" "FILES"

Describes the message type

groupId
string (Message Group ID)

Optional message group ID that can be associated with a message, the Custom Channel must be configured for Message Groups in order to use this field.

groupName
string (Message Group Name)

Used together with groupId to give the group a name that can be displayed to an Agent.

content
required
Plain text message (object) or Files message (object)

Responses

201

Message received

400

Invalid fields(s) in the request body

post /api/v1/communications/custom-channels/{customChannelId}/messages
https://organization.gladly.com/api/v1/communications/custom-channels/{customChannelId}/messages

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "sender":
    {
    },
  • "to": "string",
  • "type": "TEXT",
  • "groupId": "string",
  • "groupName": "string",
  • "content":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "errors":
    [
    ]
}

Update message status

Update message status of Custom Channel messages sent from agents. This allow a Custom Channel integration to set message status to indicate to an Agent that the message has been delivered.

path Parameters
customChannelId
required
string

The ID of the Custom Channel. To find the Custom Channel ID, you must open the overflow menu of a Custom Channel Entry Point and select the "View Integration Data" option.

messageId
required
string

The id of message updated

Request Body schema: application/json

Custom Channel message status

value
required
string
Enum: "ACCEPTED" "DELIVERED" "READ" "FAILED"
details
string

Optional status details. It is particularly useful when the value is 'Failed'.

Responses

200

Status updated

400

Invalid fields(s) in the request body

404

Message with messageId not found

put /api/v1/communications/custom-channels/{customChannelId}/messages/{messageId}/status
https://organization.gladly.com/api/v1/communications/custom-channels/{customChannelId}/messages/{messageId}/status

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "value": "ACCEPTED",
  • "details": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "errors":
    [
    ]
}

Conversations

Conversation

A Conversation in Gladly contains the timeline of activity for a customer including communications to and from your organization along with other internal and external activity. Conversations API enables you to interact with the customer conversation timeline.

Conversation Items

A number of different types of items may appear in a customer's timeline. Each is described below.

Item Type Item Definition Create Read Update Delete Media
Chat Message A message sent/received via the Chat channel Yes Yes No No No
Conversation Status Change Conversation status changed (e.g.: from OPEN to WAITING, or OPEN to CLOSED) Yes Yes Yes No No
Custom Channel Message A Message sent/received via a Custom Channel integration No Yes No No No
Customer Activity Non-routable customer activity added to customer timeline via API Yes Yes No Yes No
Email A message sent/received via the Email channel Yes Yes No No No
Facebook Messenger Message A message sent/received via the Facebook Messenger channel Yes Yes No No No
Instagram Direct A message sent/received via the Instagram channel No Yes No No No
Note An internal Note on the Customer conversation Yes Yes No No No
Phone Call A Phone Call placed/received on Gladly No Yes No No Yes
SMS Message A message sent/received via the SMS channel Yes Yes No No No
Task A Task on a Customer's profile Yes Yes Yes No No
Topic Change A Topic added or removed on a Conversation Yes Yes No Yes No
Twitter (decommissioned as of 04/20/23) A message sent/received via the Twitter channel No Yes No Yes No
Voicemail A Voicemail received No Yes No No Yes
WhatsApp A message sent/received via the WhatsApp channel No Yes No No No

Chat Message

Content of messages sent between Gladly and customers through Gladly Chat.

Conversation Status Change

Record of a change in the status of a conversation.

Customer Activity

Information about activities customers participated in, for example, emails they received, issues in another system, or customer satisfaction surveys they answered. These can be created through the API to bring in information from other systems. Adding an activity to the customer timeline is not customer facing. For example, posting an email activity to the timeline does not send an email to the customer. Customer Activity

Email

Content of emails sent between Gladly and customers.

Facebook Messenger Message

Content of messages sent between Gladly and customers on Facebook Messenger.

Instagram Direct

Content of messages sent between Gladly and customers on Instagram Direct.

Note

Content of the note recorded in Gladly.

Phone Call

Information about phone calls that took place between Gladly and customers.

SMS Message

Content of SMS text messages sent between Gladly and customers. To send SMS messages to customers through the API, see Send SMS.

Task

Interacting with tasks through the conversations API is deprecated. Use Tasks API instead.

Topic Change

Record of an agent adding or removing a topic from a conversation in Gladly.

Twitter (decommissioned as of 04/20/23)

Content of messages sent between Gladly and customers on Twitter.

Voicemail

Information about voicemail left by customers in Gladly.

WhatsApp

Content of messages sent between Gladly and customers on WhatsApp.

Get conversation

Get conversation metadata such as it's assignee, topics, inbox, etc.

path Parameters
conversationId
required
string
Example: 9BcE2O0DQ2ynGHRmk9FeoA

Id of the conversation to get

Responses

200

Conversation metadata

404

A conversation with the given id does not exist

get /api/v1/conversations/{conversationId}
https://organization.gladly.com/api/v1/conversations/{conversationId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "HXRqKC5GSV-jAlq0-sxYTA",
  • "topicIds":
    [
    ],
  • "customAttributes":
    [
    ],
  • "customerId": "o2sg-TMTSD2rTwMuxzewbA",
  • "createdAt": "2016-01-02T00:10:00Z",
  • "closedAt": "2016-01-03T08:10:00Z",
  • "agentId": "sHuXx-U3QqOmhvFusJGeBw",
  • "inboxId": "E1nArq1uQAees_DogHB0MA",
  • "status": "OPEN"
}

Update conversation

Update conversation assignee, statusor both

path Parameters
conversationId
required
string
Example: 9BcE2O0DQ2ynGHRmk9FeoA

Id of the conversation

Request Body schema: application/json

JSON representation of conversation updates

assignee
object (Assignee Update)
status
object (Conversation Status)

Responses

204

updated conversation

400

Invalid request

404

A conversation with the given id does not exist

patch /api/v1/conversations/{conversationId}
https://organization.gladly.com/api/v1/conversations/{conversationId}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "assignee":
    {
    },
  • "status":
    {
    }
}

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "errors":
    [
    ]
}

Create item

To add items to the timeline for a customer specified by identifying information. If the customer doesn't exist, a new customer profile is created.

Any items created using this API will not be considered part of a conversation, and are non-routable and non-searchable aside from the mobile phone number or email address specified as part of the payload.

Request Body schema: application/json

Conversation Item to create

id
string <= 50 characters

Unique conversation item id. Must be URL safe and under 50 characters. An id will be automatically generated if one is not included.

customer
required
object (Customer Specification)

Specifies the customer an item belongs to. You must provide exactly one of the values.

content
required
Customer Activity (object) or Task (deprecated) (object) (Conversation Item Content To Create)

Responses

200

The created item

400

Invalid field(s) in request body

409

Specified id is in use

post /api/v1/conversation-items
https://organization.gladly.com/api/v1/conversation-items

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "pOVVdzweSumI4bFxjlT8LA",
  • "customer":
    {
    },
  • "content":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "pOVVdzweSumI4bFxjlT8LA",
  • "customerId": "gHufx-U3QqOmhvFuViceTw",
  • "timestamp": "2019-07-03T04:30:12.07Z",
  • "initiator":
    {
    },
  • "responder":
    {
    },
  • "content":
    {
    }
}

Get item

Returns the conversation item with the provided id.

path Parameters
itemId
required
string
Example: pOVVdzweSumI4bFxjlT8LA

id of the conversation item

Responses

200

conversation item

400

An item exists but is not supported by the API

404

An item with the given id could not be found

get /api/v1/conversation-items/{itemId}
https://organization.gladly.com/api/v1/conversation-items/{itemId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "pOVVdzweSumI4bFxjlT8LA",
  • "customerId": "gHufx-U3QqOmhvFuViceTw",
  • "conversationId": "PmDVUfWfRjKuwb4VgA2zEA",
  • "timestamp": "2019-07-03T04:30:12.07Z",
  • "initiator":
    {
    },
  • "responder":
    {
    },
  • "content":
    {
    }
}

Delete item

To delete an item.

Please note only items of type CUSTOMER_ACTIVITY may be deleted by this API.

path Parameters
itemId
required
string

Id of the item to be deleted.

Responses

204

The item was deleted

404

An item with the given id could not be found

delete /api/v1/conversation-items/{itemId}
https://organization.gladly.com/api/v1/conversation-items/{itemId}

Get media

Returns the media file associated with the conversation item.

path Parameters
itemId
required
string
Example: pOVVdzweSumI4bFxjlT8LA

id of the conversation item

Responses

200

The media file associated with the conversation item

404

An item with the given id could not be found

get /api/v1/conversation-items/{itemId}/media/recording
https://organization.gladly.com/api/v1/conversation-items/{itemId}/media/recording

Create item for customer

To add items to a customer's timeline.

Any items created using this API will not be considered part of a conversation, and are non-routable and non-searchable aside from the mobile phone number or email address specified as part of the payload.

path Parameters
customerId
required
string

Id of the customer associated with this item.

You can look up the id using the Find customers API.

Request Body schema: application/json

Conversation Item to create

id
string <= 50 characters

Unique conversation item id. Must be URL safe and under 50 characters. An id will be automatically generated if one is not included.

content
required
Customer Activity (object) or Task (deprecated) (object) (Conversation Item Content To Create)

Responses

200

The created item

301

This customer id no longer exists, but has been moved because it has been merged with another customer

400

Invalid field(s) in request body

404

Customer with customerId does not exist

409

Specified id is in use

post /api/v1/customers/{customerId}/conversation-items
https://organization.gladly.com/api/v1/customers/{customerId}/conversation-items

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "content":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "pOVVdzweSumI4bFxjlT8LA",
  • "customerId": "gHufx-U3QqOmhvFuViceTw",
  • "timestamp": "2019-07-03T04:30:12.07Z",
  • "initiator":
    {
    },
  • "responder":
    {
    },
  • "content":
    {
    }
}

Delete item for customer

To delete an item.

Please note only items of type CUSTOMER_ACTIVITY may be deleted by this API.

path Parameters
customerId
required
string

Id of the customer associated with this item.

You can look up the id using the Find customers API.

itemId
required
string

Id of the item to be deleted.

Responses

204

The item was deleted

404

An item with the given id, for the given customer id, could not be found

delete /api/v1/customers/{customerId}/conversation-items/{itemId}
https://organization.gladly.com/api/v1/customers/{customerId}/conversation-items/{itemId}

List items in conversation

Get the list of items in the timeline of a conversation. The conversation represents a period of related interactions between a customer and your organization. The list is not paginated and will return at most 1000 items. The items are returned in ascending order by timestamp. The Gladly-Limited-Data header flag in the response will indicate if the conversation has more items than returned.

path Parameters
conversationId
required
string
Example: 9BcE2O0DQ2ynGHRmk9FeoA

Id of the conversation to get the timeline for

Responses

200

The items on the conversation timeline

404

A conversation with the given id does not exist

get /api/v1/conversations/{conversationId}/items
https://organization.gladly.com/api/v1/conversations/{conversationId}/items

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    }
]

Add topic

Adds a list of topics to the conversation. If the topic being added already exists on the conversation, that topic is ignored.

path Parameters
conversationId
required
string

Id of the conversation.

Request Body schema: application/json
topicIds
Array of strings

Topic Ids to be added to the conversation.

Responses

204

The topic was added successfully

400

Invalid field(s) in request body

404

A conversation with the given Id could not be found

post /api/v1/conversations/{conversationId}/topics
https://organization.gladly.com/api/v1/conversations/{conversationId}/topics

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "topicIds":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "errors":
    [
    ]
}

Delete topic

Delete a topic from a conversation.

path Parameters
conversationId
required
string

Id of the conversation.

topicId
required
string

Id of topic to be deleted from conversation.

Responses

204

The topic was deleted from the conversation successfully

404

A conversation with the given id could not be found

delete /api/v1/conversations/{conversationId}/topics/{topicId}
https://organization.gladly.com/api/v1/conversations/{conversationId}/topics/{topicId}

Add or Remove Freeform topic

Adds or removes a list of freeform topics to the conversation. If the freeform topic being added already exists on the conversation, that topic is ignored.

path Parameters
customerId
required
string

Id of the customer.

conversationId
required
string

Id of the conversation.

Request Body schema: application/json
body
string

Freeform topics that need to be added or removed from a conversation

Responses

204

The freeform topic was added successfully

400

Invalid field(s) in request body

404

A conversation with the given Id could not be found

post /api/v1/customer-history/{customerId}/conversations/{conversationId}/custom-attributes
https://organization.gladly.com/api/v1/customer-history/{customerId}/conversations/{conversationId}/custom-attributes

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "add":
    [
    ],
  • "remove":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "errors":
    [
    ]
}

Add note

Adds note to an existing conversation.

path Parameters
conversationId
required
string

Id of the conversation.

Request Body schema: application/json
body
string

Plain text or rich content of the note.

Responses

201

The note was added successfully

400

Invalid field(s) in request body

404

A conversation with the given Id could not be found

post /api/v1/conversations/{conversationId}/notes
https://organization.gladly.com/api/v1/conversations/{conversationId}/notes

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "content":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "errors":
    [
    ]
}

Get note

Returns the note with the provided conversation and note id.

path Parameters
conversationId
required
string
Example: pOVVdzweSumI4bFxjlT8LA

id of the conversation

noteId
required
string
Example: aOVVdzweSumI4bFxjlT8LA

id of the note

Responses

200

Conversation note

404

An item with the given id could not be found

get /api/v1/conversations/{conversationId}/notes/{noteId}
https://organization.gladly.com/api/v1/conversations/{conversationId}/notes/{noteId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "pOVVdzweSumI4bFxjlT8LA",
  • "customerId": "gHufx-U3QqOmhvFuViceTw",
  • "conversationId": "PmDVUfWfRjKuwb4VgA2zEA",
  • "timestamp": "2019-07-03T04:30:12.07Z",
  • "initiator":
    {
    },
  • "responder":
    {
    },
  • "content":
    {
    }
}

Reply to message

Sends a response to a conversation item

path Parameters
itemId
required
string
Example: pOVVdzweSumI4bFxjlT8LA

id of the conversation item

Request Body schema: application/json
content
required
Email Message Content (object) or (Chat Message Content (Message Content (object) or QuickReply Request Content (object))) or Facebook Message Content (object) or Instagram Direct Message Content (object) or SMS Message Content (object) or Twitter Direct Message Content (decommissioned as of 04/20/2023) (object) or WhatsApp Message Content (object) (Message content)

Responses

201

The reply was created successfully. Note that creation doesn't guarantee delivery

400

Invalid field(s) in request body

404

A conversation item with the given id could not be found

post /api/v1/conversation-items/{itemId}/reply
https://organization.gladly.com/api/v1/conversation-items/{itemId}/reply

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "content":
    {
    }
}

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "errors":
    [
    ]
}

Redact conversation item

For supported items, the item's content will be removed but the item will remain in the conversation timeline. Supported types are Chat Message, SMS Message, Email, Twitter (decommissioned as of 04/20/23, but can still be redacted), WhatsApp, Voicemail, Phone Call.

path Parameters
itemId
required
string
Example: pOVVdzweSumI4bFxjlT8LA

id of the conversation item

Request Body schema: application/json
any

The request body should be empty

Responses

201

The redaction was successful.

404

A conversation item with the given id could not be found

post /api/v1/conversation-items/{itemId}/redact
https://organization.gladly.com/api/v1/conversation-items/{itemId}/redact

Request samples

Content type
application/json
Copy
Expand all Collapse all
null

Customers

A Customer in Gladly represents information about a customer of your organization including their profile, contact information, notes, and transactions.

Customers API allows you to add, update, and get customer profile data.

Error Handling

Id, mobile phone number, and email address must be unique across customer records. 409 errors returned will include details on any conflicts, such as a field being taken.

Additionally, errors may be returned due to customer profiles being merged. If a customer has been merged into another, requests to get a customer by id will return 301 errors specifying the new id of the customer, and requests to update a customer by id will return 404 errors.

Create customer

Create a new customer with the supplied profile data.

Request Body schema: application/json

Customer record to add.

name
string

Customer's name

image
string

URL for an image that will appear as the customer's avatar

address
string

Customer's street address

emails
Array of objects (email addresses)

Customer's email addresses

phones
Array of objects (phone numbers)

Customer's phone numbers

externalCustomerId
string

Customer ID in your system of record for Customer Profiles linked to a Lookup Adaptor installed prior to 05/12/21. If Customer Profile is linked to a Lookup Adaptor installed on or after 05/12/21, this field will not exist and cannot be set.

customAttributes
object

Organization-specific attributes from Customer system of record. The shape of customAttributes is defined by the Customer Profile Definition. These are specific to a customer and different from the Custom Attribute entity.

id
string

Unique customer id. Must be URL safe and under 50 characters. An id will be automatically generated if one is not included

Responses

201

customer created

400

error creating customer

409

Specified id is in use or a uniqueness constraint failed

post /api/v1/customer-profiles
https://organization.gladly.com/api/v1/customer-profiles

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "OOrlNMXeS72gs_WEX2TtMg",
  • "name": "Francis Avallone",
  • "address": "4303 Spring Forest Ln, Westlake Village, CA 91362-5605",
  • "emails":
    [
    ],
  • "phones":
    [
    ],
  • "externalCustomerId": "a21c1636-c622-48b7-bf6a-d9032645aa55",
  • "customAttributes":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "errors":
    [
    ]
}

Find customers

Find customers by searching by choosing one of the following identifiers as query parameters:

/api/v1/customer-profiles?phoneNumber=%2B14151234567

Max limit of 50 profiles returned, sorted by most recently updatedAt date descending.

query Parameters
email
string
Example: email=customer@email.net

customer email address to search on.

externalCustomerId
string
Example: externalCustomerId=a21c1636-c622-48b7-bf6a-d9032645aa55

Customer ID in your system of record for Customer Profiles linked to a Lookup Adaptor installed prior to 05/12/21. If Customer Profile is linked to a Lookup Adaptor installed on or after 05/12/21, this field is not searchable.

phoneNumber
string
Example: phoneNumber=+16505551987

Phone number in E.164 format. The value should be URL escaped where + becomes %2B.

Responses

200

found customers

400

error finding customers

get /api/v1/customer-profiles
https://organization.gladly.com/api/v1/customer-profiles

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get customer

Get a customer by unique id. If a customer has been merged into another, an error will be returned specifying the new id of the customer.

path Parameters
customerId
required
string
Example: OOrlNMXeS72gs_WEX2TtMg

id of the customer

Responses

200

fetched customer

301

customer id no longer exists and has been changed due to a merge with another customer

404

customer not found

get /api/v1/customer-profiles/{customerId}
https://organization.gladly.com/api/v1/customer-profiles/{customerId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "Martha J Williams",
  • "address": "563 Rigoberto Station Apt. 197",
  • "emails":
    [
    ],
  • "phones":
    [
    ],
  • "externalCustomerId": "a21c1636-c622-48b7-bf6a-d9032645aa55",
  • "customAttributes":
    {
    },
  • "id": "OOrlNMXeS72gs_WEX2TtMg",
  • "createdAt": "2019-02-21T07:15:18.07272933Z",
  • "updatedAt": "2019-02-21T19:50:23.486566336Z",
  • "externalCustomerIds":
    {
    }
}

Update customer

Update a customer by unique id with the supplied JSON patch.

You may supply only the properties which you want to update or insert into the profile. When updating arrays, such as phones and emails you must provide the entire list of values since it is not possible to add or delete a single value.

If a customer has been merged into another, an error will be returned specifying the new id of the customer.

path Parameters
customerId
required
string
Example: OOrlNMXeS72gs_WEX2TtMg

id of the customer

Request Body schema: application/json

JSON patch of customer profiles properties to insert or update.

name
string

Customer's name

image
string

URL for an image that will appear as the customer's avatar

address
string

Customer's street address

emails
Array of objects (email addresses)

Customer's email addresses

phones
Array of objects (phone numbers)

Customer's phone numbers

externalCustomerId
string

Customer ID in your system of record for Customer Profiles linked to a Lookup Adaptor installed prior to 05/12/21. If Customer Profile is linked to a Lookup Adaptor installed on or after 05/12/21, this field will not exist and cannot be set.

customAttributes
object

Organization-specific attributes from Customer system of record. The shape of customAttributes is defined by the Customer Profile Definition. These are specific to a customer and different from the Custom Attribute entity.

Responses

204

updated customer

400

error updating customer

404

customer not found

patch /api/v1/customer-profiles/{customerId}
https://organization.gladly.com/api/v1/customer-profiles/{customerId}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "Frankie Avalon",
  • "emails":
    [
    ],
  • "customAttributes":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "errors":
    [
    ]
}

Delete customer

Delete a customer and all associated conversations.

All conversations associated with the customer must be closed before the customer can be deleted.

This operation is irreversible.

The user associated with the API token must have both Compliance Admin and API User roles.

path Parameters
customerId
required
string
Example: OOrlNMXeS72gs_WEX2TtMg

id of the customer

Responses

204

customer was deleted

400

error deleting customer with open or waiting conversation

delete /api/v1/customer-profiles/{customerId}
https://organization.gladly.com/api/v1/customer-profiles/{customerId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "errors":
    {
    }
}

Events

An Event is something that has happened in Gladly. The Events API allows you to extract event details from the past 24 hours.

List events

Returns a stream of events for the specified entities within the given time range. Responses are streamed using JSONL.

Events are up to 15 seconds behind real-time.

/api/v1/events?startAt=2020-05-20T14:00:00Z&entities=AGENT_STATUS&entities=AGENT_AVAILABILITY
query Parameters
startAt
required
string
Example: startAt=2020-04-13T19:27:34-09:00

Starting time of the events interval. This is based on the timestamp field which indicates when the event was recorded. Must be from last 24 hours.

The date should be in ISO 8601 format.

endAt
string
Example: endAt=2020-04-13T20:27:12-09:00

Ending time of the events interval. This is based on the timestamp field which indicates when the event was recorded. If unspecified, current time will be implied.

The date should be in ISO 8601 format.

entities
required
array
Example: entities=AGENT_AVAILABILITY,AGENT_STATUS

Entity types that have associated events. Any number of types is acceptable and at least one must be present

Available Types: AGENT_AVAILABILITY, AGENT_STATUS, CONTACT, CONVERSATION, CUSTOMER, PAYMENT_REQUEST,TASK

Responses

200

Events Streaming Response

400

Bad Request

get /api/v1/events
https://organization.gladly.com/api/v1/events

Response samples

Content type
application/x-jsonlines
Example
Copy
Expand all Collapse all
{
  • "id": "zGaHXjD4SR-moMR9LbULDa",
  • "type": "AGENT_AVAILABILITY/FOCUS_ENTERED",
  • "timestamp": "2019-07-03T04:30:12.07Z",
  • "initiator":
    {
    },
  • "content":
    {
    }
}

Export

Export API is a simple, comprehensive, file-based data export. You can export the lifetime of your customers' conversations in Gladly to a central data repository such as your data warehouse or data lake. You can export all communications successfully delivered within a specified date range. The export date range could be the past hour, the past 24 hours, or a custom data range. Please note, for one-time exports covering a period greater than six months, a service fee may apply.

Job results can be deleted once downloaded. Delete will remove all result files along with the job metadata. Files older than 14 days are removed from Gladly and jobs older than 14 days are not available from the API. If you discover that you need the deleted files later, please contact Gladly Support to regenerate them for you.

SCHEDULING EXPORT JOBS

You can schedule a one-time or repeating - hourly or daily - data export job. By default, each organization has a daily export job configured. To schedule a one-time job or change the job frequency, please contact Gladly Support.

List schedules

List all schedules. Currently, only one schedule can be configured per organization. The schedule will generate recurring data export jobs with an hourly or daily frequency. By default, each organization has a daily export job configured. To change the job frequency, please contact Gladly Support.

Hourly schedules generate new jobs on a roughly two hour lag after the nextStartAt time. For example, for an hourly schedule with a nextStartAt equal to 2019-01-21T08:00:00.00Z, the next job will be created at approximately 2019-01-21T10:00:00.00Z. Daily schedules will run jobs during the night (UTC time).

Responses

200

found jobs

get /api/v1/export/schedules
https://organization.gladly.com/api/v1/export/schedules

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

List jobs

List all jobs from the last 14 days using the following optional query parameter:

/api/v1/export/jobs?status=COMPLETED
query Parameters
status
string
Enum: "PENDING" "IN_PROGRESS" "COMPLETED" "FAILED"

export job status to search on.

Responses

200

found jobs

get /api/v1/export/jobs
https://organization.gladly.com/api/v1/export/jobs

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get job

Get a job by unique id.

path Parameters
jobId
required
string
Example: OOrlNMXeS72gs_WEX2TtMg

id of the job

Responses

200

fetched job

404

job not found

get /api/v1/export/jobs/{jobId}
https://organization.gladly.com/api/v1/export/jobs/{jobId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "vZgCEQlDR6aQz_0HeWZ9_Q",
  • "scheduleId": "OOrlNMXeS72gs_WEX2TtMg",
  • "status": "COMPLETED",
  • "updatedAt": "2019-02-21T07:15:19.07272933Z",
  • "parameters":
    {
    },
  • "files":
    [
    ]
}

Delete job

Delete a job and all associated files. Note: job status must be COMPLETED or FAILED to be deleted.

path Parameters
jobId
required
string
Example: OOrlNMXeS72gs_WEX2TtMg

id of the job

Responses

204

the job was deleted

400

unable to delete job

404

job not found

delete /api/v1/export/jobs/{jobId}
https://organization.gladly.com/api/v1/export/jobs/{jobId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get file

Download a file generated by a data export job. Filenames can be found from an export job's files field.

Files are returned in .jsonl format where each line is a json object representing an element from the array of data. Please note that, in rare cases, conversation items with invalid attributes may be excluded from the data export. For example:

  • An email message that was undelivered due to an invalid recipient email address
  • EMAIL / SMS auto-replies sent by Gladly to the customer via a Rule

Examples are as follows with schema below.

agents.jsonl

{"id": "WmeA3Y51Q5ayCAaZ1AotIA","name": "Amy Agent","emailAddress": "amy.agent@company.com"}

conversation_items.jsonl

{"id": "ybP4szYCSy6LdV4DNwEd6g","conversationId": "9BcE2O0DQ2ynGHRmk9FeoA","customerId": "OOrlNMXeS72gs_WEX2TtMg","timestamp": "2019-07-01T11:46:45.010Z","initiator": {"id": "OOrlNMXeS72gs_WEX2TtMg","type": "CUSTOMER"},"content": {"type": "CHAT_MESSAGE","sessionId": "5k04bYuTRGqyT6uoSQfWVA","content": "Hi! I know it's after hours but can someone help upgrade my account?"}}
{"id": "9lQDrx-HTz-JMoP2T4CtZA","conversationId": "9BcE2O0DQ2ynGHRmk9FeoA","customerId": "OOrlNMXeS72gs_WEX2TtMg","timestamp": "2019-07-02T06:30:12.070Z","initiator": {"id": "WmeA3Y51Q5ayCAaZ1AotIA","type": "AGENT"},"content": {"type": "EMAIL","from": "amy.agent@company.com","to": ["martha.williams@gmail.com"],"subject": "Account upgrade","content": "I would be happy to help you! We need a few details, so please give us a call this morning."}}
{"id": "QN1nURRuRne_eAEhW45UMA","conversationId": "9BcE2O0DQ2ynGHRmk9FeoA","customerId": "KgnVOMc2TbiA3zad6iVlWA","timestamp": "2020-04-21T00:44:33.690Z","initiator": {"type":"AGENT","id":"VjeJI9_GRUS_LUjKLcNlBw"},"responder":{"type":"CUSTOMER","id":"KgnVOMc2TbiA3zad6iVlWA"},"content":{"startedAt":"2020-04-21T00:44:34.604Z","answeredAt":"2020-04-21T00:44:45.515Z","completedAt":"2020-04-21T00:44:57.130Z","from":"+12096248260","to":"+14155335980","recordingUrl":"/api/v1/conversation-items/QN1nURRuRne_eAEhW45UMA/media/recording","recordingStatus":"AVAILABLE","recordingDuration":11,"type":"PHONE_CALL"}}
{"id": "K0UGL3n6S4uPpvtMvItqHA","conversationId": "9BcE2O0DQ2ynGHRmk9FeoA","customerId": "OOrlNMXeS72gs_WEX2TtMg","timestamp": "2019-07-02T08:12:55.870Z","initiator": {"id": "WmeA3Y51Q5ayCAaZ1AotIA","type": "AGENT"},"content": {"type": "TOPIC_CHANGE","addedTopicIds": ["uu4t00vITaKQ3bVjU2UrGQ"]}}
{"id": "VMn_5L1iTPmcM5DBP1U8oQ","conversationId": "9BcE2O0DQ2ynGHRmk9FeoA","customerId": "KgnVOMc2TbiA3zad6iVlWA","timestamp": "2020-04-21T00:56:03.712Z","initiator": {"type":"CUSTOMER","id":"KgnVOMc2TbiA3zad6iVlWA"}, "content":{"startedAt":"2020-04-21T00:55:50.703Z","recordingUrl":"/api/v1/conversation-items/VMn_5L1iTPmcM5DBP1U8oQ/media/recording","recordingStatus":"AVAILABLE","recordingDuration":13,"type":"VOICEMAIL"}}
{"id": "SShWgSCHSHy6EO5TiL7rNw","conversationId": "gHuxLQNXSAmmWuNePSyVTw","customerId": "0EphnSIJR0ycjMWFTf-GXA","timestamp": "2020-04-20T23:58:51.941Z","initiator": {"type":"AGENT","id":"LsFXSnO6Ty6gdnyH6y8yug"},"content":{"type":"CONVERSATION_STATUS_CHANGE","status":"CLOSED"}}
{"id": "DnaU23pZSIqOixATlII1vA","conversationId": "HXRqKC5GSV-jAlq0-sxYTA","customerId": "o2sg-TMTSD2rTwMuxzewbA","timestamp": "2020-04-24T23:42:57.780Z","initiator": {"type":"AGENT","id":"zGaHXjD4SR-moMR9LbULDA"},"content":{"type":"CONVERSATION_NOTE","body":"Customer has requested more information about our loyalty program."}}

customers.jsonl

{"id": "OOrlNMXeS72gs_WEX2TtMg","name": "Martha J Williams","address": "563 Rigoberto Station Apt. 197","emailAddresses": ["Martha.Williams@gmail.com"],"phoneNumbers": ["+17244895501"],"externalCustomerId": "a21c1636-c622-48b7-bf6a-d9032645aa55"}

topics.jsonl

{"id": "uu4t00vITaKQ3bVjU2UrGQ","name": "Order Returns","disabled": false}
path Parameters
jobId
required
string
Example: OOrlNMXeS72gs_WEX2TtMg

id of the job

filename
required
string
Example: agents.jsonl

name of the file

Responses

200

returns a file

404

file not found

get /api/v1/export/jobs/{jobId}/files/{filename}
https://organization.gladly.com/api/v1/export/jobs/{jobId}/files/{filename}

Response samples

Content type
application/x-ndjson
No sample

Freeform Topics

Freeform Topics allow you to associate granular data like Order Number to a Conversation. This data can be accessed for analysis via APIs, Webhooks, and AWS EventBridge. They are powered by custom attributes as you will see throughout this API, the Conversations API, the Events API and events used in Webhooks.

Note: These attributes are currently associated to the Conversation entity only and are therefore different from customAttributes listed under the Customer entity. See the Customer API for more information on Customer custom attributes.

Get custom attribute

Returns a custom attribute that matches the provided custom attribute id.

path Parameters
customAttributeId
required
string
Example: 1grfSzATQLa334VDLCWc4A

id of the custom attribute

Responses

200
404

Custom Attribute not found

get /api/v1/custom-attributes/:customAttributeId
https://organization.gladly.com/api/v1/custom-attributes/:customAttributeId

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "1grfSzATQLa334VDLCWc4A",
  • "key": "orderId",
  • "label": "Order ID",
  • "deactivated": true,
  • "createdAt": "2020-05-20T15:00:00.000Z",
  • "createdBy": "7MRwXOeWRaGatwYCbBLLA"
}

Inboxes

An Inbox receives customer communications in Gladly. The communications route to the inbox according to channel and destination endpoint configuration. For example, all calls to a specific phone number or emails to a specific address may go to an inbox.

List inboxes

Returns a list of inbox metadata.

Responses

200

Inboxes

get /api/v1/inboxes
https://organization.gladly.com/api/v1/inboxes

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get inbox

Get the metadata for an inbox by its unique id.

path Parameters
inboxId
required
string
Example: vZgCEQlDR6aQz_0HeWZ9_Q

id of the inbox

Responses

200

Inbox

get /api/v1/inboxes/{inboxId}
https://organization.gladly.com/api/v1/inboxes/{inboxId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "vZgCEQlDR6aQz_0HeWZ9_Q",
  • "name": "Email Inbox",
  • "disabled": false
}

Message Automation

The collection of Message Automation APIs are used to facilitate communication between a Customer via a Gladly channel and a 3rd party Automation service, such as a chat bot. These APIs allow an Automation service to interact with a Customer as well as close a Conversation with a Customer or route a Customer to an Agent. Subscribe to the Webhook Event AUTOMATION/MESSAGE_RECEIVED to receive inbound messages. Note The Message Automation APIs are currently in a private beta and attachments are currently not supported. Please contact your Customer Success Manager for access.

Get Automation Session

Returns the automation session with the provided sessionId.

path Parameters
sessionId
required
string
Example: pOVVdzweSumI4bFxjlT8LA

The id of the automation session.

Responses

200

Automation Session

404

An automation session with the given id does not exist.

get /api/v1/message-automation/sessions/{sessionId}
https://organization.gladly.com/api/v1/message-automation/sessions/{sessionId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "hyLceTJzT5yTAxz1SYJ65A",
  • "companyAddress": "606b52ba0b806d00d28f841b",
  • "conversationId": "wcIVaRWxQKC1PuKYIyruKQ",
  • "customerAddress": "x9CubuE1T5q40ULjoFW0iQ",
  • "customerId": "qe4WxGejR2miAtCcTAaA4w",
  • "endpointType": "CHAT",
  • "createdAt": "2022-05-04T06:36:23.944Z",
  • "updatedAt": "2022-05-04T06:36:23.944Z",
  • "target":
    {
    }
}

Send Outbound Automation Message

Returns the outbound automation message.

path Parameters
sessionId
required
string
Example: pOVVdzweSumI4bFxjlT8LA

Id of the automation session.

Request Body schema: application/json

Create an outbound message

type
required
string
Enum: "TEXT" "MENU"

The type of The outbound automation message.

content
required
Content of Text (object) or Content of Menu (object) (Outbound Message Content)

Responses

200

The outbound automation message is created.

400

Message has invalid type or content.

404

Message with the given messageId does not exist in the given automation session.

post /api/v1/message-automation/sessions/{sessionId}/messages
https://organization.gladly.com/api/v1/message-automation/sessions/{sessionId}/messages

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "type": "TEXT",
  • "content":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "626c058b82388c00f4770ede",
  • "content":
    {
    },
  • "createdAt": "2022-05-04T06:36:23.944Z",
  • "from":
    {
    },
  • "sessionId": "dGwbXv5RR8SjbEln5YlKaQ",
  • "type": "TEXT",
  • "context":
    {}
}

Get Automation Messages

Returns all the messages within the automation session with the provided sessionId.

path Parameters
sessionId
required
string
Example: pOVVdzweSumI4bFxjlT8LA

Id of the automation session.

Responses

200

Automation session messages

404

An automation session with the given id does not exist

get /api/v1/message-automation/sessions/{sessionId}/messages
https://organization.gladly.com/api/v1/message-automation/sessions/{sessionId}/messages

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get Automation Message

Returns the message with the provided messageId within the automation session with the provided sessionId.

path Parameters
sessionId
required
string
Example: pOVVdzweSumI4bFxjlT8LA

Id of the automation session.

messageId
required
string
Example: 62723418e0374c00f31c4ca7

Id of the message.

Responses

200

Automation session message

404

Message with the given messageId does not exist in the given automation session.

get /api/v1/message-automation/sessions/{sessionId}/messages/{messageId}
https://organization.gladly.com/api/v1/message-automation/sessions/{sessionId}/messages/{messageId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "626c058b82388c00f4770ede",
  • "content":
    {
    },
  • "createdAt": "2022-05-04T06:36:23.944Z",
  • "from":
    {
    },
  • "sessionId": "dGwbXv5RR8SjbEln5YlKaQ",
  • "type": "TEXT",
  • "context":
    {}
}

Agent Handoff

Handoff communication of the automation session, given sessionId, to an agent. If successful, returns nothing.

path Parameters
sessionId
required
string
Example: pOVVdzweSumI4bFxjlT8LA

Id of the automation session.

Request Body schema: application/json

Handoff to agent.

description
required
string [ 1 .. 240 ] characters

A brief description why the session was handed off to an agent. Cannot be blank.

Responses

204

The handoff is successful.

400

Failed to handoff to agent.

post /api/v1/message-automation/sessions/{sessionId}/handoff
https://organization.gladly.com/api/v1/message-automation/sessions/{sessionId}/handoff

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "description": "Could not handle request. Hand off to agent."
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "errors":
    [
    ]
}

Close Automation Session

Closes the automation session for the given sessionId. Returns nothing if successful.

path Parameters
sessionId
required
string
Example: pOVVdzweSumI4bFxjlT8LA

Id of the automation session.

Request Body schema: application/json

Close the automation session.

description
required
string [ 1 .. 240 ] characters

A brief description why the session was closed. Cannot be blank.

Responses

204

Automation session was successfully closed.

400

Failed to close the given automation session.

post /api/v1/message-automation/sessions/{sessionId}/close
https://organization.gladly.com/api/v1/message-automation/sessions/{sessionId}/close

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "description": "Customer not responding. Close session."
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "errors":
    [
    ]
}

Organization

An Organization contains metadata about your company that Gladly is configured with.

Get organization

Returns metadata about your organization.

Responses

200

Organization

get /api/v1/organization
https://organization.gladly.com/api/v1/organization

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "ihKsWxiZCDVtXg1iwVmT9Q",
  • "loginDomain": "organization.com",
  • "name": "My Organization",
  • "timezone": "America/Los_Angeles",
}

Reports

A Report in Gladly contains metrics that you need to run the contact center. Reports API allows you to access Gladly's reports programatically.

Generate a report

Generate a report with a set of specific parameters and filters. The report is returned as a CSV file. These are the same reports that you can normally access via UI. For more information about each report, check out the Reporting and Insights section of the help docs.

Request Body schema: application/json

Parameters describing the report to generate.

metricSet
required
string
Enum: "AgentAwayTimeReport" "AgentDurationsReport" "AgentLoginTimeReport" "AgentSummary" "AgentSummaryV2" "AgentSummaryGlanceReport" "AgentSummaryGlanceReportV2" "AgentTimestampsReport" "FirstContactResolutionByAgentV2Report" "PaymentsByAgentReport" "WorkSessionEventsReportV3" "WorkSessionsReport" "WorkSessionsReportV3" "AnswerUsageReport" "AnswerUsageByAgentReport" "ChannelMixReportV2" "ChannelWaitTimeReport" "ChannelWaitTimeReportV2" "ContactExportReport" "ContactExportReportV2" "ContactExportReportV3" "ContactSummaryReport" "ContactSummaryReportV2" "ContactSummaryCountsReport" "ContactSummaryDurationsReport" "ContactSummaryDurationsReportV2" "ContactTimestampsReport" "ConversationExportReport" "ConversationSummaryReport" "ConversationTimestampsReport" "AbandonedCallsInIVRReport" "AutoThrottleMissedConversationsReport" "IVRExecutiveSummaryReportV2" "IvrEndStatesReportV2" "PaymentsSummaryReport" "ProactiveVoiceSummaryReport" "TopicHierarchyReport" "TaskExportReport" "TaskSummaryReport" "TaskTimestampsReport" "TopicSummaryReport" "AutoThrottleChangesReport" "ChatDisplayPctChangesReport" "HelpCenterAnswerSearchReport" "HelpCenterAnswerUsageReport" "QuickActionsUsageReport" "SelfServiceThreadsReport" "SidekickAssistsByClassificationTopicReport" "GladAppAnswerSearchReport" "GladAppAnswerUsageReport" "GladAppContactPointsReport"

This parameter is used to specify that the report should include a predetermined set of metrics. These are the same reports that you can normally access via UI.

For more information about each report, check out the Work With OOTB Reports section of the help docs.

timezone
string

The timezone to be used for the report. Supported timezones are those found in the IANA timezone database.

If omitted, the organization's default timezone will be used.

startAt
required
string

Starting date at the timezone indicated by the timezone parameter. The report will begin at midnight of the specified date.

The date should be in the format YYYY-mm-dd. For example 2019-05-01.

endAt
required
string

Ending date at the timezone indicated by the timezone parameter. The report will end just before midnight of the following day such that the report includes all data for the endAt day.

The date should be in the format YYYY-mm-dd. For example 2019-05-01.

aggregationLevel
string
Default: "daily"
Enum: "halfHourly" "daily" "weekly" "monthly" "quarterly"


The aggregation level for the report.

Applies to the following metricSets: AgentAwayTimeReport, AgentLoginTimeReport, AgentSummary, AgentSummaryV2, AgentSummaryGlanceReport, AgentSummaryGlanceReportV2, FirstContactResolutionByAgentV2Report, AnswerUsageReport, AnswerUsageByAgentReport, ChannelMixReportV2, ChannelWaitTimeReport,ChannelWaitTimeReportV2, ContactSummaryReport, ContactSummaryReportV2, ContactSummaryCountsReport, ContactSummaryDurationsReport, ContactSummaryDurationsReportV2, ConversationSummaryReport, AbandonedCallsInIVRReport, AutoThrottleMissedConversationsReport, PaymentsSummaryReport, ProactiveVoiceSummaryReport, TopicHierarchyReport, TaskSummaryReport, HelpCenterAnswerUsageReport, QuickActionsUsageReport, and GladAppAnswerUsageReport.

Note that an individual aggregationLevel may only be available depending on the metricSet and date range selected (e.g.: "halfHourly" is not available on the AgentSummary metricSet if requesting over 1 month's worth of data)

filters
object

Additional filters that can be applied to the report. Each filter applies to select metricSets. Compatibility is detailed in the description of each parameter.

Responses

200

Report CSV

400

Invalid request

post /api/v1/reports
https://organization.gladly.com/api/v1/reports

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "metricSet": "ContactSummaryReport",
  • "timezone": "America/Los_Angeles",
  • "startAt": "2021-10-01",
  • "endAt": "2021-10-02",
  • "aggregationLevel": "daily",
  • "filters":
    {
    }
}

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "errors":
    [
    ]
}

Generate a work session report

A Work Session represents a period of time that an Agent spends working with a Customer on a given channel, during a given Contact (messaging exchange, phone call, etc.). In particular:

  • A Customer may have 0 or more Conversations, but only 1 Conversation is open at any given time.
  • A Conversation may contain 0 or more Contacts (e.g.: A single phone call, a chat session, an email session).
  • A Contact may have 0 or more Work Sessions (i.e.: Agents who work on the Contact).
  • A Work Session is the unique combination of contact_session_id and agent_id. The agent_id column will be NULL if the contact has not been handled by any Agent.

The Work Session Report API contains both contacts and work sessions. It allows you to understand what your inbound contact volume looks like, and to get a view into how Agents are using their time. The primary use of this information is for forecasting and scheduling purposes, but it can also be used to understand, at a fine-grained level, aspects of agent behavior, agent performance, multichannel conversation patterns and more.

The time anchor for data returned by this API is COALESCE(contact_session_created_at, contact_session_ended_at) (i.e.: if contact_session_ended_at does not exist, use contact_session_created_at. Otherwise, use contact_session_ended_at).

This means that if it is currently 2023-03-23T00:00Z and:

  • contact_session_id A was created on 2023-03-21T04:00Z and ended on 2023-03-22T04:00Z
  • You set the startAt time filter to 2023-03-21T00:00Z
  • You set the endAt time filter to 2023-03-22T00:00Z
  • You would not be able to retrieve contact_session_id A in your API request. Instead, you will need to set the endAt time filter to now() (aka 2023-03-23T00:00Z) to retrieve the contact information.

Therefore, the general recommendation to get correct data is always to set the endAt time to now() rather than the end interval you'd like to analyze - this will accomodate contacts that "move" intervals due to ending.

Note that:

  • work_session_unknown_time_sec and work_session_after_contact_time_sec may accumulate after the contact ends and before the conversation ends / another contact begins
  • work_session_handle_time_sec will only be available for a contact after it ends
  • This report is subject to the same data latency as other Gladly reports

This CSV file contains the following columns, whose definitions may be viewed via the Work Sessions section of the help docs.

  • id
  • contact_session_id
  • contact_session_created_at
  • customer_id
  • conversation_id
  • inbox_id
  • channel
  • direction
  • agent_accepted_at
  • contact_session_routed_at
  • agent_id
  • sla_fulfilled_at
  • contact_session_ended_at
  • status
  • within_sla
  • work_session_handle_time_sec
  • work_session_after_contact_time_sec
  • work_session_unknown_time_sec
  • accepted_inbox_id
Request Body schema: application/json

A time range for the report that will be generated.

startAtTime
required
string

Starting time of the report interval

The date should be in ISO 8601 format YYYY-mm-ddThh:mmZ. For example 2020-04-13T19:27Z

endAtTime
required
string

Ending time of the report interval. This date is inclusive meaning that the report will include data up to 1min past the endAtTime

The date should be in ISO 8601 format YYYY-mm-ddThh:mmZ. For example 2020-04-14T19:27-09:00

Responses

200

Work Session Report CSV

400

Bad Request

post /api/v1/reports/work-session-events
https://organization.gladly.com/api/v1/reports/work-session-events

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "startAtTime": "2020-04-13T19:27-09:00",
  • "endAtTime": "2020-04-14T19:27-09:00"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "errors":
    [
    ]
}

Tasks

A task is a way to create and do internal follow-up work for a customer within Gladly. Tasks have a due date, an assignee, a description of what is needed for a customer, and can be commented on. These can be created through the API to assign items to work within Gladly. Task

Create task

To add tasks to the timeline for a customer specified by identifying information. If the customer doesn't exist, a new customer profile is created.

Request Body schema: application/json

Task to create

id
string <= 50 characters

Specifies the id of the task

assignee
required
object (Assignee)

Inbox and agent assignee for a task

body
required
string <= 10000 characters

Text to describe what task to complete. Constrained HTML Rich Content is supported.

dueAt
required
string <RFC3339>

Time when the task will be due. This must be set to a time in the future.

customer
required
object (Customer Specification)

Specifies the customer a task belongs to. You must provide exactly one of the values.

Responses

201

task created

400

Invalid field(s) in request body

post /api/v1/tasks
https://organization.gladly.com/api/v1/tasks

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "pOVVdzweSumI4bFxjlT8LA",
  • "assignee":
    {
    },
  • "body": "Call customer back with information about booking",
  • "dueAt": "2020-03-15T06:13:00.125Z",
  • "customer":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "errors":
    [
    ]
}

Create task for customer

Add a task to an existing customer's conversation timeline

path Parameters
customerId
required
string

Id of the customer associated with the task to create.

You can look up the id using the Find customers API.

Request Body schema: application/json

Create Task

id
string <= 50 characters

Unique task id. Must be URL safe and under 50 characters. An id will be automatically generated if one is not included.

assignee
required
object (Assignee)

Inbox and agent assignee for a task

body
required
string <= 10000 characters

Text to describe what task to complete. Constrained HTML Rich Content is supported.

dueAt
required
string <RFC3339>

Time when the task will be due. This must be set to a time in the future.

Responses

201

task created

400

Invalid field(s) in request body

404

Customer with customerId does not exist

409

Specified id is in use

post /api/v1/customers/{customerId}/tasks
https://organization.gladly.com/api/v1/customers/{customerId}/tasks

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "pOVVdzweSumI4bFxjlT8LA",
  • "assignee":
    {
    },
  • "body": "Call customer back with information about booking",
  • "dueAt": "2020-03-15T06:13:00.125Z"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "errors":
    [
    ]
}

List tasks

Fetch all tasks for a customer.

The list is not paginated and will return at most 2000 tasks. The tasks are returned in descending order by timestamp. The Gladly-Limited-Data header flag in the response will indicate if the customer has more tasks than returned.

To see and act on any newly created tasks, webhooks can be used to listen for task related events. Tasks older than the limit can be viewed using the Task Export.

path Parameters
customerId
required
string

Id of the customer whose tasks you'd like to view.

query Parameters
status
string
Enum: "OPEN" "CLOSED"

Fetch tasks with the provided status.

Responses

200

Array of tasks

400

Invalid input

404

A customer with the given id does not exist

get /api/v1/customers/{customerId}/tasks
https://organization.gladly.com/api/v1/customers/{customerId}/tasks

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Update task

Update an existing task

path Parameters
taskId
required
string

Id of the task that is to be updated

Request Body schema: application/json

Task properties to create

status
string
Enum: "OPEN" "CLOSED"
body
string <= 10000 characters

Text to describe what task to complete. Constrained HTML Rich Content is supported.

dueAt
string <RFC3339 with millis>

Due date of task

assignee
object (Assignee)

Inbox and agent assignee for a task

Responses

204

The task was created task

400

Invalid field(s) in request body

404

Task with taskId does not exist.

patch /api/v1/tasks/{taskId}
https://organization.gladly.com/api/v1/tasks/{taskId}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "OPEN",
  • "body": "Call customer back with information about booking",
  • "dueAt": "2021-04-11T14:09:23.000Z",
  • "assignee":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "errors":
    [
    ]
}

Get task

Get task

path Parameters
taskId
required
string

Id of the task requested

Responses

200

Returns requested task

404

Given task id does not exist

get /api/v1/tasks/{taskId}
https://organization.gladly.com/api/v1/tasks/{taskId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "pOVVdzweSumI4bFxjlT8LA",
  • "customerId": "gHufx-U3QqOmhvFuViceTw",
  • "timestamp": "2019-07-03T04:30:12.07Z",
  • "createdBy":
    {
    },
  • "assignee":
    {
    },
  • "body": "Call customer back with information about booking",
  • "dueAt": "2020-03-15T06:13:00.125Z",
  • "status": "OPEN"
}

Add task comment

Create a comment on a task. Note that you can’t create comments on closed tasks. Task Comment

path Parameters
taskId
required
string

Id of the task that will be commented on.

Request Body schema: application/json

Add comment to task

id
string <= 50 characters

Unique comment id. Must be URL safe and under 50 characters. An id will be automatically generated if one is not included.

agentId
required
string

the id of the agent making the comment

comment
string <= 10000 characters

Comment body

Responses

201

comment added

400

Invalid field(s) in request body

404

Task with taskId does not exist

post /api/v1/tasks/{taskId}/comments
https://organization.gladly.com/api/v1/tasks/{taskId}/comments

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "pOVVdzweSumI4bFxjlT8LA",
  • "agentId": "dzweSumI4bFxjlT8LApOVV",
  • "comment": "Return call to customer"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "errors":
    [
    ]
}

Get task comments

The comments are returned in ascending order by createdAt timestamp. The list is not paginated and will return at most 1000 task comments. The Gladly-Limited-Data header flag in the response will indicate if the task has more comments than returned.

To see and act on any newly created task comments, webhooks can be used to listen to any task comment related events.

path Parameters
taskId
required
string

Id of the task comments are requested for.

Responses

200

All comments that belong to task

404

Task with taskId does not exist

get /api/v1/tasks/{taskId}/comments
https://organization.gladly.com/api/v1/tasks/{taskId}/comments

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get task comment

Get task comment.

path Parameters
taskId
required
string

Task id

commentId
required
string

Comment id

Responses

200

Returns task comment

404

Comment with commentId does not exist

get /api/v1/tasks/{taskId}/comments/{commentId}
https://organization.gladly.com/api/v1/tasks/{taskId}/comments/{commentId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "pOVVdzweSumI4bFxjlT8LA",
  • "agentId": "dzweSumI4bFxjlT8LApOVV",
  • "comment": "Return call to customer.",
  • "taskId": "dzweSumI4bFxjlT8LApOVV",
  • "createdAt": "2020-03-15T06:13:00.125Z"
}

Teams

A Team represents a group of Agents. They may handle particular Inboxes or types of work within Gladly.

List teams

Returns a list of teams.

Responses

200

Teams

get /api/v1/teams
https://organization.gladly.com/api/v1/teams

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get team

Get a team by its unique id.

path Parameters
teamId
required
string
Example: ovg2jQCQS9ScsDkBxG-o2Q

id of the team

Responses

200

Team

get /api/v1/teams/{teamId}
https://organization.gladly.com/api/v1/teams/{teamId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "ovg2jQCQS9ScsDkBxG-o2Q",
  • "name": "Stay Advisors",
  • "description": "Team to answer customer questions about new bookings",
  • "agentIds":
    [
    ]
}

User Identity

Create a User Identity JWT

Create a User Identity JWT for a customer. The JWT is used to authenticate the customer with Glad App. The JWT contains the customer identity information.

Request Body schema: application/json

Customer Identity Information

identityType
string
Enum: "EMAIL" "MOBILE_PHONE_NUMBER"

The type of identity information

identity
string

The identity information, the value depends on the identityType field. Needs to be a valid email or phone number format (E.164).

Responses

200

customer created

400

error creating JWT

post /api/v1/user-identity-jwt
https://organization.gladly.com/api/v1/user-identity-jwt

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "identityType": "EMAIL",
  • "identity": "test@example.com"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "token": "string"
}

Topics

A Topic is a way of labeling a conversation in Gladly for specific business purposes. For example, an agent may apply the topic "Return" to a conversation where a customer returns merchandise. Topics are used for reporting and to control various workflows.

Topics can be configured to have a nested hierarchy. For instance, the topic "Return" could be a parent of "Size" and "Color" child topics. Visit our Help Pages to learn more about Hierarchical Topics.

List topics

Returns a list of topics.

Responses

200

Topics

get /api/v1/topics
https://organization.gladly.com/api/v1/topics

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    },
  • {
    },
  • {
    }
]

Get topic

Get a topic by its unique id.

path Parameters
topicId
required
string
Example: uu4t00vITaKQ3bVjU2UrGQ

id of the topic

Responses

200

Topic

get /api/v1/topics/{topicId}
https://organization.gladly.com/api/v1/topics/{topicId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "uu4t00vITaKQ3bVjU2UrGQ",
  • "name": "Order Returns",
  • "disabled": false,
  • "parentId": "ChefeoTHSlaIbKg57H5R9Q"
}

Webhooks

A Webhook is a way to send notifications about Gladly events as a POST request to the endpoint of your choice.

Create webhook

Create a new webhook with the supplied data. The webhook will be in disabled state by default.

If creating a new enabled webhook, your service is expected to respond to a Ping Event.

You are limited to 20 webhooks for your organization.

Request Body schema: application/json

Webhook to add

name
string <= 200 characters

friendly name of the webhook

events
required
Array of strings
Items Enum: "AGENT_AVAILABILITY/FOCUS_ENTERED" "AGENT_AVAILABILITY/FOCUS_EXITED" "AGENT_AVAILABILITY/UPDATED" "AGENT_STATUS/CHANGED_ACTIVE_REASON" "AGENT_STATUS/LOGGED_IN" "AGENT_STATUS/LOGGED_OUT" "AGENT_STATUS/RETURNED_FROM_AWAY" "AGENT_STATUS/WENT_AWAY" "AUTOMATION/MESSAGE_RECEIVED" "CONTACT/ENDED" "CONTACT/FULFILLED" "CONTACT/HOLD_ENDED" "CONTACT/HOLD_STARTED" "CONTACT/JOINED" "CONTACT/MESSAGE_RECEIVED" "CONTACT/MESSAGE_SENT" "CONTACT/OFFER_ACCEPTED" "CONTACT/OFFERED" "CONTACT/OFFER_REJECTED" "CONTACT/STARTED" "CONTACT/TRANSFERRED" "CONVERSATION/CLOSED" "CONVERSATION/CREATED" "CONVERSATION/CUSTOM_ATTRIBUTE_ADDED" "CONVERSATION/CUSTOM_ATTRIBUTE_REMOVED" "CONVERSATION/NOTE_CREATED" "CONVERSATION/REOPENED" "CONVERSATION/TOPIC_ADDED" "CONVERSATION/TOPIC_REMOVED" "CONVERSATION_ASSIGNEE/UPDATED" "CONVERSATION_STATUS/UPDATED" "CUSTOM_CHANNEL/MESSAGE_SENT" "CUSTOMER/MERGED" "CUSTOMER_PROFILE/CREATED" "CUSTOMER_PROFILE/DELETED" "CUSTOMER_PROFILE/MERGED (deprecated)" "CUSTOMER_PROFILE/UPDATED" "EXPORT_JOB/COMPLETED" "EXPORT_JOB/FAILED" "MESSAGE/RECEIVED (deprecated)" "PAYMENT_REQUEST/CREATED" "PAYMENT_REQUEST/STATUS_CHANGED" "PAYMENT_REQUEST/VIEWED" "TASK/ASSIGNEE_UPDATED" "TASK/CLOSED" "TASK/COMMENT_ADDED" "TASK/CONTENT_UPDATED" "TASK/CREATED" "TASK/DUE_DATE_UPDATED" "TASK/FOLLOWER_ADDED" "TASK/FOLLOWER_REMOVED" "TASK/REOPENED"

list of events that trigger the webhook. More events are coming soon. Please see Events for more information about the data included for each event type.

url
required
string

your URL that POST requests are sent to when events occur. HTTPS is required and this value must be unique across all webhooks.

credentials
object (Basic Auth Credentials)
headers
object (HTTP Headers)

custom HTTP headers to include in every request

enabled
boolean
Default: false

whether the webhook is delivering notifications

Responses

201

Created webhook

400

Invalid field(s) in request body

post /api/v1/webhooks
https://organization.gladly.com/api/v1/webhooks

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "CSAT integration",
  • "events":
    [
    ],
  • "credentials":
    {
    },
  • "headers":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "errors":
    [
    ]
}

List webhooks

Returns a list of webhooks.

Responses

200

Webhook

get /api/v1/webhooks
https://organization.gladly.com/api/v1/webhooks

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Update webhook

Update webhook by id.

If enabling a webhook or updating a webhook's URL, your service is expected to respond to a Ping Event.

path Parameters
webhookId
required
string
Example: a9dIl-kKRrKUZLQtJ-tjtw

id of the webhook

Request Body schema: application/json

JSON patch of webhook properties to insert or update

name
string <= 200 characters

friendly name of the webhook

events
Array of strings
Items Enum: "AGENT_AVAILABILITY/FOCUS_ENTERED" "AGENT_AVAILABILITY/FOCUS_EXITED" "AGENT_AVAILABILITY/UPDATED" "AGENT_STATUS/CHANGED_ACTIVE_REASON" "AGENT_STATUS/LOGGED_IN" "AGENT_STATUS/LOGGED_OUT" "AGENT_STATUS/RETURNED_FROM_AWAY" "AGENT_STATUS/WENT_AWAY" "AUTOMATION/MESSAGE_RECEIVED" "CONTACT/ENDED" "CONTACT/FULFILLED" "CONTACT/HOLD_ENDED" "CONTACT/HOLD_STARTED" "CONTACT/JOINED" "CONTACT/MESSAGE_RECEIVED" "CONTACT/MESSAGE_SENT" "CONTACT/OFFER_ACCEPTED" "CONTACT/OFFERED" "CONTACT/OFFER_REJECTED" "CONTACT/STARTED" "CONTACT/TRANSFERRED" "CONVERSATION/CLOSED" "CONVERSATION/CREATED" "CONVERSATION/CUSTOM_ATTRIBUTE_ADDED" "CONVERSATION/CUSTOM_ATTRIBUTE_REMOVED" "CONVERSATION/NOTE_CREATED" "CONVERSATION/REOPENED" "CONVERSATION/TOPIC_ADDED" "CONVERSATION/TOPIC_REMOVED" "CONVERSATION_ASSIGNEE/UPDATED" "CONVERSATION_STATUS/UPDATED" "CUSTOM_CHANNEL/MESSAGE_SENT" "CUSTOMER/MERGED" "CUSTOMER_PROFILE/CREATED" "CUSTOMER_PROFILE/DELETED" "CUSTOMER_PROFILE/MERGED (deprecated)" "CUSTOMER_PROFILE/UPDATED" "EXPORT_JOB/COMPLETED" "EXPORT_JOB/FAILED" "MESSAGE/RECEIVED (deprecated)" "PAYMENT_REQUEST/CREATED" "PAYMENT_REQUEST/STATUS_CHANGED" "PAYMENT_REQUEST/VIEWED" "TASK/ASSIGNEE_UPDATED" "TASK/CLOSED" "TASK/COMMENT_ADDED" "TASK/CONTENT_UPDATED" "TASK/CREATED" "TASK/DUE_DATE_UPDATED" "TASK/FOLLOWER_ADDED" "TASK/FOLLOWER_REMOVED" "TASK/REOPENED"

list of events that trigger the webhook. More events are coming soon. Please see Events for more information about the data included for each event type.

url
string

your URL that POST requests are sent to when events occur. HTTPS is required and this value must be unique across all webhooks.

credentials
object (Basic Auth Credentials)
headers
object (HTTP Headers)

custom HTTP headers to include in every request

enabled
boolean
Default: false

whether the webhook is delivering notifications

Responses

204

Updated webhook

400

Invalid field(s) in request body

404

Webhook with id does not exist

patch /api/v1/webhooks/{webhookId}
https://organization.gladly.com/api/v1/webhooks/{webhookId}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "enabled": true
}

Delete webhook

Delete a webhook by ID

path Parameters
webhookId
required
string
Example: a9dIl-kKRrKUZLQtJ-tjtw

id of the webhook

Responses

204

Webhook deleted

400

Webhook must be disabled to be deleted

404

Webhook with id does not exist

delete /api/v1/webhooks/{webhookId}
https://organization.gladly.com/api/v1/webhooks/{webhookId}

Get webhook

Get a webhook by ID

path Parameters
webhookId
required
string
Example: a9dIl-kKRrKUZLQtJ-tjtw

id of the webhook

Responses

200

Webhook

404

Webhook with id does not exist

get /api/v1/webhooks/{webhookId}
https://organization.gladly.com/api/v1/webhooks/{webhookId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "a9dIl-kKRrKUZLQtJ-tjtw",
  • "name": "CSAT integration",
  • "events":
    [
    ],
  • "createdAt": "2019-07-03T04:30:12.07Z",
  • "updatedAt": "2019-07-09T09:00:10.00Z",
  • "hasCredentials": true,
  • "headerKeys":
    [
    ],
  • "enabled": false,
  • "disabledAtDueToRetryLimit": "2019-07-10T12:00:00.00Z"
}

Summary

Gladly webhooks are an easy way to send notifications about Gladly events and have them delivered to the endpoint of your choice, giving you a streamlined method to trigger associated actions in external systems that respond to events in Gladly.

Simply choose where to send notifications about events that you are interested in (e.g. when a conversation is closed), and they’ll be delivered to the endpoint of your choice.

Configure webhooks using the Webhooks API or the Webhooks Admin Page.

Users with API User permissions can configure webhooks by navigating to Integrations > Webhooks.

Webhooks admin page

Securing Webhooks

We provide two methods for your web service to authenticate requests from Gladly. We recommend implementing at least one authentication option.

Basic Authentication

For this method you will supply a username and password with the webhooks credentials field. This will be sent with each request. You may optionally supply a realm if needed.

Header Based Token Authentication

For this method you will configure one or more HTTP headers with the webhook's headers field. Gladly will send in each request to your web service.

Ping Event

Whenever you enable a webhook or update a webhook's URL, we'll send you a special PING event.

Your web service is expected to respond with a 200 status code to this event. If it does not respond or times out, the webhook create or update will not succeed.

Retry Policy

Effective 6/28/23

If your service responds to an event with a response code outside the 2XX range or times out after 15 seconds, Gladly considers that delivery as failed and will resend the request up to 4 times over an hour. After the fourth attempt, we will deactivate the webhook and wil notify all API Users in your organization's environment via email.

To reactivate the webhook, your team will first need to investigate the issue and make the necessary changes for the webhook to start working again. Once the issue is resolved, you will be able to re-activate the webhook via the Settings > Webhooks page.

The following table shows the intervals between each retry attempt.

Attempt Retry interval
1 30 seconds
2 5 minutes
3 30 minutes
4 1 hour

Logs

We provide the last 100 HTTP request logs for a webhook that occurred during the past month. Logs can take up to 30 seconds to view and require you to refresh the page.

Webhook Logs

Each log displays the status, event type and occurred at timestamp for a given request. You can expand the log for more details about the request and response. For more information about webhook logs, please see our Help Documentation.

Payloads

Gladly payloads are intentionally small: they contain only Gladly IDs and event names rather than the object/data that has been modified or created

This helps Gladly webhooks perform more quickly when many events occur throughout the day. This also assists with security, so if you misconfigure a webhook, it does not send sensitive information to an outside service.

To retrieve more information about the object in question, you may make an additional Gladly API call to retrieve the Gladly object. For example, to know more about conversationId whose status was updated, call the GET Conversation API or the List Items in Conversation API.

Available Events

Please see the Help Documentation for more information about many of the events listed below.

Event Triggered by Gladly when:
AGENT_AVAILABILITY/UPDATED an Agent's availability is updated
AGENT_STATUS/CHANGED_ACTIVE_REASON an Agent's active reason is updated
AGENT_STATUS/LOGGED_IN an Agent logs in
AGENT_STATUS/LOGGED_OUT an Agent logs out
AGENT_STATUS/RETURNED_FROM_AWAY an Agent returns from away
AGENT_STATUS/WENT_AWAY an Agent goes away
AUTOMATION/MESSAGE_RECEIVED an Entry Point that has been configured for Message Automation receives an inbound message
CONTACT/ENDED a Contact is ended
CONTACT/FULFILLED a Contact's SLA is fulfilled
CONTACT/HOLD_ENDED a Contact's hold is ended
CONTACT/HOLD_STARTED a Contact's hold is started
CONTACT/JOINED an Agent joins a Contact
CONTACT/MESSAGE_RECEIVED a Message is received
CONTACT/MESSAGE_SENT a Message is sent
CONTACT/OFFER_ACCEPTED a Contact's offer is accepted
CONTACT/OFFERED a Contact is offered
CONTACT/OFFER_REJECTED a Contact's offer is rejected
CONTACT/STARTED a Contact is started
CONTACT/TRANSFERRED a Contact is transferred
CONVERSATION/CLOSED a Conversation is closed
CONVERSATION/CREATED a new Conversation is created
CONVERSATION/CUSTOM_ATTRIBUTE_ADDED a custom attribute has been added to the conversation
CONVERSATION/CUSTOM_ATTRIBUTE_REMOVED a custom attribute has been removed from the conversation
CONVERSATION/NOTE_CREATED a Note is added to a Conversation
CONVERSATION/REOPENED a Conversation is reopened
CONVERSATION/TOPIC_ADDED a topic is added to a Conversation
CONVERSATION/TOPIC_REMOVED a Conversation's topic is removed
CONVERSATION_ASSIGNEE/UPDATED a Conversation's assignee (inbox and/or Agent) changes
CONVERSATION_STATUS/UPDATED a Conversation changes statuses (e.g.: from OPEN to CLOSED)
CUSTOM_CHANNEL/MESSAGE_SENT an outbound message sent using a Custom Channel
CUSTOMER/MERGED a Customer Profile is merged with another profile
CUSTOMER_PROFILE/CREATED a Customer Profile is created
CUSTOMER_PROFILE/DELETED a Customer Profile is deleted
CUSTOMER_PROFILE/MERGED a Customer Profile is merged with another profile
CUSTOMER_PROFILE/UPDATED a Customer Profile is updated (e.g.: name is updated)
EXPORT_JOB/COMPLETED a data export job is completed
EXPORT_JOB/FAILED a data export job fails to complete
MESSAGE/RECEIVED an inbound message other than a phone call is received
PAYMENT_REQUEST/CREATED a payment request is created
PAYMENT_REQUEST/STATUS_CHANGED a payment request's status changes
PAYMENT_REQUEST/VIEWED a payment request is viewed by the Customer
PING a webhook is initially created to verify serivce availability
TASK/ASSIGNEE_UPDATED a task's assignee is updated
TASK/CLOSED a task is closed
TASK/COMMENT_ADDED a comment is added to a task
TASK/CONTENT_UPDATED the content of a task is updated
TASK/CREATED a task is created
TASK/DUE_DATE_UPDATED the due date of a task is updated
TASK/FOLLOWER_ADDED a follower is added to a task
TASK/FOLLOWER_REMOVED a follower is removed from a task
TASK/REOPENED a closed task is reopened

Payloads

Events

Gladly will perform a POST request to your endpoint when the event occurs.

Your service is expected to respond within 15 seconds.

If your service responds to a webhook notification with a response code outside the 2XX range or times out after 15 seconds, Gladly considers that delivery as failed and will resend the request up to 4 times over an hour. After the fourth attempt, we will deactivate the webhook and will notify all API Users in your organization's environment via email.

Request Body schema: application/json

the event payload

One of
  • Agent Availability Updated
  • Agent Changed Active Reason
  • Agent Logged In
  • Agent Logged Out
  • Agent Returned From Away
  • Agent Went Away
  • Automation Message Received
  • Contact Ended
  • Contact Fulfilled
  • Contact Hold Ended
  • Contact Hold Started
  • Contact Joined
  • Contact Message Received
  • Contact Message Sent
  • Contact Offer Accepted
  • Contact Offer Rejected
  • Contact Offered
  • Contact Started
  • Contact Transferred
  • Conversation Assignee Updated
  • Conversation Closed
  • Conversation Created
  • Conversation Custom Attribute Added
  • Conversation Custom Attribute Removed
  • Conversation Note Created
  • Conversation Reopened
  • Conversation Status Updated
  • Conversation Topic Added
  • Conversation Topic Removed
  • Custom Channel Message Sent
  • Customer Merged
  • Customer Profile Created
  • Customer Profile Deleted
  • Customer Profile Merged (deprecated)
  • Customer Profile Updated
  • Export Job Completed
  • Export Job Failed
  • Message Received (deprecated)
  • PING
  • Payment Request Created
  • Payment Status Changed
  • Payment Request Viewed
  • Task Assignee Updated
  • Task Closed
  • Task Comment Added
  • Task Content Updated
  • Task Created
  • Task Due Date Updated
  • Task Follower Added
  • Task Follower Removed
  • Task Reopened
id
required
string

Unique event ID

type
required
string
Value: "AGENT_AVAILABILITY/UPDATED"
timestamp
required
string <ISO 8601>

Time the event was recorded

initiator
required
object (Initiator)

Type and ID (if applicable) of the entity that triggered the event.

content
required
object (Content)

Content for event

Responses

200

Success

post /gladly/webhook

Web service hosted on your servers should be reachable from the Gladly cluster

https://gateway.organization.com/gladly/webhook

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "id": "zGaHXjD4SR-moMR9LbULDa",
  • "type": "AGENT_AVAILABILITY/UPDATED",
  • "timestamp": "2019-07-03T04:30:12.07Z",
  • "initiator":
    {
    },
  • "content":
    {
    }
}

Customer Lookup

Customer Lookup allows you to provide a web service to search and get customer profile data and transactions.

To support Customer Lookup, your organization will deploy an adaptor service (aka Lookup Adaptor) running on your network that implements the Lookup API.

From there you can can connect the service to internal systems providing customer and transaction data.

Lookup Architecture

Overview

Building a Lookup Adaptor will allow you to showcase extended customer profile information and actions in Gladly. For example, you may extend the customer profile in Gladly with loyalty points and lifetime value to assist with VIP routing. You can also display historical orders in Gladly to allow agents to view frequently used directly in Gladly without having to go to another system. You can even extend Gladly with Actions so that agents can cancel orders or award loyalty points directly in Gladly!

On a high-level, Gladly will perform a request to your Customer Lookup integration(s) to retrieve extended information from your system(s) about a Customer Profile in Gladly.

To ensure performance, Gladly recommends that your Customer Lookup integration(s) be able to respond back to the Gladly POST request in < 5 seconds. Gladly will terminate the request in 15 seconds if it receives no response from your integration(s). Please note that if one Customer Lookup integration times out / responds with an error that Gladly will consider this an error for all Customer Lookup integration(s).

Sample code

Sample code for building a Customer Lookup integration can be found here.

Architecture, Setup, Authentication, Sample Requests and More

A detailed overview of Lookup Adaptor architecture, requests, resposnes and more can be found here.

Versioning

As we evolve the Gladly API over time, changes will be either added to the current version of the API (i.e. backwards compatible changes), or result in a new version that you will need to integrate with afresh (i.e. non-backwards compatible changes).

URL Path Versioning

The various versions of the Gladly API will be differentiated via global versioning, with the relevant version number reflected within the path parameter of the URL:

https://organization.gladly.com/api/v{major-version-number}/{resource path}

Backwards Compatible Changes

For the most part, changes to the API will be backwards compatible, such as adding resources, additional fields to response objects, new value types for enums, or expanding a validation constraint to be more accepting.

Ensure your client can gracefully handle or ignore unfamiliar fields and values so it continues to operate smoothly over the lifespan of an API version.

Non-Backwards Compatible Changes

Versions will be upleveled when a non-backwards compatible change occurs. This should not happen often, but can occur in the case of:

  • a field being removed from an object
  • a resource path no longer being supported
  • changing the type of a field
  • adding a new required parameter for a resource
  • constricting the validation parameters for a request

These will only occur when absolutely necessary and a summary of the changes from version to version can be viewed in the release notes. Previous versions will be supported for a period of time before being removed after providing ample advanced notice.

Error Handling

Wherever possible, Gladly uses standard HTTP status codes to signal the success or failure of a call. Generally speaking, 2xx statuses indicate success, 3xx statuses indicate the client must take further action such as redirection, 4xx statuses indicate an error with the input supplied by the client, 5xx statuses indicate an unexpected error from Gladly servers (these will be rare cases).

Common Status Codes

HTTP Status Description
200 Success with results in response body
201 Resource created
204 Success with empty response body
301 The resource location has moved
400 API usage error
401 Authentication not provided
403 User does not have persmission to access resource
404 Resource is not found
429 Rate limit reached

Programmatic Remediation

In the case of a 400 response, there will be a structured list of error objects that will provide information to correct the error. The error object will contain a code to describe the problem.

The most common codes are:

Code Description
blank Presence error
invalid Format error
moved This resource is now located elsewhere
not_a_number Value not numeric error
present Absence error
taken Uniqueness error
too_long Exceeds permissible length error
wrong_length Length is not equal to expected error

Refer to the errors section of each endpoint for more information.

Example:

{"errors":[{"code":"blank","detail":"one of emailAddress, phoneNumber must be present"}]}

Rate Limit

The number of requests for an organization is rate limited for all APIs to ensure that adequate resources are available for all customers.

Gladly has two types of API rate limits:

Request Limit

Request limits are applied on a per-second basis and are implemented to protect against denial-of-service attacks. This ensures that adequate resources are available for all customers.

Concurrency Limit

Concurrency limits are applied on the number of simultaneous requests to the endpoint. For example, a few long-lasting requests to an API endpoint simultaneously might exceed the concurrent rate limit for that endpoint.

Default Rate Limit

Organizations that send many requests in quick succession may see error responses that show up as status code 429.

Individual APIs may have their own API Rate Limit and will be documented as such. Otherwise, the following default rate limits apply.

Method Request Limit Concurrency Limit
GET 10 Requests per second Not Applicable
POST 10 Requests per second Not Applicable
PUT 10 Requests per second Not Applicable
PATCH 10 Requests per second Not Applicable
DELETE 10 Requests per second Not Applicable

We may adjust limits to prevent abuse.

If you have questions about rate limited requests, please contact Gladly Support.

Reporting API Rate Limit

The Reports APIs have slightly different default rate limits than other APIs.

Method Request Limit Concurrency Limit
POST 10 Requests per minute 2 concurrent requests at a time across the entire organization

Handling Rate Limit

The Gladly API response headers include the organization's current rate limit and the number of requests remaining in the current second. The remaining limit is calculated using the total number of requests received from all clients with your organization's API tokens.

  Ratelimit-Limit-Second
  Ratelimit-Remaining-Second

You can anticipate hitting the rate limit by checking these headers.

One technique for gracefully handling rate-limited requests is to watch for 429 status codes and implement a client-side retry mechanism with an exponential backoff schedule. We’d also recommend building some randomness into the backoff schedule to avoid a thundering herd effect.

Rich Content

In some data properties, HTML markup is supported for formatting rich content to display within Gladly. For security and readability, only a limited set of HTML tags and attributes are allowed.

Tags Attributes
a href, target
img src, align, alt, height, width
h1, h2, h3
hr, br
div style
span, p
font size, color
strong, em, b, i, u
ul, ol type
li type, value
dl, dt, dd
table
tbody, tfoot align, valign
col, colgroup align, valign, height, width, span
thead, tr align, valign
td, th align, valign, style, abbr, colspan, rowspan, headers, height, width, scope, nowrap
caption

The style attribute may use style properties: border-left, margin, padding-left, text-align, background-color.

Launching Soon

We are continuously expanding Gladly's integration capabilities. To get early access to any of the following features, please contact Gladly Support.

New Integrations

Create customer service experiences that fit your business and delight your customers. We continue to build integrations with applications that your teams already rely on today. Customer satisfaction, quality assurance, workforce management, email marketing, and order management are application categories we're focusing on next. For the list of available integrations, see our Integrations Library.

New APIs

If you can't wait for native integrations mentioned above, you can integrate your apps with Gladly using a growing list of APIs and webhook events. Sign up for our release notes to be notified of new developments.