# Upload Consent Files

Upload files that serve as consent from your customer to debit their bank account. You must upload all required files for a Consent (front and back scans of the ID card, a selfie of the user holding the ID, and a signed contract). Each file cannot be larger than 20MB.

Endpoint: POST /consents/{consentId}/files
Version: 1.0.0
Security: ApiKeyAuth, ApiKeySecret

## Path parameters:

  - `consentId` (string, required)
    The ID of the Consent that you want to upload files for.

## Request fields (multipart/form-data):

  - `id_front` (string, required)
    The front scan/photo of the user’s ID.

  - `id_back` (string, required)
    The back scan/photo of the user’s ID.

  - `selfie` (string, required)
    A selfie of the user holding their ID.

  - `contract` (string, required)
    A signed contract from the user authorizing the debit.

## Response 201 fields (application/json):

  - `type` (string, required)
    The type of Consent file. Can be one of the following:
  - id_front
  - id_back
  - selfie
  - contract
    Enum: "id_front", "id_back", "selfie", "contract"

  - `consentFileId` (string, required)
    The unique identifier created by Belvo used to reference the Consent file.
    Example: "8c56b4e7-d025-4b1a-a303-dd472b24f431"

  - `consentId` (string, required)
    The unique identifier created by Belvo used to reference the Consent.
    Example: "0494baff-3bbb-43c7-bb58-67ac6cba3e54"

## Response 400 fields (application/json):

  - `statusCode` (integer)
    The HTTP status code for this error.
    Example: 400

  - `error` (string)
    The HTTP status code description for this error.
    Example: "Bad Request"

  - `message` (any)
    A short description of the error, indicating what is wrong with the request.
> Note: We return either a string or an array of strings, depending on the validation error(s). 

The description can be (among others):

  - id must be a UUID
  - Not enough balance
  - amount is not a valid decimal number.
  - currency must be one of the following values: cop, mxn, usd
  - reference must be a string
  - Customer not found for merchant
  - documentType is a required field
    Example: "id must be a UUID"

## Response 401 fields (application/json):

  - `statusCode` (integer)
    The HTTP status code for this error.
    Example: 401

  - `error` (string)
    The HTTP status code description for this error.
    Example: "Unauthorized"

  - `message` (string)
    A short description of the error, indicating what is wrong with the request.
In the case of a 401 Unauthorized error, the message is:

  - Unauthorized credentials
    Example: "Unauthorized credentials"

## Response 404 fields (application/json):

  - `statusCode` (integer)
    The HTTP status code for this error.
    Example: 404

  - `error` (string)
    The HTTP status code description for this error.
    Example: "Not Found"

  - `message` (string)
    A short description of the error, indicating what is wrong with the request.
The description can be (among others):

  - Payout Target not found
  - Payment method not found
  - Customer not found
    Example: "Payout Target not found"


