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

# Create a new document collection

> The endpoint creates a new document collection and uploads documents in a single request. Documents are provided as base64-encoded content in JSON format. The uploaded files are automatically validated and queued for AI-powered categorization.




## OpenAPI

````yaml POST /v1/documents/collections/
openapi: 3.0.1
info:
  title: Truv API
  description: Truv API Documentation
  termsOfService: https://www.truv.com/legal/terms-of-use
  contact:
    email: support@truv.com
  version: v1
servers:
  - url: https://prod.truv.com
security:
  - ClientID: []
    AccessKey: []
tags:
  - name: Users
  - name: Bridge Token
  - name: Companies and Data Providers
  - name: Key Management
  - name: Account Links
  - name: Data Refresh
  - name: Customization Templates
  - name: Webhooks
  - name: Orders
  - name: Tasks
  - name: VOIE Reports
  - name: VOA Reports
  - name: Income Insights Reports
  - name: DDS Reports
  - name: Employment
  - name: Identity
  - name: Shifts
  - name: Pay Statements
  - name: Tax Documents
  - name: Parsed Documents
  - name: Reports
  - name: Uploaded Documents
  - name: Bank Accounts
  - name: Bank Statements
  - name: Deposit Switch Reports
  - name: Insurance Reports
  - name: Income Report
  - name: Scoring Attributes
  - name: Accounts
  - name: Transactions
  - name: Recurring Transactions
  - name: Document Collections
paths:
  /v1/documents/collections/:
    parameters: []
    post:
      tags:
        - Document Collections
      summary: Create a new document collection
      description: >
        The endpoint creates a new document collection and uploads documents in
        a single request. Documents are provided as base64-encoded content in
        JSON format. The uploaded files are automatically validated and queued
        for AI-powered categorization.
      operationId: collections_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentCollectionCreate'
        required: true
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentCollectionCreateResponse'
        '400':
          description: HTTP 400 Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error400'
        '401':
          description: HTTP 401 Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error401'
        '403':
          description: HTTP 403 Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error403'
