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

# Upload a KYB document for a legal entity

POST https://api.letsdeel.com/rest/legal-entities/{legal_entity_id}/kyb/documents
Content-Type: multipart/form-data

Stores one KYB document (a company document, a Proof of Authority, or one side of an identity document or selfie for a person of significant control) for a legal entity and returns an opaque handle. Reference the handle from `POST /rest/legal-entities/{legal_entity_id}/kyb`. Handles are bound to the legal entity, usable once, and expire after 24 hours if unused. The file itself is never returned.

**Token scopes**: `legal-entity:write`

**Beta**: this version requires the `X-Beta: true` request header and its contract may change before it is promoted to stable. It is scheduled to become stable on 2027-01-02.

Reference: https://developer.deel.com/api/reference/endpoints/legal-entities/upload-legal-entity-kyb-document-v-2026-10-02

## Authentication

- `Authorization` header (bearer token, required) — ## Authentication The Deel API uses bearer tokens to authenticate requests. All API calls must be made over HTTPS — calls over plain HTTP or without authentication will fail. ```curl curl -X GET 'https://api.letsdeel.com/rest/v2/contracts' \ -H 'Authorization: Bearer YOUR-TOKEN-HERE' ``` [Learn more about authentication](/api/authentication)
- `Authorization` header (bearer token, required) — Standard OAuth2 security scheme based on https://swagger.io/docs/specification/authentication/

## Servers

- `https://api.letsdeel.com/rest` (Production, default)
- `https://api-staging.letsdeel.com/rest` (Demo)

## Request

### Path parameters

- `legal_entity_id` (string, required) — Public id of the legal entity. The entity must belong to the authenticated organization; any other id answers 404.

### Body (multipart/form-data)

This endpoint expects a multipart form.

- `data` (LegalEntitiesLegalEntityIdKybDocumentsPostRequestBodyContentMultipartFormDataSchemaData, required)

## Response

### 201

The document was stored and registered for verification. Use the returned handle in a KYB submission.

- `data` (LegalEntitiesLegalEntityIdKybDocumentsPostResponsesContentApplicationJsonSchemaData, required)

## Errors

### 400 Bad Request Error

Bad request. No file was uploaded, or the multipart body could not be processed.

- `errors` (list of LegalEntitiesLegalEntityIdKybDocumentsPostResponsesContentApplicationJsonSchemaErrorsItems, required)

### 401 Unauthorized Error

Unauthorized. The request token is missing or invalid. The API gateway rejects an unauthenticated call before it reaches Deel; a call that reaches Deel without a valid session is rejected by the access middleware, whose error item carries a message and no code.

- `errors` (list of LegalEntitiesLegalEntityIdKybDocumentsPostResponsesContentApplicationJsonSchemaErrorsItems, required)

### 403 Forbidden Error

Forbidden. Codes: GENERIC_ERROR (the token lacks the `legal-entity:write` scope, or the actor cannot submit verification for this organization), KYB_SERVICE_ACCOUNT_MISSING (the organization has no service account to act as; contact Deel support).

- `errors` (list of LegalEntitiesLegalEntityIdKybDocumentsPostResponsesContentApplicationJsonSchemaErrorsItems, required)

### 404 Not Found Error

Not found. The legal entity does not exist or does not belong to the authenticated organization. The two cases are deliberately indistinguishable.

- `errors` (list of LegalEntitiesLegalEntityIdKybDocumentsPostResponsesContentApplicationJsonSchemaErrorsItems, required)

### 415 Unsupported Media Type Error

Unsupported media type. The file content type is not accepted for the given document type; `details.allowed` lists the accepted types.

- `errors` (list of LegalEntitiesLegalEntityIdKybDocumentsPostResponsesContentApplicationJsonSchemaErrorsItems, required)

### 422 Unprocessable Entity Error

Unprocessable. Codes: KYB_DOCUMENT_TYPE_INVALID (unknown `document_type`; `details.allowed` lists the accepted values), KYB_DOCUMENT_CLAIM_FAILED (the verification service refused the file; upload it again).

- `errors` (list of LegalEntitiesLegalEntityIdKybDocumentsPostResponsesContentApplicationJsonSchemaErrorsItems, required)

### 429 Too Many Requests Error

Too many requests. Either the per-organization upload rate limit was hit, or the legal entity already has 200 uploaded documents that no submission has used yet (code KYB_DOCUMENT_LIMIT_REACHED).

- `errors` (list of LegalEntitiesLegalEntityIdKybDocumentsPostResponsesContentApplicationJsonSchemaErrorsItems, required)

### 500 Internal Server Error

Operation failed.

- `request` (ApiErrorRequest, optional)
- `errors` (list of ApiError, optional)

## Types

### LegalEntitiesLegalEntityIdKybDocumentsPostResponsesContentApplicationJsonSchemaData

