Skip to main content

Errors

Olyn uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 200 range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted). Codes in the 5xx range indicate an error with Olyn's servers.

Some 4xx errors that could be handled programmatically include an error code that briefly explains the error reported. Developers could handle these types of errors programmatically.

HTTP Status Code Summary#

Status CodeDescription
200 - OKEverything worked as expected.
400 - Bad RequestThe request was unacceptable, often due to missing a required parameter.
401 - UnauthorizedNo valid API key provided.
402 - Request FailedThe parameters were valid but the request failed.
403 - ForbiddenThe organization doesn't have permissions to perform the request.
404 - Not FoundThe requested resource doesn't exist.
409 - ConflictThe request conflicts with another request. (e.g. creating an organization without a unique code)
429 - Too Many RequestsThe rate limit has been exceeded.
500, 502, 503, 504 - Server ErrorsSomething went wrong on Olyn's end.

Error Types#

Error TypeDescription
AUTHENTICATION_ERRORFailure to properly authenticate to complete the request. This could be due to a bad API key, invalid Organization code, or a lack of the proper roles needed to interact with the endpoint.
API_ERRORAPI errors cover any other type of problem (e.g., a temporary problem with Olyn's servers).
INVALID_REQUEST_ERRORInvalid request errors arise when your request has invalid parameters.
NOT FOUNDNot Found errors arise when your resource does not exist.
CONFLICTConflict errors arise when a request conflicts with current state of the target resource.

Error Codes#

Error CodeDescription
ORGANIZATION_CODE_ALREADY_EXISTSThese codes arise when you are trying to create an organization with a code that is already being used.
OWNER_INVALIDThe owner is in an invalid format. Must be in the format {provider}|{id}
INVALID_IDGeneric invalid ID
PROVIDER_UNSUPPORTEDThe identity provider is unsupported
TOKEN_ID_INVALIDToken_id provided does not match with the stored in the unit_card_id
OWNER_NOT_FOUNDOwner not found
OWNER_PUBLIC_KEY_NOT_PROVIDEDPublic key from owner not provided
UNIT_CARD_NOT_FOUNDUnitCard not found in OLYN-system
METADATA_NOT_FOUNDMetadata resource not found in OLYN-system
METADATA_TYPE_NOT_SUPPORTEDMetadata Type not supported
METADATA_KEY_ALREADY_EXISTSMetadata Key already exists

Sample Error Responses#

Authentication error:

{
"error": {
"type": "AUTHENTICATION_ERROR"
}
}

Organization already exists:

{
"error": {
"type": "INVALID_REQUEST_ERROR",
"code": "ORGANIZATION_CODE_ALREADY_EXISTS"
}
}