Metadata Schemas

Update a metadata schema

Changes the schema, the selector, or both. resource_type is fixed at creation: it decides the selector's spelling and which write path reads the row, so changing it would silently repoint the declaration at a different door — delete it and declare again instead.

patch/v1/projects/{project_id}/metadata-schemas/{metadata_schema_id}

Request

  • Base URL: https://api.naturali.ai
  • URL: https://api.naturali.ai/v1/projects/{project_id}/metadata-schemas/{metadata_schema_id}
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://api.naturali.ai/authorize, token URL https://api.naturali.ai/token, scopes: mcp:access)

Path parameters

metadata_schema_idstring required
Example:mdschema_V1StGXR8Z5jdHi6B

Request body

path_prefixstring

The declaration's new selector.

schemaobject

Replaces the declared JSON Schema.

Example request

{
  "path_prefix": "/reports/quarterly",
  "schema": {
    "type": "object",
    "required": [
      "quarter",
      "owner"
    ],
    "properties": {
      "quarter": {
        "type": "string"
      },
      "owner": {
        "type": "string"
      }
    }
  }
}

Response

The declaration

idstring

Public ID (mdschema_ prefix)

project_idstring
resource_type'document'

The resource whose metadata this declaration governs.

path_prefixstring

The selector, in the field its resource type is addressed by. A document's is the directory it is filed under.

schemaobject

The declared JSON Schema, as written.

created_atstring date-time
updated_atstring date-time

Example response

{
  "id": "mdschema_V1StGXR8Z5jdHi6B",
  "project_id": "proj_V1StGXR8Z5jdHi6B",
  "resource_type": "document",
  "path_prefix": "/reports",
  "schema": {
    "type": "object",
    "required": [
      "quarter"
    ],
    "properties": {
      "quarter": {
        "type": "string"
      }
    }
  },
  "created_at": "2024-01-01T00:00:00.000Z",
  "updated_at": "2024-01-01T00:00:00.000Z"
}

Changes

No recorded changes to this operation across all 1 revision of this API.