All errors from the Swisstools API return a JSON body with a singleDocumentation Index
Fetch the complete documentation index at: https://docs.swisstools.dev/llms.txt
Use this file to discover all available pages before exploring further.
error field containing a human-readable message. The HTTP status code tells you the category of the problem. There are no nested error objects or machine-readable error codes beyond the status code itself.
Error Response Shape
Every error response looks like this:Content-Type header is always application/json, even for error responses.
HTTP Status Codes
| Status | Meaning |
|---|---|
400 Bad Request | The request body is missing required fields or contains invalid values. Fix the input and retry. |
401 Unauthorized | No valid session cookie or API key was supplied. Authenticate and retry. |
403 Forbidden | You are authenticated but do not have permission to access this resource. |
404 Not Found | The resource you requested does not exist, or has been deleted. |
405 Method Not Allowed | You used an HTTP method that is not supported on this endpoint (e.g., POST on a read-only route). |
500 Internal Server Error | Something went wrong on our end. If this persists, contact support. |
Example Error Responses
400 — missing required field:Handling Errors in Code
Checkres.ok before reading the response body. When res.ok is false, parse the JSON and surface the error string to your users or logs.