PATCH
/
prod
/
v1
/
files
/
schema
Update file schema
curl --request PATCH \
  --url https://api.orion.file.ai/prod/v1/files/schema \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "fileId": "f739da3b-d8cb-4f62-8174-4d387c28a5ac",
  "schemaId": "689eaa87aea205bcfc0f0201",
  "shouldCreateCustomIfNotExists": true,
  "schemaVersionType": "MINOR",
  "shouldChangeDocumentToNewSchemaVersion": true,
  "fieldPaths": [
    {
      "path": "/Receipt Number",
      "mode": "CREATE",
      "attributes": {
        "type": "string",
        "format": null,
        "title": "Receipt Number",
        "hidden": false,
        "internet_context": false,
        "enumValues": [],
        "description": "Receipt Number"
      }
    }
  ]
}'
{
  "id": "689eaa87aea205bcfc0f0201",
  "fields": [
    {
      "id": "689eaa87aea205bcfc0f0201",
      "name": "Receipt Number",
      "type": "string",
      "format": null,
      "title": "Receipt Number",
      "hidden": false,
      "internet_context": false,
      "enumValues": [],
      "description": "Receipt Number"
    }
  ],
  "blueprintId": "689eaa87aea205bcfc0f0201",
  "originalSchemaId": "689eaa87aea205bcfc0f0201",
  "schemaHistoryId": "689eaa87aea205bcfc0f0201",
  "schemaHistoryVersionNumber": 1,
  "fileId": "689eaa87aea205bcfc0f0201",
  "blueprintMode": "USER",
  "schemaType": "SYSTEM",
  "state": "ACTIVE",
  "usageApprovalState": "DRAFT",
  "schemaOverrideType": "NONE",
  "aiSchemaVersion": "v3",
  "createdAt": "2025-03-31T09:50:56.068Z",
  "updatedAt": "2025-03-31T09:50:56.068Z",
  "deletedAt": null,
  "deletedBy": null
}
It is used to change the file schema to a new version, and update the file fields accordingly. The shouldChangeDocumentToNewSchemaVersion flag is used to determine whether the file should be updated to the new schema version.
  • If set to true, the file will be updated to the new schema version.
  • If set to false, the file will not be updated, and the new schema version will be created as a new schema version.
The shouldCreateCustomIfNotExists flag is used to determine whether a custom schema should be created if the file does not have a custom schema.
  • If set to true, a custom schema will be created if the file does not have a custom schema.
  • If set to false, no custom schema will be created.
The schemaVersionType field is used to determine the type of schema version that should be created.
  • The allowed values are MAJOR, MINOR, and PATCH.
The fieldPaths field is used to specify the fields that should be updated in the file.
  • The fields that are specified in the fieldPaths field will be updated with the new schema fields.
  • If a field is not specified in the fieldPaths field, the field will not be updated.

Authorizations

x-api-key
string
header
required

API key for authentication

Body

application/json · string

Update file schema

The body is of type string.

Response

200
application/json

The schema is patched

The response is of type object.