> This page is for BaaS.

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

# Upload accreditation document (PDF)

POST https://tenant.api.corpx.com/v1/accreditations/{accreditationId}/documents
Content-Type: application/json

Registers a PDF slot and returns a presigned `uploadUrl` (HTTP `PUT`,
1 hour). Company kinds are PJ-only and allowed while status is
`PENDING_BIOMETRY`, `BIOMETRY_APPROVED`, or `PENDING_REVIEW`
(rejected for `FAILED` / `INTEGRATING` / `ACTIVE`).
`account_opening_terms` is optional for PF and PJ and stays accepted
until status is `ACTIVE` or `FAILED` (including `INTEGRATING`). After this `201`,
`PUT` the PDF bytes to `uploadUrl` before the URL expires. `sizeBytes`
is **required** and is part of the URL signature: the PUT must send
exactly that many bytes (max 50 MiB). A required slot does **not** fulfil
the documentary requirement — `GET` keeps that kind in `missingDocumentKinds`
until the object exists in the KYC archive with size > 0 (and, when
the sanitizer is on, after a successful scan). `kind=other` is capped
at 10 files per accreditation.

**Required kinds by `company.legalForm`:**
- `mei`, `ltda`: `company_articles`
- `sa`, `cooperative`: the above plus `cnpj_card`, `financial_statements`

Optional for all: `company_proof_of_address`, `business_license`,
`regulatory_license`, `account_opening_terms`, `other` (`other` allows
multiple files, max 10; `fileName` required). `account_opening_terms`
does not block account opening. Typed kinds are one-per-accreditation
(re-upload replaces). Document freshness (e.g. proof of address) is
checked by the CorpX operator during review, who may still request it.

Upload in parallel with biometrics. Missing required kinds block
operator approve unless they set `forceIncompleteDocuments` (audited).
**BaaS integrators only.**

**Centralized biometry tenants:** there is no `uploadUrl`. Send the
PDF in `contentBase64` (up to 4 MB) and it is forwarded to the
tenant's KYC. Only `company_articles`, `company_proof_of_address` and
`financial_statements` are accepted; the response is `201` with
`deliveryStatus: forwarded`.


Reference: https://en.docs.api.corpx.com/baas/referencia/accreditations/upload-accreditation-document

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `accreditationId` (string, required) — Accreditation (onboarding) identifier returned on creation.

### Headers

- `X-Tenant-Id` (string, required) — Tenant context used for authorization and routing.
- `Idempotency-Key` (string, optional) — Optional client-generated idempotency token (recommended for safe retries).

### Body (application/json)

This endpoint expects an AccreditationDocumentUploadRequest.

- `kind` (enum, required)
  - Allowed values: `company_articles`, `company_proof_of_address`, `cnpj_card`, `financial_statements`, `business_license`, `regulatory_license`, `account_opening_terms`, `other`
- `sizeBytes` (long, required) — Actual PDF size in bytes (max 50 MiB). Part of the upload URL signature.
- `fileName` (string, optional) — Required when kind=`other` (shown to reviewers).
- `contentType` (enum, optional, default: application/pdf)
  - Allowed values: `application/pdf`
- `contentBase64` (string, optional) — Centralized biometry tenants only. The PDF itself, base64, up to 4 MB decoded. Forwarded to the tenant's KYC instead of returning an upload URL.

## Response

### 201

Document slot created; upload the PDF via `uploadUrl`.

- `documentId` (string, optional)
- `kind` (enum, optional)
  - Allowed values: `company_articles`, `company_proof_of_address`, `cnpj_card`, `financial_statements`, `business_license`, `regulatory_license`, `account_opening_terms`, `other`
- `uploadUrl` (string, optional) — Presigned S3 URL — PUT exactly sizeBytes bytes with the same Content-Type.
- `uploadExpiresAt` (datetime, optional)
- `sizeBytes` (long, optional)
- `deliveryStatus` (enum, optional) — Slot only. The kind stays in missingDocumentKinds until the object is in the KYC archive.
  - Allowed values: `pending_upload`
- `scanStatus` (enum, optional) — Uploads are archived only after real type detection, antivirus and sanitization (the PDF is rasterized), which takes a few seconds. Infected, corrupted or unexpected-type files are rejected and shown as rejected in the operator review.
  - Allowed values: `PENDING`
- `info` (string, optional) — Human readable note about the signed PUT and scanning step.

## Errors

### 400 Bad Request Error

Invalid request sent by client.

