Errors
When a request fails, IDkollen responds with a 4xx or 5xx status code and a JSON body with a message:
{
"message": "Incorrectly formatted JSON request"
}
4xx errors are expected during normal operation, for example when a user has a flow in progress already or a result
has expired. 5xx errors should not happen and are monitored by IDkollen.
This page lists the errors common to all endpoints, followed by the messages specific to some eIDs.
Status codes
| Status code | Meaning |
|---|---|
| 400 | The request is invalid: a missing or malformed field, an unsupported HTTP method, or a provider error. |
| 401 | The credentials are missing or wrong. |
| 403 | The credentials are valid but may not be used for this request. See Access denied. |
| 404 | The resource does not exist, belongs to another account, or has expired. |
| 429 | Too many requests. See Rate limits. |
| 500 | Internal server error. Should not occur during normal operation. |
| 503 | The service is unavailable, for example during maintenance. See status.idkollen.se. |
Invalid requests
These 400 messages can be returned by any endpoint:
| Message | Cause |
|---|---|
| Required request payload missing | The endpoint expects a JSON body, but none was sent. |
| Incorrectly formatted JSON request | The body is not valid JSON, or a field has the wrong type. |
| Validation failed for field '<field>': Invalid value '<value>' must be one of [...] | A field only accepts a fixed set of values. |
| Unsupported content type: '<type>' | Send JSON with Content-Type: application/json. |
| Request method not supported: '<method>' | Wrong HTTP method, for example GET instead of POST. |
Optional fields can be left out or sent as null, which means the same thing.
Access denied
A 403 means that the credentials were accepted, but the account may not make this request:
| Message | Cause |
|---|---|
| Credentials suspended | The API keys have been suspended. |
| Account suspended | The account has been suspended. |
| Account deleted | The account has been deleted. |
| IP not whitelisted | Your account only accepts requests from certain IP addresses, and this one is not one of them. |
| API disabled | The API is not enabled for your account. |
A 403 is also returned when using keys for one API on another, for example Data API keys on an eID endpoint, or when
a feature (such as requestAddress or backchannel authentication) is not enabled for your account. Contact
support@idkollen.se to enable it.
Rate limits
| Limit | Applies to | Size |
|---|---|---|
| Status polling | The GET endpoints that fetch the status of an eID flow | One request per second per flow |
| Data API | TeleID, TeleSign, SafeMail and Admin endpoints | A number of requests per hour, set per company |
Exceeding a limit returns 429:
{
"message": "The Data API call rate limit has been reached. Try again later."
}
Counted responses carry one of these headers:
| Header | Description |
|---|---|
X-Rate-Limit-Remaining | Requests left before the limit is reached. |
X-Rate-Limit-Retry-After-Seconds | Sent with a 429: how many seconds to wait before retrying. |
Handling errors
- Use the status code to decide what to do, and log the
messagefor troubleshooting. messagetexts are meant for developers and may change. Where an eID returns a fixed set of codes, such as BankID'salreadyInProgressor a failed flow'serror, those can be relied on.- New messages and error codes may be added without notice. Treat unknown ones as a generic failure of the same status.
- Retry
429after the time given inX-Rate-Limit-Retry-After-Seconds, and500and503with a backoff. Don't retry other4xxerrors without changing the request.
eID-specific errors
BankID (SE)
| Message | Description |
|---|---|
| alreadyInProgress | The user already has an authentication or signing in progress. Both are cancelled. Ask the user to try again. |
alreadyInProgress is the most common BankID error. It happens when a user starts a new flow while one is still
pending, for example by clicking a button twice.
Freja eID
| Message | Description |
|---|---|
| User with the specified userInfo does not exist in Freja eID database | The user doesn't have Freja eID. |
| Authentication request failed. Previous authentication request was rejected due to security reasons | Several requests were sent to Freja eID in a row for the same SSN. |