> This page is for Spain Public Administration Flow.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://infonite.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://infonite.dev/_mcp/server.

# Attachments

**Where it lives:** on every result that carries documents — e.g.
`data.employment.labor_check.attachments` — and listed session-wide by the attachments
endpoint.

Many results carry the **original documents** they were extracted from — official PDF reports,
receipts — as attachments. The result itself only carries the attachment's description; the
bytes are downloaded separately through the session's attachments endpoint using the
attachment's `id`, so payloads stay light and you fetch only the files you need.

Attachments follow the session's lifetime: download what you want to keep while the session is
available.

### Schema (`FileAttachmentSchema`)

A document attached to a result — an official report, a receipt, an invoice... The entry
describes the file; its bytes are downloaded with `id`, through the attachments endpoint of the
API that returned the result.

```yaml
components:
  schemas:
    ProductAttachmentType:
      type: string
      enum:
        - attachment:attachment
        - attachment:supplier_invoice
        - attachment:client_invoice
        - attachment:es-tgss-life-report
        - attachment:es-tgss-contribution-base-report
        - attachment:es-aeat-model-100
        - attachment:es-cirbe-report
        - attachment:sepa-direct-debit-bill
        - attachment:person-certified-photo
      description: Product Attachment Type
      title: ProductAttachmentType
    FileAttachmentSchema:
      type: object
      properties:
        product:
          type: string
          enum:
            - attachment
          default: attachment
          description: The product type identifier. Always `attachment`.
        sub_family:
          $ref: '#/components/schemas/ProductAttachmentType'
          description: >-
            What kind of document this is (e.g.
            `attachment:es-tgss-life-report`).
        id:
          type: string
          format: object-id
          description: >-
            Attachment identifier — what the attachments endpoint of the API
            that returned the result

            takes to download the file.
        content_name:
          type: string
          description: File name of the document.
        content_hash:
          type: string
          description: Fingerprint of the content, to verify its integrity.
        content_type:
          type: string
          format: mime-type
          description: MIME type of the content.
        metadata:
          type: object
          additionalProperties:
            description: Any type
          description: >-
            Extra facts about the document, as simple key-value pairs (e.g. its
            official verification

            code, its issue date).
      required:
        - sub_family
        - id
        - content_name
        - content_type
        - metadata
      title: FileAttachmentSchema
```

## Document kinds

`sub_family` tells you what each document is:

### Schema (`ProductAttachmentType`)

Product Attachment Type

```yaml
components:
  schemas:
    ProductAttachmentType:
      type: string
      enum:
        - attachment:attachment
        - attachment:supplier_invoice
        - attachment:client_invoice
        - attachment:es-tgss-life-report
        - attachment:es-tgss-contribution-base-report
        - attachment:es-aeat-model-100
        - attachment:es-cirbe-report
        - attachment:sepa-direct-debit-bill
        - attachment:person-certified-photo
      title: ProductAttachmentType
```

## Signed documents

Some documents carry their issuer's digital signature. The Banco de España's risk report (`attachment:es-cirbe-report`) is one of them, and its signature is checked against the Banco de España's own certificates before the report reaches you. The verdict travels in the attachment's `metadata`; a report whose check fails is still delivered, with the reason.

| Key                               | What it says                                                                                                                                      |
| :-------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------ |
| `signature-verified`              | `true` only when the signature is valid: the document is the one the Banco de España signed, untouched since.                                     |
| `signature-status`                | `valid`, `invalid`, `unsigned` or `unsupported`.                                                                                                  |
| `signature-signer`                | Who signed, as their certificate states it — the Banco de España's Central de Información de Riesgos. Valid signatures only.                      |
| `signature-organization`          | The signer's organization: `BANCO DE ESPAÑA`. Valid signatures only.                                                                              |
| `signature-date`                  | When the document was signed. Valid signatures only.                                                                                              |
| `signature-certificate-authority` | The Banco de España certificate authority the signature was verified up to. Valid signatures only.                                                |
| `signature-failure`               | Why the check failed, when it did — `digest_mismatch` (the content changed after signing), `untrusted_chain` (not signed by the Banco de España)… |