Skip to content

Plan the backup of a period through a delivery link: production documents, issued and received.

POST
/v1/archive-delivery/plan
curl --request POST \
--url https://api.emite.cr/v1/archive-delivery/plan \
--header 'Content-Type: application/json' \
--data '{ "from": "2026-09-01", "to": "2026-09-30", "token": "example" }'

The same plan as GET /v1/archive/plan, for the closed company the token opens, in production. 404 ARCHIVE_DELIVERY_LINK_INVALID / ARCHIVE_DELIVERY_LINK_EXPIRED; 400 ARCHIVE_RANGE_INVALID / ARCHIVE_RANGE_TOO_LONG.

Media typeapplication/json
object
from
required

First Costa Rica calendar day of the EMISSION-date range (inclusive).

string
Example
2026-09-01
to
required

Last Costa Rica calendar day of the range (inclusive), not before from (400 ARCHIVE_RANGE_INVALID). The range covers at most 366 days, both ends included (400 ARCHIVE_RANGE_TOO_LONG); a longer period takes several plans.

string
Example
2026-09-30
token
required

The delivery link's token, as the email carried it.

string
>= 20 characters <= 200 characters
Media typeapplication/json
object
from
required

First day of the range, as requested.

string
to
required

Last day of the range, as requested.

string
blockSize
required

Documents per block, the same for both sections. Read it from here instead of hard-coding it.

number
issued
required

The company's own documents in the environment of the session or API key: every one with a signed XML whose emission date falls in the range, native or imported, and whatever its status — a rejected document used its number and is kept too.

object
total
required

Documents in the range for this section, across all its blocks.

number
blocks
required

The blocks in download order. Documents are ordered by emission date and each block holds blockSize of them, except the last, which can hold fewer. Empty when the range has no documents.

Array<object>
object
block
required

1-based position of the block in its section. Pass it as block to GET /v1/archive/download, with the same from, to and kind.

number
count
required

Documents in this block.

number
firstEmission
required

Emission instant of its first document.

string
lastEmission
required

Emission instant of its last document.

string
received
required

null when the caller lacks documents:read.

object
total
required

Documents in the range for this section, across all its blocks.

number
blocks
required

The blocks in download order. Documents are ordered by emission date and each block holds blockSize of them, except the last, which can hold fewer. Empty when the range has no documents.

Array<object>
object
block
required

1-based position of the block in its section. Pass it as block to GET /v1/archive/download, with the same from, to and kind.

number
count
required

Documents in this block.

number
firstEmission
required

Emission instant of its first document.

string
lastEmission
required

Emission instant of its last document.

string
Example
{
"from": "2026-09-01",
"to": "2026-09-30",
"blockSize": 1000,
"issued": {
"total": 2350,
"blocks": [
{
"block": 1,
"count": 1000,
"firstEmission": "2026-09-01T14:03:11.000Z",
"lastEmission": "2026-09-12T23:41:05.000Z"
}
]
},
"received": {
"total": 2350,
"blocks": [
{
"block": 1,
"count": 1000,
"firstEmission": "2026-09-01T14:03:11.000Z",
"lastEmission": "2026-09-12T23:41:05.000Z"
}
]
}
}