ReferenceSDKClient
Schemas
SDK reference for schemas — Create and manage reusable JSON Schema definitions for validation.
Create and manage reusable JSON Schema definitions for validation.
createSchema
Create a new JSON Schema definition that can be used for validation.
POST
Usage:
const result = await swirls.client.schemas.createSchema({
projectId: '...',
name: '...',
label: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | No | |
projectId | string | Yes | |
folderId | string | null | No | |
name | string | Yes | |
label | string | Yes | |
description | string | No | |
schema | object | No |
Output:
| Field | Type | Description |
|---|---|---|
id | string |
getSchema
Get a schema by ID
GET
Usage:
const result = await swirls.client.schemas.getSchema({
id: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes |
Output:
| Field | Type | Description |
|---|---|---|
id | string | |
projectId | string | |
folderId | string | null | |
name | string | |
label | string | |
description | string | null | |
schema | object | null | |
createdAt | unknown | |
orgId | string | null | |
userId | string |
updateSchema
Update an existing schema.
PUT
Usage:
const result = await swirls.client.schemas.updateSchema({
id: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
name | string | No | |
description | string | No | |
schema | object | No | |
folderId | string | null | No |
Output:
| Field | Type | Description |
|---|---|---|
id | string | |
projectId | string | |
folderId | string | null | |
name | string | |
label | string | |
description | string | null | |
schema | object | null | |
createdAt | unknown | |
orgId | string | null | |
userId | string |
deleteSchema
Delete a schema
DELETE
Usage:
const result = await swirls.client.schemas.deleteSchema({
id: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes |
listSchemas
List all schemas in a project
GET
Usage:
const result = await swirls.client.schemas.listSchemas({
projectId: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
folderId | string | null | No | |
pagination | object | No |
Output:
| Field | Type | Description |
|---|---|---|
pagination | object | |
results | object[] | |
totalCount | number |
searchSchemaCandidates
GET
Usage:
const result = await swirls.client.schemas.searchSchemaCandidates({
projectId: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
query | string | No | |
excludeGraphId | string | No | |
excludeNodeId | string | No | |
limit | number | No |