> For the complete documentation index, see [llms.txt](https://selenium-4.gitbook.io/nexus-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://selenium-4.gitbook.io/nexus-docs/docs/document-services/retrieve-document-information/main.md).

# Retrieve Document Information

| Campo              | Valor                                                                  |
| ------------------ | ---------------------------------------------------------------------- |
| **Service Domain** | Document Services                                                      |
| **BIAN Version**   | 14.0.0                                                                 |
| **Operation**      | Retrieve Document Information                                          |
| **Method**         | GET                                                                    |
| **API Name**       | Document Services API                                                  |
| **Versão**         | v1.0.0                                                                 |
| **Endpoint**       | `GET /v1/document-services/document-directory/{document-directory-id}` |
| **Autenticação**   | Bearer Token (OAuth 2.0 / OIDC)                                        |

***

## 1. Descrição da Operação

A operação `RetrieveDocuments` consulta os metadados e o conteúdo dos documentos associados a uma instância do directório de documentos (Document Directory). A resposta devolve a configuração do directório e a lista de entradas de documentos (`documentDirectoryEntryRecord[]`), cada uma com os respectivos metadados, propriedade, localização, segurança, conformidade regulatória, conteúdo extraído e histórico do fluxo de trabalho.

***

## 2. Path Parameters

| Parâmetro               | Tipo   | Obrigatório | Descrição                                                                               |
| ----------------------- | ------ | ----------- | --------------------------------------------------------------------------------------- |
| `document-directory-id` | string | Sim         | Identificador da instância do directório de documentos a consultar (ex: `DOC-DIR-001`). |

***

## 3. Payload de Resposta (Response)

### 3.1 Exemplo

> O exemplo abaixo mostra uma resposta com três entradas de documentos de tipos diferentes (identificação, contrato e declaração), ilustrando como `documentContent.documentMetadata` e `documentContent.documentExtractedData` variam consoante `documentType`/`documentSubType`.

```json
{
  "documentDirectoryRetrieveOutputRecord": {
    "documentDirectoryRetrieveActionTaskRecord": {
      "documentDirectoryRetrieveActionRequest": "RetrieveDocuments",
      "documentDirectoryRetrieveActionTaskReference": "DDDR-001",
      "documentDirectoryRetrieveActionTaskRecord": {
        "documentDirectoryInstanceRecord": {
          "documentDirectoryInstanceReference": "DOC-DIR-001",
          "documentDirectoryInstanceStatus": "Active",
          "documentDirectoryConfiguration": {
            "documentServiceType": "DocumentManagement",
            "documentCategory": "CustomerDocuments",
            "documentUpdateFrequency": "Real-time",
            "documentMaintainerReference": "DOCUMENT-SVC-001"
          },
          "documentDirectoryEntryRecord": [
            {
              "documentEntryReference": "DOC-ID-001",
              "documentEntryDetails": {
                "documentId": "DOC-ID-001",
                "documentType": "IDENTIFICATION",
                "documentSubType": "PASSPORT",
                "documentName": "Customer Passport",
                "documentDescription": "Passport document for customer identification verification",
                "documentStatus": "VERIFIED",
                "documentFormat": "PDF",
                "documentSize": 2048576,
                "documentMimeType": "application/pdf",
                "documentVersion": "1.0",
                "documentLanguage": "en-US",
                "documentClassification": "CONFIDENTIAL",
                "documentRetentionPeriod": "P10Y",
                "documentCreationDate": "2025-07-10T10:30:00Z",
                "documentLastModifiedDate": "2025-07-10T10:30:00Z",
                "documentExpiryDate": "2030-07-10T00:00:00Z",
                "documentOwnership": {
                  "documentOwnerReference": "CUST-001",
                  "documentOwnerType": "CUSTOMER",
                  "documentOwnerName": "John Doe"
                },
                "documentLocation": {
                  "documentStorageType": "CLOUD",
                  "documentStorageLocation": "s3://bank-documents/identification/DOC-ID-001.pdf",
                  "documentAccessUrl": "https://secure.bank.com/documents/DOC-ID-001",
                  "documentDownloadUrl": "https://secure.bank.com/api/documents/DOC-ID-001/download"
                },
                "documentSecurity": {
                  "encryptionStatus": "ENCRYPTED",
                  "encryptionMethod": "AES-256",
                  "accessLevel": "RESTRICTED",
                  "accessPermissions": ["READ", "DOWNLOAD"],
                  "digitalSignature": true,
                  "checksumMD5": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
                  "checksumSHA256": "z9y8x7w6v5u4t3s2r1q0p9o8n7m6l5k4j3i2h1g0f9e8d7c6b5a4"
                },
                "documentContent": {
                  "documentData": null,
                  "documentMetadata": {
                    "documentNumber": "AB123456789",
                    "issuingAuthority": "Government Passport Office",
                    "issuanceDate": "2020-07-10",
                    "expirationDate": "2030-07-10",
                    "issuingCountry": "United States",
                    "documentPageCount": 32
                  },
                  "documentExtractedData": {
                    "firstName": "John",
                    "lastName": "Doe",
                    "dateOfBirth": "1985-05-15",
                    "nationality": "American",
                    "documentNumber": "AB123456789"
                  }
                },
                "documentCompliance": {
                  "regulatoryRequirements": ["KYC", "AML", "GDPR"],
                  "complianceStatus": "COMPLIANT",
                  "lastComplianceCheck": "2025-07-10T10:30:00Z",
                  "nextComplianceReview": "2026-07-10T10:30:00Z",
                  "retentionCompliance": "COMPLIANT",
                  "privacyCompliance": "COMPLIANT"
                },
                "documentWorkflow": {
                  "currentWorkflowState": "VERIFIED",
                  "workflowHistory": [
                    {
                      "state": "SUBMITTED",
                      "timestamp": "2025-07-10T09:00:00Z",
                      "actor": "CUSTOMER",
                      "comment": "Document uploaded by customer"
                    },
                    {
                      "state": "UNDER_REVIEW",
                      "timestamp": "2025-07-10T09:30:00Z",
                      "actor": "SYSTEM",
                      "comment": "Automated document validation initiated"
                    },
                    {
                      "state": "VERIFIED",
                      "timestamp": "2025-07-10T10:30:00Z",
                      "actor": "COMPLIANCE_OFFICER",
                      "comment": "Document verified and approved"
                    }
                  ],
                  "nextAction": "ARCHIVE",
                  "workflowOwner": "COMPLIANCE_TEAM"
                }
              }
            }
          ]
        }
      }
    },
    "documentDirectoryRetrieveActionResponse": {
      "documentDirectoryRetrieveActionResponseCode": "Success",
      "documentDirectoryRetrieveActionResponseMessage": "Documents retrieved successfully"
    }
  }
}
```

> A resposta completa devolvida pela fonte inclui ainda `DOC-CONTRACT-001` (tipo `CONTRACT`/`ACCOUNT_AGREEMENT`) e `DOC-EMPLOYMENT-001` (tipo `DECLARATION`/`EMPLOYMENT_VERIFICATION`) dentro do mesmo array `documentDirectoryEntryRecord[]`, seguindo a mesma estrutura de campos acima, com `documentContent.documentMetadata` e `documentContent.documentExtractedData` adaptados a cada tipo de documento.

### 3.2 Objecto: `documentDirectoryInstanceRecord`

| Campo                                | Tipo   | Descrição                                                                                                                                 |
| ------------------------------------ | ------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `documentDirectoryInstanceReference` | string | Identificador da instância do directório de documentos consultada.                                                                        |
| `documentDirectoryInstanceStatus`    | string | Estado da instância do directório (ex: `Active`).                                                                                         |
| `documentDirectoryConfiguration`     | object | Configuração do serviço documental (`documentServiceType`, `documentCategory`, `documentUpdateFrequency`, `documentMaintainerReference`). |
| `documentDirectoryEntryRecord[]`     | array  | Lista de entradas de documentos associadas à instância. Ver secção 3.3.                                                                   |

### 3.3 Objecto: `documentDirectoryEntryRecord[].documentEntryDetails`

| Campo                                                                      | Tipo                       | Descrição                                                                                                                                                         |
| -------------------------------------------------------------------------- | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `documentId`                                                               | string                     | Identificador único do documento.                                                                                                                                 |
| `documentType` / `documentSubType`                                         | string                     | Tipo e subtipo do documento (ex: `IDENTIFICATION` / `PASSPORT`).                                                                                                  |
| `documentName` / `documentDescription`                                     | string                     | Nome e descrição do documento.                                                                                                                                    |
| `documentStatus`                                                           | string                     | Estado do documento (ex: `VERIFIED`, `SIGNED`).                                                                                                                   |
| `documentFormat` / `documentMimeType`                                      | string                     | Formato do ficheiro e respectivo tipo MIME.                                                                                                                       |
| `documentSize`                                                             | integer                    | Tamanho do ficheiro em bytes.                                                                                                                                     |
| `documentVersion`                                                          | string                     | Versão do documento.                                                                                                                                              |
| `documentLanguage`                                                         | string                     | Idioma do documento.                                                                                                                                              |
| `documentClassification`                                                   | string                     | Classificação de confidencialidade.                                                                                                                               |
| `documentRetentionPeriod`                                                  | string (ISO 8601 duration) | Período de retenção do documento.                                                                                                                                 |
| `documentCreationDate` / `documentLastModifiedDate` / `documentExpiryDate` | string (ISO 8601)          | Datas de criação, última modificação e expiração do documento.                                                                                                    |
| `documentOwnership`                                                        | object                     | Dados do proprietário do documento (`documentOwnerReference`, `documentOwnerType`, `documentOwnerName`).                                                          |
| `documentLocation`                                                         | object                     | Localização de armazenamento, incluindo `documentDownloadUrl` para descarregar o ficheiro.                                                                        |
| `documentSecurity`                                                         | object                     | Estado de segurança do documento (`encryptionStatus`, `accessLevel`, `accessPermissions[]`, `digitalSignature`, checksums).                                       |
| `documentContent`                                                          | object                     | `documentData` (conteúdo binário, `null` quando não solicitado), `documentMetadata` e `documentExtractedData` — estrutura variável consoante o tipo de documento. |
| `documentCompliance`                                                       | object                     | Estado de conformidade regulatória (`complianceStatus`, `lastComplianceCheck`, `nextComplianceReview`, `retentionCompliance`, `privacyCompliance`).               |
| `documentWorkflow`                                                         | object                     | Estado corrente e histórico do fluxo de trabalho (`currentWorkflowState`, `workflowHistory[]`, `nextAction`, `workflowOwner`).                                    |

### 3.4 Objecto: `documentDirectoryRetrieveActionResponse`

| Campo                                            | Tipo   | Descrição                                        |
| ------------------------------------------------ | ------ | ------------------------------------------------ |
| `documentDirectoryRetrieveActionResponseCode`    | string | Código do resultado da operação (ex: `Success`). |
| `documentDirectoryRetrieveActionResponseMessage` | string | Mensagem descritiva do resultado da operação.    |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://selenium-4.gitbook.io/nexus-docs/docs/document-services/retrieve-document-information/main.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