- `errorCode` (string, required) — Stable machine-readable code. See `ErrorCode` for the known values.
- `message` (string, required) — Human-readable explanation (pt-BR). Presentation only; may change.
- `docs` (string, optional) — Link to this code in the public error catalogue.
- `requestId` (string, optional) — Gateway request id. Quote it when contacting support.
- `details` (map from string to any, optional) — Optional machine-readable context for the specific `errorCode` (for example `kind` on `identity_verification_monthly_limit_exceeded`, `maxBytes` on `payload_too_large`, `attemptsRemaining` on `facetec_attempts_exhausted`). Keys are documented per operation; absent when the code carries no extra context.
- `partner` (ErrorResponsePartner, optional) — Raw error from the settlement bank, when the failure came from it. Diagnostic only.

### 404 Not Found Error

Accreditation not found for this tenant.

- `errorCode` (string, required) — Stable machine-readable code. See `ErrorCode` for the known values.
- `message` (string, required) — Human-readable explanation (pt-BR). Presentation only; may change.
- `docs` (string, optional) — Link to this code in the public error catalogue.
- `requestId` (string, optional) — Gateway request id. Quote it when contacting support.
- `details` (map from string to any, optional) — Optional machine-readable context for the specific `errorCode` (for example `kind` on `identity_verification_monthly_limit_exceeded`, `maxBytes` on `payload_too_large`, `attemptsRemaining` on `facetec_attempts_exhausted`). Keys are documented per operation; absent when the code carries no extra context.
- `partner` (ErrorResponsePartner, optional) — Raw error from the settlement bank, when the failure came from it. Diagnostic only.

### 409 Conflict Error

Accreditation status does not allow uploads.

- `errorCode` (string, required) — Stable machine-readable code. See `ErrorCode` for the known values.
- `message` (string, required) — Human-readable explanation (pt-BR). Presentation only; may change.
- `docs` (string, optional) — Link to this code in the public error catalogue.
- `requestId` (string, optional) — Gateway request id. Quote it when contacting support.
- `details` (map from string to any, optional) — Optional machine-readable context for the specific `errorCode` (for example `kind` on `identity_verification_monthly_limit_exceeded`, `maxBytes` on `payload_too_large`, `attemptsRemaining` on `facetec_attempts_exhausted`). Keys are documented per operation; absent when the code carries no extra context.
- `partner` (ErrorResponsePartner, optional) — Raw error from the settlement bank, when the failure came from it. Diagnostic only.

### 413 Content Too Large Error

PDF above 50 MiB.

- `errorCode` (string, required) — Stable machine-readable code. See `ErrorCode` for the known values.
- `message` (string, required) — Human-readable explanation (pt-BR). Presentation only; may change.
- `docs` (string, optional) — Link to this code in the public error catalogue.
- `requestId` (string, optional) — Gateway request id. Quote it when contacting support.
- `details` (map from string to any, optional) — Optional machine-readable context for the specific `errorCode` (for example `kind` on `identity_verification_monthly_limit_exceeded`, `maxBytes` on `payload_too_large`, `attemptsRemaining` on `facetec_attempts_exhausted`). Keys are documented per operation; absent when the code carries no extra context.
- `partner` (ErrorResponsePartner, optional) — Raw error from the settlement bank, when the failure came from it. Diagnostic only.

### 422 Unprocessable Entity Error

Invalid kind, non-PDF contentType, missing sizeBytes, or too many `other` files.

- `errorCode` (string, required) — Stable machine-readable code. See `ErrorCode` for the known values.
- `message` (string, required) — Human-readable explanation (pt-BR). Presentation only; may change.
- `docs` (string, optional) — Link to this code in the public error catalogue.
- `requestId` (string, optional) — Gateway request id. Quote it when contacting support.
- `details` (map from string to any, optional) — Optional machine-readable context for the specific `errorCode` (for example `kind` on `identity_verification_monthly_limit_exceeded`, `maxBytes` on `payload_too_large`, `attemptsRemaining` on `facetec_attempts_exhausted`). Keys are documented per operation; absent when the code carries no extra context.
- `partner` (ErrorResponsePartner, optional) — Raw error from the settlement bank, when the failure came from it. Diagnostic only.

### 500 Internal Server Error

Unexpected server error.

