> ## Documentation Index
> Fetch the complete documentation index at: https://crossmint-devin-1787949784-wallet-docs-two-concept-model.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload a User Document

> Upload a document for a user. 

**API scope required**: `users.create`



## OpenAPI

````yaml post /2025-06-09/documents
openapi: 3.0.0
info:
  contact:
    email: support@crossmint.com
    name: Crossmint Support
    url: https://www.crossmint.com
  description: Crossmint Users API
  title: Crossmint Users API
  version: 1.0.0
servers:
  - description: Staging environment (testnets)
    url: https://staging.crossmint.com/api
  - description: Production environment (mainnets)
    url: https://www.crossmint.com/api
security: []
tags: []
paths:
  /2025-06-09/documents:
    post:
      tags:
        - User Documents
      summary: Upload a User Document
      description: |-
        Upload a document for a user. 

        **API scope required**: `users.create`
      operationId: Documents20250609Controller-createDocument-2
      parameters:
        - description: API key required for authentication
          in: header
          name: X-API-KEY
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUserDocumentDto'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDocumentResponseDto'
          description: Document replaced successfully
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDocumentResponseDto'
          description: Document created successfully
components:
  schemas:
    CreateUserDocumentDto:
      properties:
        data:
          description: Base64 encoded document data
          example: >-
            data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==
          minLength: 1
          type: string
        documentType:
          description: Type of document being uploaded
          enum:
            - id-idcard-back
            - id-idcard-front
            - id-passport
            - id-residency-permit
            - proof-of-address
            - selfie-front
            - selfie-left
            - selfie-right
            - source-of-wealth
          example: id-passport
          type: string
        expiresAt:
          description: Document expiration date in YYYY-MM-DD format
          example: '2030-12-31'
          pattern: ^\d{4}-\d{2}-\d{2}$
          type: string
        reference:
          description: Reference to the user who owns this document
          example:
            userLocator: email:user@example.com
          properties:
            userLocator:
              description: >-
                User identifier in the format 'email:user@example.com' or
                'userId:123'
              example: email:user@example.com
              minLength: 1
              type: string
          type: object
      required:
        - data
        - documentType
        - reference
      type: object
    UserDocumentResponseDto:
      properties:
        createdAt:
          description: ISO 8601 timestamp when the document was created
          example: '2024-12-05T10:30:00.000Z'
          type: string
        documentType:
          description: Type of document
          enum:
            - id-idcard-back
            - id-idcard-front
            - id-passport
            - id-residency-permit
            - proof-of-address
            - selfie-front
            - selfie-left
            - selfie-right
            - source-of-wealth
          example: id-passport
          type: string
        expiresAt:
          description: Document expiration date in YYYY-MM-DD format
          example: '2030-12-31'
          type: string
        id:
          description: Unique identifier for the document
          example: doc_abc123xyz
          type: string
      required:
        - createdAt
        - documentType
        - id
      type: object

````