Update Asset Schema
PUT/api/v1/assetschemas/:schema_id
This API is used to create a new Asset Schema definition.
Note: When creating custom schema, please follow these guidelines to get the best performance:-
- Limit maximum size of a text field to 1000 characters, particularly fields marked as
searchable- Limit maximum metadata JSON payload per asset to 3000 characters
Warning: Note that when creating Asset Schema id should not be provided.
Asset Schema - Update
Update an existing Asset Schema definition.
Warning: Built-in Asset Schema (Schema ID 0) cannot be updated using this API.
Note
It is OK to:-
- Adding new field to existing schema
- Increase Max length for an existing text field
It is NOT OK to:
- Change a type of an existing field
- Change filespin properties of an existing schema field such as searchable, filterable, facetable
- Remove an existing field
- Change the name of existing field
- Change min length of any existing field
Request Body JSON
Include id of Asset Schema to be updated in {BODY PARAMs} request payload as below:-
{
"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
}
}
}
}
}
}
See [Asset Schema API] for the JSON format.
HTTP RESPONSE
| Parameter | Type | Description |
|---|---|---|
id | integer | ID of new Asset Schema created. |
Response JSON
{
"id": 27
}
Request
Responses
- 200
- 400
- 401
- 404
- 500
Schema updated successfully
Invalid schema definition
Unauthorized
Schema not found
Internal server error