Skip to main content

Using the API

With the infinity.swiss API, you can perform actions within an Infinity organisation programmatically. The following modules are suppported through the API:

Authentication

To make requests to the Infinity API, an API token is required. API tokens are bound to an organisation and can be created from your Infinity account settings. To authenticate a request, provide the API token in the x-api-token header of your HTTP request:
x-api-token: your-jwt-token-here
The API token automatically scopes all requests to the organisation it was created for. You do not need to specify an organisation ID in your requests.

Rate Limiting

The Infinity REST API has rate limits to ensure fair usage and system stability:
  • Limit: Maximum 1000 requests per hour
  • Headers: Rate limit information is returned in response headers
  • Exceeded: When the rate limit is exceeded, you’ll receive a 429 Too Many Requests response with error code general/too-many-requests
  • Reset: Rate limits reset every hour from your first request
If you need higher rate limits for your use case, please contact our support team.

Response Format

Success Responses

Successful requests return a 200 OK (or 201 Created for resource creation) status code along with a JSON response containing the requested data.

Error Responses

When something goes wrong, endpoints of the Infinity API will return a non-OK status code along with a JSON response containing an error code:
{
  "code": "general/unauthorised"
}
For validation errors, the response may also include an invalidFields array indicating which fields were invalid:
{
  "code": "general/missing-fields",
  "invalidFields": ["firstName", "lastName", "companyName"]
}
We recommend that you use the error code to discern the specific cause of the error, as some types of errors use the same HTTP status error code. Common error codes that may occur for all endpoints:
  • general/unauthorised - Invalid or expired API token
  • general/too-many-requests - Rate limit exceeded
  • general/missing-fields - Required fields are missing
  • general/malformed-request - Request payload is invalid
  • general/server-error - Internal server error
Other endpoint-specific error codes can be found in the individual endpoint documentation (see section “Response” and select an HTTP error response code from the dropdown to see the errors).