Schemas
Create schema
Create a new product schema with column definitions.
POST
/
v1
/
schemas
const schema = await client.schemas.create({
name: "Electronics Catalog",
description: "Schema for consumer electronics",
columns: [
{ key: "product_name", label: "Product Name", type: "text", required: true },
{ key: "price", label: "Price", type: "number" },
{ key: "brand", label: "Brand", type: "text" },
{ key: "category", label: "Category", type: "enum", enum_values: ["phones", "laptops", "tablets"] },
{ key: "image_url", label: "Image", type: "image" },
{ key: "specs", label: "Specifications", type: "json" },
],
});
console.log(schema.id);
schema = client.schemas.create(
name="Electronics Catalog",
description="Schema for consumer electronics",
columns=[
{"key": "product_name", "label": "Product Name", "type": "text", "required": True},
{"key": "price", "label": "Price", "type": "number"},
{"key": "brand", "label": "Brand", "type": "text"},
{"key": "category", "label": "Category", "type": "enum", "enum_values": ["phones", "laptops", "tablets"]},
{"key": "image_url", "label": "Image", "type": "image"},
{"key": "specs", "label": "Specifications", "type": "json"},
],
)
print(schema["id"])
curl -X POST "https://hub.banditshq.com/api/v1/schemas" \
-H "Authorization: Bearer lasso_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Electronics Catalog",
"description": "Schema for consumer electronics",
"columns": [
{"key": "product_name", "label": "Product Name", "type": "text", "required": true},
{"key": "price", "label": "Price", "type": "number"},
{"key": "brand", "label": "Brand", "type": "text"},
{"key": "category", "label": "Category", "type": "enum", "enum_values": ["phones", "laptops", "tablets"]},
{"key": "image_url", "label": "Image", "type": "image"},
{"key": "specs", "label": "Specifications", "type": "json"}
]
}'
{
"id": "schema_abc123",
"name": "Electronics Catalog",
"description": "Schema for consumer electronics",
"is_default": false,
"columns": [
{ "key": "product_name", "label": "Product Name", "type": "text", "required": true },
{ "key": "price", "label": "Price", "type": "number" }
],
"created_at": "2025-03-01T10:00:00.000Z",
"updated_at": "2025-03-01T10:00:00.000Z"
}
Request body
string
required
A name for the schema.
string
A description of what this schema is used for.
boolean
default:"false"
Whether this should be the default schema.
array
required
Array of column definitions. Must be non-empty.
Show Column object
Show Column object
string
required
Machine-readable key (snake_case).
string
required
Human-readable label.
string
required
Column type. One of:
text, number, url, email, date, boolean, richtext, enum, tags, image, images, json.boolean
Whether this column is required.
string
Description of the column.
string[]
Allowed values for
enum type columns.Response
string
Unique schema identifier.
string
Schema name.
string | null
Schema description.
boolean
Whether this is the default schema.
array
The column definitions.
string
ISO 8601 timestamp.
string
ISO 8601 timestamp.
const schema = await client.schemas.create({
name: "Electronics Catalog",
description: "Schema for consumer electronics",
columns: [
{ key: "product_name", label: "Product Name", type: "text", required: true },
{ key: "price", label: "Price", type: "number" },
{ key: "brand", label: "Brand", type: "text" },
{ key: "category", label: "Category", type: "enum", enum_values: ["phones", "laptops", "tablets"] },
{ key: "image_url", label: "Image", type: "image" },
{ key: "specs", label: "Specifications", type: "json" },
],
});
console.log(schema.id);
schema = client.schemas.create(
name="Electronics Catalog",
description="Schema for consumer electronics",
columns=[
{"key": "product_name", "label": "Product Name", "type": "text", "required": True},
{"key": "price", "label": "Price", "type": "number"},
{"key": "brand", "label": "Brand", "type": "text"},
{"key": "category", "label": "Category", "type": "enum", "enum_values": ["phones", "laptops", "tablets"]},
{"key": "image_url", "label": "Image", "type": "image"},
{"key": "specs", "label": "Specifications", "type": "json"},
],
)
print(schema["id"])
curl -X POST "https://hub.banditshq.com/api/v1/schemas" \
-H "Authorization: Bearer lasso_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Electronics Catalog",
"description": "Schema for consumer electronics",
"columns": [
{"key": "product_name", "label": "Product Name", "type": "text", "required": true},
{"key": "price", "label": "Price", "type": "number"},
{"key": "brand", "label": "Brand", "type": "text"},
{"key": "category", "label": "Category", "type": "enum", "enum_values": ["phones", "laptops", "tablets"]},
{"key": "image_url", "label": "Image", "type": "image"},
{"key": "specs", "label": "Specifications", "type": "json"}
]
}'
{
"id": "schema_abc123",
"name": "Electronics Catalog",
"description": "Schema for consumer electronics",
"is_default": false,
"columns": [
{ "key": "product_name", "label": "Product Name", "type": "text", "required": true },
{ "key": "price", "label": "Price", "type": "number" }
],
"created_at": "2025-03-01T10:00:00.000Z",
"updated_at": "2025-03-01T10:00:00.000Z"
}
Column types
| Type | Description |
|---|---|
text | Plain text string. |
number | Numeric value (integer or float). |
url | A valid URL. |
email | An email address. |
date | A date or datetime string. |
boolean | true or false. |
richtext | HTML or markdown formatted text. |
enum | One of a predefined set of values (see enum_values). |
tags | Array of string tags. |
image | A single image URL. |
images | Array of image URLs. |
json | Arbitrary JSON object. |
⌘I
const schema = await client.schemas.create({
name: "Electronics Catalog",
description: "Schema for consumer electronics",
columns: [
{ key: "product_name", label: "Product Name", type: "text", required: true },
{ key: "price", label: "Price", type: "number" },
{ key: "brand", label: "Brand", type: "text" },
{ key: "category", label: "Category", type: "enum", enum_values: ["phones", "laptops", "tablets"] },
{ key: "image_url", label: "Image", type: "image" },
{ key: "specs", label: "Specifications", type: "json" },
],
});
console.log(schema.id);
schema = client.schemas.create(
name="Electronics Catalog",
description="Schema for consumer electronics",
columns=[
{"key": "product_name", "label": "Product Name", "type": "text", "required": True},
{"key": "price", "label": "Price", "type": "number"},
{"key": "brand", "label": "Brand", "type": "text"},
{"key": "category", "label": "Category", "type": "enum", "enum_values": ["phones", "laptops", "tablets"]},
{"key": "image_url", "label": "Image", "type": "image"},
{"key": "specs", "label": "Specifications", "type": "json"},
],
)
print(schema["id"])
curl -X POST "https://hub.banditshq.com/api/v1/schemas" \
-H "Authorization: Bearer lasso_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Electronics Catalog",
"description": "Schema for consumer electronics",
"columns": [
{"key": "product_name", "label": "Product Name", "type": "text", "required": true},
{"key": "price", "label": "Price", "type": "number"},
{"key": "brand", "label": "Brand", "type": "text"},
{"key": "category", "label": "Category", "type": "enum", "enum_values": ["phones", "laptops", "tablets"]},
{"key": "image_url", "label": "Image", "type": "image"},
{"key": "specs", "label": "Specifications", "type": "json"}
]
}'
{
"id": "schema_abc123",
"name": "Electronics Catalog",
"description": "Schema for consumer electronics",
"is_default": false,
"columns": [
{ "key": "product_name", "label": "Product Name", "type": "text", "required": true },
{ "key": "price", "label": "Price", "type": "number" }
],
"created_at": "2025-03-01T10:00:00.000Z",
"updated_at": "2025-03-01T10:00:00.000Z"
}

