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

# Get all schemas

> This endpoint is used to get all schemas.

The response will contain a list of all schemas that are available for the current user in the current workspace.

The `schemas` field is an array of schemas. Each schema contains the following fields:

- `id`: The ID of the schema. This is the unique identifier for the schema.

- `fields`: An array of fields. Each field contains the following fields:

  - `id`: The ID of the field. This is the unique identifier for the field.

- `blueprintId`: The ID of the blueprint that the schema is associated with.

- `originalSchemaId`: The ID of the original schema that the schema is based on.

- `schemaHistoryId`: The ID of the schema history that the schema is associated with.

- `schemaHistoryVersionNumber`: The version number of the schema history that the schema is associated with. This is a number that increments every time a new version of the schema is created.

- `fileId`: The ID of the file that the schema is associated with.

- `blueprintMode`: The mode of the blueprint that the schema is associated with. This can be either USER or SYSTEM.

- `schemaType`: The type of the schema. This can be either SYSTEM, CUSTOM, or AI.

- `state`: The state of the schema. This can be either ACTIVE or INACTIVE.

- `usageApprovalState`: The state of the usage approval of the schema. This can be either APPROVED, PENDING, or REJECTED.

- `schemaOverrideType`: The type of the schema override. This can be either OVERRIDE or DEFAULT.

- `aiSchemaVersion`: The version of the AI schema that the schema is associated with.

- `createdAt`: The date and time when the schema was created.

- `updatedAt`: The date and time when the schema was last updated.

- `deletedAt`: The date and time when the schema was deleted.

- `deletedBy`: The ID of the user who deleted the schema.


The response will contain a list of all schemas that are available for the current user in the current workspace. The schemas field is an array of schemas.

Each **schema** contains the following fields:

* **id**: The ID of the schema. This is the unique identifier for the schema.
* **fields**: An array of fields.

Each **field** contains the following fields:

* **id**: The ID of the field. This is the unique identifier for the field.
* **blueprintId**: The ID of the blueprint that the schema is associated with.
* **originalSchemaId**: The ID of the original schema that the schema is based on.
* **schemaHistoryId**: The ID of the schema history that the schema is associated with.
* **schemaHistoryVersionNumber**: The version number of the schema history that the schema is associated with. This is a number that increments every time a new version of the schema is created.
* **fileId**: The ID of the file that the schema is associated with.
* **blueprintMode**: The mode of the blueprint that the schema is associated with. This can be either USER or SYSTEM.
* **schemaType**: The type of the schema. This can be either SYSTEM, CUSTOM, or AI.
* **state**: The state of the schema. This can be either ACTIVE or INACTIVE.
* **usageApprovalState**: The state of the usage approval of the schema. This can be either APPROVED, PENDING, or REJECTED.
* **schemaOverrideType**: The type of the schema override. This can be either OVERRIDE or DEFAULT.
* **aiSchemaVersion**: The version of the AI schema that the schema is associated with.


## OpenAPI

