> For the complete documentation index, see [llms.txt](https://partner.doc.bunq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://partner.doc.bunq.com/documentation/bunq-as-a-service/chapter-7-compliance/attachment.md).

# Attachment

## Upload attachment

> Upload a file attachment for the provisioned user. The resulting attachment ID can then be\
> passed to \`PUT /user/{userId}/user-information-inquiry/{inquiryId}/partner-user-information-inquiry-entry/{entryId}\`\
> via \`all\_attachment\_id\` to submit documents for an inquiry entry.\
> \
> The request body is the \*\*raw binary content\*\* of the file. The content type and an\
> optional description are passed as headers, not in the body.\
> \
> \*\*Supported content types:\*\* \`image/png\`, \`image/jpeg\`, \`image/gif\`, \`application/pdf\`<br>

```json
{"openapi":"3.1.0","info":{"title":"bunq Partner API","version":"1.0.0"},"tags":[{"name":"User Management","description":"User onboarding and management"}],"servers":[{"url":"https://partner-api.sandbox.bunq.com","description":"Sandbox Partner API Server"},{"url":"https://api.partner.bunq.com","description":"Production Partner API Server"}],"security":[{"SessionAuth":[]},{"ClientSignature":[]}],"components":{"securitySchemes":{"SessionAuth":{"type":"apiKey","in":"header","name":"X-Bunq-Client-Authentication","description":"Session token received from POST /session-server"},"ClientSignature":{"type":"apiKey","in":"header","name":"X-Bunq-Client-Signature","description":"HMAC-SHA256 signature of request body using private key"}},"parameters":{"CacheControl":{"name":"Cache-Control","in":"header","required":false,"schema":{"type":"string","default":"no-cache"}},"UserAgent":{"name":"User-Agent","in":"header","required":false,"schema":{"type":"string"}},"BunqLanguage":{"name":"X-Bunq-Language","in":"header","required":false,"schema":{"type":"string","default":"en_US"}},"BunqRegion":{"name":"X-Bunq-Region","in":"header","required":false,"schema":{"type":"string","default":"NL"}},"BunqGeolocation":{"name":"X-Bunq-Geolocation","in":"header","required":false,"schema":{"type":"string"}},"BunqClientRequestId":{"name":"X-Bunq-Client-Request-Id","in":"header","required":false,"schema":{"type":"string"}},"BunqClientAuthentication":{"name":"X-Bunq-Client-Authentication","in":"header","required":true,"schema":{"type":"string","description":"Session token from POST /session-server"}},"BunqClientSignature":{"name":"X-Bunq-Client-Signature","in":"header","required":true,"schema":{"type":"string","description":"HMAC-SHA256 signature of request"}}},"schemas":{"Id":{"type":"object","properties":{"id":{"type":"integer","description":"The ID of the created resource"}}},"Error":{"type":"object","properties":{"Error":{"type":"array","items":{"type":"object","properties":{"error_description":{"type":"string"},"error_description_translated":{"type":"string"}}}}}}}},"paths":{"/user/{userId}/attachment":{"post":{"tags":["User Management"],"summary":"Upload attachment","description":"Upload a file attachment for the provisioned user. The resulting attachment ID can then be\npassed to `PUT /user/{userId}/user-information-inquiry/{inquiryId}/partner-user-information-inquiry-entry/{entryId}`\nvia `all_attachment_id` to submit documents for an inquiry entry.\n\nThe request body is the **raw binary content** of the file. The content type and an\noptional description are passed as headers, not in the body.\n\n**Supported content types:** `image/png`, `image/jpeg`, `image/gif`, `application/pdf`\n","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"integer"},"description":"ID of the provisioned user."},{"name":"X-Bunq-Attachment-Description","in":"header","required":false,"schema":{"type":"string"},"description":"Human-readable description of the attachment."},{"name":"Content-Type","in":"header","required":true,"schema":{"type":"string","enum":["image/png","image/jpeg","image/gif","application/pdf"]},"description":"MIME type of the uploaded file."},{"$ref":"#/components/parameters/CacheControl"},{"$ref":"#/components/parameters/UserAgent"},{"$ref":"#/components/parameters/BunqLanguage"},{"$ref":"#/components/parameters/BunqRegion"},{"$ref":"#/components/parameters/BunqGeolocation"},{"$ref":"#/components/parameters/BunqClientRequestId"},{"$ref":"#/components/parameters/BunqClientAuthentication"},{"$ref":"#/components/parameters/BunqClientSignature"}],"requestBody":{"required":true,"content":{"image/png":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/gif":{"schema":{"type":"string","format":"binary"}},"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"Attachment uploaded successfully. Returns the ID to use in inquiry entry submissions.","content":{"application/json":{"schema":{"type":"object","properties":{"Response":{"type":"array","items":{"type":"object","properties":{"Id":{"$ref":"#/components/schemas/Id"}}}}}}}}},"400":{"description":"Bad request — unsupported content type or missing body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Read attachment

> Retrieve metadata for a previously uploaded attachment.\
> Returns the attachment description, content type, and URLs to download the file.<br>

```json
{"openapi":"3.1.0","info":{"title":"bunq Partner API","version":"1.0.0"},"tags":[{"name":"User Management","description":"User onboarding and management"}],"servers":[{"url":"https://partner-api.sandbox.bunq.com","description":"Sandbox Partner API Server"},{"url":"https://api.partner.bunq.com","description":"Production Partner API Server"}],"security":[{"SessionAuth":[]},{"ClientSignature":[]}],"components":{"securitySchemes":{"SessionAuth":{"type":"apiKey","in":"header","name":"X-Bunq-Client-Authentication","description":"Session token received from POST /session-server"},"ClientSignature":{"type":"apiKey","in":"header","name":"X-Bunq-Client-Signature","description":"HMAC-SHA256 signature of request body using private key"}},"parameters":{"CacheControl":{"name":"Cache-Control","in":"header","required":false,"schema":{"type":"string","default":"no-cache"}},"UserAgent":{"name":"User-Agent","in":"header","required":false,"schema":{"type":"string"}},"BunqLanguage":{"name":"X-Bunq-Language","in":"header","required":false,"schema":{"type":"string","default":"en_US"}},"BunqRegion":{"name":"X-Bunq-Region","in":"header","required":false,"schema":{"type":"string","default":"NL"}},"BunqGeolocation":{"name":"X-Bunq-Geolocation","in":"header","required":false,"schema":{"type":"string"}},"BunqClientRequestId":{"name":"X-Bunq-Client-Request-Id","in":"header","required":false,"schema":{"type":"string"}},"BunqClientAuthentication":{"name":"X-Bunq-Client-Authentication","in":"header","required":true,"schema":{"type":"string","description":"Session token from POST /session-server"}},"BunqClientSignature":{"name":"X-Bunq-Client-Signature","in":"header","required":true,"schema":{"type":"string","description":"HMAC-SHA256 signature of request"}}}},"paths":{"/user/{userId}/attachment/{attachmentId}":{"get":{"tags":["User Management"],"summary":"Read attachment","description":"Retrieve metadata for a previously uploaded attachment.\nReturns the attachment description, content type, and URLs to download the file.\n","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"integer"},"description":"ID of the provisioned user."},{"name":"attachmentId","in":"path","required":true,"schema":{"type":"integer"},"description":"ID of the attachment to read."},{"$ref":"#/components/parameters/CacheControl"},{"$ref":"#/components/parameters/UserAgent"},{"$ref":"#/components/parameters/BunqLanguage"},{"$ref":"#/components/parameters/BunqRegion"},{"$ref":"#/components/parameters/BunqGeolocation"},{"$ref":"#/components/parameters/BunqClientRequestId"},{"$ref":"#/components/parameters/BunqClientAuthentication"},{"$ref":"#/components/parameters/BunqClientSignature"}],"responses":{"200":{"description":"Attachment metadata.","content":{"application/json":{"schema":{"type":"object","properties":{"Response":{"type":"array","items":{"type":"object","properties":{"AttachmentUser":{"type":"object","properties":{"id":{"type":"integer"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"},"attachment":{"type":"object","properties":{"description":{"type":"string"},"content_type":{"type":"string"},"urls":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"url":{"type":"string","format":"uri"}}}}}}}}}}}}}}}}}}}}}
```

#### If required, sometimes attachments need to be linked with onboarding for additional information via document type

**Endpoint**&#x20;

```http
POST /v1/user/{user_id}/document-identification
```

**Request**

```http
{
    "document_type": "CRYPTO_KYC_QUESTIONNAIRE",
    "document_country_of_issuance": "NL", // <- country of residence of the user
    "document_attachment_id": 1771,
    "document_back_attachment_id": 2067 // <- optional
}
```

**Response**

```http
{
    "Response": [
        {
            "Id": {
                "id": 261
            }
        }
    ]
}
```