components:
  schemas:
    DocumentCollectionCreate:
      type: object
      required:
        - documents
      properties:
        documents:
          title: Documents
          type: array
          minItems: 1
          maxItems: 10
          description: Array of documents to upload (maximum 10 files per request)
          items:
            $ref: '#/components/schemas/DocumentUploadData'
        users:
          title: Users
          type: array
          description: >-
            Array of users to create/update in this collection (optional).
            Documents can be automatically matched to users by name, or
            explicitly assigned via user_id/external_user_id in the documents
            array.
          items:
            $ref: '#/components/schemas/CollectionUser'
    DocumentCollectionCreateResponse:
      type: object
      required:
        - collection_id
        - uploaded_files
        - documents
        - users
      properties:
        collection_id:
          title: Collection ID
          type: string
          example: a1b2c3d4e5f6478899aabbccddeeff00
        uploaded_files:
          title: Uploaded files
          type: array
          items:
            $ref: '#/components/schemas/UploadedFileBasic'
        documents:
          title: Recognized documents
          type: array
          items:
            $ref: '#/components/schemas/RecognizedDocumentBasic'
        users:
          title: Users
          type: array
          items:
            $ref: '#/components/schemas/CollectionUserResponse'
    Error400:
      description: ''
      type: object
      properties:
        error:
          description: ''
          type: object
          properties:
            code:
              description: ''
              type: string
              example: incorrect_parameters
            message:
              description: ''
              type: string
              example: Incorrect request parameters
            extra:
              description: ''
              type: object
              properties:
                invalid-params:
                  description: ''
                  type: array
                  items:
                    description: ''
                    type: object
                    properties:
                      field:
                        description: ''
                        type: string
                        example: access_token
                      message:
                        description: ''
                        type: string
                        example: This field is required.
                  example:
                    - field: access_token
                      message: This field is required.
    Error401:
      description: ''
      type: object
      properties:
        error:
          description: ''
          type: object
          properties:
            code:
              description: ''
              type: string
              example: authentication_failed
            message:
              description: ''
              type: string
              example: No such token
    Error403:
      description: ''
      type: object
      properties:
        error:
          description: ''
          type: object
          properties:
            code:
              description: ''
              type: string
              example: not_authenticated
            message:
              description: ''
              type: string
              example: Authentication credentials were not provided.
    DocumentUploadData:
      required:
        - filename
        - mime_type
        - content
      type: object
      properties:
        filename:
          title: Filename
          type: string
          maxLength: 255
          example: paystub.pdf
        mime_type:
          title: MIME type
          type: string
          enum:
            - application/pdf
            - image/jpeg
            - image/png
            - image/tiff
            - image/webp
            - image/x-ms-bmp
            - image/heic
            - image/heif
          example: application/pdf
        content:
          title: Base64-encoded file content
          type: string
          format: byte
          minLength: 1336
          maxLength: 13333336
          description: >
            Base64-encoded file content. Maximum file size: 10 MB (10,000,000
            bytes).

            Minimum file size: 1 KB (1,000 bytes).

            Note: maxLength accounts for base64 encoding overhead (4/3 ratio).
          example: JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwo...
        user_id:
          title: User ID
          type: string
          maxLength: 64
          nullable: true
          description: >-
            Truv user ID to assign this document to (optional, mutually
            exclusive with external_user_id)
          example: a1b2c3d4e5f6478899aabbccddeeff00
        external_user_id:
          title: External User ID
          type: string
          maxLength: 512
          nullable: true
          description: >-
            External system user ID to assign this document to (optional,
            mutually exclusive with user_id)
          example: ext_user_789
    CollectionUser:
      type: object
      description: >-
        User information for collection. Either 'id' or 'external_user_id' must
        be provided, but not both.
      oneOf:
        - required:
            - id
        - required:
            - external_user_id
      properties:
        id:
          title: User ID
          type: string
          maxLength: 64
          nullable: true
          description: Truv user ID (optional, mutually exclusive with external_user_id)
          example: a1b2c3d4e5f6478899aabbccddeeff00
        external_user_id:
          title: External User ID
          type: string
          maxLength: 512
          nullable: true
          description: >-
            External system user ID (optional, mutually exclusive with id).
            Either id or external_user_id must be provided.
          example: ext_user_789
        full_name:
          title: Full Name
          type: string
          maxLength: 255
          nullable: true
          description: >-
            Full name to parse into first_name and last_name (required if
            profile doesn't exist or has no names)
          example: John Doe
        ssn:
          title: Social Security Number
          type: string
          pattern: ^(\d{4}|\d{9})$
          nullable: true
          description: Social Security Number - either 4 or 9 digits (optional)
          example: '991919991'
    UploadedFileBasic:
      type: object
      required:
        - file_id
        - filename
        - mime_type
        - status
      properties:
        file_id:
          title: File ID
          type: string
          example: f1234567890abcdef1234567890abcde
        filename:
          title: Filename
          type: string
          example: paystub.pdf
        mime_type:
          title: MIME type
          type: string
          enum:
            - application/pdf
            - image/jpeg
            - image/png
            - image/tiff
            - image/webp
            - image/x-ms-bmp
            - image/heic
            - image/heif
          example: application/pdf
        validations:
          title: File validations
          type: object
          nullable: true
          properties:
            is_viable_size:
              type: boolean
              nullable: true
              description: Whether the file size is within acceptable limits
            is_supported_type:
              type: boolean
              nullable: true
              description: Whether the file type is supported
            is_accessible:
              type: boolean
              nullable: true
              description: Whether the file is accessible
            is_valid:
              type: boolean
              nullable: true
              description: Overall validation status
            is_readable:
              type: boolean
              nullable: true
              description: Whether the file can be read
            is_unique:
              type: boolean
              nullable: true
              description: Whether the file is unique (not a duplicate)
          example:
            is_viable_size: true
            is_supported_type: true
            is_accessible: true
            is_valid: true
            is_readable: true
            is_unique: true
        status:
          title: Processing status
          type: string
          enum:
            - pending
            - validating
            - validated
            - invalid
            - duplicate
            - processing
            - successful
            - failed
          example: validated
        user_id:
          title: User ID
          type: string
          nullable: true
          description: Truv user ID associated with this file
          example: a1b2c3d4e5f6478899aabbccddeeff00
        external_user_id:
          title: External User ID
          type: string
          nullable: true
          description: External system user ID associated with this file
          example: ext_user_789
    RecognizedDocumentBasic:
      type: object
      required:
        - document_id
        - file_id
        - document_type
        - status
        - start_page
        - end_page
      properties:
        document_id:
          title: Document ID
          type: string
          example: d0c1234567890abcdef1234567890abc
        file_id:
          title: File ID
          type: string
          example: f1234567890abcdef1234567890abcde
        document_type:
          title: Document type
          type: string
          enum:
            - PAYSTUB
            - W2
            - F1099
            - F1040
            - BANK_STATEMENT
            - PASSPORT
            - GREEN_CARD
            - DRIVER_LICENSE
            - LETTER_OF_VERIFICATION
            - UTILITY_BILL
            - LEASE_AGREEMENT
            - INSURANCE_HOME_POLICY
            - INSURANCE_AUTO_POLICY
            - VOLUNTEER_LETTER
            - OTHER
          example: PAYSTUB
        document_subtype:
          title: Document subtype
          type: string
          nullable: true
          enum:
            - F1099_MISC
            - F1099_NEC
            - F1099_DIV
            - F1099_INT
            - F1099_G
            - F1099_R
            - F_SSA1099
            - VOL_TRANSCRIPT
            - VOL_HOURS_LOG
            - null
          example: null
        status:
          title: Status
          type: string
          enum:
            - successful
            - failed
            - rejected
          example: successful
        first_name:
          title: First name
          type: string
          nullable: true
          example: John
        last_name:
          title: Last name
          type: string
          nullable: true
          example: Doe
        user_id:
          title: User ID
          type: string
          nullable: true
          description: Truv user ID associated with this document
          example: a1b2c3d4e5f6478899aabbccddeeff00
        external_user_id:
          title: External User ID
          type: string
          nullable: true
          description: External system user ID associated with this document
          example: ext_user_789
        start_page:
          title: Start page
          type: integer
          example: 1
        end_page:
          title: End page
          type: integer
          example: 2
    CollectionUserResponse:
      type: object
      required:
        - id
        - external_user_id
        - first_name
        - last_name
      description: User information returned in collection responses
      properties:
        id:
          title: User ID
          type: string
          description: Truv user ID
          example: a1b2c3d4e5f6478899aabbccddeeff00
        external_user_id:
          title: External User ID
          type: string
          nullable: true
          description: External system user ID
          example: ext_user_789
        first_name:
          title: First Name
          type: string
          nullable: true
          description: User's first name
          example: John
        last_name:
          title: Last Name
          type: string
          nullable: true
          description: User's last name
          example: Doe
  securitySchemes:
    ClientID:
      type: apiKey
      description: Client ID
      name: X-Access-Client-Id
      in: header
    AccessKey:
      type: apiKey
      description: Client Access Key
      name: X-Access-Secret
      in: header

````