Making requests
Authentication and headers
You need a personal access token to access the API and to perform actions on your behalf. Your personal access token needs to be send trough an Authorization Bearer request. You can download your personal access token in Trengo.
Next, you are also required to send JSON headers for a proper request processing and a JSON response.
| name | value |
|---|---|
| Endpoint | https://app.trengo.com/api/v2 |
| Authorization | Bearer {{YOUR_TOKEN}} |
| Content-Type | application/json |
API key types
| Prefix | Key type | Acts as |
|---|---|---|
trpat_ | Personal API key | You, with your permissions |
trsa_ | Service account key | A separate user for an integration |
Create both in Trengo under Settings > Integrations > Rest API.
Deprecated API keys
Keys that don't start with trpat_ or trsa_ stop working after 31 January 2027. After that, the API returns 401. Replace them with a new key before then.
API rate limiting
All requests to the Trengo API are rate limited to prevent abuse or possible high CPU / memory usage and this is something you need to take in account when implementing the API. The current rate limit is 120 requests per minute. The API responses contains useful rate limit headers to check the remaining requests.
| name | description | example |
|---|---|---|
| x-ratelimit-limit | The rate limit | 120 |
| x-ratelimit-remaining | The remaining requests left for the current ratelimit window. | 5 |
Note that when you hit the ratelimit a HTTP-status of 429 (Too Many Requests) is returned and a header "Retry-After" & "X-RateLimit-Reset" is send to the client. These values can be used to determine when the next call will be possible (Where "Retry-After" is the number of seconds to wait. This is the safest way as it does not matter if you have a clock-skew with the server.).
Please contact us in case you think the current rate limit is to strict for your use case.
Updated 6 days ago