> This page is for API, version 2026-01-01 (Stable) (default).
> For other versions, use one of these documentation indexes:
> - 2026-01-01 (Stable) (default): https://developer.deel.com/api/stable/llms.txt

> 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 document for an EDD request of a legal entity

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

Stores one document answering a `DOCUMENT_UPLOAD` question of the open enhanced due diligence (EDD) request of a legal entity, and returns an opaque handle. Reference the handle from `POST /rest/legal-entities/{legal_entity_id}/kyb/edd`. Handles are bound to the legal entity, the EDD request and the question, 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-14.

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

## 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.

### Headers

- `X-Beta` (enum, required, default: true) — Opts in to the beta version of this endpoint. Must be `true`.
  - Allowed values: `true`

### Body (multipart/form-data)

This endpoint expects a multipart form.

- `data` (LegalEntitiesLegalEntityIdKybEddDocumentsPostRequestBodyContentMultipartFormDataSchemaData, required)

## Response

### 201

The document was stored. Use the returned handle in an EDD answer.

- `data` (LegalEntitiesLegalEntityIdKybEddDocumentsPostResponsesContentApplicationJsonSchemaData, required)

## Errors

### 400 Bad Request Error

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

- `errors` (list of LegalEntitiesLegalEntityIdKybEddDocumentsPostResponsesContentApplicationJsonSchemaErrorsItems, 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 LegalEntitiesLegalEntityIdKybEddDocumentsPostResponsesContentApplicationJsonSchemaErrorsItems, 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 LegalEntitiesLegalEntityIdKybEddDocumentsPostResponsesContentApplicationJsonSchemaErrorsItems, 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 LegalEntitiesLegalEntityIdKybEddDocumentsPostResponsesContentApplicationJsonSchemaErrorsItems, required)

### 409 Conflict Error

Conflict. Codes: KYB_EDD_NOT_OPEN (the entity is not in EDD, or the request was already answered), KYB_EDD_REQUEST_MISMATCH (`edd_request_id` is not the open request; read the KYB state again).

- `errors` (list of LegalEntitiesLegalEntityIdKybEddDocumentsPostResponsesContentApplicationJsonSchemaErrorsItems, required)

### 415 Unsupported Media Type Error

Unsupported media type. The file content type is not accepted; `details.allowed` lists the accepted types (application/pdf, image/jpeg, image/png).

- `errors` (list of LegalEntitiesLegalEntityIdKybEddDocumentsPostResponsesContentApplicationJsonSchemaErrorsItems, required)

### 422 Unprocessable Entity Error

Unprocessable. Codes: KYB_EDD_DOCUMENT_QUESTION_INVALID (`question_key` is not a `DOCUMENT_UPLOAD` question of the open EDD request), KYB_EDD_DOCUMENT_CLAIM_FAILED (the verification service refused the file; upload it again).

- `errors` (list of LegalEntitiesLegalEntityIdKybEddDocumentsPostResponsesContentApplicationJsonSchemaErrorsItems, required)

### 429 Too Many Requests Error

Too many requests. Either the per-organization upload rate limit was hit, or the EDD request already has 500 uploaded documents that no answer has used yet (code KYB_EDD_DOCUMENT_LIMIT_REACHED).

- `errors` (list of LegalEntitiesLegalEntityIdKybEddDocumentsPostResponsesContentApplicationJsonSchemaErrorsItems, required)

### 500 Internal Server Error

Operation failed.

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

### 503 Service Unavailable Error

Service unavailable. The EDD request or its form could not be read, so the question could not be checked. The file was not stored; retry later.

- `errors` (list of LegalEntitiesLegalEntityIdKybEddDocumentsPostResponsesContentApplicationJsonSchemaErrorsItems, required)

## Types

### LegalEntitiesLegalEntityIdKybEddDocumentsPostResponsesContentApplicationJsonSchemaData