- `errorCode` (string, required) — Stable machine-readable code. See `ErrorCode` for the known values.
- `message` (string, required) — Human-readable explanation (pt-BR). Presentation only; may change.
- `docs` (string, optional) — Link to this code in the public error catalogue.
- `requestId` (string, optional) — Gateway request id. Quote it when contacting support.
- `details` (map from string to any, optional) — Optional machine-readable context for the specific `errorCode` (for example `kind` on `identity_verification_monthly_limit_exceeded`, `maxBytes` on `payload_too_large`, `attemptsRemaining` on `facetec_attempts_exhausted`). Keys are documented per operation; absent when the code carries no extra context.
- `partner` (ErrorResponsePartner, optional) — Raw error from the settlement bank, when the failure came from it. Diagnostic only.

## Types

### ErrorResponsePartner

Raw error from the settlement bank, when the failure came from it. Diagnostic only.

- `code` (string, optional)
- `message` (string, optional)
- `field` (string, optional) — Field the partner pointed at, when any.

## Examples

**Request**

```json
{
  "kind": "company_articles",
  "sizeBytes": 50,
  "fileName": "MARIA DA SILVA",
  "contentType": "application/pdf"
}
```

**Response**

```json
{
  "documentId": "doc_a1b2c3d4e5f6",
  "kind": "company_articles",
  "uploadUrl": "https://example.com/webhooks/corpx",
  "uploadExpiresAt": "2026-02-20T08:33:39Z",
  "sizeBytes": 50,
  "deliveryStatus": "pending_upload",
  "scanStatus": "PENDING",
  "info": "Pagamento pedido #12345"
}
```

**SDK Code**

```python Accreditations_uploadAccreditationDocument_example
import requests

url = "https://tenant.api.corpx.com/v1/accreditations/accreditationId/documents"

payload = {
    "kind": "company_articles",
    "sizeBytes": 50,
    "fileName": "MARIA DA SILVA",
    "contentType": "application/pdf"
}
headers = {
    "X-Tenant-Id": "X-Tenant-Id",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Accreditations_uploadAccreditationDocument_example
const url = 'https://tenant.api.corpx.com/v1/accreditations/accreditationId/documents';
const options = {
  method: 'POST',
  headers: {
    'X-Tenant-Id': 'X-Tenant-Id',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"kind":"company_articles","sizeBytes":50,"fileName":"MARIA DA SILVA","contentType":"application/pdf"}'
};

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

```go Accreditations_uploadAccreditationDocument_example
package main

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

func main() {

	url := "https://tenant.api.corpx.com/v1/accreditations/accreditationId/documents"

	payload := strings.NewReader("{\n  \"kind\": \"company_articles\",\n  \"sizeBytes\": 50,\n  \"fileName\": \"MARIA DA SILVA\",\n  \"contentType\": \"application/pdf\"\n}")

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

	req.Header.Add("X-Tenant-Id", "X-Tenant-Id")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

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

url = URI("https://tenant.api.corpx.com/v1/accreditations/accreditationId/documents")

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

request = Net::HTTP::Post.new(url)
request["X-Tenant-Id"] = 'X-Tenant-Id'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"kind\": \"company_articles\",\n  \"sizeBytes\": 50,\n  \"fileName\": \"MARIA DA SILVA\",\n  \"contentType\": \"application/pdf\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://tenant.api.corpx.com/v1/accreditations/accreditationId/documents")
  .header("X-Tenant-Id", "X-Tenant-Id")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"kind\": \"company_articles\",\n  \"sizeBytes\": 50,\n  \"fileName\": \"MARIA DA SILVA\",\n  \"contentType\": \"application/pdf\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://tenant.api.corpx.com/v1/accreditations/accreditationId/documents', [
  'body' => '{
  "kind": "company_articles",
  "sizeBytes": 50,
  "fileName": "MARIA DA SILVA",
  "contentType": "application/pdf"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'X-Tenant-Id' => 'X-Tenant-Id',
  ],
]);

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

```csharp Accreditations_uploadAccreditationDocument_example
using RestSharp;

var client = new RestClient("https://tenant.api.corpx.com/v1/accreditations/accreditationId/documents");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Tenant-Id", "X-Tenant-Id");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"kind\": \"company_articles\",\n  \"sizeBytes\": 50,\n  \"fileName\": \"MARIA DA SILVA\",\n  \"contentType\": \"application/pdf\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Accreditations_uploadAccreditationDocument_example
import Foundation

let headers = [
  "X-Tenant-Id": "X-Tenant-Id",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "kind": "company_articles",
  "sizeBytes": 50,
  "fileName": "MARIA DA SILVA",
  "contentType": "application/pdf"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://tenant.api.corpx.com/v1/accreditations/accreditationId/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()
```