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

# Get File By MD5

> Look up an uploaded file by the MD5 of its bytes, without knowing its `file_*` id. Returns the newest non-expired match when the same file was uploaded more than once. Compute the hash over the exact bytes you uploaded (for example `md5sum image.png`).



## OpenAPI

````yaml /openapi.json get /v1/files/by-md5/{md5}
openapi: 3.1.0
info:
  title: Decart API
  version: 1.0.0
servers: []
security: []
paths:
  /v1/files/by-md5/{md5}:
    get:
      summary: Get File By MD5
      description: >-
        Look up an uploaded file by the MD5 of its bytes, without knowing its
        `file_*` id. Returns the newest non-expired match when the same file was
        uploaded more than once. Compute the hash over the exact bytes you
        uploaded (for example `md5sum image.png`).
      operationId: get_file_by_md5_v1_files_by_md5__md5__get
      parameters:
        - name: md5
          in: path
          required: true
          schema:
            type: string
            pattern: ^[0-9a-fA-F]{32}$
            title: Md5
          description: Hex MD5 of the uploaded bytes
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
            description: API key for authentication
            title: X-Api-Key
          description: API key for authentication
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileReferenceResponse'
        '404':
          description: No non-expired upload with this MD5
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                required:
                  - detail
                title: FileNotFound
              example:
                detail: File not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    FileReferenceResponse:
      properties:
        id:
          type: string
          title: Id
        filename:
          anyOf:
            - type: string
            - type: 'null'
          title: Filename
        mime_type:
          type: string
          title: Mime Type
        size_bytes:
          type: integer
          title: Size Bytes
        md5:
          anyOf:
            - type: string
            - type: 'null'
          title: Md5
          description: >-
            Hex MD5 of the uploaded bytes. Null on files uploaded before hashes
            were recorded.
        created_at:
          type: string
          format: date-time
          title: Created At
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
      type: object
      required:
        - id
        - filename
        - mime_type
        - size_bytes
        - md5
        - created_at
        - expires_at
      title: FileReferenceResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````