---
title: "REST API Integration - Lacuna Scanner"
description: "Integrating with the Lacuna Scanner REST API from any language: API key in the X-Api-Key header and session creation with POST /api/v2/scan-sessions."
canonical: "https://docs.lacunasoftware.com/en-us/articles/scanner/integration/other"
locale: "en"
product: "Scanner"
last_updated: "2026-10-12"
---

# REST API Integration - Lacuna Scanner

The Lacuna Scanner API is a REST API with JSON messages, easily called from any programming language that can make HTTP requests.

> **Tip**
>
> Before you start, see the [integration overview](https://docs.lacunasoftware.com/en-us/articles/scanner/integration#overview).

See the [API documentation](https://scn.lacunasoftware.com/swagger).

Prefix every relative URL mentioned on this page with the **endpoint** communication parameter. Send the **API key** in the `X-Api-Key`
header of every request:

```plaintext
X-Api-Key: ...
```

Call `POST /api/v2/scan-sessions`, passing the **returnUrl**, to start a session:

```plaintext
POST /api/v2/scan-sessions
{
	"returnUrl": "https://your-return-url/"
}
```

Use the value returned in the `redirectUrl` field to redirect the user on the frontend:

```js
location.href = scanSessionParams.redirectUrl;
```

When you detect that the user has returned to your site (look for the `scanSessionId` argument in the URL), call `GET /api/scan-sessions/{id}` to get the
scanned documents:

```plaintext
GET /api/scan-sessions/{id}
```

For each document returned (the `documents` array), call `GET /api/documents/{id}/content` to get the file content:

```plaintext
GET /api/documents/{id}/content
```

> **Note**
>
> The content is returned in binary format.

If you prefer, call `GET /api/documents/{id}/file-link` to get a temporary link that you can render as a link or button on the frontend,
for the user to click and get the document:

```plaintext
GET /api/documents/{id}/file-link
```

> **Note**
>
> The returned link can be accessed without authentication, so it can be used in an `<a href=...` or in a `location.href = ...`.

## Multifile sessions

You can let the user scan multiple documents. To do so, pass the `"multifile": true` parameter when creating the session:

```plaintext
POST /api/v2/scan-sessions
{
	"returnUrl": "https://your-return-url/",
	"multifile": true
}
```

At the end of the process, instead of taking only the first document, iterate over the list of scanned documents.

## Sessions with metadata input and/or signature

To ask the person scanning to enter the metadata required by Decree 10,278/2020, pass the `"metadataInputEnabled": true` parameter:

```plaintext
POST /api/v2/scan-sessions
{
	"returnUrl": "https://your-return-url/",
	"metadataInputEnabled": true
}
```

To have the person scanning digitally sign the document at the end of the process, pass the `"signatureEnabled": true` parameter:

```plaintext
POST /api/v2/scan-sessions
{
	"returnUrl": "https://your-return-url/",
	"signatureEnabled": true
}
```

> **Tip**
>
> To comply with Decree 10,278/2020, enable both metadata input and document signature.
