---
search:
  tags:
    - Files
    - POST
seo:
  description: >-
    Uploads a file as base64 and optionally links it to users or organisations.
    Reference for the POST /api/v1/{app_id}/files/upload endpoint in the
    Customers API.
sidebar:
  label: Upload a file
  badge: POST
title: Upload a file
type: openapi-operation
---
Uploads a file as base64 and optionally links it to users or organisations

`POST /api/v1/{app_id}/files/upload`

**Request body** (`application/json`, required)

File upload data

- `base64_encoded_image` (string, required)
- `custom_fields` (object)
- `filename` (string)
- `order_reference` (string)
- `organisation_number` (string)
- `relationship_ids` (string[])

Request body example:

```json
{
  "base64_encoded_image": "string",
  "custom_fields": {
    "property1": null,
    "property2": null
  },
  "filename": "string",
  "order_reference": "string",
  "organisation_number": "string",
  "relationship_ids": [
    "string"
  ]
}
```

**Responses**

- `201` — Created
- `400` — Invalid request
- `500` — Internal server error

Response example, 201:

```json
{
  "app_id": "string",
  "content_type": "string",
  "created_at": "string",
  "custom_fields": {
    "property1": null,
    "property2": null
  },
  "filename": "string",
  "id": "string",
  "updated_at": "string",
  "url": "string"
}
```
