# Submit Documents API

Submit a document or set of documents on behalf of an end user.  An end user may be of account type `individual` or `corporate`.

<table data-header-hidden><thead><tr><th width="74.8046875" align="center"></th><th></th></tr></thead><tbody><tr><td align="center"><mark style="color:blue;"><strong>POST</strong></mark> </td><td>https://api.sfox.com/v1/files/verification</td></tr></tbody></table>

***

#### Overview

This API allows Connect partners to submit one or more documents on behalf of an `individual` or `corporate` account. &#x20;

The following steps provide an overview of how to do so:

1. First, you must obtain a User Auth Token, as that is going to be used during authorization when calling POST `/files/verification`.  You can obtain a User Auth Token using [this](https://docs.sfox.com/connect/rest-api/create-user-auth-token#request) endpoint.
2. Then, you must obtain the sFOX-provided `id` that corresponds to the end user for which you are submitting documents.  You can obtain the proper `id` by calling the GET `user/{user_id}` [endpoint](https://docs.sfox.com/connect/rest-api/end-users/get-end-user).

{% hint style="info" %}
When uploading documents related to the `corporate` entity itself - such as a `business_formation` document, you should use the `id` of a beneficial owner within the account. &#x20;

Providing this `id` will ensure documents flow into the sFOX system properly for our review.
{% endhint %}

3. You now have the necessary information to call the `/files/verification` endpoint to submit documents.  A few notes:
   1. The request should use  `form-data` encoding.
   2. There are two `field names` that must exist as part of the request: `data` and `files`.&#x20;
      1. The `data` field includes the JSON encoded payload as defined below.
      2. The `files` field is an array of files that are binary encoded.

{% hint style="success" %}
**Regarding document context**

A document is of a certain type, such as a `passport` or `ownership_chart`.  Additionally a document is submitted to sFOX for a purpose; that purpose is to fulfill one or more `requirements`. \
\
This structure allows the sFOX team to obtain contextual information about the documents submitted and review them with that knowledge in-hand.
{% endhint %}

#### Request Fields

The `data` field includes a JSON payload with the below attributes:

<table><thead><tr><th width="193.625">Parameter</th><th width="138.109375">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>filename</code> <mark style="color:red;">required</mark></td><td>string</td><td>The name of the file being uploaded, including the extension.  This must match the name of the file in the <code>files</code> key.  <br><br>Example: <code>funding-overview.png</code></td></tr><tr><td><code>document_type</code> <mark style="color:red;">required</mark></td><td>string</td><td>Must be one of the following: <code>passport</code>, <code>drivers_license_front</code>, <code>drivers_license_back</code>, <code>state_provincial_id_front</code>, <code>state_provincial_id_back</code>, <code>national_id_front</code>, <code>national_id_back</code>, <code>military_id</code>, <code>matriculate_id</code>, <code>visa</code>, <code>bank_statement</code>, <code>utility_bill</code>, <code>payslip</code>, <code>business_formation</code>, <code>ownership_chart</code>, <code>ownership_information</code>, <code>flow_of_funds</code>, <code>directors_register</code>, <code>aml_policy</code>, <code>shareholder_register</code>, <code>evidence_of_good_standing</code>, <code>marketing_materials</code>, <code>tax_id</code>, <code>e_signature_agreement</code>, <code>balance_sheet</code>, <code>financials</code>, <code>taxes</code>, <code>other</code></td></tr><tr><td><code>requirements</code> <mark style="color:red;">required</mark></td><td>array</td><td>Must be one or more of the following, separated by a comma: <code>identity_verification</code>, <code>proof_of_address</code>, <code>proof_of_source_of_funds</code>, <code>proof_of_financial_means</code>, <code>proof_of_tax_id</code>, <code>proof_of_relationship</code>, <code>proof_of_nature_of_business</code>, <code>proof_of_account_purpose</code>, <code>proof_of_authority</code>, <code>proof_of_name_change</code>, <code>business_formation</code>, <code>business_ownership_or_organization_structure</code>, <code>other</code></td></tr><tr><td><code>related_entity_id</code><br><mark style="color:red;">required</mark></td><td>string</td><td>The <code>id</code> corresponding to the <code>individual</code> or beneficial owner (for corporate accounts) for which you are submitting documents.</td></tr></tbody></table>

### Example Requests

{% tabs %}
{% tab title="Data Field JSON" %}

```json
{
    "data": [
        {
            "filename": "funding-overview.png",
            "document_type": "flow_of_funds",
            "requirements": [
                "proof_of_nature_of_business"
            ],
            "related_entity_id": "{ID}"
        },
        {
            "filename": "formation.pdf",
            "document_type": "business_formation",
            "requirements": [
                "proof_of_tax_id", "proof_of_address"
            ],
            "related_entity_id": "{ID}"
        }
    ]
}
```

{% endtab %}

{% tab title="Shell" %}

```sh
// Submit a single document
curl --location 'https://api.sfox.com/v1/files/verification' \
--header 'Authorization: Bearer ${USER_AUTH_TOKEN}' \
--form 'data="{
    \"data\": [
        {
            \"filename\": \"funding-overview.png\",
            \"document_type\": \"flow_of_funds\",
            \"requirements\": [
                \"business_formation\"
            ],
            \"related_entity_id\": \"{ID}\"
        }
    ]
}"' \
--form 'files=@"${PATH_TO_FILE}"'
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
var https = require('follow-redirects').https;
var fs = require('fs');

var options = {
  'method': 'POST',
  'hostname': 'api.sfox.com',
  'path': '/v1/files/verification',
  'headers': {
    'Authorization': 'Bearer ffad35fd1436d302',
    'Cookie': 'SqyNWag8AFgj9QKSZqn4A1iUgnWHzI5bP.cNAvX3dYQEOxBZ_qmHgW8Pt2ZoI_JMnOsaHIsHDRUhd2C'
  },
  'maxRedirects': 20
};

var req = https.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function (chunk) {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });

  res.on("error", function (error) {
    console.error(error);
  });
});

var postData = "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"data\"\r\n\r\n{
    \"data\": [
        {
            \"filename\": \"funding-overview.png\",
            \"document_type\": \"flow_of_funds\",
            \"requirements\": [
                \"business_formation\"
            ],
            \"related_entity_id\": \"{ID}\"
        }
    ]
}\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"files\"; filename=\"funding-overview.png\"\r\nContent-Type: \"{Insert_File_Content_Type}\"\r\n\r\n" + fs.readFileSync('/Users/administrator/Downloads/funding-overview.png') + "\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--";

req.setHeader('content-type', 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW');

req.write(postData);

req.end();
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.sfox.com/v1/files/verification"

payload = {'data': '{
    "data": [
        {
            "filename": "funding-overview.png",
            "document_type": "flow_of_funds",
            "requirements": [
                "business_formation"
            ],
            "related_entity_id": "{ID}"
        }
    ]
}'}
files=[
  ('files',('funding-overview.png',open('/Users/administrator/Downloads/funding-overview.png','rb'),'image/png'))
]
headers = {
  'Authorization': 'Bearer 350464755bb81ffad35fd1436d302',
  'Cookie': '__cf_bm=NoE282Vym1KE4jWqOOhxf5juK7r_P3fANDCWhk3l.h8-1765304523.9766364-1.0.1.1-JzeIIfsK9OfSD_uU3DSWnX09WG67Wlbw4Rf07JaItUZnD1lmfSqyNWag8AFgj9QKSZqn4A1iUgnWHzI5bP.cNAvX3dYQEOxBZ_qmHgW8Pt2ZoI_JMnOsaHIsHDRUhd2C'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)

```

{% endtab %}
{% endtabs %}

#### Document Requirements

* The supported MIME types for document submission are `image/jpeg`, `image/png`, `application/pdf` .&#x20;
* File extension must be one of `jpg`, `jpeg`, `png`, `pdf`.
* The file names specified for each file in the `files` array must exactly match the file name included in the `data` JSON payload.

## Response

<details>

<summary><mark style="color:green;"><strong><code>201</code></strong></mark> Created</summary>

```json
// Request accepted, files uploaded successfully
{
    "data": [
        {
            "filename": "204b9810-d47b-11f0-a8e5-12e9c04dbb1d-flow_of_funds-funding-overview.png",
            "document_type": "flow_of_funds",
            "requirements": [
                "business_formation"
            ],
            "date_added": "2025-12-09T18:22:05.000Z"
        }
    ]
}
```

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sfox.com/connect/rest-api/end-users/submit-documents/submit-documents-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
