Resources
Documents
Every Documents endpoint, with the scope it enforces, the body it takes, a response you can read, and the refusals it can return.
List documents linked to a passport.
/organizations/{organization}/passports/{id}/documents- Scope
- documents:read
Idempotency-Key- Not accepted
- Returns
- 200
Path parameters
organizationstringRequiredThe organization this request acts for. The credential must hold a grant for it.
idstringRequiredThe identifier of the resource. Treat it as an opaque string.
Query parameters
limitstringOptionalHow many records to return. The server may return fewer.
cursorstringOptionalThe next_cursor from the previous page. A cursor encodes the filters it was issued under; sending it with different filters is refused with cursor_invalid.
typestringOptionalReturn only documents of this type.
access_tierstringOptionalReturn only documents published to this audience tier.
Errors
Every refusal this endpoint can return, with the status it arrives with.
curl "https://passportcraft.com/api/v1/organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41/documents?access_tier=public" \
-H "Authorization: Bearer $PASSPORTCRAFT_API_KEY"{
"object": "list",
"data": [
{
"object": "document",
"id": "a3b8c2d1-5e64-4f79-8a0b-1c2d3e4f5a6b",
"name": "organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41/documents/a3b8c2d1-5e64-4f79-8a0b-1c2d3e4f5a6b",
"organization_id": "8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2",
"passport_id": "2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"passport": "organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"type": "conformity_declaration",
"access_tier": "public",
"file_name": "doc-2026-kestrel.pdf",
"display_name": "EU Declaration of Conformity",
"mime_type": "application/pdf",
"file_size": 184320,
"upload_state": "ready",
"uploaded_at": "2026-07-29T15:44:02.008Z",
"livemode": true,
"created_at": "2026-07-29T15:43:51.660Z",
"linked_at": "2026-07-29T15:43:51.660Z"
}
],
"has_more": false,
"next_cursor": null
}GET /organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41/documents?access_tier=public
Create a document and get a signed upload URL.
/organizations/{organization}/passports/{id}/documents- Scope
- documents:write
Idempotency-Key- Accepted
- Returns
- 201
Path parameters
organizationstringRequiredThe organization this request acts for. The credential must hold a grant for it.
idstringRequiredThe identifier of the resource. Treat it as an opaque string.
Request body
This endpoint takes one of two bodies. Send exactly one form — a body carrying fields from both is refused.
Link a document already in the library
document_idstringRequiredLink a document already in the organization library instead of uploading. Cannot be combined with any of the upload fields. Linking a document not yet attached answers 201; re-linking one already attached answers 200. Neither carries an upload object.
Upload a new file
typestringRequiredRequired when uploading; must be absent when document_id is set. One of certification, image, document, conformity_declaration.
access_tierstringRequiredRequired when uploading; must be absent when document_id is set. One of public, restricted, authority. It decides who can read the file once the passport is live.
file_namestringRequiredRequired when uploading; must be absent when document_id is set. The file name to store it under.
mime_typestringRequiredRequired when uploading; must be absent when document_id is set. One of application/pdf, image/png, image/jpeg, image/webp. Sent verbatim to storage, which refuses a mismatch.
file_sizeintegerOptionalSize in bytes, up to 10485760.
display_namestringOptionalThe label a reader sees. Defaults to file_name.
Errors
Every refusal this endpoint can return, with the status it arrives with.
- 500configuration_error
- 409idempotency_conflict
- 403insufficient_scope
- 500internal_error
- 401invalid_key
- 400invalid_request
- 401key_expired
- 401key_revoked
- 401key_rotated
- 400mode_mismatch
- 402no_subscription
- 404organization_not_found_or_not_granted
- 413payload_too_large
- 402payment_overdue
- 429rate_limited
- 404resource_not_found
- 415unsupported_media_type
- 422validation_failed
- 400wildcard_not_supported
curl "https://passportcraft.com/api/v1/organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41/documents" \
-X POST \
-H "Authorization: Bearer $PASSPORTCRAFT_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"type": "conformity_declaration",
"access_tier": "public",
"file_name": "doc-2026-kestrel.pdf",
"mime_type": "application/pdf",
"file_size": 184320,
"display_name": "EU Declaration of Conformity"
}'{
"object": "document",
"id": "a3b8c2d1-5e64-4f79-8a0b-1c2d3e4f5a6b",
"name": "organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41/documents/a3b8c2d1-5e64-4f79-8a0b-1c2d3e4f5a6b",
"organization_id": "8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2",
"passport_id": "2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"passport": "organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"type": "conformity_declaration",
"access_tier": "public",
"file_name": "doc-2026-kestrel.pdf",
"display_name": "EU Declaration of Conformity",
"mime_type": "application/pdf",
"file_size": 184320,
"upload_state": "pending",
"uploaded_at": null,
"livemode": true,
"created_at": "2026-08-02T09:40:12.331Z",
"linked_at": "2026-08-02T09:40:12.331Z",
"upload": {
"url": "https://<project>.supabase.co/storage/v1/object/upload/sign/passport-assets/<organization>/library/<uuid>-doc-2026-kestrel.pdf?token=<jwt>",
"method": "PUT",
"headers": {
"Content-Type": "application/pdf"
},
"expires_at": "2026-08-02T11:40:12.331Z",
"max_bytes": 10485760
}
}POST /organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41/documents