PUT
/
api
/
v1
/
schemas
/
id
/
{schema_id}
curl --request PUT \
  --url https://api.invaro.ai/api/v1/api/v1/schemas/id/{schema_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "description": "Updated schema with more fields",
  "schema_string": {
    "fields": [
      "invoice_number",
      "date",
      "total",
      "currency"
    ]
  }
}'
{
  "success": true,
  "data": {
    "id": "b3376c85-86e0-476e-aee9-5f05afaa05ea",
    "user_id": "b4825725-605b-4374-a64e-c40896b5a0e8",
    "name": "invoice_schema_v1",
    "type": "invoice",
    "description": "Schema for parsing standard invoices",
    "schema_string": "{\"fields\": [...]} Gzip Base64 format",
    "version": 1,
    "is_active": true,
    "created_at": "2024-01-18T12:34:56Z",
    "updated_at": "2024-01-18T12:34:56Z"
  }
}

Path Parameters

schema_id
string
required

The unique identifier of the schema to update.

Request Body

Request
{
  "description": "Updated schema with more fields",
  "schema_string": {
    "fields": [
      "invoice_number",
      "date",
      "total",
      "customer_name",
      "items",
      "tax",
      "currency",
      "payment_terms"
    ]
  }
}

Response

Success Response (200)
{
  "success": true,
  "data": {
    "id": "b3376c85-86e0-476e-aee9-5f05afaa05ea",
    "name": "invoice_schema_v1",
    "type": "invoice",
    "description": "Updated schema with more fields",
    "schema_string": "{\"fields\": [...]}",
    "version": 2,
    "is_active": true,
    "created_at": "2024-01-18T12:34:56Z",
    "updated_at": "2024-01-18T12:35:56Z"
  }
}

Examples

Update a Schema

Curl
curl -X PUT "https://api.invaro.ai/api/v1/schemas/id/b3376c85-86e0-476e-aee9-5f05afaa05ea" \
  -H "Authorization: Bearer your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "Updated invoice schema with additional fields",
    "schema_string": {
      "fields": [
        "invoice_number",
        "date",
        "total",
        "customer_name",
        "items",
        "tax",
        "gst_number",
        "payment_terms",
        "currency",
        "due_date"
      ]
    }
  }'

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

schema_id
string
required

The unique identifier of the schema.

Body

application/json
description
string

Updated description for the schema

Example:

"Updated schema with more fields"

schema_string
object

The updated schema definition itself

Response

200 - application/json
Schema updated successfully
success
boolean
Example:

true

data
object