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 thex-api-token header of your HTTP request:
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 Requestsresponse with error codegeneral/too-many-requests - Reset: Rate limits reset every hour from your first request
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:invalidFields array indicating which fields were invalid:
general/unauthorised- Invalid or expired API tokengeneral/too-many-requests- Rate limit exceededgeneral/missing-fields- Required fields are missinggeneral/malformed-request- Request payload is invalidgeneral/server-error- Internal server error