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

# Create a case or add an upload

> Upload documents for a candidate. If a case with the given `externalId` already exists, files are added as a new upload to that case. Otherwise, a new case is created.

Accepted formats: PDF, PNG, JPG, JPEG, WebP, ZIP. Limits: 20 files, 30 MB per file, 40 MB total.

Optionally send an `Idempotency-Key` header to make retries safe: replaying the same key with an identical payload returns the original upload instead of creating a duplicate.



## OpenAPI

````yaml /partner-api/openapi.json post /cases
openapi: 3.0.3
info:
  title: TruEnroll Partner API
  version: 1.0.0
  description: >-
    Submit academic documents and retrieve structured extraction, forensics, and
    translation results.
servers:
  - url: https://eval-api.trential.dev/partner/v1
    description: Sandbox
  - url: https://api.truenroll.com/partner/v1
    description: Production
security:
  - apiKey: []
tags:
  - name: Cases
    description: Create and manage processing cases.
  - name: Results
    description: Fetch extraction, forensics, and translation results.
  - name: Webhooks
    description: Register endpoints that receive case events.
paths:
  /cases:
    post:
      tags:
        - Cases
      summary: Create a case or add an upload
      description: >-
        Upload documents for a candidate. If a case with the given `externalId`
        already exists, files are added as a new upload to that case. Otherwise,
        a new case is created.


        Accepted formats: PDF, PNG, JPG, JPEG, WebP, ZIP. Limits: 20 files, 30
        MB per file, 40 MB total.


        Optionally send an `Idempotency-Key` header to make retries safe:
        replaying the same key with an identical payload returns the original
        upload instead of creating a duplicate.
      operationId: createCase
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
          description: >-
            Optional. Makes the upload safe to retry: replaying the same key
            with an identical payload returns the original upload. Reusing a key
            with a different payload returns 409.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - files
                - externalId
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                  description: >-
                    One or more document files. Accepted formats: PDF, PNG, JPG,
                    JPEG, WebP, ZIP. Max 20 files, 30 MB each, 40 MB total.
                externalId:
                  type: string
                  minLength: 1
                  maxLength: 128
                  description: >-
                    Your reference for this case. Unique per organization;
                    subsequent submissions with the same externalId append to
                    the existing case.
                classify:
                  type: boolean
                  default: true
                  description: >-
                    Run AI document classification. When false, features run
                    directly against the raw uploaded files instead of
                    classified credentials.
                features:
                  type: string
                  description: >-
                    JSON array of features to run. Defaults to all three.
                    Example: `["extraction","forensics"]`
                  example: '["extraction","forensics","translation"]'
                metadata:
                  type: string
                  description: >-
                    JSON object of key-value pairs (string, number, or boolean
                    values).
                  example: '{"cycle":"2025-fall"}'
      responses:
        '202':
          description: Upload accepted for asynchronous processing.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/CreateCaseResponse'
              example:
                success: true
                message: Upload accepted
                meta: {}
                data:
                  caseId: 6850abc123def456ghi789
                  externalId: applicant-9876
                  upload:
                    uploadId: 6850def456ghi789abc123
                    status: processing
                    classify: true
                    features:
                      - name: extraction
                        status: processing
                      - name: forensics
                        status: processing
                      - name: translation
                        status: processing
                    files:
                      - fileId: file_abc
                        fileName: transcript.pdf
                    createdAt: '2025-06-22T10:00:00Z'
                    updatedAt: '2025-06-22T10:00:00Z'
        '400':
          description: >-
            No files, unsupported format, file below the 1 KB minimum, or
            invalid request body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Key is not a partner key, the key is inactive, or the organization
            lacks a requested feature.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >-
            The case for this externalId has been deleted, the case is still
            initializing, or an `Idempotency-Key` was reused with a different
            payload.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '413':
          description: Per-file or total payload size limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SuccessResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
        meta:
          type: object
          description: >-
            Optional metadata (e.g. pagination). Empty object when not
            applicable.
        data: {}
      required:
        - success
        - message
        - meta
        - data
    CreateCaseResponse:
      type: object
      properties:
        caseId:
          type: string
        externalId:
          type: string
        upload:
          $ref: '#/components/schemas/Upload'
      required:
        - caseId
        - externalId
        - upload
    ErrorResponse:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
      required:
        - statusCode
        - message
    Upload:
      type: object
      properties:
        uploadId:
          type: string
        status:
          $ref: '#/components/schemas/CaseStatus'
        classify:
          type: boolean
        features:
          type: array
          items:
            $ref: '#/components/schemas/UploadFeature'
        files:
          type: array
          items:
            $ref: '#/components/schemas/UploadFile'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - uploadId
        - status
        - classify
        - features
        - files
        - createdAt
        - updatedAt
    CaseStatus:
      type: string
      enum:
        - queued
        - processing
        - completed
        - failed
      description: Processing status.
    UploadFeature:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/PartnerFeature'
        status:
          $ref: '#/components/schemas/FeatureStatus'
      required:
        - name
        - status
    UploadFile:
      type: object
      properties:
        fileId:
          type: string
        fileName:
          type: string
      required:
        - fileId
        - fileName
    PartnerFeature:
      type: string
      enum:
        - extraction
        - forensics
        - translation
    FeatureStatus:
      type: string
      enum:
        - queued
        - processing
        - completed
        - failed
        - skipped
      description: >-
        Per-feature processing status. `skipped` means the feature was not run
        for this upload.
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: 'Partner API key. Also accepted as `Authorization: Bearer <key>`.'

````