---
title: "Get started with the Amplia Reg API"
description: "Get started with the Amplia Reg API: from zero to your first certificate order in five steps, with the API key, the webhook, the certificate type, the order creation and the first notification."
canonical: "https://docs.lacunasoftware.com/en-us/articles/amplia-reg/get-started"
locale: "en"
product: "Amplia Reg"
last_updated: "2026-11-17"
---

# Get started with the Amplia Reg API

This guide shows you how to create your first certificate order through the [Amplia Reg](https://docs.lacunasoftware.com/en-us/articles/amplia-reg) API, in five steps.
At the end, you have one order and the first webhook notification for that order.

> **Note**
>
> The example in this guide creates an order for an ICP-Brasil standard certificate, through the `/api/brazil/orders` route. For this
> reason, the example uses CPF and CNPJ. For other certificate formats, see [Create orders of other formats](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/other-formats).

The reference for all use cases is in the [Integration Guide](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration).

## Before you start

You will need:

* 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`.
* Access to the **Applications** menu of the control panel, to create the API key and register the webhook. If you do not have this
  access, ask the administrator of your Amplia Reg instance for the endpoint and an API key, and ask them to register the webhook. Then
  go to [step 3](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/get-started#certificate-type).
* A public URL of your application that accepts `POST` requests with a JSON body. Amplia Reg sends the notifications to this URL.
* The CNPJ of the registration authority (RA) where you will create the orders.
* The data of a test holder: CPF, full name and birth date.

> **Note**
>
> In the examples of this guide, the endpoint is `https://ampliareg.yourcompany.com`. Replace it with the endpoint of your instance. An API
> key works only on the instance where you created it.

> **Warning**
>
> This guide creates a real order on the instance. If you have a test instance or a test RA, use it. [Step 5](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/get-started#follow-order) shows how to
> cancel the order at the end.

## Step 1: Create the application and the API key

1. Sign in to the control panel of your instance.
2. In the side menu, click **Applications**, then **Add**.
3. Fill in a **name** for the application.
4. Select the subscription of the application: the certification authority (CA) or the RA where the application will create orders. The
   role in the next item appears only for these subscriptions.
5. Select the **Sales app** role. With this role, the application can create and cancel orders, do the holder checks and send documents.
   To create [pre-approved orders](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/preapproved-orders), also select the **Electronic registration authority** role.
6. Click **Create**.
7. On the application page, click **Keys**, then **Add**.
8. Fill in a description for the key and choose an expiration. Then click **Create**.

The key has the format `application-name|<key>`. Send it in the `X-Api-Key` header of every request:

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

> **Warning**
>
> Amplia Reg shows the key only once, when you create it. Keep the key in a secrets vault. You cannot recover a lost key. You can only
> create a new key.

To make sure that the key works, list the certificate types:

```bash
curl -i "https://ampliareg.yourcompany.com/api/certificate-types?isDisabled=false" -H "X-Api-Key: your-app|YOUR_KEY"
```

A `401` response means that Amplia Reg did not recognize the key. Common causes:

* The request has no `X-Api-Key` header, or the header name is wrong.
* The key is incomplete. Send the whole key, with the application name, the `|` and the key.
* The key belongs to another instance.
* The key is expired, or someone deleted it.

A `403` response means that the key is valid, but the application does not have the role that the operation requires.

## Step 2: Register the webhook

The webhook is a URL of your application. Amplia Reg calls this URL on each status change of the orders that your application created.
The webhook notifies only the changes that occur after you register it. For this reason, register it before you create the order.

1. On the page of the application from step 1, click **Edit**. Then turn on **Enable webhook**.
2. Fill in the **URL** that will receive the notifications.
3. In **Authentication type**, select `Bearer`. In **Authentication token**, fill in a long, random secret.
4. Save.

Amplia Reg sends the secret in the `Authorization: Bearer <secret>` header of each notification. See
[Register and receive webhooks](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/webhooks) for the other authentication types and for what your application must do
with each notification.

## Step 3: Choose the certificate type

The certificate type defines the certificate that the holder receives, for example an e-CPF A1. The call from step 1 lists the enabled
types:

```json
[
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "name": "e-CPF A1",
    "format": "PkiBrazil",
    "code": "ECPFA1",
    "allowVideoConference": true,
    "validityOptions": [
      { "years": 1, "months": 0, "days": 0 },
      { "years": 2, "months": 0, "days": 0 }
    ]
  }
]
```

The example shows only some of the fields. Write down these values:

* The `code` of the certificate type. The `code` identifies the type when you create the order.
* One of the `validityOptions`. These are the validity periods that the certificate type allows.

## Step 4: Create the order

> **Note**
>
> If the instance has the [RFB prior query](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/verify-holder#rfb-query) configured, the order creation checks the holder's data
> with the Brazilian Revenue Service (RFB). In this case, send the real data of the holder, with the name as the RFB has it.

Create the order with the `code` and the validity from step 3:

```bash
curl -X POST "https://ampliareg.yourcompany.com/api/brazil/orders" \
  -H "X-Api-Key: your-app|YOUR_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @order.json
```

Content of `order.json`:

```json
{
  "registrationAuthority": {
    "organizationIdentifier": "09933230000188"
  },
  "certificateType": {
    "code": "ECPFA1"
  },
  "issueType": "Presential",
  "parameters": {
    "cpf": "07917307000",
    "name": "Holder Name",
    "birthDate": "1995-10-15"
  },
  "validity": {
    "years": 1
  }
}
```

| Field | Content |
|---|---|
| `registrationAuthority.organizationIdentifier` | The CNPJ registered on the RA, without punctuation. Instead, you can send the RA's ID in `registrationAuthority.id`. If the application belongs to an RA, you can omit `registrationAuthority` |
| `certificateType.code` | The `code` from step 3 |
| `issueType` | How the holder's identity will be validated. `Presential` is in-person validation, at the RA |
| `parameters` | The holder's CPF (digits only), full name and birth date (`yyyy-mm-dd`) |
| `validity` | One of the `validityOptions` from step 3 |

Response:

```json
{
  "id": "0195a9dc-c0f0-4f5c-83d3-bf562ae98ed9",
  "number": "800-005-520",
  "videoIdentification": null,
  "preValidation": null
}
```

The `number` is the order number. The holder and the agents use this number to find the order. Keep it: the other APIs receive
the number in the URL.

If the response is `400`, a required field is missing or a field has an incorrect value. If the response is `422`, the body has an error code, for example `CertificateTypeNotFound` when the `code` does not exist. See the
[error codes](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/error-codes).

## Step 5: Follow the order

Immediately after the creation, your URL receives the first notification of the order, with the `WaitingValidation` status:

```json
{
  "type": "OrderStatusChanged",
  "orderStatusTransitionModel": {
    "orderId": "0195a9dc-c0f0-4f5c-83d3-bf562ae98ed9",
    "orderNumber": "800-005-520",
    "previousStatus": null,
    "status": "WaitingValidation",
    "date": "2025-03-18T15:26:11.704304+00:00"
  },
  "videoIdentificationCompletedModel": null
}
```

The example shows only some of the fields. If the notification does not arrive, see
[Check the deliveries](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/webhooks#troubleshooting).

For a real order, the agents of the RA validate the identity of the holder and approve the order, and each status change causes a new
notification. When the certificate is issued, you receive a notification with the `Issued` status. See
[How certificate issuance works](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/issuance) for all statuses between creation and issuance.

This order is a test, so cancel it:

```bash
curl -X POST "https://ampliareg.yourcompany.com/api/orders/800-005-520/cancellation" \
  -H "X-Api-Key: your-app|YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"description\": \"Test order\"}"
```

Your URL receives one more notification, now with the `Canceled` status.

## Next steps

With your first order created, you can:

* [Verify the holder](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/verify-holder) before creating the order: biometric enrollment, phone number and, if you want, the RFB prior query.
* [Send the holder documents](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/add-holder-files) to the order.
* Create orders [by videoconference](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/create-order#brazil) or [pre-approved orders](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/preapproved-orders).
* [Cancel an order](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/cancel-order) that is no longer needed.
* Call the API through the [.NET client library](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/dotnet-client), as in the [full example](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/full-example).