- `id` (string, required) — Opaque handle for the uploaded document. Pass it in the matching document field of `POST /rest/legal-entities/{legal_entity_id}/kyb`. Valid only for this legal entity, usable once, and expires if unused.
- `file_name` (string, required, nullable) — Original file name, when the upload carried one.
- `created_at` (string, required) — When the document was uploaded.
- `expires_at` (string, required) — When the handle stops being accepted if it has not been used in a submission.
- `content_type` (string, required) — MIME type of the stored file.
- `document_type` (enum, required) — The document type the file was uploaded as. The handle can only be used for this type.
  - Allowed values: `ARTICLES_OF_INCORPORATION`, `COMPANY_BANK_STATEMENT`, `CERTIFICATE_OF_GOOD_STANDING`, `ULTIMATE_BENEFICIAL_OWNER_FORM`, `PROOF_OF_AUTHORITY`, `IDENTITY_DOCUMENT_FRONT`, `IDENTITY_DOCUMENT_BACK`, `SELFIE`

### LegalEntitiesLegalEntityIdKybDocumentsPostResponsesContentApplicationJsonSchemaErrorsItems

- `code` (enum, required) — Machine-readable error code.
  - Allowed values: `KYB_DOCUMENT_LIMIT_REACHED`
- `message` (string, required) — Human-readable explanation of the error.
- `details` (LegalEntitiesLegalEntityIdKybDocumentsPostResponsesContentApplicationJsonSchemaErrorsItemsDetails, optional) — Which request field the error refers to and, for a content-type or document-type error, the accepted values.

### ApiErrorRequest

- `method` (string, optional) — The HTTP method of the failed request
- `url` (string, optional) — The relative URL of the failed request
- `status` (double, optional) — The status code of the response
- `api_req_id` (string, optional) — The request ID of the failed request
- `docs` (string, optional) — A link to the official documentation for the requested endpoint resource
- `source` (string, optional) — The source handler which produced the returned error
- `code` (double, optional) — The code of the source handler which produced the returned error

### ApiError

- `message` (string, optional) — A description of the returned error
- `path` (string, optional) — The JSON path where input validation failed

### LegalEntitiesLegalEntityIdKybDocumentsPostResponsesContentApplicationJsonSchemaErrorsItemsDetails

Which request field the error refers to and, for a content-type or document-type error, the accepted values.

- `key` (string, optional) — The request field the error refers to.
- `keys` (list of string, optional) — Every offending request field, for a multi-field error.
- `allowed` (list of string, optional) — Accepted values for the field.

## Examples

**Request**

```json
{
  "data": {
    "file": "<binary file content>",
    "document_type": "PROOF_OF_AUTHORITY"
  }
}
```

**Response**

```json
{
  "data": {
    "id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
    "file_name": "articles-of-incorporation.pdf",
    "created_at": "2026-09-15T10:00:00.000Z",
    "expires_at": "2026-09-16T10:00:00.000Z",
    "content_type": "application/pdf",
    "document_type": "ARTICLES_OF_INCORPORATION"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.letsdeel.com/rest/legal-entities/5f4a2c0e-6f1c-4a52-9c4e-1c8f1d2e3a4b/kyb/documents"

payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"data\"\r\n\r\n{\n  \"file\": \"<binary file content>\",\n  \"document_type\": \"PROOF_OF_AUTHORITY\"\n}\r\n-----011000010111000001101001--\r\n"
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "multipart/form-data; boundary=---011000010111000001101001"
}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.letsdeel.com/rest/legal-entities/5f4a2c0e-6f1c-4a52-9c4e-1c8f1d2e3a4b/kyb/documents';
const form = new FormData();
form.append('data', '{
  "file": "<binary file content>",
  "document_type": "PROOF_OF_AUTHORITY"
}');

const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.letsdeel.com/rest/legal-entities/5f4a2c0e-6f1c-4a52-9c4e-1c8f1d2e3a4b/kyb/documents"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"data\"\r\n\r\n{\n  \"file\": \"<binary file content>\",\n  \"document_type\": \"PROOF_OF_AUTHORITY\"\n}\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.letsdeel.com/rest/legal-entities/5f4a2c0e-6f1c-4a52-9c4e-1c8f1d2e3a4b/kyb/documents")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"data\"\r\n\r\n{\n  \"file\": \"<binary file content>\",\n  \"document_type\": \"PROOF_OF_AUTHORITY\"\n}\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.letsdeel.com/rest/legal-entities/5f4a2c0e-6f1c-4a52-9c4e-1c8f1d2e3a4b/kyb/documents")
  .header("Authorization", "Bearer <token>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"data\"\r\n\r\n{\n  \"file\": \"<binary file content>\",\n  \"document_type\": \"PROOF_OF_AUTHORITY\"\n}\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.letsdeel.com/rest/legal-entities/5f4a2c0e-6f1c-4a52-9c4e-1c8f1d2e3a4b/kyb/documents', [
  'multipart' => [
    [
        'name' => 'data',
        'contents' => '{
  "file": "<binary file content>",
  "document_type": "PROOF_OF_AUTHORITY"
}'
    ]
  ]
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.letsdeel.com/rest/legal-entities/5f4a2c0e-6f1c-4a52-9c4e-1c8f1d2e3a4b/kyb/documents");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"data\"\r\n\r\n{\n  \"file\": \"<binary file content>\",\n  \"document_type\": \"PROOF_OF_AUTHORITY\"\n}\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]
let parameters = [
  [
    "name": "data",
    "value": "{
  \"file\": \"<binary file content>\",
  \"document_type\": \"PROOF_OF_AUTHORITY\"
}"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://api.letsdeel.com/rest/legal-entities/5f4a2c0e-6f1c-4a52-9c4e-1c8f1d2e3a4b/kyb/documents")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```