Introduction
Programmatically access to your Operator’s data and schedule calls.
In this section, we will guide you through integrating with the Operator REST API.
Creating an API key
First, create an API key for your Operator. On the API Integration page, scroll down to the “API Keys” section. Click the “Generate Key” button to generate a new API key. Save this API key in a secure place such as a secrets manager.
In the rest of the documentation, we will reference this key as $OPERATOR_API_KEY
. If you are following along in the shell, please run:
Connecting to the API
The Operator REST API is accessible on the https://api.operator.xyz domain. To get a list of your Operator’s conversations, make a request like so:
You should see the most recent conversations appear!
Concepts
Authentication
We authenticate requests with an API Key authentication scheme. You can generate an API Key on the API Integration page.
When making a request to the Operator API, add the API Key to the request header. For example:
Versioning
We use date-based versioning. When introducing breaking changes, we will release a
new API version. The current version is 2024-11-11
.
All API requests must include a Operator-Version
header:
Idempotency (coming soon!)
Please get in touch if you would like us to prioritize this sooner!
Troubleshooting
We have tried to make errors as descriptive as possible so that they can be solved from the error output alone. However, if you encounter any difficulties or obscure errors when integrating with the API, please drop a note in Slack!
Status codes & errors
We use standard HTTP status codes to indicate request success or failure. 2xx
codes indicate success, 4xx
codes indicate client errors, and 5xx
codes indicate server errors.
We return these specific status codes:
200 OK
- Successful request.201 Created
- Resource successfully created.202 Accepted
- Asynchronous operation accepted. No data will be returned.204 No Content
- Resource successfully deleted. SubsequentDELETE
requests will return404 Not Found
.400 Bad Request
- Invalid request. Check that the request is well-formed and includes all required parameters.401 Unauthorized
- Invalid API key.403 Forbidden
- The provided API key lacks permission for this resource.404 Not Found
- The requested resource was not found.405 Method Not Allowed
- The requested HTTP method is not allowed for this resource.409 Conflict
- The request conflicts with a previous request, typically due to an idempotency key conflict.418 I'm a Teapot
- Your Operator is a teapot.429 Too Many Requests
- Rate limit exceeded. Please wait for a exponential backoff with jitter before retrying.5xx
- Server error. Please retry later.
Errors are returned with the following schema: