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

# Upload media

> Uploads a selfie or document image to the verification session.
Consent must be accepted before uploading. The file is validated
for quality (face detection, blur, brightness for selfies;
document detection, readability for documents).

Answers `200` with an empty body; a failed quality check answers `422`.



## OpenAPI

````yaml /openapi.json post /verifications/{verification}/media
openapi: 3.1.0
info:
  title: API Reference
  version: 1.0.0
  description: >-
    ProofAge is an identity verification and age estimation API. Use this API to
    create verification sessions, upload media (selfies and documents), and
    receive decisions via webhooks.
servers:
  - url: https://api.proofage.net/v1
    description: API
security:
  - apiKey: []
    hmacSignature: []
paths:
  /verifications/{verification}/media:
    post:
      tags:
        - Media
      summary: Upload media
      description: |-
        Uploads a selfie or document image to the verification session.
        Consent must be accepted before uploading. The file is validated
        for quality (face detection, blur, brightness for selfies;
        document detection, readability for documents).

        Answers `200` with an empty body; a failed quality check answers `422`.
      operationId: uploadMedia
      parameters:
        - name: verification
          in: path
          required: true
          description: The verification ID
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UploadMediaRequest'
      responses:
        '200':
          description: The media was stored. The body is empty.
          content:
            text/html:
              schema:
                type: string
                examples:
                  - ''
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '422':
          description: The image failed a quality check; the code says which.
          content:
            application/json:
              schema:
                type: object
                examples:
                  - code: FACE_NOT_FOUND
                    message: >-
                      Face validation failed. Please upload a clear, well-lit
                      selfie with your face fully visible.
                properties:
                  code:
                    type: string
                  message:
                    type: string
                required:
                  - code
                  - message
components:
  schemas:
    UploadMediaRequest:
      type: object
      properties:
        file:
          type: string
          format: binary
          contentMediaType: application/octet-stream
        type:
          type: string
          description: >-
            What the file is: the person's selfie, or one side of their
            document.
          enum:
            - selfie
            - document
        side:
          type: string
          description: Which side of the document. Required when `type` is `document`.
          enum:
            - front
            - back
        document:
          type: string
          description: The kind of document. Required when `type` is `document`.
          enum:
            - id
            - driver_license
            - passport
            - residence_permit
      required:
        - file
        - type
      title: UploadMediaRequest
  responses:
    ModelNotFoundException:
      description: Not found
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
  securitySchemes:
    apiKey:
      type: apiKey
      description: Your workspace public key (pk_test_… or pk_live_…).
      in: header
      name: X-API-Key
    hmacSignature:
      type: apiKey
      description: >-
        HMAC-SHA256 of the request, hex-encoded, keyed with the workspace secret
        key. See API authentication.
      in: header
      name: X-HMAC-Signature

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.