# Download a rendition

Source: https://amanucci.com/nl/docs/developers/api/documents/getRendition

## GET /v1/entities/{entityId}/documents/{documentId}/renditions/{kind}

Download a rendition

Stream a finalized document's rendered bytes back, through the artifact port — the pre-gate send door: Peppol transmission is out of this slice, so the UBL DOWNLOADS and is sent by hand. The answer names its file, `Content-Disposition: attachment; filename="<docNo>.pdf|xml"`, the number's `/` as `-`. A DRAFT and an inbound document have no renditions and answer 404, as does a document in another entity: absence and 'not yours' are indistinguishable by construction.

Operation ID: `getRendition`

### Parameters

```json
[
  {
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "required": true,
    "name": "documentId",
    "in": "path"
  },
  {
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "required": true,
    "name": "entityId",
    "in": "path"
  },
  {
    "schema": {
      "type": "string",
      "enum": [
        "ubl",
        "pdf"
      ],
      "description": "Which rendering: the UBL a machine reads, or the PDF a person reads. Both are `evidence/` artifacts minted at finalize; a draft has neither."
    },
    "required": true,
    "description": "Which rendering: the UBL a machine reads, or the PDF a person reads. Both are `evidence/` artifacts minted at finalize; a draft has neither.",
    "name": "kind",
    "in": "path"
  }
]
```

### Responses

#### 200 The rendered bytes, with the rendering's own content type.

```json
{
  "application/pdf": {
    "schema": {
      "type": "string"
    }
  },
  "application/xml": {
    "schema": {
      "type": "string"
    }
  }
}
```

#### 401 Dead or absent credential (`unauthenticated`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 403 Authenticated, present, and refused: a missing grant, a missing seat, or a missing step-up.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 404 Absent, or hidden from this asker — the two are indistinguishable (`not-found`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 422 The request did not satisfy the schema (`invalid-input`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 429 Too many requests on this door's bucket (`rate-limited`); refused before any handler ran, `Retry-After` says when to come back.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 503 Temporarily unavailable; `Retry-After` says when to come back.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```