- `id` (string, required) — Opaque handle for the uploaded document. Pass it in the matching answer of `POST /rest/legal-entities/{legal_entity_id}/kyb/edd`. Valid only for this legal entity, EDD request and question, usable once, and expires if unused.
- `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 an answer.
- `question_key` (string, required) — The EDD question key the file was uploaded for. The handle can only be used for this question.

### LegalEntitiesLegalEntityIdKybEddDocumentsPostResponsesContentApplicationJsonSchemaErrorsItems

- `code` (enum, required) — Machine-readable error code.
  - Allowed values: `KYB_VERIFICATION_UNAVAILABLE`
- `message` (string, required) — Human-readable explanation of the error.
- `details` (LegalEntitiesLegalEntityIdKybEddDocumentsPostResponsesContentApplicationJsonSchemaErrorsItemsDetails, 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

### LegalEntitiesLegalEntityIdKybEddDocumentsPostResponsesContentApplicationJsonSchemaErrorsItemsDetails

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>",
    "question_key": "q7",
    "edd_request_id": "0b8f3e0a-6c2d-4f0e-9d3b-2a1f5c7e9b41"
  }
}
```

**Response**

```json
{
  "data": {
    "id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
    "created_at": "2026-09-15T10:00:00.000Z",
    "expires_at": "2026-09-16T10:00:00.000Z",
    "question_key": "q7"
  }
}
```

**SDK Code**

```python
import requests

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

payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"data\"\r\n\r\n{\n  \"file\": \"<binary file content>\",\n  \"question_key\": \"q7\",\n  \"edd_request_id\": \"0b8f3e0a-6c2d-4f0e-9d3b-2a1f5c7e9b41\"\n}\r\n-----011000010111000001101001--\r\n"
headers = {
    "X-Beta": "true",
    "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/edd/documents';
const form = new FormData();
form.append('data', '{
  "file": "<binary file content>",
  "question_key": "q7",
  "edd_request_id": "0b8f3e0a-6c2d-4f0e-9d3b-2a1f5c7e9b41"
}');

const options = {method: 'POST', headers: {'X-Beta': 'true', 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/edd/documents"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"data\"\r\n\r\n{\n  \"file\": \"<binary file content>\",\n  \"question_key\": \"q7\",\n  \"edd_request_id\": \"0b8f3e0a-6c2d-4f0e-9d3b-2a1f5c7e9b41\"\n}\r\n-----011000010111000001101001--\r\n")

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

	req.Header.Add("X-Beta", "true")
	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/edd/documents")

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

request = Net::HTTP::Post.new(url)
request["X-Beta"] = 'true'
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"data\"\r\n\r\n{\n  \"file\": \"<binary file content>\",\n  \"question_key\": \"q7\",\n  \"edd_request_id\": \"0b8f3e0a-6c2d-4f0e-9d3b-2a1f5c7e9b41\"\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/edd/documents")
  .header("X-Beta", "true")
  .header("Authorization", "Bearer <token>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"data\"\r\n\r\n{\n  \"file\": \"<binary file content>\",\n  \"question_key\": \"q7\",\n  \"edd_request_id\": \"0b8f3e0a-6c2d-4f0e-9d3b-2a1f5c7e9b41\"\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/edd/documents', [
  'multipart' => [
    [
        'name' => 'data',
        'contents' => '{
  "file": "<binary file content>",
  "question_key": "q7",
  "edd_request_id": "0b8f3e0a-6c2d-4f0e-9d3b-2a1f5c7e9b41"
}'
    ]
  ]
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'X-Beta' => 'true',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.letsdeel.com/rest/legal-entities/5f4a2c0e-6f1c-4a52-9c4e-1c8f1d2e3a4b/kyb/edd/documents");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Beta", "true");
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  \"question_key\": \"q7\",\n  \"edd_request_id\": \"0b8f3e0a-6c2d-4f0e-9d3b-2a1f5c7e9b41\"\n}\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-Beta": "true",
  "Authorization": "Bearer <token>"
]
let parameters = [
  [
    "name": "data",
    "value": "{
  \"file\": \"<binary file content>\",
  \"question_key\": \"q7\",
  \"edd_request_id\": \"0b8f3e0a-6c2d-4f0e-9d3b-2a1f5c7e9b41\"
}"
  ]
]

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/edd/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()
```