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

# Create a file

> Creates a single file for the authenticated partner.
For details on file upload restrictions and limitations, please refer to the [File Uploads documentation](https://docs.qonto.com/api-reference/onboarding-api/endpoints/files/file-uploads#file-uploads).
<Warning>
  Supported only for registrations in company creation flow (`legal_flow` = `company_creation`).
</Warning>




## OpenAPI

````yaml post /register/registrations/{registrationId}/files
openapi: 3.0.3
info:
  title: Onboarding API
  version: '1.0'
  license:
    name: Proprietary
    url: https://qonto.com/terms
servers:
  - url: https://thirdparty-sandbox.staging.qonto.co
    description: Sandbox
  - url: https://onboarding-partners.qonto.com
    description: Production
security:
  - apiKey: []
    qontoPartnerId: []
tags:
  - name: Registrations
    description: Endpoints for Registration resource
  - name: Files
    description: Endpoints for file management throughout the company creation process.
  - name: Webhooks
    description: Endpoints to configure webhook to be notified about registration progress.
paths:
  /register/registrations/{registrationId}/files:
    post:
      tags:
        - Files
      summary: Create a file
      description: >
        Creates a single file for the authenticated partner.

        For details on file upload restrictions and limitations, please refer to
        the [File Uploads
        documentation](https://docs.qonto.com/api-reference/onboarding-api/endpoints/files/file-uploads#file-uploads).

        <Warning>
          Supported only for registrations in company creation flow (`legal_flow` = `company_creation`).
        </Warning>
      operationId: files/create
      parameters:
        - $ref: '#/components/parameters/X-Qonto-Staging-Token'
        - name: registrationId
          in: path
          required: true
          description: id of the Registration resource
          schema:
            type: string
            format: uuid
          example: 63647ae1-eeb0-4294-9bf0-65e1d9d0db66
      requestBody:
        description: >-
          You have to specify [multipart form
          data](https://swagger.io/docs/specification/describing-request-body/file-upload/#multipart)
          in order to attach the file to the request.
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                file_type:
                  type: string
                  enum:
                    - organization-deposit-certificate
                    - organization-proof-of-address
                    - organization-by-laws
                    - organization-kbis
                    - stakeholder-proof-of-identity
                    - stakeholder-residence-permit
                  example: organization-deposit-certificate
                stakeholder_id:
                  type: string
                  format: uuid
                  example: a3818b4d-4240-4098-bae4-87124b5add31
                  description: >-
                    Only applicable to and required for
                    `stakeholder-proof-of-identity` and
                    `stakeholder-residence-permit` file types.
              required:
                - file
                - file_type
      responses:
        '201':
          description: Returns the file created.
          content:
            application/json:
              schema:
                type: object
                properties:
                  registration_file:
                    $ref: '#/components/schemas/file'
        '400':
          $ref: '#/components/responses/400-bad-request'
        '401':
          $ref: '#/components/responses/401-unauthorized'
        '404':
          $ref: '#/components/responses/404-not-found'
        '422':
          description: >
            Returns an unprocessable entity error if any required parameters are
            missing, or if validation rules are not respected.


            Validations rules:

            * Missing file
                * code: missing_file
                * detail: The request is missing a file parameter
                * source.pointer: /file
            * File too big
                * code: file_too_big
                * detail: Only files up to 30MB can be uploaded.
                * source.pointer: file
            * Invalid file type:
                * code: invalid_file
                * detail: Wrong file format
                * source.pointer: file
                Valid file extensions: .pdf .png .jpeg .jpg .heif .heic
            * Not a file
                * code: not_a_file
                * detail: The file param included in the request is not a file. Include a file in the request by specyfing HTTP multipart POST data.
                * source.pointer: file
                Valid content-types: application/pdf image/png image/jpeg image/heic image/heif
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors'
              examples:
                Example:
                  $ref: '#/components/examples/unprocessable-entity'
        '500':
          $ref: '#/components/responses/500-internal-servor-error'
      security:
        - apiKey: []
          qontoPartnerId: []
components:
  parameters:
    X-Qonto-Staging-Token:
      name: X-Qonto-Staging-Token
      in: header
      description: >-
        Required only for Sandbox API requests; to get one, please sign up to
        the [Developer Portal](https://developers.qonto.com/).
      schema:
        type: string
  schemas:
    file:
      title: File
      type: object
      required:
        - id
        - filename
        - filesize_bytes
        - url
        - created_at
        - file_type
      properties:
        id:
          type: string
          format: uuid
          example: d7344200-97d7-44b7-8fc5-9e5fb2f8831b
          readOnly: true
        filename:
          type: string
          example: document.pdf
          readOnly: true
        filesize_bytes:
          type: integer
          example: 981723
          readOnly: true
        url:
          type: string
          example: https://example-s3-url
          readOnly: true
          description: URL to access/download the file itself. TTL is 2 hours
        created_at:
          type: string
          format: date-time
          readOnly: true
          example: '2021-08-17T12:31:32.689Z'
        file_type:
          type: string
          description: >-
            We only accept one file per <type>. In case you want to replace,
            delete the old file and upload a new one.
          enum:
            - organization-deposit-certificate
            - organization-proof-of-address
            - organization-by-laws
            - organization-kbis
            - stakeholder-proof-of-identity
            - stakeholder-residence-permit
            - organization-registration-application-proof
            - organization-capital-deposit-statement
          example: organization-deposit-certificate
        stakeholder_id:
          type: string
          readOnly: true
          nullable: true
          description: >-
            Id of the stakeholder. Only applicable to and required for
            `stakeholder-proof-of-identity` and `stakeholder-residence-permit`
            file types.
    errors:
      title: Errors
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                readOnly: true
              detail:
                type: string
                readOnly: true
              source:
                type: object
                properties:
                  pointer:
                    type: string
                readOnly: true
            required:
              - code
              - detail
  responses:
    400-bad-request:
      description: Returns a bad request error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errors'
    401-unauthorized:
      description: Returns an unauthorized error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errors'
          examples:
            Example:
              $ref: '#/components/examples/unauthorized'
    404-not-found:
      description: >-
        Returns a not found error if the specified resource was not found or
        does not belong to the authenticated partner.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errors'
          examples:
            Example:
              $ref: '#/components/examples/not-found'
    500-internal-servor-error:
      description: Returns an internal server error.
  examples:
    unprocessable-entity:
      value:
        errors:
          - code: <error-code>
            detail: <relevant-detail>
            source:
              pointer: <ie /data/attributes/attr_name>
    unauthorized:
      value:
        errors:
          - code: unauthorized
            detail: You must authenticate to perform API requests
    not-found:
      value:
        errors:
          - code: not_found
            detail: The record identified by <uuid> could not be found.
  securitySchemes:
    apiKey:
      type: http
      description: >
        Bearer authorization header: `Bearer <token>`.

        To get your `<token>`, please sign up to the [Developer
        Portal](https://developers.qonto.com/).
      scheme: bearer
      bearerFormat: JWT
    qontoPartnerId:
      type: apiKey
      description: >
        API Key authorization header: `Qonto-Partner-Id: <partner_id>`.

        To get your `<partner_id>` please, sign up to the [Developer
        Portal](https://developers.qonto.com/).
      name: Qonto-Partner-Id
      in: header

````