Skip to main content

Read PDI Stored (Raw)

This API returns the complete, raw record of a single conserved or rejected PDI — including all metadata, packaging references, file information, and discard data.

Why This API Exists

When a document is uploaded to TS Archive it is owned by the User who submitted it. That user has the right to retrieve everything about their document at any time. This API exists to give that full picture.

However, this level of detail comes with a strict security constraint: only the User security role is allowed to call this endpoint. This is an intentional choice to protect privacy and sensitive data.

The Security Design Rule

EndpointAllowed RolesInformation Exposed
GET /api/v3/archive/pdi/{id}/rawUser onlyFull document record — all metadata, file info, subject data
GET /api/v3/archive/pdi/status/{id}User, M2M, BackofficeStatus + rejection reason only — no private data

The rule is: no API accessible by M2M or Backoffice tokens will ever expose bulk document content or metadata.

The reason is simple: if an M2M token were ever stolen, an attacker could loop over billions of PDI IDs and attempt to harvest document metadata at scale. By restricting this endpoint to User only, the blast radius of any credential compromise is contained — a stolen M2M token can only reach the /status endpoint, which reveals nothing sensitive.

This is why the /status endpoint exists at all: systems like invoice platforms send millions of documents per day over M2M and simply need to know "did my document get stored or not?" — they don't need (and shouldn't have access to) the full record. See Read PDI Document Status for that use case.


Use Cases

Use this API when you need to:

  • Retrieve the full archived record of a document you own — after conservation is complete, read back everything that was stored.
  • Audit your own submission — verify that all metadata, subjects, file hashes, and classification fields were stored exactly as submitted.
  • Inspect rejection details — if a document was rejected, the full rejection_reason and errors_to_notify fields are available here.
  • Access rectification links — if a document was rectified, the rectified_pdi_id and rectifier_pdi_id fields trace the chain of corrections.
  • Check discard scheduling — read the discard_information block to see if and when a document is scheduled for disposal.

This API is not suitable for M2M or automated batch status checks. Use GET /api/v3/archive/pdi/status/{id} for that purpose.


How to Use the API

Endpoint

GET /api/v3/archive/pdi/{id}/raw

Authentication

Authentication is required. Refer to the Authentication page for how to obtain and use a valid JWT token.

Allowed security roles: User only.

M2M and Backoffice tokens will receive a 403 Forbidden response on this endpoint.

Request

Pass the PDI ID as the path parameter {id}.

GET /api/v3/archive/pdi/{id}/raw
Authorization: Bearer <your_jwt_token>
Content-Type: application/json
  • id (path, required) — The PDI ID assigned to the document at upload time.

Responses

200 OK — Full PDI record returned

