Skip to main content

Update Asset Schema

PUT 

/api/v1/assetschemas/:schema_id

Update an existing Asset Schema definition.

Warning: Built-in Asset Schema (Schema ID 0) cannot be updated using this API.

What you CAN change

  • Add new fields — existing assets won't have values for these fields, which is fine
  • Increase maxLength for text fields — makes the field accept longer values

What you SHOULD NOT change

  • Field types — can't change a string to a number
  • Search properties (keyword_searchable, searchable) — would require re-indexing
  • Remove fields — would orphan existing data
  • Rename fields — same as remove + add, breaks existing data
  • Decrease minLength — would invalidate previously valid data
Schema versioning strategy

Since you can't change field types or search properties, plan your schema carefully before creating it. If you need incompatible changes, create a new schema and migrate assets gradually. After migration, deactivate the old schema by setting status: "INACTIVE".

For more on schema versioning and soft-delete, see Organizing Assets with Custom Metadata Schemas.

Request Body JSON

Include id of the Asset Schema to be updated in the request payload:-

{
"id": 26,
"name": {
"en": "My Asset Schema"
},
"status": "ACTIVE",
"schema": {
"$id": "https://app.filespin.io/api/v1/json-schema/Asset/CustomMetadata.v1.schema.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"title": "My Asset Metadata",
"required": [],
"properties": {
"email": {
"title": "An Email",
"type": "string",
"format": "email",
"minLength": 5,
"maxLength": 200,
"filespin_properties": {
"title": {
"en": "an email"
},
"hint": {
"en": "an email"
},
"placeholder": {
"en": "an email"
},
"searchable": true,
"keyword_searchable": false,
"ui": {
"order": 4,
"readonly": false,
"disabled": false,
"hidden": false
}
}
}
}
}
}

Response

Returns HTTP 200 on success. The response body is the updated schema definition.

Request

Responses

Schema updated successfully