PATCH
/
prod
/
v1
/
schemas
Patch a schema
curl --request PATCH \
  --url https://api.orion.file.ai/prod/v1/schemas \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "schemaId": "5f5f726eea75272d54e1e1e1",
  "fields": [
    {
      "id": "5f5f726eea75272d54e1e1e2",
      "title": "Title",
      "description": "Description",
      "type": "STRING",
      "format": "text",
      "hidden": false,
      "internet_context": false,
      "fieldSuggestion": {
        "id": "5f5f726eea75272d54e1e1e3",
        "name": "Field Suggestion"
      },
      "items": [],
      "value": "Value",
      "enumValues": [],
      "inlineListType": "SINGLE"
    }
  ]
}'
{
  "success": true
}
The schemaId field is used to specify the schema that should be patched. The fields field is used to specify the fields that should be updated. The fields field is an array of fields. Each field contains the following fields:
  • title: The title of the field. This is the human-readable name of the field.
  • description: The description of the field. This is a human-readable description of the field.
  • type: The type of the field. This can be either STRING, NUMBER, BOOLEAN, DATE, or OBJECT.
  • format: The format of the field. This is a string that indicates the format of the field.
  • hidden: Whether the field is hidden or not. This is a boolean value that indicates whether the field is hidden or not.
  • internet_context: Whether the field is internet context or not. This is a boolean value that indicates whether the field is internet context or not.
  • fieldSuggestion: The field suggestion of the field. This is an object that contains the following fields:
  • id: The ID of the field suggestion. This is the unique identifier for the field suggestion.
  • name: The name of the field suggestion. This is the human-readable name of the field suggestion.
  • items: The items of the field. This is an array of fields that are the items of the field.
  • value: The value of the field. This is the value of the field.
  • enumValues: The enum values of the field. This is an array of strings that are the enum values of the field.
  • inlineListType: The inline list type of the field. This is a string that indicates the inline list type of the field.

Request Body

ParameterTypeRequiredDescription
schemaIdstringYesUnique identifier of the schema to update
fieldsarrayYesArray of field objects to update or add

Field Object Structure

Each field in the fields array can contain the following properties:
PropertyTypeRequiredDescription
titlestringNoHuman-readable name of the field
descriptionstringNoDetailed description of the field’s purpose
typestringNoData type: STRING, NUMBER, BOOLEAN, DATE, or OBJECT
formatstringNoSpecific format specification for the field
hiddenbooleanNoWhether the field should be hidden from display
internet_contextbooleanNoWhether the field relates to internet/web context
fieldSuggestionobjectNoSuggested values configuration
itemsarrayNoFor array/list fields, defines the structure of list items
valueanyNoDefault or current value of the field
enumValuesarrayNoArray of allowed string values for enum fields
inlineListTypestringNoType specification for inline list formatting

Field Object Structure

Each field in the fields array can contain the following properties:
PropertyTypeDescription
idstringUnique identifier for the suggestion
namestringDisplay name for the suggestion

Example Request

{
  "schemaId": "user-profile-schema-123",
  "fields": [
    {
      "title": "Full Name",
      "description": "User's complete name including first and last name",
      "type": "STRING",
      "hidden": false,
      "value": ""
    },
    {
      "title": "Age",
      "description": "User's age in years",
      "type": "NUMBER",
      "format": "integer",
      "hidden": false
    },
    {
      "title": "Account Status",
      "description": "Current status of the user account",
      "type": "STRING",
      "enumValues": ["active", "inactive", "suspended", "pending"],
      "fieldSuggestion": {
        "id": "status-suggestion-1",
        "name": "Account Status Options"
      }
    },
    {
      "title": "Preferences",
      "description": "User preference settings",
      "type": "OBJECT",
      "hidden": false,
      "items": [
        {
          "title": "Email Notifications",
          "type": "BOOLEAN",
          "value": true
        }
      ]
    }
  ]
}

Authorizations

x-api-key
string
header
required

API key for authentication

Body

application/json · string

The schema to patch

The body is of type string.

Response

200
application/json

The schema is patched

The response is of type object.