---
title: "API authentication and errors"
description: "Amplia Reg API reference: endpoint, API key in the X-Api-Key or Authorization headers, application roles, HTTP status codes, ErrorModel and Accept-Language."
canonical: "https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/authentication"
locale: "en"
product: "Amplia Reg"
last_updated: "2026-11-17"
---

# API authentication and errors

Every call to the [Amplia Reg](https://docs.lacunasoftware.com/en-us/articles/amplia-reg) API uses the same endpoint, the same API key and the same error response format.

## Endpoint

All API URLs are relative to the endpoint. The endpoint is the address of the Amplia Reg instance. It is the same as the address of the
control panel, for example `https://ampliareg.yourcompany.com`. If you do not know the address, ask the administrator of your Amplia Reg instance.

## API key

Every call requires an API key, in the `X-Api-Key` header:

```plaintext
X-Api-Key: your-app|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```

Or in the `Authorization` header, with the `ApiKey` scheme:

```plaintext
Authorization: ApiKey your-app|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```

The key has the format `application-name|<key>` and works only on the instance where you created it. To create a key, see
[Get started](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/get-started#api-key).

## Application roles

The key belongs to an application, and the application's roles define what the key can do:

| Role | Operations |
|---|---|
| **Sales app** | Creating and canceling orders, holder checks, sending holder documents and listing the status changes |
| **Electronic registration authority** | Creating [pre-approved orders](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/preapproved-orders), getting the issue keys and issue links, resending the issue instructions and listing the status changes |

The **Sales app** role cannot get the order (`GET /api/brazil/orders/{number}` and the routes of the other formats). It also cannot create
orders with `startValidation`. For these calls, the API responds with HTTP 403. To follow the order, use the [webhooks](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/webhooks) or
the status change list.

The [phone number validation](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/verify-holder#phone-validation) accepts any API key.

## Application subscription

Each application belongs to a subscription: a certification authority (CA) or a registration authority (RA). The calls of the
application apply to that subscription. For example, the certificate type list has the types of the CA of the application.

Some APIs require the RA in the `X-Subscription` header, for example the [pre-approved orders](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/preapproved-orders) API. When a
subscription is missing, the API responds with the `SubscriptionRequired` error code.

## HTTP status codes

| Code | Meaning |
|---|---|
| `200` (OK) | The request was processed. The response body depends on the API: see the [API reference](https://ar.lacunasoftware.com/swagger) |
| `400` (Bad Request) | A required field is missing or has an incorrect value. This also applies to the fields that are required only in some cases, for example `contact` for the `VideoIdentification` and `OnlineIssuance` issue types |
| `401` (Unauthorized) | The API key was not sent or is invalid |
| `403` (Forbidden) | The API key is valid, but the application does not have the role the operation requires |
| `415` (Unsupported Media Type) | The request body is empty or is not JSON |
| `422` (Unprocessable Entity) | API error: a business rule stopped the operation, for example an order that was not found. The body is an [`ErrorModel`](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/authentication#error-model) |
| `500` (Internal Server Error) | An unexpected error happened. The `exceptionCode` field of the body helps with the diagnosis |

## ErrorModel

| Field | Type | Content |
|---|---|---|
| `code` | string | The error code. Test this field in your code, not the message. See the [error codes](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/error-codes) |
| `message` | string | A description of the error, in English. Log it, but do not show it to the user |

```json
{
	"code": "OrderNotFound",
	"message": "Order not found: 100123456"
}
```

## Language

The API reads the `Accept-Language` header. The header accepts these values:

* `pt-BR` (or `pt`)
* `en-US` (or `en`)
* `es-ES` (or `es`)

Error messages do not change with this header.

## See also

* [Error codes](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/error-codes)
* [Use the .NET library](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/dotnet-client)
* [API reference (Swagger)](https://ar.lacunasoftware.com/swagger)
