# Retrieve a document (/docs/api-reference/documents/get)

`GET https://druckling-nine.vercel.app/v1/documents/{id}`

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |

## Response 200: OK

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "object": {
      "const": "document"
    },
    "status": {
      "enum": [
        "queued",
        "rendering",
        "rendered",
        "failed",
        "expired"
      ],
      "type": "string"
    },
    "template": {
      "type": "string"
    },
    "version": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "filename": {
      "type": "string"
    },
    "format": {
      "enum": [
        "pdf",
        "png",
        "xml"
      ],
      "type": "string",
      "description": "`xml` for XRechnung and Peppol BIS e-invoices."
    },
    "content_type": {
      "type": "string",
      "description": "`application/pdf`, `image/png` or `application/xml`."
    },
    "image": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "page": {
              "type": "number",
              "description": "The page that was rendered (1-based)."
            },
            "scale": {
              "type": "number",
              "description": "Pixels per point: 2 = 144 dpi."
            },
            "width": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Pixel width, once rendered."
            },
            "height": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Pixel height, once rendered."
            }
          },
          "required": [
            "page",
            "scale",
            "width",
            "height"
          ]
        },
        {
          "type": "null"
        }
      ],
      "description": "Set for `png` documents."
    },
    "pages": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "description": "Pages in the file (a PNG is one page; null for XML)."
    },
    "size_bytes": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Signed download URL while the document is retained."
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "field": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "code",
            "message",
            "field"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "einvoice": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "format": {
              "enum": [
                "factur-x",
                "xrechnung",
                "peppol"
              ],
              "type": "string",
              "description": "`factur-x`: Factur-X 1.0 / ZUGFeRD 2.x hybrid invoice, a PDF/A-3 with the CII XML embedded. `xrechnung`: XRechnung 3.0 (German CIUS) as XML. `peppol`: Peppol BIS Billing 3.0 as UBL XML."
            },
            "syntax": {
              "enum": [
                "cii",
                "ubl"
              ],
              "type": "string",
              "description": "XML syntax: UN/CEFACT CII (Factur-X, XRechnung on request) or OASIS UBL 2.1 (XRechnung default, Peppol)."
            },
            "profile": {
              "type": "string",
              "description": "`EN 16931`, `XRechnung 3.0` or `Peppol BIS Billing 3.0`."
            },
            "customization_id": {
              "type": "string",
              "description": "Specification identifier (BT-24) written into the XML."
            },
            "attachment": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "File name of the XML embedded in the PDF; null when the document is the XML itself."
            }
          },
          "required": [
            "format",
            "syntax",
            "profile",
            "customization_id",
            "attachment"
          ]
        },
        {
          "type": "null"
        }
      ],
      "description": "Set when the document is or carries an e-invoice (templates with e-invoicing on)."
    },
    "batch": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "index": {
              "type": "number",
              "description": "Position of the item in the batch's `items`."
            }
          },
          "required": [
            "id",
            "index"
          ]
        },
        {
          "type": "null"
        }
      ],
      "description": "Set for documents rendered as part of a batch."
    },
    "language": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Language the document was rendered in (one of the template's `languages`); null for documents rendered before templates had languages."
    },
    "signature": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "certificate": {
              "type": "string",
              "description": "Id of the workspace certificate that signed the PDF."
            },
            "certificate_name": {
              "type": "string"
            },
            "subject": {
              "type": "string",
              "description": "The signer, from the certificate."
            },
            "level": {
              "enum": [
                "B-B",
                "B-T"
              ],
              "type": "string",
              "description": "PAdES baseline level (ETSI EN 319 142-1): `B-T` carries a trusted timestamp from a timestamp authority, `B-B` does not."
            },
            "signed_at": {
              "type": "string",
              "format": "date-time"
            },
            "test_certificate": {
              "type": "boolean",
              "description": "Signed with a Druckling test certificate, which proves nothing about the signer."
            }
          },
          "required": [
            "certificate",
            "certificate_name",
            "subject",
            "level",
            "signed_at",
            "test_certificate"
          ]
        },
        {
          "type": "null"
        }
      ],
      "description": "Set when the PDF carries a digital signature (PAdES) applied by Druckling."
    },
    "storage": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "bucket": {
              "type": "string",
              "description": "Id of the bucket connection (Storage page)."
            },
            "status": {
              "enum": [
                "pending",
                "delivered",
                "failed"
              ],
              "type": "string",
              "description": "`pending` until the file is uploaded (retried with backoff for about 2.5 hours), then `delivered` or `failed`."
            },
            "key": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Object key in your bucket, from the bucket's path template."
            },
            "error": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "What the bucket answered on the last failed attempt, e.g. `403 AccessDenied: Access Denied`."
            },
            "attempts": {
              "type": "number"
            },
            "delivered_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "bucket",
            "status",
            "key",
            "error",
            "attempts",
            "delivered_at"
          ]
        },
        {
          "type": "null"
        }
      ],
      "description": "Set when the document is also copied to your own S3-compatible bucket (request `storage`, or the template's bucket rule)."
    },
    "test_mode": {
      "type": "boolean"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "id",
    "object",
    "status",
    "template",
    "version",
    "filename",
    "format",
    "content_type",
    "image",
    "pages",
    "size_bytes",
    "url",
    "expires_at",
    "error",
    "einvoice",
    "batch",
    "language",
    "signature",
    "storage",
    "test_mode",
    "created_at"
  ]
}
```