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.

namevalue
Endpointhttps://app.trengo.com/api/v2
AuthorizationBearer {{YOUR_TOKEN}}
Content-Typeapplication/json
Acceptapplication/json

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.

namedescriptionexample
x-ratelimit-limitThe rate limit120
x-ratelimit-remainingThe 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.


What’s Next