Skip to main content

Errors

When a request fails, IDkollen responds with a 4xx or 5xx status code and a JSON body with a message:

HTTP/2.0 400 Bad Request
{
"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 codeMeaning
400The request is invalid: a missing or malformed field, an unsupported HTTP method, or a provider error.
401The credentials are missing or wrong.
403The credentials are valid but may not be used for this request. See Access denied.
404The resource does not exist, belongs to another account, or has expired.
429Too many requests. See Rate limits.
500Internal server error. Should not occur during normal operation.
503The service is unavailable, for example during maintenance. See status.idkollen.se.

Invalid requests​

These 400 messages can be returned by any endpoint:

MessageCause
Required request payload missingThe endpoint expects a JSON body, but none was sent.
Incorrectly formatted JSON requestThe 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:

MessageCause
Credentials suspendedThe API keys have been suspended.
Account suspendedThe account has been suspended.
Account deletedThe account has been deleted.
IP not whitelistedYour account only accepts requests from certain IP addresses, and this one is not one of them.
API disabledThe 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​

LimitApplies toSize
Status pollingThe GET endpoints that fetch the status of an eID flowOne request per second per flow
Data APITeleID, TeleSign, SafeMail and Admin endpointsA number of requests per hour, set per company

Exceeding a limit returns 429:

HTTP/2.0 429 Too Many Requests
{
"message": "The Data API call rate limit has been reached. Try again later."
}

Counted responses carry one of these headers:

HeaderDescription
X-Rate-Limit-RemainingRequests left before the limit is reached.
X-Rate-Limit-Retry-After-SecondsSent with a 429: how many seconds to wait before retrying.

Handling errors​

  • Use the status code to decide what to do, and log the message for troubleshooting.
  • message texts are meant for developers and may change. Where an eID returns a fixed set of codes, such as BankID's alreadyInProgress or a failed flow's error, 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 429 after the time given in X-Rate-Limit-Retry-After-Seconds, and 500 and 503 with a backoff. Don't retry other 4xx errors without changing the request.

eID-specific errors​

BankID (SE)​

MessageDescription
alreadyInProgressThe 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​

MessageDescription
User with the specified userInfo does not exist in Freja eID databaseThe user doesn't have Freja eID.
Authentication request failed. Previous authentication request was rejected due to security reasonsSeveral requests were sent to Freja eID in a row for the same SSN.