Home

December 2, 2024

Compressed API responses

The Karbon API can now compress response payloads - this often significantly reduces the size of the transmitted response and the total time taken to complete the request.

In order to specify the response should be compressed, the Accept-Encoding HTTP header should include gzip, e.g. Accept-Encoding: deflate, gzip. The response will then include the HTTP header Content-Encoding: gzip which indicates the payload is compressed using the gzip compression scheme.

As an example:

  • A request to the /v3/WorkItems endpoint returns an uncompressed payload of 768kb and takes ~1500ms.
  • With the Accept-Encoding header set to gzip, the response is compressed to 56kb and takes ~650ms.

Please note that actual compressed payload sizes and response durations will differ depending on factors such as the compressibility of the data and network speed.

API Rate Limiting

The Karbon API now enforces a limit on the number of requests that can be made per minute. When the rate limit is hit, the HTTP 429 response code is returned along with a Retry-After response header that specifies a delay in seconds before a request can be reattempted.

We recommend API users keep to a maximum of 120 requests per minute (2 requests per second) and implement handling of HTTP 429 response codes.

The limit is applies to the combination of the Karbon account and API application, for example:

  • an API application connected to 10 different Karbon accounts
  • for one of the accounts, the API application makes 600 requests per minute and is rate limited
  • for each of the other 9 accounts the request volume is 90 requests per minute no rate limiting is applied