Skip to content

Plan the XML archive of a period

GET
/v1/archive/plan
curl --request GET \
--url 'https://api.emite.cr/v1/archive/plan?from=2026-09-01&to=2026-09-30' \
--header 'Authorization: Bearer <token>'

The documents whose EMISSION date falls in from..to (Costa Rica calendar days, inclusive, at most 366 days), cut into blocks of 1000 ordered by emission date. Each block downloads as its own ZIP from GET /v1/archive/download. received is null for a caller without documents:read.

from
required
string
Example
2026-09-01

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

to
required
string
Example
2026-09-30

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.

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"
}
]
}
}

ARCHIVE_RANGE_INVALID / ARCHIVE_RANGE_TOO_LONG.