````yaml /api-reference/cleaned_openapi.json GET /prod/v1/schemas
openapi: 3.0.0
info:
  title: Public API
  description: >-

    ### Welcome to fileAI’s Public API Documentation.

    This API allows users to check the health of the system, upload and manage
    files, and manage AI Schemas.

    Should you have any questions, please reach out to fileAI via the “Contact a
    Developer” link below.



    [Contact a Developer](mailto:support@file.ai)



    ### Prerequisites


    Before using our API, please ensure you complete the following prerequisites

    - You must have a fileAI account. Sign up or login
    [here](https://orion.file.ai/en/sign-up)

    - You must have an API Key. After creating your fileAI account, you can
    generate your API Key. Refer to the Authentication section below for more
    details.



    ### Authentication

    All API requests require an API key for authentication.

    - To obtain your API key, please log in to your fileAI account and navigate
    to Project Settings in your dashboard

    - Keep your API key secure and do not share it publicly.


    ![Authentication](https://fileai-static-assets.s3.us-west-2.amazonaws.com/public-api-service/authentication.png)


    ### How to Use Your API Key

    Once you have your API key:

    - Click the Authorize button on the top-right of this page

    - Enter your API Key under Value

    - Click Authorize to start making authenticated requests directly from the
    documentation


    ![How to Use Your API
    Key](https://fileai-static-assets.s3.us-west-2.amazonaws.com/public-api-service/how-to-use-api-keys.png)
        
  version: '1.0'
  contact: {}
servers:
  - url: https://api.orion.file.ai
security: []
tags:
  - name: Public API V1
paths:
  /prod/v1/schemas:
    get:
      tags:
        - Public API V1
      summary: Get all schemas
      description: >
        This endpoint is used to get all schemas.


        The response will contain a list of all schemas that are available for
        the current user in the current workspace.


        The `schemas` field is an array of schemas. Each schema contains the
        following fields:


        - `id`: The ID of the schema. This is the unique identifier for the
        schema.


        - `fields`: An array of fields. Each field contains the following
        fields:

          - `id`: The ID of the field. This is the unique identifier for the field.

        - `blueprintId`: The ID of the blueprint that the schema is associated
        with.


        - `originalSchemaId`: The ID of the original schema that the schema is
        based on.


        - `schemaHistoryId`: The ID of the schema history that the schema is
        associated with.


        - `schemaHistoryVersionNumber`: The version number of the schema history
        that the schema is associated with. This is a number that increments
        every time a new version of the schema is created.


        - `fileId`: The ID of the file that the schema is associated with.


        - `blueprintMode`: The mode of the blueprint that the schema is
        associated with. This can be either USER or SYSTEM.


        - `schemaType`: The type of the schema. This can be either SYSTEM,
        CUSTOM, or AI.


        - `state`: The state of the schema. This can be either ACTIVE or
        INACTIVE.


        - `usageApprovalState`: The state of the usage approval of the schema.
        This can be either APPROVED, PENDING, or REJECTED.


        - `schemaOverrideType`: The type of the schema override. This can be
        either OVERRIDE or DEFAULT.


        - `aiSchemaVersion`: The version of the AI schema that the schema is
        associated with.


        - `createdAt`: The date and time when the schema was created.


        - `updatedAt`: The date and time when the schema was last updated.


        - `deletedAt`: The date and time when the schema was deleted.


        - `deletedBy`: The ID of the user who deleted the schema.
      operationId: PublicAPIController_getAllSchemas
      parameters:
        - name: schemaIds
          required: false
          in: query
          description: Schema Ids
          schema:
            example: 649e2d2d2d2d2d2d2d2d2d2d
            type: string
        - name: uploadIds
          required: false
          in: query
          description: Upload Ids
          schema:
            example: 649e2d2d2d2d2d2d2d2d2d2d
            type: string
        - name: page
          required: false
          in: query
          description: Page number
          schema:
            default: 1
            example: 1
            type: number
        - name: limit
          required: false
          in: query
          description: Number of items per page
          schema:
            default: 100
            example: 100
            type: number
        - name: sortBy
          required: false
          in: query
          description: Field to sort by
          schema:
            default: createdAt
            example: createdAt
            type: string
        - name: sortOrder
          required: false
          in: query
          description: Sort direction
          schema:
            default: ASC
            example: ASC
            enum:
              - ASC
              - DESC
            type: string
      responses:
        '200':
          description: The list of schemas
          content:
            application/json:
              example:
                schemas:
                  - id: 5f5f726eea75272d54e1e1e1
                    fields:
                      - id: 5f5f726eea75272d54e1e1e2
                    blueprintId: 5f5f726eea75272d54e1e1e3
                    originalSchemaId: 5f5f726eea75272d54e1e1e4
                    schemaHistoryId: 5f5f726eea75272d54e1e1e5
                    schemaHistoryVersionNumber: 1
                    fileId: 5f5f726eea75272d54e1e1e6
                    blueprintMode: USER
                    schemaType: SYSTEM
                    state: ACTIVE
                    usageApprovalState: APPROVED
                    schemaOverrideType: OVERRIDE
                    aiSchemaVersion: 5f5f726eea75272d54e1e1e7
                    createdAt: '2020-10-05T14:30:00.000Z'
                    updatedAt: '2020-10-05T14:30:00.000Z'
                    deletedAt: null
                    deletedBy: null
                count: 1
                currentPage: 1
              schema:
                type: object
                properties:
                  schemas:
                    type: array
                    items:
                      type: object
                  count:
                    type: number
                  currentPage:
                    type: number
        '401':
          description: Invalid API key | API key is missing
          content:
            application/json:
              example:
                message: Invalid API key | API key is missing
                error: Unauthorized
                statusCode: 401
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error:
                    type: string
                  statusCode:
                    type: number
        '429':
          description: Too Many Requests
          content:
            application/json:
              example:
                statusCode: 429
                message: Too Many Requests
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                  message:
                    type: string
      security:
        - x-api-key: []
components:
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication

````