> ## 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.

# Export schemas

> Export one or more schemas to a downloadable zip file.

**Request Body:**
- `aiSchemaIds` (string, required): Comma-separated list of schema IDs to export

**Response:**
- `exportedFileDownloadUrl` (string): Pre-signed URL to download the exported zip file (valid for 1 hour)
- `s3Path` (string): S3 path where the file is stored
- `fileName` (string): Name of the exported file

**Example:**
```json
{
  "aiSchemaIds": "649e2d2d2d2d2d2d2d2d2d2d,649e2d2d2d2d2d2d2d2d2d2e"
}
```

Export one or more schemas to a downloadable zip file. This endpoint allows you to backup or transfer your AI schemas between workspaces.

<Info>
  The exported zip file contains all schema definitions, field mappings, and
  related metadata needed to recreate the schemas.
</Info>

## How It Works

<Steps>
  <Step title="1. Select Schemas">
    Choose which schemas to export by providing their IDs
  </Step>

  <Step title="2. Export Request">
    Send the schema IDs to receive a pre-signed download URL
  </Step>

  <Step title="3. Download File">
    Use the pre-signed URL to download the exported zip file
  </Step>
</Steps>

## Request Parameters

### Request Body

The request body must contain a JSON object with the following property:

| Property    | Type   | Required | Description                                  |
| ----------- | ------ | -------- | -------------------------------------------- |
| aiSchemaIds | string | Yes      | Comma-separated list of schema IDs to export |

**Example Request Body:**

```json theme={null}
{
  "aiSchemaIds": "649e2d2d2d2d2d2d2d2d2d2d,649e2d2d2d2d2d2d2d2d2d2e"
}
```

## Downloading the Exported File

<Warning>
  The pre-signed download URL is valid for **1 hour** only. Download the file
  promptly.
</Warning>

```bash theme={null}
# Use the download URL from the response
curl -o exported-schemas.zip "https://s3.amazonaws.com/bucket/exported-schemas.zip?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Signature=...&Expires=3600"
```

## Export File Contents

The exported zip file contains:

* **Schema definitions** - JSON files with field mappings and validation rules
* **Blueprint configurations** - Document type classifications and extraction rules
* **Metadata** - Creation timestamps, version information, and relationships

<Note>
  Exported schemas can be imported into other workspaces using the
  `/prod/v1/files/schema/import` endpoint.
</Note>

## Best Practices

* **Regular backups** - Export schemas periodically to maintain backups
* **Workspace transfers** - Use export/import to move schemas between workspaces
* **Version control** - Keep track of exported files for schema versioning
* **Validate before import** - Review exported contents before importing to new workspaces


## OpenAPI

````yaml post /prod/v1/files/schema/export
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/files/schema/export:
    post:
      tags:
        - Public API V1
      summary: Export schemas
      description: >-
        Export one or more schemas to a downloadable zip file.


        **Request Body:**

        - `aiSchemaIds` (string, required): Comma-separated list of schema IDs
        to export


        **Response:**

        - `exportedFileDownloadUrl` (string): Pre-signed URL to download the
        exported zip file (valid for 1 hour)

        - `s3Path` (string): S3 path where the file is stored

        - `fileName` (string): Name of the exported file


        **Example:**

        ```json

        {
          "aiSchemaIds": "649e2d2d2d2d2d2d2d2d2d2d,649e2d2d2d2d2d2d2d2d2d2e"
        }

        ```
      operationId: PublicAPIController_exportBlueprints
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExportBlueprintsForPAInput'
      responses:
        '200':
          description: Schemas exported successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportBlueprintsForPAOutput'
        '400':
          description: Bad Request - Invalid blueprint IDs
        '422':
          description: Unprocessable Entity - Invalid input
        '429':
          description: Too Many Requests
      security:
        - x-api-key: []
components:
  schemas:
    ExportBlueprintsForPAInput:
      type: object
      properties:
        aiSchemaIds:
          type: string
          description: AISchemaIds IDs to export (comma-separated)
          example: 649e2d2d2d2d2d2d2d2d2d2d,649e2d2d2d2d2d2d2d2d2d2e
      required:
        - aiSchemaIds
    ExportBlueprintsForPAOutput:
      type: object
      properties:
        exportedFileDownloadUrl:
          type: string
          description: Exported file download URL
        s3Path:
          type: string
          description: S3 path of the exported file
        fileName:
          type: string
          description: File name
      required:
        - exportedFileDownloadUrl
        - s3Path
        - fileName
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication

````