> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wepayout.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit Document For KYC

> Submit documents for a pending KYC verification

# Submit Document For KYC

This route is used to submit documents for a pending KYC. There are two types of documents that can be submitted:

* **Text-type documents**
* **File-type documents**

Only one document can be updated at a time.

<Warning>
  **Attention point**: Supported extensions for file-type documents: `jpg`, `jpeg`, `gif`, `png` and `pdf`
</Warning>

## Path Parameters

<ParamField path="documentId" type="integer" required>
  The ID of the document to update
</ParamField>

## Body

<ParamField body="value" type="string" required>
  The value to submit for the document. For file-type documents, provide the file URL. For text-type documents, provide the text value.
</ParamField>

## Response

<ResponseField name="id" type="integer">
  Unique identifier for the uploaded document record.
</ResponseField>

<ResponseField name="status_id" type="integer">
  Identifier of the current validation status of the document.
</ResponseField>

<ResponseField name="status_name" type="string">
  Name of the document's validation status.
</ResponseField>

<ResponseField name="document_id" type="integer">
  Identifier of the document.
</ResponseField>

<ResponseField name="document_name" type="string">
  Name of the document type uploaded.
</ResponseField>

<ResponseField name="collection_name" type="string">
  Name of the document collection or group.
</ResponseField>

<ResponseField name="collection_id" type="integer">
  Identifier of the document collection.
</ResponseField>

<ResponseField name="value_field" type="string">
  URL for downloading the uploaded document file.
</ResponseField>

<ResponseField name="rejection_reason" type="string">
  Reason for rejection if the document was not approved.
</ResponseField>

<ResponseField name="label" type="string">
  Label or description used to identify the document field.
</ResponseField>

<ResponseField name="type_field" type="string">
  Type of input expected for this field.

  Example: `file` or `text`
</ResponseField>

<ResponseField name="required_field" type="boolean">
  Indicates whether this field is mandatory for completing the KYC process.
</ResponseField>

<ResponseField name="expires_at" type="string">
  Expiration date of the document, if applicable.

  Format: `<date-time>`
</ResponseField>

<ResponseField name="automaticatic_validation" type="integer">
  Indicates whether the document is eligible for automatic validation.

  Example: `1` = yes, `0` = no
</ResponseField>

## Request Example

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.sandbox.wepayout.com.br/v1/kyc/documents/{documentId}/update \
    --header 'Accept: application/json' \
    --header 'Authorization: Bearer 123' \
    --header 'Content-Type: application/json' \
    --data '{
    "value": "string"
  }'
  ```

  ```javascript JavaScript theme={null}
  async function submitKYCDocument(documentId, value) {
    const response = await fetch(
      `https://api.sandbox.wepayout.com.br/v1/kyc/documents/${documentId}/update`,
      {
        method: 'POST',
        headers: {
          'Accept': 'application/json',
          'Authorization': 'Bearer 123',
          'Content-Type': 'application/json'
        },
        body: JSON.stringify({
          value: value
        })
      }
    );
    
    if (!response.ok) {
      throw new Error(`Failed to submit document: ${response.statusText}`);
    }
    
    return await response.json();
  }

  // Usage - Submit file URL
  const fileResult = await submitKYCDocument(35, 'https://s3.amazonaws.com/bucket/file.pdf');
  console.log('File document submitted:', fileResult);

  // Usage - Submit text value
  const textResult = await submitKYCDocument(36, 'John Doe');
  console.log('Text document submitted:', textResult);
  ```

  ```python Python theme={null}
  import requests

  def submit_kyc_document(document_id, value):
      url = f'https://api.sandbox.wepayout.com.br/v1/kyc/documents/{document_id}/update'
      headers = {
          'Accept': 'application/json',
          'Authorization': 'Bearer 123',
          'Content-Type': 'application/json'
      }
      
      data = {
          'value': value
      }
      
      response = requests.post(url, headers=headers, json=data)
      response.raise_for_status()
      
      return response.json()

  # Usage - Submit file URL
  file_result = submit_kyc_document(35, 'https://s3.amazonaws.com/bucket/file.pdf')
  print('File document submitted:', file_result)

  # Usage - Submit text value
  text_result = submit_kyc_document(36, 'John Doe')
  print('Text document submitted:', text_result)
  ```
</CodeGroup>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "id": 5891,
    "status_id": 2,
    "status_name": "Waiting Approval Documents",
    "document_id": 35,
    "document_name": "kyc/qsa",
    "collection_name": null,
    "collection_id": null,
    "value_field": "https://s3.amazonaws.com/bucket-name/path/to/file",
    "rejection_reason": null,
    "label": "KYC/QSA",
    "type_field": "file",
    "required_field": true,
    "expires_at": null,
    "automaticatic_validation": 0
  }
  ```
</ResponseExample>

## Best Practices

<Note>
  **One Document at a Time**: Only one document can be updated per request. To submit multiple documents, make separate API calls for each.
</Note>

<Warning>
  **File Extensions**: Ensure file-type documents use only supported extensions: `jpg`, `jpeg`, `gif`, `png`, or `pdf`.
</Warning>

<Tip>
  **Document Status**: After submission, the document status will typically change to "Waiting Approval Documents" (status\_id: 2).
</Tip>

## Related Resources

<CardGroup cols={2}>
  <Card title="List KYC" icon="list" href="/api-reference/kyc/list-kyc">
    List all KYC verifications
  </Card>

  <Card title="Get KYC By ID" icon="magnifying-glass" href="/api-reference/kyc/get">
    Get KYC by ID
  </Card>

  <Card title="Get KYC By Document" icon="file-search" href="/api-reference/kyc/get-by-document">
    Get KYC by document number
  </Card>

  <Card title="Create Payment" icon="money-bill-transfer" href="/api-reference/cash-out/payout/create-payment">
    Create a payout payment
  </Card>
</CardGroup>