{
"document_id": "string",
"status_id": 0,
"creation_date": "2026-02-23T12:51:55.957Z",
"last_modify_date": "2026-02-23T12:51:55.957Z",
"last_change_status_date": "2026-02-23T12:51:55.957Z",
"origin_app_name": "string",
"errors_to_notify": "string",
"rejection_reason": "string",
"already_existing_file_id": "string",
"retention_date": "2026-02-23T12:51:55.957Z",
"rectified_pdi_id": "string",
"rectifier_pdi_id": "string",
"rectification_reason": "string",
"pdv": { "id": "string", "status": 0 },
"pda": { "id": "string", "status": 0 },
"annulment_pdv": { "id": "string", "status": 0 },
"pcas": { "id": "string", "source": "string", "hash_256": "string" },
"preservation_certificate_id": ["string"],
"file": {
"hash_256": "string",
"identificativo_applicativo_esterno": "string",
"nome": "string",
"file_size": 0,
"type": "string",
"md5": "string"
},
"holder": {
"company_name": "string",
"first_name": "string",
"last_name": "string",
"country_id": "string",
"tax_id": "string",
"vat_number": "string",
"office_code": "string",
"identifier": "string"
},
"submitter": {
"submitter_user_id": "string",
"company_name": "string",
"first_name": "string",
"last_name": "string",
"country_id": "string",
"tax_id": "string",
"vat_number": "string",
"office_code": "string",
"identifier": "string"
},
"anno_riferimento": 0,
"details": {
"prodotto_software": {
"nome": "string",
"versione": "string",
"produttore": "string"
},
"classificazione": {
"descrizione": "string",
"indice": "string",
"piano": "string"
},
"custom_metadata": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"chiave_descrittiva": {
"oggetto": "string",
"parole_chiave": ["string"]
},
"dati_registrazione": {
"data": "2026-02-23T12:51:55.958Z",
"codice_registro": "string",
"numero": "string",
"tipo_registro": "string",
"tipologia_flusso": "string"
},
"id_agg": [
{ "tipo_aggregazione": "string", "id_aggregazione": "string" }
],
"identificativo_documento_primario": {
"impronta": "string",
"algoritmo": "string",
"identificativo": "string"
},
"modalita_formazione": "string",
"note": "string",
"riservato": true,
"soggetti": [
{
"ruolo": "string",
"tipo": "string",
"cognome": "string",
"nome": "string",
"codice_fiscale": "string",
"denominazione": "string",
"codice_ipa": "string",
"partita_iva": "string",
"denominazione_ufficio": "string",
"denominazione_amministrazione_aoo": "string",
"codice_ipa_aoo": "string",
"denominazione_amministrazione_uor": "string",
"codice_ipa_uor": "string",
"id_paese": "string",
"matricola": "string",
"codice_sdi": "string",
"indirizzi_digitali_riferimento": ["string"]
}
],
"tipologia_documentale": "string",
"allegati": {
"numero_allegati": "string",
"indice_allegati": [
{
"id_doc": {
"impronta": "string",
"algoritmo": "string",
"identificativo": "string"
},
"descrizione": "string"
}
]
},
"tracciature_modifiche": {
"soggetto_autore": { "ruolo": "string", "tipo": "string" },
"data": "2026-02-23T12:51:55.958Z",
"id_versione_precedente": {
"impronta": "string",
"algoritmo": "string",
"identificativo": "string"
},
"tipo": "string"
},
"verifica": {
"conformita_copie_immagine": true,
"firmato_digitalmente": true,
"marcatura_temporale": true,
"sigillato_elettronicamente": true
},
"versione": "string"
},
"_document_key": "string",
"discard_information": {
"schedule_discard_date": "2026-02-23T12:51:55.958Z",
"discard_date": "2026-02-23T12:51:55.958Z",
"discard_notification_id": "string",
"discard_completion_date": "2026-02-23T12:51:55.958Z",
"ids_id": "string"
}
}

Key fields:

FieldDescription
document_idThe unique identifier of the document within the archive.
status_idNumeric code of the conservation state (e.g. 4747 = Conserved, 4744 = Rejected).
rejection_reasonPopulated if the document was rejected — explains why.
errors_to_notifyAny errors raised during processing that were flagged for notification.
already_existing_file_idIf rejected as a duplicate, this is the ID of the already-stored document.
retention_dateThe date until which the document must be retained.
rectified_pdi_idIf this document rectifies a previous one, the ID of the original.
rectifier_pdi_idIf this document has been rectified by a later one, the ID of the rectifier.
pdv / pdaReferences to the submission package and archival package.
pcasReference to the conservation authority package.
preservation_certificate_idIDs of the preservation certificates issued for this document.
fileFile name, size, MIME type, and integrity hashes (SHA-256, MD5).
holderThe entity that owns the document.
submitterThe entity that uploaded the document.
anno_riferimentoThe reference year used to compute the retention period.
detailsAll custom and structured metadata submitted at upload time (subjects, classification, registration data, attachments, etc.).
discard_informationScheduling and completion dates for document disposal, if applicable.

400 Bad Request

The request was malformed or the provided id is invalid.

{
"timestamp": "2026-02-23T12:51:55.968Z",
"status": "CONTINUE",
"code": "string",
"message": "string"
}

401 Unauthorized

The request is missing a valid authentication token or the token has expired.

{
"timestamp": "2026-02-23T12:51:55.969Z",
"status": "CONTINUE",
"code": "string",
"message": "string"
}

403 Forbidden

The authenticated caller does not hold the User role. M2M and Backoffice tokens are not permitted on this endpoint.

{
"timestamp": "2026-02-23T12:51:55.970Z",
"status": "CONTINUE",
"code": "string",
"message": "string"
}

404 Not Found

No document was found for the provided PDI ID. This may mean the document has not yet been fully conserved and is still in the processing queue — use GET /api/v3/archive/pdi/status/{id} to check its current stage.

{
"timestamp": "2026-02-23T12:51:55.971Z",
"status": "CONTINUE",
"code": "string",
"message": "string"
}

API Reference

Use the links below to open the interactive OpenAPI (Swagger) documentation for this endpoint in each environment.

EnvironmentAPI Documentation
Testhttps://archive-documents.test.teamsystem.digital/swagger-ui/index.html?url=/v3/api-docs#/PdI/getPdiRaw
Productionhttps://archive-documents.teamsystem.digital/swagger-ui/index.html?url=/v3/api-docs#/PdI/getPdiRaw