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

# Get a file's details

> Retrieves a file's details by its ID. Use this endpoint to get file metadata.



## OpenAPI

````yaml /api/files/openapi.yaml get /files/{id}/get
openapi: 3.1.0
info:
  title: Unified CDN API | Files
  description: Interact with files on the Unified CDN system.
  version: 0.1.0
servers:
  - url: https://{Unified_CDN_domain}/api
    description: Production server where your Unified CDN is hosted.
    variables:
      Unified_CDN_domain:
        default: api.example.com
        description: >-
          The domain where your Unified CDN is hosted. Change this to your
          custom domain if you have one.
security: []
paths:
  /files/{id}/get:
    get:
      summary: Get a file's details
      description: >-
        Retrieves a file's details by its ID. Use this endpoint to get file
        metadata.
      parameters:
        - name: id
          description: ID of the file to retrieve.
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successfully retrieved the file details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/File'
        '400':
          description: Bad request due to invalid configuration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                timezone_not_set:
                  value:
                    error: InvalidConfigurationError
                    message: The site's timezone is not set.
        '401':
          $ref: '#/components/responses/UnauthorisedError'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - ApiKeyAuth: []
        - CodeAuth: []
components:
  schemas:
    File:
      type: object
      properties:
        id:
          type: string
        applicationId:
          type: string
        databaseId:
          type: string
        key:
          type: string
        name:
          type: string
        size:
          type: integer
        contentType:
          type: string
        expiresAt:
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - applicationId
        - databaseId
        - key
        - name
        - size
        - contentType
        - createdAt
        - updatedAt
    Error:
      type: object
      required:
        - code
        - message
      properties:
        error:
          type: string
        message:
          type: string
  responses:
    UnauthorisedError:
      description: The request lacks valid authentication credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            unauthorised:
              value:
                error: UnauthorisedError
                message: You are unauthorised to perform this action.
    NotFound:
      description: The specified resource does not exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            notFound:
              value:
                error: NotFoundError
                message: The requested resource was not found.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Enter your API key using the format `Bearer <your-api-key>`.
    CodeAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Enter your code using the format `Code <your-code>`.

````

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