Guides

Schema Create/Update

This API is used to create a new Asset Schema definition.

📘

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

🚧

Note that when creating Asset Schema id should not be provided.

Asset Schema - Update

Update an existing Asset Schema definition.

🚧

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

Note

It is OK to:-

  1. Adding new field to existing schema
  2. Increase Max length for an existing text field

It is NOT OK to:

  1. Change a type of an existing field
  2. Change filespin properties of an existing schema field such as searchable, filterable, facetable
  3. Remove an existing field
  4. Change the name of existing field
  5. 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": "<<API_HOST>>/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

ParameterTypeDescription
idintegerID of new Asset Schema created.

Response JSON

{
  "id": 27
}
Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!