Plan the XML archive of a period
const url = 'https://api.emite.cr/v1/archive/plan?from=2026-09-01&to=2026-09-30';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Example
2026-09-01First Costa Rica calendar day of the EMISSION-date range (inclusive).
Example
2026-09-30Last 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.
Responses
Section titled “Responses”object
First day of the range, as requested.
Last day of the range, as requested.
Documents per block, the same for both sections. Read it from here instead of hard-coding it.
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
Documents in the range for this section, across all its blocks.
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.
object
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.
Documents in this block.
Emission instant of its first document.
Emission instant of its last document.
null when the caller lacks documents:read.
object
Documents in the range for this section, across all its blocks.
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.
object
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.
Documents in this block.
Emission instant of its first document.
Emission instant of its last document.
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.