> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chaintable.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenAPI endpoints

> Find credential access, parameters, response fields, and examples by resource.

The base URL is `https://api.chaintable.com`. See [Authentication](/guides/openapi/authentication) for credential setup and [API calls](/guides/openapi/calling) for response conventions, error handling, and CU consumption.

## Credential access

A Personal Access Token can access every OpenAPI endpoint on this page, subject to the user’s resource permissions. Access Keys serve production applications and services making calls at scale. They support only the following endpoints, subject to the owning account’s resource permissions:

| Method | Path | Purpose |
| - | - | - |
| `POST` | [/v1/function/invoke](#post-function-invoke) | Invoke a Function |
| `POST` | [/v1/leafage/\{chain\_id}](#post-leafage-chain-id) | Call Leafage |

A Personal Access Token requires `X-Account-ID`. An Access Key uses its owning account; if this header is supplied, it must match.

Send `GET` parameters in the query string and `POST` parameters in a JSON body. For nested fields, “Required” applies when the containing object is supplied. Optional fields accept `null` only when their type includes it. Return fields describe `data`; conditional related fields appear only when requested or applicable.

IDs and results in examples are illustrative; replace them with your own resources. Credentials are read from environment variables. Expand an object or array to see its fields. `object[]` denotes an array of objects.

## Endpoints

### space

<AccordionGroup>
  <Accordion title="GET /v1/space — Get a Space" id="get-space">
    `id` is a Space ID. Returns `data: null` if it does not exist.

    **Method**: `GET`<br />
    **Path**: `/v1/space`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Space ID; 1–64 characters |

    **Returns**

    `data` is `null` if the object does not exist.

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `description` | `string` / `null` | Description |
    | `account_id` | `string` | Account ID |
    | `status` | `string` | Status |
    | `visibility` | `string` | Visibility: public, org, or private |
    | `dep_count` | `integer` | Dependency count |
    | `content_count` | `integer` | Number of content entries |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `account` | `object` / `null` | Account details |

    <Expandable title="account — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `type` | `string` | Account type: personal or org |
      | `slug` | `string` / `null` | Account slug used for display and URLs |
      | `display_name` | `string` / `null` | Account display name |
      | `avatar_url` | `string` / `null` | Avatar URL |
      | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/space \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode id=demo
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "demo",
        "description": "Example resources",
        "account_id": "0190000000007000800000000000000b",
        "status": "active",
        "visibility": "public",
        "dep_count": 0,
        "content_count": 6,
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "account": {
          "id": "0190000000007000800000000000000b",
          "type": "org",
          "slug": "example-team",
          "display_name": "Example team",
          "avatar_url": null,
          "avatar_thumbnail_url": null
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/space/list — List visible Spaces" id="get-space-list">
    List visible Spaces.

    **Method**: `GET`<br />
    **Path**: `/v1/space/list`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `start` | `integer` | No | Pagination offset, starting at 0; ≥ 0; Default `0` |
    | `limit` | `integer` | No | Maximum number of entries; ≥ 1; ≤ 1000; Default `100` |
    | `account_id` | `string` / `null` | No | Account ID; 32–32 characters; Pattern: `^[0-9a-f]{32}$` |
    | `order_by` | `string` | No | Sort field; Values: `"id"`, `"created_at"`, `"updated_at"`; Default `"updated_at"` |
    | `direction` | `string` | No | Sort direction; Values: `"asc"`, `"desc"`; Default `"desc"` |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `start` | `integer` | Pagination offset, starting at 0 |
    | `limit` | `integer` | Maximum number of entries |
    | `items` | `object[]` | Entries on this page |
    | `total_count` | `integer` | Total number of matching entries |

    <Expandable title="items — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `description` | `string` / `null` | Description |
      | `account_id` | `string` | Account ID |
      | `status` | `string` | Status |
      | `visibility` | `string` | Space visibility |
      | `dep_count` | `integer` | Dependency count |
      | `content_count` | `integer` | Number of content entries |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |
      | `table_count` | `integer` | Number of tables in the Space |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/space/list \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode start=0 \
      --data-urlencode limit=10
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "items": [
          {
            "id": "demo",
            "description": "Example resources",
            "account_id": "0190000000007000800000000000000b",
            "status": "active",
            "visibility": "public",
            "dep_count": 0,
            "content_count": 6,
            "created_at": 1788220800.0,
            "updated_at": 1788220800.0,
            "account": {
              "id": "0190000000007000800000000000000b",
              "type": "org",
              "slug": "example-team",
              "display_name": "Example team",
              "avatar_url": null,
              "avatar_thumbnail_url": null
            },
            "table_count": 1
          }
        ],
        "total_count": 1,
        "start": 0,
        "limit": 10
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### table

Row-reading endpoints represent 64-bit integers, UINT256, and DECIMAL values as strings to preserve precision. See [Data types](/reference/data-types).

<AccordionGroup>
  <Accordion title="GET /v1/table — Get a table definition" id="get-table">
    Use the full table ID. Leave `is_l1=false` for the main definition; use `true` to read a derived data table.

    **Method**: `GET`<br />
    **Path**: `/v1/table`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Full table ID, such as demo.asset\_notes; 1–255 characters |
    | `is_l1` | `boolean` | No | Whether to read a derived data table definition; Default `false` |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `space` | `string` | Space ID |
    | `name` | `string` / `null` | Name |
    | `chain_id` | `string` / `null` | Platform chain identifier, such as eth; empty or null for non-block tables |
    | `table_type` | `string` | Table type |
    | `description` | `string` / `null` | Description |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `space_entity` | `object` / `null` | Details of the owning Space |
    | `columns` | `object[]` | Initialized column definitions; omitted from list responses |
    | `indexes` | `object[]` | Initialized indexes; omitted from list responses |
    | `view` | `object` / `null` | Table display settings |
    | `start_height` | `integer` / `null` | Start block height |
    | `deps` | `integer` | Number of dependencies reading the table |
    | `last_write_at_ms` | `integer` / `null` | Last write time in Unix milliseconds; null if unavailable |
    | `first_write_at` | `number` / `null` | First write time in Unix seconds; returned for Time tables |
    | `inited` | `boolean` | Whether initialized; returned by detail and schema operations |
    | `table_rows` | `integer` | Number of table rows |
    | `table_size` | `integer` | Table data size in bytes |
    | `replica_num` | `integer` | Number of replicas |
    | `s3_synced_at` | `number` / `null` | Data synchronization time in Unix seconds |
    | `subtables` | `object[]` | Related tables |
    | `parent` | `object` | Owning table’s ID and type |
    | `label` | `string` | Display label or category |
    | `relations` | `object[]` | Related tables |

    <Expandable title="space_entity — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `description` | `string` / `null` | Description |
      | `account_id` | `string` | Account ID |
      | `status` | `string` | Status |
      | `visibility` | `string` | Visibility: public, org, or private |
      | `dep_count` | `integer` | Dependency count |
      | `content_count` | `integer` | Number of content entries |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    <Expandable title="columns — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `name` | `string` | Name |
      | `type` | `string` | Logical column type; see the data types reference; see [Data types](/reference/data-types) |
      | `is_system` | `boolean` | Whether this is a system column or index |
    </Expandable>

    <Expandable title="indexes — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` / `null` | Unique object ID |
      | `columns` | `string[]` | Column names in index order |
      | `is_primary` | `boolean` | Whether this is the primary key index |
      | `is_system` | `boolean` | Whether this is a system column or index |
      | `is_hidden` | `boolean` | Whether the index is hidden |
    </Expandable>

    <Expandable title="view — Value fields">
      | Field | Type | Description |
      | - | - | - |
      | `sort` | `integer` | Column display order, starting at 0 |
    </Expandable>

    <Expandable title="subtables — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `label` | `string` | Display label or category |
    </Expandable>

    <Expandable title="parent — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `table_type` | `string` | Table type |
    </Expandable>

    <Expandable title="relations — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `label` | `string` | Display label or category |
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/table \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode id=demo.asset_notes
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "demo.asset_notes",
        "space": "demo",
        "name": "asset_notes",
        "chain_id": "",
        "table_type": "normal",
        "description": "Asset notes",
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "columns": [
          {
            "id": "id",
            "name": "id",
            "type": "STRING",
            "is_system": true
          },
          {
            "id": "note",
            "name": "note",
            "type": "STRING",
            "is_system": false
          }
        ],
        "indexes": [
          {
            "columns": [
              "id"
            ],
            "is_primary": true,
            "is_system": true
          }
        ],
        "table_rows": 1,
        "table_size": 64,
        "replica_num": 1,
        "inited": true,
        "subtables": [],
        "space_entity": {
          "id": "demo",
          "description": "Example resources",
          "account_id": "0190000000007000800000000000000b",
          "status": "active",
          "visibility": "public",
          "dep_count": 0,
          "content_count": 6,
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "account": {
            "id": "0190000000007000800000000000000b",
            "type": "org",
            "slug": "example-team",
            "display_name": "Example team",
            "avatar_url": null,
            "avatar_thumbnail_url": null
          }
        },
        "view": {
          "id": {
            "sort": 0
          },
          "note": {
            "sort": 1
          }
        },
        "deps": 0,
        "last_write_at_ms": 1788220800000
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/table/columns/update — Update columns" id="post-table-columns-update">
    Replaces the column definitions. Include existing columns you want to retain. Existing types cannot change, and columns referenced by indexes cannot be removed.

    **Method**: `POST`<br />
    **Path**: `/v1/table/columns/update`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Full table ID, such as demo.asset\_notes; 1–255 characters |
    | `columns` | `object[]` | Yes | Column definitions |
    | `view` | `object` / `null` | No | Table display settings |

    <Expandable title="columns — Item fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `id` | `string` | Yes | Unique object ID; 1–64 characters |
      | `name` | `string` | Yes | Name; 1–64 characters |
      | `type` | `string` | Yes | Logical column type; see the data types reference; see [Data types](/reference/data-types); ≥ 1 characters |
    </Expandable>

    <Expandable title="view — Value fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `sort` | `integer` | No | Column display order, starting at 0 |
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `space` | `string` | Space ID |
    | `name` | `string` / `null` | Name |
    | `chain_id` | `string` / `null` | Platform chain identifier, such as eth; empty or null for non-block tables |
    | `table_type` | `string` | Table type |
    | `description` | `string` / `null` | Description |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `space_entity` | `object` / `null` | Details of the owning Space |
    | `columns` | `object[]` | Initialized column definitions; omitted from list responses |
    | `indexes` | `object[]` | Initialized indexes; omitted from list responses |
    | `view` | `object` / `null` | Table display settings |
    | `start_height` | `integer` / `null` | Start block height |
    | `deps` | `integer` | Number of dependencies reading the table |
    | `last_write_at_ms` | `integer` / `null` | Last write time in Unix milliseconds; null if unavailable |
    | `first_write_at` | `number` / `null` | First write time in Unix seconds; returned for Time tables |
    | `inited` | `boolean` | Whether initialized; returned by detail and schema operations |
    | `table_rows` | `integer` | Number of table rows |
    | `table_size` | `integer` | Table data size in bytes |
    | `replica_num` | `integer` | Number of replicas |
    | `s3_synced_at` | `number` / `null` | Data synchronization time in Unix seconds |
    | `subtables` | `object[]` | Related tables |
    | `parent` | `object` | Owning table’s ID and type |
    | `label` | `string` | Display label or category |
    | `relations` | `object[]` | Related tables |

    <Expandable title="space_entity — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `description` | `string` / `null` | Description |
      | `account_id` | `string` | Account ID |
      | `status` | `string` | Status |
      | `visibility` | `string` | Visibility: public, org, or private |
      | `dep_count` | `integer` | Dependency count |
      | `content_count` | `integer` | Number of content entries |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    <Expandable title="columns — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `name` | `string` | Name |
      | `type` | `string` | Logical column type; see the data types reference; see [Data types](/reference/data-types) |
      | `is_system` | `boolean` | Whether this is a system column or index |
    </Expandable>

    <Expandable title="indexes — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` / `null` | Unique object ID |
      | `columns` | `string[]` | Column names in index order |
      | `is_primary` | `boolean` | Whether this is the primary key index |
      | `is_system` | `boolean` | Whether this is a system column or index |
      | `is_hidden` | `boolean` | Whether the index is hidden |
    </Expandable>

    <Expandable title="view — Value fields">
      | Field | Type | Description |
      | - | - | - |
      | `sort` | `integer` | Column display order, starting at 0 |
    </Expandable>

    <Expandable title="subtables — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `label` | `string` | Display label or category |
    </Expandable>

    <Expandable title="parent — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `table_type` | `string` | Table type |
    </Expandable>

    <Expandable title="relations — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `label` | `string` | Display label or category |
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/table/columns/update \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "demo.asset_notes",
      "columns": [
        {
          "id": "id",
          "name": "id",
          "type": "STRING"
        },
        {
          "id": "note",
          "name": "note",
          "type": "STRING"
        }
      ]
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "demo.asset_notes",
        "space": "demo",
        "name": "asset_notes",
        "chain_id": "",
        "table_type": "normal",
        "description": "Asset notes",
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "columns": [
          {
            "id": "id",
            "name": "id",
            "type": "STRING",
            "is_system": true
          },
          {
            "id": "note",
            "name": "note",
            "type": "STRING",
            "is_system": false
          }
        ],
        "indexes": [
          {
            "columns": [
              "id"
            ],
            "is_primary": true,
            "is_system": true
          }
        ],
        "table_rows": 1,
        "table_size": 64,
        "replica_num": 1,
        "inited": true,
        "subtables": [],
        "space_entity": {
          "id": "demo",
          "description": "Example resources",
          "account_id": "0190000000007000800000000000000b",
          "status": "active",
          "visibility": "public",
          "dep_count": 0,
          "content_count": 6,
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "account": {
            "id": "0190000000007000800000000000000b",
            "type": "org",
            "slug": "example-team",
            "display_name": "Example team",
            "avatar_url": null,
            "avatar_thumbnail_url": null
          }
        },
        "view": {
          "id": {
            "sort": 0
          },
          "note": {
            "sort": 1
          }
        },
        "deps": 0,
        "last_write_at_ms": 1788220800000
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/table/columns/validate — Validate a column name" id="post-table-columns-validate">
    Validate a column name.

    **Method**: `POST`<br />
    **Path**: `/v1/table/columns/validate`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `name` | `string` | Yes | Name; ≥ 1 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `is_valid` | `boolean` | Whether the name is valid |
    | `reason` | `string` / `null` | Reason, or null when none applies |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/table/columns/validate \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "name": "note"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "is_valid": true,
        "reason": null
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/table/create — Create a table" id="post-table-create">
    The table ID is formed from `space.name` and must not exceed 64 characters. Block table names need the matching chain suffix; `chain_id` uses an identifier such as `eth`.

    **Method**: `POST`<br />
    **Path**: `/v1/table/create`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `name` | `string` | Yes | Name; 1–255 characters |
    | `table_type` | `string` | Yes | Table type; Values: `"normal"`, `"block_event"`, `"block_state"`, `"time"` |
    | `chain_id` | `string` / `null` | No | Platform chain identifier, such as eth; required for block tables; Default `""` |
    | `description` | `string` / `null` | No | Description; ≤ 255 characters |
    | `space` | `string` | Yes | Space ID; 1–64 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `space` | `string` | Space ID |
    | `name` | `string` / `null` | Name |
    | `chain_id` | `string` / `null` | Platform chain identifier, such as eth; empty or null for non-block tables |
    | `table_type` | `string` | Table type |
    | `description` | `string` / `null` | Description |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/table/create \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "space": "demo",
      "name": "asset_notes",
      "table_type": "normal",
      "description": "Asset notes"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "demo.asset_notes",
        "space": "demo",
        "name": "asset_notes",
        "chain_id": "",
        "table_type": "normal",
        "description": "Asset notes",
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0
      }
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/table/id_types — List primary key types" id="get-table-id-types">
    List primary key types.

    **Method**: `GET`<br />
    **Path**: `/v1/table/id_types`

    **Parameters**

    No request parameters.

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `data` | `string[]` | Supported primary key type names |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/table/id_types \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID"
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": [
        "STRING",
        "ADDRESS",
        "TOKENID",
        "HASH",
        "BLOCKID",
        "CHAINID",
        "TXID"
      ]
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/table/indexes/update — Update indexes" id="post-table-indexes-update">
    Replaces `indexes` as a whole; include existing indexes you want to retain.

    **Method**: `POST`<br />
    **Path**: `/v1/table/indexes/update`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Full table ID, such as demo.asset\_notes; 1–255 characters |
    | `indexes` | `object[]` | Yes | Index definitions |

    <Expandable title="indexes — Item fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `id` | `string` / `null` | No | Required for Normal table indexes; retain an existing index’s ID to keep it; 1–64 characters |
      | `columns` | `string[]` | Yes | Column names in index order; ≥ 1 items |
      | `is_hidden` | `boolean` / `null` | No | Read-only flag; ignored when supplied |
      | `is_system` | `boolean` / `null` | No | Read-only flag; ignored when supplied |
      | `is_primary` | `boolean` / `null` | No | Read-only flag; ignored when supplied |
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `space` | `string` | Space ID |
    | `name` | `string` / `null` | Name |
    | `chain_id` | `string` / `null` | Platform chain identifier, such as eth; empty or null for non-block tables |
    | `table_type` | `string` | Table type |
    | `description` | `string` / `null` | Description |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `space_entity` | `object` / `null` | Details of the owning Space |
    | `columns` | `object[]` | Initialized column definitions; omitted from list responses |
    | `indexes` | `object[]` | Initialized indexes; omitted from list responses |
    | `view` | `object` / `null` | Table display settings |
    | `start_height` | `integer` / `null` | Start block height |
    | `deps` | `integer` | Number of dependencies reading the table |
    | `last_write_at_ms` | `integer` / `null` | Last write time in Unix milliseconds; null if unavailable |
    | `first_write_at` | `number` / `null` | First write time in Unix seconds; returned for Time tables |
    | `inited` | `boolean` | Whether initialized; returned by detail and schema operations |
    | `table_rows` | `integer` | Number of table rows |
    | `table_size` | `integer` | Table data size in bytes |
    | `replica_num` | `integer` | Number of replicas |
    | `s3_synced_at` | `number` / `null` | Data synchronization time in Unix seconds |
    | `subtables` | `object[]` | Related tables |
    | `parent` | `object` | Owning table’s ID and type |
    | `label` | `string` | Display label or category |
    | `relations` | `object[]` | Related tables |

    <Expandable title="space_entity — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `description` | `string` / `null` | Description |
      | `account_id` | `string` | Account ID |
      | `status` | `string` | Status |
      | `visibility` | `string` | Visibility: public, org, or private |
      | `dep_count` | `integer` | Dependency count |
      | `content_count` | `integer` | Number of content entries |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    <Expandable title="columns — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `name` | `string` | Name |
      | `type` | `string` | Logical column type; see the data types reference; see [Data types](/reference/data-types) |
      | `is_system` | `boolean` | Whether this is a system column or index |
    </Expandable>

    <Expandable title="indexes — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` / `null` | Unique object ID |
      | `columns` | `string[]` | Column names in index order |
      | `is_primary` | `boolean` | Whether this is the primary key index |
      | `is_system` | `boolean` | Whether this is a system column or index |
      | `is_hidden` | `boolean` | Whether the index is hidden |
    </Expandable>

    <Expandable title="view — Value fields">
      | Field | Type | Description |
      | - | - | - |
      | `sort` | `integer` | Column display order, starting at 0 |
    </Expandable>

    <Expandable title="subtables — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `label` | `string` | Display label or category |
    </Expandable>

    <Expandable title="parent — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `table_type` | `string` | Table type |
    </Expandable>

    <Expandable title="relations — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `label` | `string` | Display label or category |
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/table/indexes/update \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "demo.asset_notes",
      "indexes": [
        {
          "id": "note_index",
          "columns": [
            "note"
          ]
        }
      ]
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "demo.asset_notes",
        "space": "demo",
        "name": "asset_notes",
        "chain_id": "",
        "table_type": "normal",
        "description": "Asset notes",
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "columns": [
          {
            "id": "id",
            "name": "id",
            "type": "STRING",
            "is_system": true
          },
          {
            "id": "note",
            "name": "note",
            "type": "STRING",
            "is_system": false
          }
        ],
        "indexes": [
          {
            "columns": [
              "id"
            ],
            "is_primary": true,
            "is_system": true
          },
          {
            "id": "note_index",
            "columns": [
              "note"
            ],
            "is_system": false
          }
        ],
        "table_rows": 1,
        "table_size": 64,
        "replica_num": 1,
        "inited": true,
        "subtables": [],
        "space_entity": {
          "id": "demo",
          "description": "Example resources",
          "account_id": "0190000000007000800000000000000b",
          "status": "active",
          "visibility": "public",
          "dep_count": 0,
          "content_count": 6,
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "account": {
            "id": "0190000000007000800000000000000b",
            "type": "org",
            "slug": "example-team",
            "display_name": "Example team",
            "avatar_url": null,
            "avatar_thumbnail_url": null
          }
        },
        "view": {
          "id": {
            "sort": 0
          },
          "note": {
            "sort": 1
          }
        },
        "deps": 0,
        "last_write_at_ms": 1788220800000
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/table/init — Initialize a table" id="post-table-init">
    Initializes the table schema. Normal tables require an `id` column. Column IDs and names must be unique. Time tables have fixed columns; block tables retain their system columns.

    **Method**: `POST`<br />
    **Path**: `/v1/table/init`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Full table ID, such as demo.asset\_notes; 1–255 characters |
    | `columns` | `object[]` | No | Column definitions |
    | `indexes` | `object[]` | No | Index definitions |
    | `view` | `object` / `null` | No | Table display settings |

    <Expandable title="columns — Item fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `id` | `string` | Yes | Unique object ID; 1–64 characters |
      | `name` | `string` | Yes | Name; 1–64 characters |
      | `type` | `string` | Yes | Logical column type; see the data types reference; see [Data types](/reference/data-types); ≥ 1 characters |
    </Expandable>

    <Expandable title="indexes — Item fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `id` | `string` / `null` | No | Required for Normal table indexes; retain an existing index’s ID to keep it; 1–64 characters |
      | `columns` | `string[]` | Yes | Column names in index order; ≥ 1 items |
      | `is_hidden` | `boolean` / `null` | No | Read-only flag; ignored when supplied |
      | `is_system` | `boolean` / `null` | No | Read-only flag; ignored when supplied |
      | `is_primary` | `boolean` / `null` | No | Read-only flag; ignored when supplied |
    </Expandable>

    <Expandable title="view — Value fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `sort` | `integer` | No | Column display order, starting at 0 |
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `space` | `string` | Space ID |
    | `name` | `string` / `null` | Name |
    | `chain_id` | `string` / `null` | Platform chain identifier, such as eth; empty or null for non-block tables |
    | `table_type` | `string` | Table type |
    | `description` | `string` / `null` | Description |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `space_entity` | `object` / `null` | Details of the owning Space |
    | `columns` | `object[]` | Initialized column definitions; omitted from list responses |
    | `indexes` | `object[]` | Initialized indexes; omitted from list responses |
    | `view` | `object` / `null` | Table display settings |
    | `start_height` | `integer` / `null` | Start block height |
    | `deps` | `integer` | Number of dependencies reading the table |
    | `last_write_at_ms` | `integer` / `null` | Last write time in Unix milliseconds; null if unavailable |
    | `first_write_at` | `number` / `null` | First write time in Unix seconds; returned for Time tables |
    | `inited` | `boolean` | Whether initialized; returned by detail and schema operations |
    | `table_rows` | `integer` | Number of table rows |
    | `table_size` | `integer` | Table data size in bytes |
    | `replica_num` | `integer` | Number of replicas |
    | `s3_synced_at` | `number` / `null` | Data synchronization time in Unix seconds |
    | `subtables` | `object[]` | Related tables |
    | `parent` | `object` | Owning table’s ID and type |
    | `label` | `string` | Display label or category |
    | `relations` | `object[]` | Related tables |

    <Expandable title="space_entity — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `description` | `string` / `null` | Description |
      | `account_id` | `string` | Account ID |
      | `status` | `string` | Status |
      | `visibility` | `string` | Visibility: public, org, or private |
      | `dep_count` | `integer` | Dependency count |
      | `content_count` | `integer` | Number of content entries |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    <Expandable title="columns — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `name` | `string` | Name |
      | `type` | `string` | Logical column type; see the data types reference; see [Data types](/reference/data-types) |
      | `is_system` | `boolean` | Whether this is a system column or index |
    </Expandable>

    <Expandable title="indexes — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` / `null` | Unique object ID |
      | `columns` | `string[]` | Column names in index order |
      | `is_primary` | `boolean` | Whether this is the primary key index |
      | `is_system` | `boolean` | Whether this is a system column or index |
      | `is_hidden` | `boolean` | Whether the index is hidden |
    </Expandable>

    <Expandable title="view — Value fields">
      | Field | Type | Description |
      | - | - | - |
      | `sort` | `integer` | Column display order, starting at 0 |
    </Expandable>

    <Expandable title="subtables — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `label` | `string` | Display label or category |
    </Expandable>

    <Expandable title="parent — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `table_type` | `string` | Table type |
    </Expandable>

    <Expandable title="relations — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `label` | `string` | Display label or category |
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/table/init \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "demo.asset_notes",
      "columns": [
        {
          "id": "id",
          "name": "id",
          "type": "STRING"
        },
        {
          "id": "note",
          "name": "note",
          "type": "STRING"
        }
      ],
      "indexes": [],
      "view": {
        "id": {
          "sort": 0
        },
        "note": {
          "sort": 1
        }
      }
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "demo.asset_notes",
        "space": "demo",
        "name": "asset_notes",
        "chain_id": "",
        "table_type": "normal",
        "description": "Asset notes",
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "columns": [
          {
            "id": "id",
            "name": "id",
            "type": "STRING",
            "is_system": true
          },
          {
            "id": "note",
            "name": "note",
            "type": "STRING",
            "is_system": false
          }
        ],
        "indexes": [
          {
            "columns": [
              "id"
            ],
            "is_primary": true,
            "is_system": true
          }
        ],
        "table_rows": 1,
        "table_size": 64,
        "replica_num": 1,
        "inited": true,
        "subtables": [],
        "space_entity": {
          "id": "demo",
          "description": "Example resources",
          "account_id": "0190000000007000800000000000000b",
          "status": "active",
          "visibility": "public",
          "dep_count": 0,
          "content_count": 6,
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "account": {
            "id": "0190000000007000800000000000000b",
            "type": "org",
            "slug": "example-team",
            "display_name": "Example team",
            "avatar_url": null,
            "avatar_thumbnail_url": null
          }
        },
        "view": {
          "id": {
            "sort": 0
          },
          "note": {
            "sort": 1
          }
        },
        "deps": 0,
        "last_write_at_ms": 1788220800000
      }
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/table/instance/list — List related Notebook instances" id="get-table-instance-list">
    `access` selects read or write activity. Returns instances visible to the caller.

    **Method**: `GET`<br />
    **Path**: `/v1/table/instance/list`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Full table ID, such as demo.asset\_notes; 1–255 characters |
    | `access` | `string` | Yes | Read or write activity; Values: `"read"`, `"write"` |
    | `limit` | `integer` | No | Maximum number of entries; ≥ 1; Default `100` |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `instances` | `object[]` | Notebook execution instances |
    | `count` | `integer` | Number of returned instances |

    <Expandable title="instances — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `last_accessed_at_ms` | `integer` / `null` | Last access time in Unix milliseconds |
      | `name` | `string` / `null` | Name |
      | `display_status` | `string` | Instance display status; Values: `"running"`, `"succeeded"`, `"failed"`, `"canceled"`, `"starting"` |
      | `launched` | `string` | How the instance was launched; Values: `"manual"`, `"schedule"` |
      | `notebook_id` | `string` / `null` | Notebook ID |
      | `schedule_id` | `string` / `null` | Schedule ID |
      | `exit_message` | `string` / `null` | Exit reason; null while running |
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/table/instance/list \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode id=demo.asset_notes \
      --data-urlencode access=write \
      --data-urlencode limit=10
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "instances": [
          {
            "id": "01900000000070008000000000000009",
            "last_accessed_at_ms": 1788220800000,
            "name": "print_message",
            "display_status": "running",
            "launched": "manual",
            "notebook_id": "01900000000070008000000000000002",
            "schedule_id": null,
            "exit_message": null
          }
        ],
        "count": 1
      }
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/table/list — List tables" id="get-table-list">
    List tables.

    **Method**: `GET`<br />
    **Path**: `/v1/table/list`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `start` | `integer` | No | Pagination offset, starting at 0; ≥ 0; Default `0` |
    | `limit` | `integer` | No | Maximum number of entries; ≥ 1; ≤ 100; Default `10` |
    | `order_by` | `string` | No | Sort field; Values: `"id"`, `"name"`, `"created_at"`, `"updated_at"`; Default `"updated_at"` |
    | `direction` | `string` | No | Sort direction; Values: `"asc"`, `"desc"`; Default `"desc"` |
    | `space` | `string` / `null` | No | Filter by Space; when omitted, list resources in visible Spaces; 1–64 characters |
    | `name` | `string` / `null` | No | Name substring filter |
    | `with_activity` | `boolean` | No | Include usage and write activity; Default `false` |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `start` | `integer` | Pagination offset, starting at 0 |
    | `limit` | `integer` | Maximum number of entries |
    | `items` | `object[]` | Entries on this page |
    | `total_count` | `integer` | Total number of matching entries |

    <Expandable title="items — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `space` | `string` | Space ID |
      | `name` | `string` / `null` | Name |
      | `chain_id` | `string` / `null` | Platform chain identifier, such as eth; empty or null for non-block tables |
      | `table_type` | `string` | Table type |
      | `description` | `string` / `null` | Description |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `space_entity` | `object` / `null` | Details of the owning Space |
      | `deps` | `integer` | Number of dependencies reading the table |
      | `last_write_at_ms` | `integer` / `null` | Last write time in Unix milliseconds; null if unavailable |

      <Expandable title="space_entity — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `description` | `string` / `null` | Description |
        | `account_id` | `string` | Account ID |
        | `status` | `string` | Status |
        | `visibility` | `string` | Visibility: public, org, or private |
        | `dep_count` | `integer` | Dependency count |
        | `content_count` | `integer` | Number of content entries |
        | `created_at` | `number` | Creation time in Unix seconds |
        | `updated_at` | `number` | Last update time in Unix seconds |
        | `account` | `object` / `null` | Account details |

        <Expandable title="account — Fields">
          | Field | Type | Description |
          | - | - | - |
          | `id` | `string` | Unique object ID |
          | `type` | `string` | Account type: personal or org |
          | `slug` | `string` / `null` | Account slug used for display and URLs |
          | `display_name` | `string` / `null` | Account display name |
          | `avatar_url` | `string` / `null` | Avatar URL |
          | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
        </Expandable>
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/table/list \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode space=demo \
      --data-urlencode limit=10 \
      --data-urlencode with_activity=true
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "items": [
          {
            "id": "demo.asset_notes",
            "space": "demo",
            "name": "asset_notes",
            "chain_id": "",
            "table_type": "normal",
            "description": "Asset notes",
            "created_at": 1788220800.0,
            "updated_at": 1788220800.0,
            "space_entity": {
              "id": "demo",
              "description": "Example resources",
              "account_id": "0190000000007000800000000000000b",
              "status": "active",
              "visibility": "public",
              "dep_count": 0,
              "content_count": 6,
              "created_at": 1788220800.0,
              "updated_at": 1788220800.0,
              "account": {
                "id": "0190000000007000800000000000000b",
                "type": "org",
                "slug": "example-team",
                "display_name": "Example team",
                "avatar_url": null,
                "avatar_thumbnail_url": null
              }
            },
            "deps": 0,
            "last_write_at_ms": 1788220800000
          }
        ],
        "total_count": 1,
        "start": 0,
        "limit": 10
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/table/row/create — Upsert a row" id="post-table-row-create">
    Writes a row to an initialized Normal table, updating it if its primary key already exists. Include the primary key `id` in `data` and use values matching the table schema.

    **Method**: `POST`<br />
    **Path**: `/v1/table/row/create`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `table_id` | `string` | Yes | Full table ID; 1–255 characters |
    | `data` | `object` | Yes | Row fields and values |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `data` | `null` | Operation completed with no response data |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/table/row/create \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "table_id": "demo.asset_notes",
      "data": {
        "id": "usdc",
        "note": "Stablecoin"
      }
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": null
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/table/row/delete — Delete a row" id="post-table-row-delete">
    Supports Normal tables. `id` is the primary key of the row to delete.

    **Method**: `POST`<br />
    **Path**: `/v1/table/row/delete`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `table_id` | `string` | Yes | Full table ID; 1–255 characters |
    | `id` | `string` | Yes | Row primary key; ≥ 1 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `data` | `null` | Operation completed with no response data |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/table/row/delete \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "table_id": "demo.asset_notes",
      "id": "usdc"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": null
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/table/row/get — Read rows by primary key" id="post-table-row-get">
    `pks` is an array of primary key strings with up to 10,000 entries.

    **Method**: `POST`<br />
    **Path**: `/v1/table/row/get`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `table_id` | `string` | Yes | Full table ID; 1–255 characters |
    | `pks` | `string[]` | Yes | Primary key values; ≤ 10000 items |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `columns` | `object[]` | Result column definitions |
    | `rows` | `object[]` | Result rows, each keyed by column name |
    | `total_count` | `integer` / `null` | Matching row count for row/get; normally null for row/list and row/query |
    | `start` | `integer` | Pagination offset returned by row/list |
    | `limit` | `integer` | Page size returned by row/list |
    | `truncated` | `boolean` | Whether row/query results were truncated |
    | `rows_count` | `integer` | Number of rows returned by row/query |

    <Expandable title="columns — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `name` | `string` | Name |
      | `type` | `string` | Type |
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/table/row/get \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "table_id": "demo.asset_notes",
      "pks": [
        "usdc"
      ]
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "columns": [
          {
            "id": "id",
            "name": "id",
            "type": "STRING"
          },
          {
            "id": "note",
            "name": "note",
            "type": "STRING"
          }
        ],
        "rows": [
          {
            "id": "usdc",
            "note": "Stablecoin"
          }
        ],
        "total_count": 1
      }
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/table/row/list — List rows" id="get-table-row-list">
    Reads a page of rows. filter is a JSON-encoded array of conditions with field (column name), op (eq, neq, gt, lt, gte, lte), and value (string, number, boolean, or null). Conditions are combined with AND; null supports only eq and neq.

    **Method**: `GET`<br />
    **Path**: `/v1/table/row/list`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `table_id` | `string` | Yes | Full table ID; 1–255 characters |
    | `start` | `integer` | No | Pagination offset, starting at 0; ≥ 0; ≤ 9223372036854775807; Default `0` |
    | `limit` | `integer` | No | Maximum number of entries; ≥ 1; ≤ 10000; Default `1000` |
    | `filter` | `string` / `null` | No | JSON-encoded filter conditions |
    | `order_by` | `string` / `null` | No | Sort field |
    | `direction` | `string` | No | Sort direction; Values: `"asc"`, `"desc"`; Default `"desc"` |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `columns` | `object[]` | Result column definitions |
    | `rows` | `object[]` | Result rows, each keyed by column name |
    | `total_count` | `integer` / `null` | Matching row count for row/get; normally null for row/list and row/query |
    | `start` | `integer` | Pagination offset returned by row/list |
    | `limit` | `integer` | Page size returned by row/list |
    | `truncated` | `boolean` | Whether row/query results were truncated |
    | `rows_count` | `integer` | Number of rows returned by row/query |

    <Expandable title="columns — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `name` | `string` | Name |
      | `type` | `string` | Type |
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/table/row/list \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode table_id=demo.asset_notes \
      --data-urlencode limit=10
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "columns": [
          {
            "id": "id",
            "name": "id",
            "type": "STRING"
          },
          {
            "id": "note",
            "name": "note",
            "type": "STRING"
          }
        ],
        "rows": [
          {
            "id": "usdc",
            "note": "Stablecoin"
          }
        ],
        "total_count": null,
        "start": 0,
        "limit": 10
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/table/row/query — Query one table" id="post-table-row-query">
    Runs one `SELECT *` statement against the specified table, with `WHERE`, `ORDER BY`, and `LIMIT`. Returns up to 10,000 rows. Use Query endpoints for aggregation and joins.

    **Method**: `POST`<br />
    **Path**: `/v1/table/row/query`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `table_id` | `string` | Yes | Full table ID; 1–255 characters |
    | `sql` | `string` | Yes | Single-table SQL query; ≥ 1 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `columns` | `object[]` | Result column definitions |
    | `rows` | `object[]` | Result rows, each keyed by column name |
    | `total_count` | `integer` / `null` | Matching row count for row/get; normally null for row/list and row/query |
    | `start` | `integer` | Pagination offset returned by row/list |
    | `limit` | `integer` | Page size returned by row/list |
    | `truncated` | `boolean` | Whether row/query results were truncated |
    | `rows_count` | `integer` | Number of rows returned by row/query |

    <Expandable title="columns — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `name` | `string` | Name |
      | `type` | `string` | Type |
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/table/row/query \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "table_id": "demo.asset_notes",
      "sql": "SELECT * FROM demo.asset_notes LIMIT 10"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "columns": [
          {
            "name": "id",
            "type": "STRING"
          },
          {
            "name": "note",
            "type": "STRING"
          }
        ],
        "rows": [
          {
            "id": "usdc",
            "note": "Stablecoin"
          }
        ],
        "total_count": null,
        "rows_count": 1,
        "truncated": false
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/table/row/update — Update a row" id="post-table-row-update">
    Supports Normal tables. If supplied, `data.id` must match the top-level `id`.

    **Method**: `POST`<br />
    **Path**: `/v1/table/row/update`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `table_id` | `string` | Yes | Full table ID; 1–255 characters |
    | `id` | `string` | Yes | Row primary key; ≥ 1 characters |
    | `data` | `object` | Yes | Row fields and values |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `data` | `null` | Operation completed with no response data |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/table/row/update \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "table_id": "demo.asset_notes",
      "id": "usdc",
      "data": {
        "note": "USD Coin"
      }
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": null
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/table/start_height/editable — Check whether the start height can change" id="get-table-start-height-editable">
    Check whether the start height can change.

    **Method**: `GET`<br />
    **Path**: `/v1/table/start_height/editable`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Full table ID, such as demo.asset\_notes; 1–255 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `editable` | `boolean` | Whether the start height can be changed |
    | `reason` | `string` / `null` | Reason, or null when none applies |

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/table/start_height/editable \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode id=demo.pool_reserves.eth
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "editable": true,
        "reason": null
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/table/start_height/update — Set the start height" id="post-table-start-height-update">
    Requires an initialized block table with no processed blocks. The start height cannot exceed the current chain height. Check `/v1/table/start_height/editable` first.

    **Method**: `POST`<br />
    **Path**: `/v1/table/start_height/update`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Full table ID, such as demo.asset\_notes; 1–255 characters |
    | `start_height` | `integer` | Yes | Start block height; ≥ 0; ≤ 9223372036854775807 |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `space` | `string` | Space ID |
    | `name` | `string` / `null` | Name |
    | `chain_id` | `string` / `null` | Platform chain identifier, such as eth; empty or null for non-block tables |
    | `table_type` | `string` | Table type |
    | `description` | `string` / `null` | Description |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `space_entity` | `object` / `null` | Details of the owning Space |
    | `columns` | `object[]` | Initialized column definitions; omitted from list responses |
    | `indexes` | `object[]` | Initialized indexes; omitted from list responses |
    | `view` | `object` / `null` | Table display settings |
    | `start_height` | `integer` / `null` | Start block height |
    | `deps` | `integer` | Number of dependencies reading the table |
    | `last_write_at_ms` | `integer` / `null` | Last write time in Unix milliseconds; null if unavailable |
    | `first_write_at` | `number` / `null` | First write time in Unix seconds; returned for Time tables |
    | `inited` | `boolean` | Whether initialized; returned by detail and schema operations |
    | `table_rows` | `integer` | Number of table rows |
    | `table_size` | `integer` | Table data size in bytes |
    | `replica_num` | `integer` | Number of replicas |
    | `s3_synced_at` | `number` / `null` | Data synchronization time in Unix seconds |
    | `subtables` | `object[]` | Related tables |
    | `parent` | `object` | Owning table’s ID and type |
    | `label` | `string` | Display label or category |
    | `relations` | `object[]` | Related tables |

    <Expandable title="space_entity — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `description` | `string` / `null` | Description |
      | `account_id` | `string` | Account ID |
      | `status` | `string` | Status |
      | `visibility` | `string` | Visibility: public, org, or private |
      | `dep_count` | `integer` | Dependency count |
      | `content_count` | `integer` | Number of content entries |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    <Expandable title="columns — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `name` | `string` | Name |
      | `type` | `string` | Logical column type; see the data types reference; see [Data types](/reference/data-types) |
      | `is_system` | `boolean` | Whether this is a system column or index |
    </Expandable>

    <Expandable title="indexes — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` / `null` | Unique object ID |
      | `columns` | `string[]` | Column names in index order |
      | `is_primary` | `boolean` | Whether this is the primary key index |
      | `is_system` | `boolean` | Whether this is a system column or index |
      | `is_hidden` | `boolean` | Whether the index is hidden |
    </Expandable>

    <Expandable title="view — Value fields">
      | Field | Type | Description |
      | - | - | - |
      | `sort` | `integer` | Column display order, starting at 0 |
    </Expandable>

    <Expandable title="subtables — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `label` | `string` | Display label or category |
    </Expandable>

    <Expandable title="parent — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `table_type` | `string` | Table type |
    </Expandable>

    <Expandable title="relations — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `label` | `string` | Display label or category |
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/table/start_height/update \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "demo.pool_reserves.eth",
      "start_height": 21000000
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "demo.pool_reserves.eth",
        "space": "demo",
        "name": "pool_reserves.eth",
        "chain_id": "eth",
        "table_type": "block_state",
        "description": "Asset notes",
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "columns": [
          {
            "id": "id",
            "name": "id",
            "type": "HASH",
            "is_system": true
          },
          {
            "id": "block_height",
            "name": "block_height",
            "type": "BLOCKHEIGHT",
            "is_system": true
          },
          {
            "id": "block_id",
            "name": "block_id",
            "type": "HASH",
            "is_system": true
          },
          {
            "id": "block_timestamp",
            "name": "block_timestamp",
            "type": "TIMESTAMP",
            "is_system": true
          }
        ],
        "indexes": [
          {
            "columns": [
              "id"
            ],
            "is_primary": true,
            "is_system": true
          }
        ],
        "table_rows": 0,
        "table_size": 0,
        "replica_num": 1,
        "inited": true,
        "subtables": [],
        "space_entity": {
          "id": "demo",
          "description": "Example resources",
          "account_id": "0190000000007000800000000000000b",
          "status": "active",
          "visibility": "public",
          "dep_count": 0,
          "content_count": 6,
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "account": {
            "id": "0190000000007000800000000000000b",
            "type": "org",
            "slug": "example-team",
            "display_name": "Example team",
            "avatar_url": null,
            "avatar_thumbnail_url": null
          }
        },
        "view": {},
        "start_height": 21000000
      }
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/table/stats/block — Get block write statistics" id="get-table-stats-block">
    `recent` is the number of recent blocks. Returned lag values are in milliseconds.

    **Method**: `GET`<br />
    **Path**: `/v1/table/stats/block`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Full table ID, such as demo.asset\_notes; 1–255 characters |
    | `recent` | `integer` | No | Number of recent blocks; ≥ 1; ≤ 60; Default `30` |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `start_height` | `integer` | Start block height |
    | `consensus_height` | `integer` / `null` | Table consensus height, or null if unavailable |
    | `chain_height` | `integer` / `null` | Current chain height, or null if unavailable |
    | `completeness` | `object[]` | Processed block height ranges |
    | `blocks` | `object[]` | Per-block write statistics |
    | `completeness_count` | `integer` | Total processed ranges; completeness may be empty when there are too many ranges |

    <Expandable title="completeness — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `start` | `integer` | Start height of a processed range |
      | `end` | `integer` | End block height |
    </Expandable>

    <Expandable title="blocks — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `block_height` | `integer` | Block height |
      | `rows` | `integer` | Number of rows written for the block |
      | `lag_ms` | `integer` / `null` | Processing lag in milliseconds, or null if unavailable |
      | `processed` | `boolean` | Whether the block has been processed |
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/table/stats/block \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode id=demo.pool_reserves.eth \
      --data-urlencode recent=2
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "start_height": 21000000,
        "consensus_height": 21000001,
        "chain_height": 21000001,
        "completeness": [
          {
            "start": 21000000,
            "end": 21000001
          }
        ],
        "completeness_count": 1,
        "blocks": [
          {
            "block_height": 21000000,
            "rows": 1,
            "lag_ms": 50,
            "processed": true
          },
          {
            "block_height": 21000001,
            "rows": 0,
            "lag_ms": 45,
            "processed": true
          }
        ]
      }
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/table/stats/daily — Get daily write statistics" id="get-table-stats-daily">
    Use `year`, or supply both `from` and `to` in `YYYY-MM-DD` format.

    **Method**: `GET`<br />
    **Path**: `/v1/table/stats/daily`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Full table ID, such as demo.asset\_notes; 1–255 characters |
    | `year` | `integer` / `null` | No | Year to summarize; ≥ 1; ≤ 9999 |
    | `from` | `string` / `null` | No | Start date; `date` |
    | `to` | `string` / `null` | No | End date; `date` |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `buckets` | `object[]` | Write statistics grouped by time |

    <Expandable title="buckets — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `time_at` | `string` / `number` | Date for daily statistics; Unix seconds for minute statistics |
      | `rows` | `integer` | Number of records in the time bucket |
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/table/stats/daily \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode id=demo.price_samples \
      --data-urlencode from=2026-09-01 \
      --data-urlencode to=2026-09-01
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "buckets": [
          {
            "time_at": "2026-09-01",
            "rows": 1
          }
        ]
      }
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/table/stats/minute — Get per-minute write statistics" id="get-table-stats-minute">
    Get per-minute write statistics.

    **Method**: `GET`<br />
    **Path**: `/v1/table/stats/minute`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Full table ID, such as demo.asset\_notes; 1–255 characters |
    | `minutes` | `integer` | No | Number of recent minutes; ≥ 1; ≤ 60; Default `30` |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `buckets` | `object[]` | Write statistics grouped by time |

    <Expandable title="buckets — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `time_at` | `string` / `number` | Date for daily statistics; Unix seconds for minute statistics |
      | `rows` | `integer` | Number of records in the time bucket |
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/table/stats/minute \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode id=demo.price_samples \
      --data-urlencode minutes=1
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "buckets": [
          {
            "time_at": 1788220800.0,
            "rows": 1
          }
        ]
      }
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/table/templates — Get a table template" id="get-table-templates">
    Get a table template.

    **Method**: `GET`<br />
    **Path**: `/v1/table/templates`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `table_type` | `string` | No | Table type; Values: `"normal"`, `"block_event"`, `"block_state"`, `"time"`; Default `"normal"` |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `columns` | `object[]` | Column definitions |
    | `indexes` | `object[]` | Index definitions |

    <Expandable title="columns — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `name` | `string` | Name |
      | `type` | `string` | Logical column type; see the data types reference; see [Data types](/reference/data-types) |
      | `is_system` | `boolean` | Whether this is a system column or index |
    </Expandable>

    <Expandable title="indexes — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` / `null` | Unique object ID |
      | `columns` | `string[]` | Column names in index order |
      | `is_primary` | `boolean` | Whether this is the primary key index |
      | `is_system` | `boolean` | Whether this is a system column or index |
      | `is_hidden` | `boolean` | Whether the index is hidden |
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/table/templates \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode table_type=normal
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "columns": [
          {
            "name": "id",
            "type": "STRING"
          }
        ],
        "indexes": []
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/table/view/update — Update table display settings" id="post-table-view-update">
    Update table display settings.

    **Method**: `POST`<br />
    **Path**: `/v1/table/view/update`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Full table ID, such as demo.asset\_notes; 1–255 characters |
    | `view` | `object` / `null` | Yes | Table display settings |

    <Expandable title="view — Value fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `sort` | `integer` | No | Column display order, starting at 0 |
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `space` | `string` | Space ID |
    | `name` | `string` / `null` | Name |
    | `chain_id` | `string` / `null` | Platform chain identifier, such as eth; empty or null for non-block tables |
    | `table_type` | `string` | Table type |
    | `description` | `string` / `null` | Description |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `space_entity` | `object` / `null` | Details of the owning Space |
    | `columns` | `object[]` | Initialized column definitions; omitted from list responses |
    | `indexes` | `object[]` | Initialized indexes; omitted from list responses |
    | `view` | `object` / `null` | Table display settings |
    | `start_height` | `integer` / `null` | Start block height |
    | `deps` | `integer` | Number of dependencies reading the table |
    | `last_write_at_ms` | `integer` / `null` | Last write time in Unix milliseconds; null if unavailable |
    | `first_write_at` | `number` / `null` | First write time in Unix seconds; returned for Time tables |
    | `inited` | `boolean` | Whether initialized; returned by detail and schema operations |
    | `table_rows` | `integer` | Number of table rows |
    | `table_size` | `integer` | Table data size in bytes |
    | `replica_num` | `integer` | Number of replicas |
    | `s3_synced_at` | `number` / `null` | Data synchronization time in Unix seconds |
    | `subtables` | `object[]` | Related tables |
    | `parent` | `object` | Owning table’s ID and type |
    | `label` | `string` | Display label or category |
    | `relations` | `object[]` | Related tables |

    <Expandable title="space_entity — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `description` | `string` / `null` | Description |
      | `account_id` | `string` | Account ID |
      | `status` | `string` | Status |
      | `visibility` | `string` | Visibility: public, org, or private |
      | `dep_count` | `integer` | Dependency count |
      | `content_count` | `integer` | Number of content entries |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    <Expandable title="columns — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `name` | `string` | Name |
      | `type` | `string` | Logical column type; see the data types reference; see [Data types](/reference/data-types) |
      | `is_system` | `boolean` | Whether this is a system column or index |
    </Expandable>

    <Expandable title="indexes — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` / `null` | Unique object ID |
      | `columns` | `string[]` | Column names in index order |
      | `is_primary` | `boolean` | Whether this is the primary key index |
      | `is_system` | `boolean` | Whether this is a system column or index |
      | `is_hidden` | `boolean` | Whether the index is hidden |
    </Expandable>

    <Expandable title="view — Value fields">
      | Field | Type | Description |
      | - | - | - |
      | `sort` | `integer` | Column display order, starting at 0 |
    </Expandable>

    <Expandable title="subtables — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `label` | `string` | Display label or category |
    </Expandable>

    <Expandable title="parent — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `table_type` | `string` | Table type |
    </Expandable>

    <Expandable title="relations — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `label` | `string` | Display label or category |
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/table/view/update \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "demo.asset_notes",
      "view": {
        "id": {
          "sort": 0
        },
        "note": {
          "sort": 1
        }
      }
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "demo.asset_notes",
        "space": "demo",
        "name": "asset_notes",
        "chain_id": "",
        "table_type": "normal",
        "description": "Asset notes",
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "columns": [
          {
            "id": "id",
            "name": "id",
            "type": "STRING",
            "is_system": true
          },
          {
            "id": "note",
            "name": "note",
            "type": "STRING",
            "is_system": false
          }
        ],
        "indexes": [
          {
            "columns": [
              "id"
            ],
            "is_primary": true,
            "is_system": true
          }
        ],
        "table_rows": 1,
        "table_size": 64,
        "replica_num": 1,
        "inited": true,
        "subtables": [],
        "space_entity": {
          "id": "demo",
          "description": "Example resources",
          "account_id": "0190000000007000800000000000000b",
          "status": "active",
          "visibility": "public",
          "dep_count": 0,
          "content_count": 6,
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "account": {
            "id": "0190000000007000800000000000000b",
            "type": "org",
            "slug": "example-team",
            "display_name": "Example team",
            "avatar_url": null,
            "avatar_thumbnail_url": null
          }
        },
        "view": {
          "id": {
            "sort": 0
          },
          "note": {
            "sort": 1
          }
        },
        "deps": 0,
        "last_write_at_ms": 1788220800000
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### function

<AccordionGroup>
  <Accordion title="GET /v1/function — Get a Function" id="get-function">
    Get a Function.

    **Method**: `GET`<br />
    **Path**: `/v1/function`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Full Function ID, such as demo.usdc\_amount; 1–255 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `space` | `string` | Space ID |
    | `name` | `string` / `null` | Name |
    | `language` | `string` / `null` | Code language |
    | `code` | `string` / `null` | Executable code; SQL for a Query |
    | `parameters` | `object[]` | Parameter definitions |
    | `return_type` | `string` / `null` | Return type |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `space_entity` | `object` / `null` | Details of the owning Space |

    <Expandable title="parameters — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `name` | `string` / `null` | Parameter name |
      | `type` | `string` | Logical parameter type, such as INT, STRING, or ADDRESS; see [Data types](/reference/data-types) |
      | `options` | `JSON[]` / `null` | Allowed choices for the parameter |
      | `default` | `object` / `null` | Default parameter value |
      | `id` | `JSON` / `null` | Parameter display ID; generated by the service in responses |
      | `order` | `integer` / `null` | Parameter order; Function parameters must all omit it or use consecutive values from 0 |

      <Expandable title="default — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `value` | `JSON` | Argument value |
      </Expandable>
    </Expandable>

    <Expandable title="space_entity — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `description` | `string` / `null` | Description |
      | `account_id` | `string` | Account ID |
      | `status` | `string` | Status |
      | `visibility` | `string` | Visibility: public, org, or private |
      | `dep_count` | `integer` | Dependency count |
      | `content_count` | `integer` | Number of content entries |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/function \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode id=demo.usdc_amount
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "demo.usdc_amount",
        "space": "demo",
        "name": "usdc_amount",
        "language": "python",
        "code": "def usdc_amount(raw_amount):\n    return raw_amount / 10**6",
        "parameters": [
          {
            "name": "raw_amount",
            "type": "INT",
            "options": null,
            "default": null,
            "id": "01900000000070008000000000000014",
            "order": 0
          }
        ],
        "return_type": "FLOAT",
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "space_entity": {
          "id": "demo",
          "description": "Example resources",
          "account_id": "0190000000007000800000000000000b",
          "status": "active",
          "visibility": "public",
          "dep_count": 0,
          "content_count": 6,
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "account": {
            "id": "0190000000007000800000000000000b",
            "type": "org",
            "slug": "example-team",
            "display_name": "Example team",
            "avatar_url": null,
            "avatar_thumbnail_url": null
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/function/create — Create a Function" id="post-function-create">
    Create a Function.

    **Method**: `POST`<br />
    **Path**: `/v1/function/create`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `name` | `string` | Yes | Name; 1–255 characters |
    | `language` | `string` | Yes | Code language; Values: `"python"`, `"go"`, `"javascript"`, `"sql"` |
    | `code` | `string` | No | Executable code; SQL for a Query; Default `""` |
    | `parameters` | `object[]` | No | Parameter definitions; updates replace the entire array |
    | `return_type` | `string` | No | Return type; Default `""` |
    | `space` | `string` | Yes | Space ID; 1–64 characters |

    <Expandable title="parameters — Item fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `name` | `string` / `null` | Yes | Parameter name |
      | `type` | `string` | Yes | Logical parameter type, such as INT, STRING, or ADDRESS; see [Data types](/reference/data-types) |
      | `options` | `JSON[]` / `null` | No | Allowed choices for the parameter |
      | `default` | `object` / `null` | No | Default parameter value |
      | `id` | `JSON` / `null` | No | Parameter display ID; generated by the service in responses |
      | `order` | `integer` / `null` | No | Parameter order; Function parameters must all omit it or use consecutive values from 0; ≥ 0 |

      <Expandable title="default — Fields">
        | Field | Type | Required | Description |
        | - | - | - | - |
        | `value` | `JSON` | Yes | Argument value |
      </Expandable>
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `space` | `string` | Space ID |
    | `name` | `string` / `null` | Name |
    | `language` | `string` / `null` | Code language |
    | `code` | `string` / `null` | Executable code; SQL for a Query |
    | `parameters` | `object[]` | Parameter definitions |
    | `return_type` | `string` / `null` | Return type |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `space_entity` | `object` / `null` | Details of the owning Space |

    <Expandable title="parameters — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `name` | `string` / `null` | Parameter name |
      | `type` | `string` | Logical parameter type, such as INT, STRING, or ADDRESS; see [Data types](/reference/data-types) |
      | `options` | `JSON[]` / `null` | Allowed choices for the parameter |
      | `default` | `object` / `null` | Default parameter value |
      | `id` | `JSON` / `null` | Parameter display ID; generated by the service in responses |
      | `order` | `integer` / `null` | Parameter order; Function parameters must all omit it or use consecutive values from 0 |

      <Expandable title="default — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `value` | `JSON` | Argument value |
      </Expandable>
    </Expandable>

    <Expandable title="space_entity — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `description` | `string` / `null` | Description |
      | `account_id` | `string` | Account ID |
      | `status` | `string` | Status |
      | `visibility` | `string` | Visibility: public, org, or private |
      | `dep_count` | `integer` | Dependency count |
      | `content_count` | `integer` | Number of content entries |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/function/create \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "space": "demo",
      "name": "usdc_amount",
      "language": "python",
      "code": "def usdc_amount(raw_amount):\n    return raw_amount / 10**6",
      "parameters": [
        {
          "name": "raw_amount",
          "type": "INT"
        }
      ],
      "return_type": "FLOAT"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "demo.usdc_amount",
        "space": "demo",
        "name": "usdc_amount",
        "language": "python",
        "code": "def usdc_amount(raw_amount):\n    return raw_amount / 10**6",
        "parameters": [
          {
            "name": "raw_amount",
            "type": "INT",
            "options": null,
            "default": null,
            "id": "01900000000070008000000000000014",
            "order": 0
          }
        ],
        "return_type": "FLOAT",
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "space_entity": {
          "id": "demo",
          "description": "Example resources",
          "account_id": "0190000000007000800000000000000b",
          "status": "active",
          "visibility": "public",
          "dep_count": 0,
          "content_count": 6,
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "account": {
            "id": "0190000000007000800000000000000b",
            "type": "org",
            "slug": "example-team",
            "display_name": "Example team",
            "avatar_url": null,
            "avatar_thumbnail_url": null
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/function/delete — Delete a Function" id="post-function-delete">
    Delete a Function.

    **Method**: `POST`<br />
    **Path**: `/v1/function/delete`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Full Function ID, such as demo.usdc\_amount; 1–255 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `data` | `null` | Operation completed with no response data |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/function/delete \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "demo.usdc_amount"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": null
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/function/invoke — Invoke a saved Function" id="post-function-invoke">
    Executes a saved Function. Pass positional values in `arguments`, or `[]` for no arguments.

    **Method**: `POST`<br />
    **Path**: `/v1/function/invoke`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Full Function ID, such as demo.usdc\_amount; 1–255 characters |
    | `arguments` | `JSON[]` | Yes | Positional argument values; pass \[] for no arguments |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `data` | `JSON` | JSON value returned by the Function, determined by its return type and implementation |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/function/invoke \
      -H "AccessKey: $CHAINTABLE_ACCESS_KEY" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "demo.usdc_amount",
      "arguments": [
        1500000
      ]
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": 1.5
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/function/list — List Functions" id="get-function-list">
    List Functions.

    **Method**: `GET`<br />
    **Path**: `/v1/function/list`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `start` | `integer` | No | Pagination offset, starting at 0; ≥ 0; Default `0` |
    | `limit` | `integer` | No | Maximum number of entries; ≥ 1; ≤ 10000; Default `20` |
    | `order_by` | `string` | No | Sort field; Values: `"id"`, `"name"`, `"created_at"`, `"updated_at"`; Default `"updated_at"` |
    | `direction` | `string` | No | Sort direction; Values: `"asc"`, `"desc"`; Default `"desc"` |
    | `space` | `string` / `null` | No | Filter by Space; when omitted, list resources in visible Spaces; 1–64 characters |
    | `name` | `string` / `null` | No | Name substring filter |
    | `keyword` | `string` / `null` | No | Search keyword |
    | `match_type` | `string` | No | Search scope; Values: `"name"`, `"code"`; Default `"name"` |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `start` | `integer` | Pagination offset, starting at 0 |
    | `limit` | `integer` | Maximum number of entries |
    | `items` | `object[]` | Entries on this page |
    | `total_count` | `integer` | Total number of matching entries |

    <Expandable title="items — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `space` | `string` | Space ID |
      | `name` | `string` / `null` | Name |
      | `language` | `string` / `null` | Code language |
      | `code` | `string` / `null` | Executable code; SQL for a Query |
      | `parameters` | `object[]` | Parameter definitions |
      | `return_type` | `string` / `null` | Return type |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `space_entity` | `object` / `null` | Details of the owning Space |
      | `matched_lines` | `object[]` | Returned for code keyword searches, with at most 10 lines |
      | `matched_line_count` | `integer` | Total matching line count for a code keyword search |

      <Expandable title="parameters — Item fields">
        | Field | Type | Description |
        | - | - | - |
        | `name` | `string` / `null` | Parameter name |
        | `type` | `string` | Logical parameter type, such as INT, STRING, or ADDRESS; see [Data types](/reference/data-types) |
        | `options` | `JSON[]` / `null` | Allowed choices for the parameter |
        | `default` | `object` / `null` | Default parameter value |
        | `id` | `JSON` / `null` | Parameter display ID; generated by the service in responses |
        | `order` | `integer` / `null` | Parameter order; Function parameters must all omit it or use consecutive values from 0 |

        <Expandable title="default — Fields">
          | Field | Type | Description |
          | - | - | - |
          | `value` | `JSON` | Argument value |
        </Expandable>
      </Expandable>

      <Expandable title="space_entity — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `description` | `string` / `null` | Description |
        | `account_id` | `string` | Account ID |
        | `status` | `string` | Status |
        | `visibility` | `string` | Visibility: public, org, or private |
        | `dep_count` | `integer` | Dependency count |
        | `content_count` | `integer` | Number of content entries |
        | `created_at` | `number` | Creation time in Unix seconds |
        | `updated_at` | `number` | Last update time in Unix seconds |
        | `account` | `object` / `null` | Account details |

        <Expandable title="account — Fields">
          | Field | Type | Description |
          | - | - | - |
          | `id` | `string` | Unique object ID |
          | `type` | `string` | Account type: personal or org |
          | `slug` | `string` / `null` | Account slug used for display and URLs |
          | `display_name` | `string` / `null` | Account display name |
          | `avatar_url` | `string` / `null` | Avatar URL |
          | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
        </Expandable>
      </Expandable>

      <Expandable title="matched_lines — Item fields">
        | Field | Type | Description |
        | - | - | - |
        | `line` | `integer` | Code line number, starting at 1 |
        | `text` | `string` | Contents of the matching code line |
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/function/list \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode space=demo \
      --data-urlencode limit=10
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "items": [
          {
            "id": "demo.usdc_amount",
            "space": "demo",
            "name": "usdc_amount",
            "language": "python",
            "code": "def usdc_amount(raw_amount):\n    return raw_amount / 10**6",
            "parameters": [
              {
                "name": "raw_amount",
                "type": "INT",
                "options": null,
                "default": null,
                "id": "01900000000070008000000000000014",
                "order": 0
              }
            ],
            "return_type": "FLOAT",
            "created_at": 1788220800.0,
            "updated_at": 1788220800.0,
            "space_entity": {
              "id": "demo",
              "description": "Example resources",
              "account_id": "0190000000007000800000000000000b",
              "status": "active",
              "visibility": "public",
              "dep_count": 0,
              "content_count": 6,
              "created_at": 1788220800.0,
              "updated_at": 1788220800.0,
              "account": {
                "id": "0190000000007000800000000000000b",
                "type": "org",
                "slug": "example-team",
                "display_name": "Example team",
                "avatar_url": null,
                "avatar_thumbnail_url": null
              }
            }
          }
        ],
        "total_count": 1,
        "start": 0,
        "limit": 10
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/function/run — Run Function code" id="post-function-run">
    Executes inline code and returns a debugging record. `status` indicates the execution outcome; `output` contains debug output and error details.

    **Method**: `POST`<br />
    **Path**: `/v1/function/run`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `language` | `string` | Yes | Code language; Values: `"python"`, `"go"`, `"javascript"`, `"sql"` |
    | `code` | `string` | Yes | Executable code; SQL for a Query; ≥ 1 characters |
    | `func_name` | `string` | No | Entry function name; Default `""` |
    | `parameters` | `object[]` | No | Parameter definitions; updates replace the entire array |
    | `arguments` | `object[]` | No | Argument values for this execution |

    <Expandable title="parameters — Item fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `name` | `string` / `null` | Yes | Parameter name |
      | `type` | `string` | Yes | Logical parameter type, such as INT, STRING, or ADDRESS; see [Data types](/reference/data-types) |
      | `options` | `JSON[]` / `null` | No | Allowed choices for the parameter |
      | `default` | `object` / `null` | No | Default parameter value |
      | `id` | `JSON` / `null` | No | Parameter display ID; generated by the service in responses |
      | `order` | `integer` / `null` | No | Parameter order; Function parameters must all omit it or use consecutive values from 0; ≥ 0 |

      <Expandable title="default — Fields">
        | Field | Type | Required | Description |
        | - | - | - | - |
        | `value` | `JSON` | Yes | Argument value |
      </Expandable>
    </Expandable>

    <Expandable title="arguments — Item fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `value` | `JSON` | Yes | Argument value |
      | `name` | `string` / `null` | No | Name of the matching parameter |
      | `order` | `integer` / `null` | No | Omit for every argument, or use consecutive values from 0 to determine argument order; ≥ 0 |
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `language` | `string` | Code language |
    | `code` | `string` | Executable code; SQL for a Query |
    | `parameters` | `object[]` | Parameter definitions |
    | `args` | `JSON[]` | Resolved positional argument values |
    | `status` | `string` | Execution outcome; Values: `"succeeded"`, `"failed"`, `"timeout"` |
    | `output` | `object` | Debug output and error details |
    | `return_value` | `JSON` | Function’s JSON return value; null on failure |
    | `creator_id` | `string` | Creator’s user ID |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `started_at` | `number` | Start time in Unix seconds; null before execution starts |
    | `finished_at` | `number` | Completion time in Unix seconds; null before completion |
    | `arguments` | `object[]` | Argument values for this execution |

    <Expandable title="parameters — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `name` | `string` / `null` | Parameter name |
      | `type` | `string` | Logical parameter type, such as INT, STRING, or ADDRESS; see [Data types](/reference/data-types) |
      | `options` | `JSON[]` / `null` | Allowed choices for the parameter |
      | `default` | `object` / `null` | Default parameter value |
      | `id` | `JSON` / `null` | Parameter display ID; generated by the service in responses |
      | `order` | `integer` / `null` | Parameter order; Function parameters must all omit it or use consecutive values from 0 |

      <Expandable title="default — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `value` | `JSON` | Argument value |
      </Expandable>
    </Expandable>

    <Expandable title="output — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `text` | `string` | Captured standard output and standard error text |
      | `truncated` | `boolean` | Whether the captured output was truncated |
      | `original_size_bytes` | `integer` | Output size before truncation, in bytes |
      | `failure` | `object` / `null` | Failure details, or null on success |
      | `error_stack` | `string` | Error stack trace |
      | `local_vars_json` | `string` | JSON-encoded local variables at the failure location |
      | `execution_duration_ms` | `integer` | Execution duration in milliseconds |
      | `queue_wait_ms` | `integer` | Queue wait in milliseconds |
      | `call_id` | `string` / `null` | Upstream call ID |

      <Expandable title="failure — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `code` | `string` | Upstream failure type identifier |
        | `message` | `string` | Description or error message |
        | `retryable` | `boolean` | Whether the upstream marks the failure as retryable |
      </Expandable>
    </Expandable>

    <Expandable title="arguments — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `value` | `JSON` | Argument value |
      | `name` | `string` / `null` | Name of the matching parameter |
      | `order` | `integer` / `null` | Omit for every argument, or use consecutive values from 0 to determine argument order |
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/function/run \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "language": "python",
      "code": "def usdc_amount(raw_amount):\n    return raw_amount / 10**6",
      "func_name": "usdc_amount",
      "parameters": [
        {
          "name": "raw_amount",
          "type": "INT"
        }
      ],
      "arguments": [
        {
          "name": "raw_amount",
          "value": 1500000
        }
      ]
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "01900000000070008000000000000017",
        "language": "python",
        "code": "def usdc_amount(raw_amount):\n    return raw_amount / 10**6",
        "parameters": [
          {
            "name": "raw_amount",
            "type": "INT",
            "options": null,
            "default": null,
            "id": "01900000000070008000000000000014",
            "order": 0
          }
        ],
        "args": [
          1500000
        ],
        "arguments": [
          {
            "name": "raw_amount",
            "value": 1500000,
            "order": null
          }
        ],
        "status": "succeeded",
        "output": {
          "text": "",
          "truncated": false,
          "original_size_bytes": 0,
          "failure": null,
          "error_stack": "",
          "local_vars_json": "",
          "execution_duration_ms": 2,
          "queue_wait_ms": 0,
          "call_id": "01900000000070008000000000000018"
        },
        "return_value": 1.5,
        "creator_id": "0190000000007000800000000000000c",
        "created_at": 1788220800.0,
        "started_at": 1788220800.0,
        "finished_at": 1788220800.002
      }
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/function/testcase — Get a test case" id="get-function-testcase">
    Get a test case.

    **Method**: `GET`<br />
    **Path**: `/v1/function/testcase`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–255 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `function_id` | `string` / `null` | Full Function ID |
    | `arguments` | `JSON[]` | Positional argument values for the test case |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/function/testcase \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode id=01900000000070008000000000000008
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "01900000000070008000000000000008",
        "function_id": "demo.usdc_amount",
        "arguments": [
          1500000
        ],
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/function/testcase/create — Create a test case" id="post-function-testcase-create">
    `arguments` is an array of JSON values. Duplicate arguments for the same Function return `409`.

    **Method**: `POST`<br />
    **Path**: `/v1/function/testcase/create`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `function_id` | `string` | Yes | Full Function ID; 1–255 characters |
    | `arguments` | `JSON[]` | No | Positional argument values for the test case |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `function_id` | `string` / `null` | Full Function ID |
    | `arguments` | `JSON[]` | Positional argument values for the test case |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/function/testcase/create \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "function_id": "demo.usdc_amount",
      "arguments": [
        1500000
      ]
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "01900000000070008000000000000008",
        "function_id": "demo.usdc_amount",
        "arguments": [
          1500000
        ],
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/function/testcase/delete — Delete a test case" id="post-function-testcase-delete">
    Delete a test case.

    **Method**: `POST`<br />
    **Path**: `/v1/function/testcase/delete`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–255 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `data` | `null` | Operation completed with no response data |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/function/testcase/delete \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "01900000000070008000000000000008"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": null
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/function/testcase/list — List test cases" id="get-function-testcase-list">
    List test cases.

    **Method**: `GET`<br />
    **Path**: `/v1/function/testcase/list`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `start` | `integer` | No | Pagination offset, starting at 0; ≥ 0; Default `0` |
    | `limit` | `integer` | No | Maximum number of entries; ≥ 1; ≤ 100; Default `20` |
    | `function_id` | `string` | Yes | Full Function ID; 1–255 characters |
    | `order_by` | `string` | No | Sort field; Values: `"id"`, `"created_at"`, `"updated_at"`; Default `"updated_at"` |
    | `direction` | `string` | No | Sort direction; Values: `"asc"`, `"desc"`; Default `"desc"` |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `start` | `integer` | Pagination offset, starting at 0 |
    | `limit` | `integer` | Maximum number of entries |
    | `items` | `object[]` | Entries on this page |
    | `total_count` | `integer` | Total number of matching entries |

    <Expandable title="items — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `function_id` | `string` / `null` | Full Function ID |
      | `arguments` | `JSON[]` | Argument values for this execution |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/function/testcase/list \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode function_id=demo.usdc_amount \
      --data-urlencode limit=10
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "items": [
          {
            "id": "01900000000070008000000000000008",
            "function_id": "demo.usdc_amount",
            "arguments": [
              1500000
            ],
            "created_at": 1788220800.0,
            "updated_at": 1788220800.0
          }
        ],
        "total_count": 1,
        "start": 0,
        "limit": 10
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/function/testcase/update — Update a test case" id="post-function-testcase-update">
    Replaces `arguments` as a whole. The owning Function cannot change.

    **Method**: `POST`<br />
    **Path**: `/v1/function/testcase/update`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–255 characters |
    | `arguments` | `JSON[]` | No | Positional argument values for the test case |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `function_id` | `string` / `null` | Full Function ID |
    | `arguments` | `JSON[]` | Positional argument values for the test case |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/function/testcase/update \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "01900000000070008000000000000008",
      "arguments": [
        2000000
      ]
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "01900000000070008000000000000008",
        "function_id": "demo.usdc_amount",
        "arguments": [
          2000000
        ],
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/function/update — Update a Function" id="post-function-update">
    Updates the Function definition, preserving omitted fields. Renaming does not change the Function ID. Parameter definitions are replaced as a whole.

    **Method**: `POST`<br />
    **Path**: `/v1/function/update`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Full Function ID, such as demo.usdc\_amount; 1–255 characters |
    | `name` | `string` | No | Name; 1–255 characters |
    | `language` | `string` | No | Code language; Values: `"python"`, `"go"`, `"javascript"`, `"sql"` |
    | `code` | `string` | No | Executable code; SQL for a Query |
    | `parameters` | `object[]` | No | Parameter definitions; updates replace the entire array |
    | `return_type` | `string` | No | Return type |

    <Expandable title="parameters — Item fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `name` | `string` / `null` | Yes | Parameter name |
      | `type` | `string` | Yes | Logical parameter type, such as INT, STRING, or ADDRESS; see [Data types](/reference/data-types) |
      | `options` | `JSON[]` / `null` | No | Allowed choices for the parameter |
      | `default` | `object` / `null` | No | Default parameter value |
      | `id` | `JSON` / `null` | No | Parameter display ID; generated by the service in responses |
      | `order` | `integer` / `null` | No | Parameter order; Function parameters must all omit it or use consecutive values from 0; ≥ 0 |

      <Expandable title="default — Fields">
        | Field | Type | Required | Description |
        | - | - | - | - |
        | `value` | `JSON` | Yes | Argument value |
      </Expandable>
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `space` | `string` | Space ID |
    | `name` | `string` / `null` | Name |
    | `language` | `string` / `null` | Code language |
    | `code` | `string` / `null` | Executable code; SQL for a Query |
    | `parameters` | `object[]` | Parameter definitions |
    | `return_type` | `string` / `null` | Return type |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `space_entity` | `object` / `null` | Details of the owning Space |

    <Expandable title="parameters — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `name` | `string` / `null` | Parameter name |
      | `type` | `string` | Logical parameter type, such as INT, STRING, or ADDRESS; see [Data types](/reference/data-types) |
      | `options` | `JSON[]` / `null` | Allowed choices for the parameter |
      | `default` | `object` / `null` | Default parameter value |
      | `id` | `JSON` / `null` | Parameter display ID; generated by the service in responses |
      | `order` | `integer` / `null` | Parameter order; Function parameters must all omit it or use consecutive values from 0 |

      <Expandable title="default — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `value` | `JSON` | Argument value |
      </Expandable>
    </Expandable>

    <Expandable title="space_entity — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `description` | `string` / `null` | Description |
      | `account_id` | `string` | Account ID |
      | `status` | `string` | Status |
      | `visibility` | `string` | Visibility: public, org, or private |
      | `dep_count` | `integer` | Dependency count |
      | `content_count` | `integer` | Number of content entries |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/function/update \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "demo.usdc_amount",
      "code": "def usdc_amount(raw_amount):\n    return raw_amount / 10**6"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "demo.usdc_amount",
        "space": "demo",
        "name": "usdc_amount",
        "language": "python",
        "code": "def usdc_amount(raw_amount):\n    return raw_amount / 10**6",
        "parameters": [
          {
            "name": "raw_amount",
            "type": "INT",
            "options": null,
            "default": null,
            "id": "01900000000070008000000000000014",
            "order": 0
          }
        ],
        "return_type": "FLOAT",
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "space_entity": {
          "id": "demo",
          "description": "Example resources",
          "account_id": "0190000000007000800000000000000b",
          "status": "active",
          "visibility": "public",
          "dep_count": 0,
          "content_count": 6,
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "account": {
            "id": "0190000000007000800000000000000b",
            "type": "org",
            "slug": "example-team",
            "display_name": "Example team",
            "avatar_url": null,
            "avatar_thumbnail_url": null
          }
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### notebook

<AccordionGroup>
  <Accordion title="GET /v1/notebook — Get a Notebook" id="get-notebook">
    Get a Notebook.

    **Method**: `GET`<br />
    **Path**: `/v1/notebook`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–255 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `space` | `string` | Space ID |
    | `name` | `string` / `null` | Name |
    | `language` | `string` / `null` | Code language |
    | `code` | `string` / `null` | Notebook code; omitted from list responses |
    | `parameters` | `object[]` | Parameter definitions |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `space_entity` | `object` / `null` | Details of the owning Space |

    <Expandable title="parameters — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `name` | `string` / `null` | Name |
      | `type` | `string` | Logical parameter type; see [Data types](/reference/data-types) |
      | `options` | `JSON[]` / `null` | Allowed choices for the parameter |
      | `default` | `object` / `null` | Default parameter value |
      | `id` | `JSON` / `null` | Unique object ID |
      | `order` | `integer` / `null` | Parameter order; consecutive numbering is not required |

      <Expandable title="default — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `value` | `JSON` | Argument value |
      </Expandable>
    </Expandable>

    <Expandable title="space_entity — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `description` | `string` / `null` | Description |
      | `account_id` | `string` | Account ID |
      | `status` | `string` | Status |
      | `visibility` | `string` | Visibility: public, org, or private |
      | `dep_count` | `integer` | Dependency count |
      | `content_count` | `integer` | Number of content entries |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/notebook \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode id=01900000000070008000000000000002
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "01900000000070008000000000000002",
        "space": "demo",
        "name": "print_message",
        "language": "python",
        "code": "print(\"Hello, Chaintable\")",
        "parameters": [],
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "space_entity": {
          "id": "demo",
          "description": "Example resources",
          "account_id": "0190000000007000800000000000000b",
          "status": "active",
          "visibility": "public",
          "dep_count": 0,
          "content_count": 6,
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "account": {
            "id": "0190000000007000800000000000000b",
            "type": "org",
            "slug": "example-team",
            "display_name": "Example team",
            "avatar_url": null,
            "avatar_thumbnail_url": null
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/notebook/create — Create a Notebook" id="post-notebook-create">
    Creates a Notebook. Names start with a lowercase letter and use lowercase letters, digits, and underscores, with dots separating valid segments.

    **Method**: `POST`<br />
    **Path**: `/v1/notebook/create`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `space` | `string` | Yes | Space ID; 1–64 characters |
    | `name` | `string` | Yes | Name; 1–255 characters |
    | `language` | `string` | No | Code language; Values: `"python"`; Default `"python"` |
    | `code` | `string` / `null` | No | Executable code; SQL for a Query; Default `""` |
    | `parameters` | `object[]` / `null` | No | Parameter definitions; updates replace the entire array |

    <Expandable title="parameters — Item fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `name` | `string` / `null` | Yes | Name |
      | `type` | `string` | Yes | Logical parameter type; see [Data types](/reference/data-types) |
      | `options` | `JSON[]` / `null` | No | Allowed choices for the parameter |
      | `default` | `object` / `null` | No | Default parameter value |
      | `id` | `JSON` / `null` | No | Unique object ID |
      | `order` | `integer` / `null` | No | Parameter order; consecutive numbering is not required; ≥ 0 |

      <Expandable title="default — Fields">
        | Field | Type | Required | Description |
        | - | - | - | - |
        | `value` | `JSON` | Yes | Argument value |
      </Expandable>
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `space` | `string` | Space ID |
    | `name` | `string` / `null` | Name |
    | `language` | `string` / `null` | Code language |
    | `code` | `string` / `null` | Notebook code; omitted from list responses |
    | `parameters` | `object[]` | Parameter definitions |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `space_entity` | `object` / `null` | Details of the owning Space |

    <Expandable title="parameters — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `name` | `string` / `null` | Name |
      | `type` | `string` | Logical parameter type; see [Data types](/reference/data-types) |
      | `options` | `JSON[]` / `null` | Allowed choices for the parameter |
      | `default` | `object` / `null` | Default parameter value |
      | `id` | `JSON` / `null` | Unique object ID |
      | `order` | `integer` / `null` | Parameter order; consecutive numbering is not required |

      <Expandable title="default — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `value` | `JSON` | Argument value |
      </Expandable>
    </Expandable>

    <Expandable title="space_entity — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `description` | `string` / `null` | Description |
      | `account_id` | `string` | Account ID |
      | `status` | `string` | Status |
      | `visibility` | `string` | Visibility: public, org, or private |
      | `dep_count` | `integer` | Dependency count |
      | `content_count` | `integer` | Number of content entries |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/notebook/create \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "space": "demo",
      "name": "print_message",
      "language": "python",
      "code": "print(\"Hello, Chaintable\")",
      "parameters": []
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "01900000000070008000000000000002",
        "space": "demo",
        "name": "print_message",
        "language": "python",
        "code": "print(\"Hello, Chaintable\")",
        "parameters": [],
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "space_entity": {
          "id": "demo",
          "description": "Example resources",
          "account_id": "0190000000007000800000000000000b",
          "status": "active",
          "visibility": "public",
          "dep_count": 0,
          "content_count": 6,
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "account": {
            "id": "0190000000007000800000000000000b",
            "type": "org",
            "slug": "example-team",
            "display_name": "Example team",
            "avatar_url": null,
            "avatar_thumbnail_url": null
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/notebook/delete — Delete a Notebook" id="post-notebook-delete">
    Delete a Notebook.

    **Method**: `POST`<br />
    **Path**: `/v1/notebook/delete`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–255 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `data` | `null` | Operation completed with no response data |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/notebook/delete \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "01900000000070008000000000000002"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": null
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/notebook/instance — Get an instance" id="get-notebook-instance">
    Get an instance.

    **Method**: `GET`<br />
    **Path**: `/v1/notebook/instance`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Notebook execution instance ID; 1–255 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `notebook_id` | `string` / `null` | Notebook ID |
    | `name` | `string` / `null` | Name |
    | `code` | `string` / `null` | Code for this execution; omitted from instance lists |
    | `parameters` | `object[]` | Parameter definitions |
    | `arguments` | `object[]` | Argument values for this execution |
    | `max_memory` | `integer` / `null` | Memory allocation in bytes |
    | `max_cpu` | `integer` / `null` | CPU allocation; 100 represents 1 vCPU |
    | `max_network_rx` | `integer` / `null` | Recorded network receive allocation |
    | `max_network_tx` | `integer` / `null` | Recorded network transmit allocation |
    | `account_id` | `string` / `null` | Account ID |
    | `user_id` | `string` / `null` | ID of the user who started execution |
    | `schedule_id` | `string` / `null` | Schedule ID |
    | `background` | `boolean` / `null` | Whether to run in the background |
    | `debug` | `boolean` / `null` | Whether to use debug mode |
    | `deadline` | `number` / `null` | Foreground instance expiry in Unix seconds; null for background instances |
    | `status` | `string` | Status; Values: `"running"`, `"ended"` |
    | `exit_code` | `integer` / `null` | Exit code; null while running, 0 on success |
    | `oom_killed` | `boolean` / `null` | Whether the instance was terminated for exceeding memory |
    | `exited_at` | `number` / `null` | Exit time in Unix seconds; null while running |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `display_status` | `string` | Instance display status; Values: `"running"`, `"succeeded"`, `"failed"`, `"canceled"`, `"starting"` |
    | `launched` | `string` | How the instance was launched; Values: `"manual"`, `"schedule"` |
    | `exit_message` | `string` / `null` | Exit reason; null while running |
    | `account` | `object` / `null` | Account details |
    | `user` | `object` / `null` | Launcher details, or null if unavailable |
    | `notebook` | `object` / `null` | Related Notebook summary, or null if unavailable |
    | `schedule` | `object` / `null` | Related schedule, or null when none exists |

    <Expandable title="parameters — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `name` | `string` / `null` | Name |
      | `type` | `string` | Logical parameter type; see [Data types](/reference/data-types) |
      | `options` | `JSON[]` / `null` | Allowed choices for the parameter |
      | `default` | `object` / `null` | Default parameter value |
      | `id` | `JSON` / `null` | Unique object ID |
      | `order` | `integer` / `null` | Parameter order; consecutive numbering is not required |

      <Expandable title="default — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `value` | `JSON` | Argument value |
      </Expandable>
    </Expandable>

    <Expandable title="arguments — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `value` | `JSON` | Argument value |
      | `name` | `string` / `null` | Name of the matching parameter |
      | `order` | `integer` / `null` | Omit for every argument, or use consecutive values from 0 to determine argument order |
    </Expandable>

    <Expandable title="account — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `type` | `string` | Account type: personal or org |
      | `slug` | `string` / `null` | Account slug used for display and URLs |
      | `display_name` | `string` / `null` | Account display name |
      | `avatar_url` | `string` / `null` | Avatar URL |
      | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
    </Expandable>

    <Expandable title="user — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    <Expandable title="notebook — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `name` | `string` / `null` | Name |
      | `space` | `string` | Space ID |
    </Expandable>

    <Expandable title="schedule — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `space` | `string` | Space ID |
      | `content_type` | `string` / `null` | Target content type |
      | `content_id` | `string` / `null` | Target content ID |
      | `cron` | `string` / `null` | Cron expression |
      | `arguments` | `object[]` | Argument values for this execution |
      | `name` | `string` / `null` | Name |
      | `mode` | `string` / `null` | Schedule mode |
      | `max_cpu` | `integer` / `null` | CPU allocation; 100 represents 1 vCPU |
      | `max_memory` | `integer` / `null` | Memory allocation in bytes |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `deleted_at` | `number` / `null` | Deletion time in Unix seconds; null if not deleted |

      <Expandable title="arguments — Item fields">
        | Field | Type | Description |
        | - | - | - |
        | `value` | `JSON` | Argument value |
        | `name` | `string` / `null` | Name of the matching parameter |
        | `order` | `integer` / `null` | Omit for every argument, or use consecutive values from 0 to determine argument order |
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/notebook/instance \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode id=01900000000070008000000000000009
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "01900000000070008000000000000009",
        "notebook_id": "01900000000070008000000000000002",
        "name": "print_message",
        "code": "print(\"Hello, Chaintable\")",
        "parameters": [],
        "arguments": [],
        "max_cpu": 100,
        "max_memory": 4294967296,
        "max_network_rx": null,
        "max_network_tx": null,
        "account_id": "0190000000007000800000000000000b",
        "user_id": "0190000000007000800000000000000c",
        "schedule_id": null,
        "background": false,
        "debug": false,
        "deadline": 1788220950.0,
        "status": "running",
        "exit_code": null,
        "oom_killed": null,
        "exited_at": null,
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "display_status": "running",
        "launched": "manual",
        "exit_message": null,
        "account": {
          "id": "0190000000007000800000000000000b",
          "type": "org",
          "slug": "example-team",
          "display_name": "Example team",
          "avatar_url": null,
          "avatar_thumbnail_url": null
        },
        "user": {
          "id": "0190000000007000800000000000000c",
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "account": null
        },
        "notebook": {
          "id": "01900000000070008000000000000002",
          "name": "print_message",
          "space": "demo"
        },
        "schedule": null
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/notebook/instance/cancel — Cancel an instance" id="post-notebook-instance-cancel">
    Cancel an instance.

    **Method**: `POST`<br />
    **Path**: `/v1/notebook/instance/cancel`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Notebook execution instance ID; 1–255 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `data` | `null` | Operation completed with no response data |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/notebook/instance/cancel \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "01900000000070008000000000000009"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": null
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/notebook/instance/keepalive — Keep a foreground instance alive" id="post-notebook-instance-keepalive">
    Extends a foreground instance expiry to 150 seconds from now. Background or finished instances are unaffected.

    **Method**: `POST`<br />
    **Path**: `/v1/notebook/instance/keepalive`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Notebook execution instance ID; 1–255 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `data` | `null` | Operation completed with no response data |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/notebook/instance/keepalive \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "01900000000070008000000000000009"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": null
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/notebook/instance/list — List instances" id="get-notebook-instance-list">
    Lists instances for the calling account, excluding `code`. The effective limit is capped at 50. `keyword` takes precedence over `name` and matches the instance name or the launcher’s personal account slug.

    **Method**: `GET`<br />
    **Path**: `/v1/notebook/instance/list`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `start` | `integer` | No | Pagination offset, starting at 0; ≥ 0; Default `0` |
    | `limit` | `integer` | No | Maximum number of entries; ≥ 1; Default `10` |
    | `notebook_id` | `string` / `null` | No | Notebook ID |
    | `schedule_id` | `string` / `null` | No | Schedule ID |
    | `display_status` | `string` / `null` | No | Instance display status; Values: `"running"`, `"succeeded"`, `"failed"`, `"canceled"` |
    | `launched` | `string` / `null` | No | How the instance was launched; Values: `"manual"`, `"schedule"` |
    | `keyword` | `string` / `null` | No | Search keyword; ≤ 255 characters |
    | `name` | `string` / `null` | No | Name substring filter; ≤ 255 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `total_count` | `integer` | Total number of matching entries |
    | `instances` | `object[]` | Notebook execution instances |

    <Expandable title="instances — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `notebook_id` | `string` / `null` | Notebook ID |
      | `name` | `string` / `null` | Name |
      | `code` | `string` / `null` | Code for this execution; omitted from instance lists |
      | `parameters` | `object[]` | Parameter definitions |
      | `arguments` | `object[]` | Argument values for this execution |
      | `max_memory` | `integer` / `null` | Memory allocation in bytes |
      | `max_cpu` | `integer` / `null` | CPU allocation; 100 represents 1 vCPU |
      | `max_network_rx` | `integer` / `null` | Recorded network receive allocation |
      | `max_network_tx` | `integer` / `null` | Recorded network transmit allocation |
      | `account_id` | `string` / `null` | Account ID |
      | `user_id` | `string` / `null` | ID of the user who started execution |
      | `schedule_id` | `string` / `null` | Schedule ID |
      | `background` | `boolean` / `null` | Whether to run in the background |
      | `debug` | `boolean` / `null` | Whether to use debug mode |
      | `deadline` | `number` / `null` | Foreground instance expiry in Unix seconds; null for background instances |
      | `status` | `string` | Status; Values: `"running"`, `"ended"` |
      | `exit_code` | `integer` / `null` | Exit code; null while running, 0 on success |
      | `oom_killed` | `boolean` / `null` | Whether the instance was terminated for exceeding memory |
      | `exited_at` | `number` / `null` | Exit time in Unix seconds; null while running |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `display_status` | `string` | Instance display status; Values: `"running"`, `"succeeded"`, `"failed"`, `"canceled"`, `"starting"` |
      | `launched` | `string` | How the instance was launched; Values: `"manual"`, `"schedule"` |
      | `exit_message` | `string` / `null` | Exit reason; null while running |
      | `account` | `object` / `null` | Account details |
      | `user` | `object` / `null` | Launcher details, or null if unavailable |
      | `notebook` | `object` / `null` | Related Notebook summary, or null if unavailable |
      | `schedule` | `object` / `null` | Related schedule, or null when none exists |

      <Expandable title="parameters — Item fields">
        | Field | Type | Description |
        | - | - | - |
        | `name` | `string` / `null` | Name |
        | `type` | `string` | Logical parameter type; see [Data types](/reference/data-types) |
        | `options` | `JSON[]` / `null` | Allowed choices for the parameter |
        | `default` | `object` / `null` | Default parameter value |
        | `id` | `JSON` / `null` | Unique object ID |
        | `order` | `integer` / `null` | Parameter order; consecutive numbering is not required |

        <Expandable title="default — Fields">
          | Field | Type | Description |
          | - | - | - |
          | `value` | `JSON` | Argument value |
        </Expandable>
      </Expandable>

      <Expandable title="arguments — Item fields">
        | Field | Type | Description |
        | - | - | - |
        | `value` | `JSON` | Argument value |
        | `name` | `string` / `null` | Name of the matching parameter |
        | `order` | `integer` / `null` | Omit for every argument, or use consecutive values from 0 to determine argument order |
      </Expandable>

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>

      <Expandable title="user — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `created_at` | `number` | Creation time in Unix seconds |
        | `updated_at` | `number` | Last update time in Unix seconds |
        | `account` | `object` / `null` | Account details |

        <Expandable title="account — Fields">
          | Field | Type | Description |
          | - | - | - |
          | `id` | `string` | Unique object ID |
          | `type` | `string` | Account type: personal or org |
          | `slug` | `string` / `null` | Account slug used for display and URLs |
          | `display_name` | `string` / `null` | Account display name |
          | `avatar_url` | `string` / `null` | Avatar URL |
          | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
        </Expandable>
      </Expandable>

      <Expandable title="notebook — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `name` | `string` / `null` | Name |
        | `space` | `string` | Space ID |
      </Expandable>

      <Expandable title="schedule — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `space` | `string` | Space ID |
        | `content_type` | `string` / `null` | Target content type |
        | `content_id` | `string` / `null` | Target content ID |
        | `cron` | `string` / `null` | Cron expression |
        | `arguments` | `object[]` | Argument values for this execution |
        | `name` | `string` / `null` | Name |
        | `mode` | `string` / `null` | Schedule mode |
        | `max_cpu` | `integer` / `null` | CPU allocation; 100 represents 1 vCPU |
        | `max_memory` | `integer` / `null` | Memory allocation in bytes |
        | `created_at` | `number` | Creation time in Unix seconds |
        | `updated_at` | `number` | Last update time in Unix seconds |
        | `deleted_at` | `number` / `null` | Deletion time in Unix seconds; null if not deleted |

        <Expandable title="arguments — Item fields">
          | Field | Type | Description |
          | - | - | - |
          | `value` | `JSON` | Argument value |
          | `name` | `string` / `null` | Name of the matching parameter |
          | `order` | `integer` / `null` | Omit for every argument, or use consecutive values from 0 to determine argument order |
        </Expandable>
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/notebook/instance/list \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode notebook_id=01900000000070008000000000000002 \
      --data-urlencode limit=10
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "total_count": 1,
        "instances": [
          {
            "id": "01900000000070008000000000000009",
            "notebook_id": "01900000000070008000000000000002",
            "name": "print_message",
            "parameters": [],
            "arguments": [],
            "max_cpu": 100,
            "max_memory": 4294967296,
            "max_network_rx": null,
            "max_network_tx": null,
            "account_id": "0190000000007000800000000000000b",
            "user_id": "0190000000007000800000000000000c",
            "schedule_id": null,
            "background": false,
            "debug": false,
            "deadline": 1788220950.0,
            "status": "running",
            "exit_code": null,
            "oom_killed": null,
            "exited_at": null,
            "created_at": 1788220800.0,
            "updated_at": 1788220800.0,
            "display_status": "running",
            "launched": "manual",
            "exit_message": null,
            "account": {
              "id": "0190000000007000800000000000000b",
              "type": "org",
              "slug": "example-team",
              "display_name": "Example team",
              "avatar_url": null,
              "avatar_thumbnail_url": null
            },
            "user": {
              "id": "0190000000007000800000000000000c",
              "created_at": 1788220800.0,
              "updated_at": 1788220800.0,
              "account": null
            },
            "notebook": {
              "id": "01900000000070008000000000000002",
              "name": "print_message",
              "space": "demo"
            },
            "schedule": null
          }
        ]
      }
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/notebook/instance/logs/history — Read instance logs" id="get-notebook-instance-logs-history">
    Use the returned `timestamp` to continue reading subsequent logs.

    **Method**: `GET`<br />
    **Path**: `/v1/notebook/instance/logs/history`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Notebook execution instance ID; 1–255 characters |
    | `timestamp` | `integer` / `null` | No | Log timestamp cursor; ≥ 0 |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `logs` | `object[]` | Log records; fields depend on the log type |
    | `timestamp` | `number` | Log cursor for subsequent reads; pass it back unchanged |

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/notebook/instance/logs/history \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode id=01900000000070008000000000000009
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "logs": [],
        "timestamp": 1788220800000
      }
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/notebook/instance/metrics/blockx — Get compute task metrics" id="get-notebook-instance-metrics-blockx">
    Get compute task metrics.

    **Method**: `GET`<br />
    **Path**: `/v1/notebook/instance/metrics/blockx`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Notebook execution instance ID; 1–255 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `instance_id` | `string` | Notebook execution instance ID |
    | `from` | `number` | Metric range start in Unix seconds |
    | `to` | `number` | Metric range end in Unix seconds |
    | `step` | `integer` | Sampling interval in seconds |
    | `charts` | `object` | Charts keyed by metric name |

    <Expandable title="charts — Value fields">
      | Field | Type | Description |
      | - | - | - |
      | `unit` | `string` | Metric unit |
      | `series` | `object[]` | Chart series |

      <Expandable title="series — Item fields">
        | Field | Type | Description |
        | - | - | - |
        | `name` | `string` | Name |
        | `points` | `number[][]` | Samples, each represented as \[Unix seconds, value] |
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/notebook/instance/metrics/blockx \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode id=01900000000070008000000000000009
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "instance_id": "01900000000070008000000000000009",
        "from": 1788220800.0,
        "to": 1788220860.0,
        "step": 3,
        "charts": {
          "block_lag": {
            "unit": "ms",
            "series": [
              {
                "name": "block_lag",
                "points": [
                  [
                    1788220800.0,
                    50
                  ],
                  [
                    1788220803.0,
                    45
                  ]
                ]
              }
            ]
          },
          "tasks": {
            "unit": "per_sec",
            "series": [
              {
                "name": "task_total",
                "points": [
                  [
                    1788220800.0,
                    10
                  ]
                ]
              },
              {
                "name": "task_failed",
                "points": [
                  [
                    1788220800.0,
                    0
                  ]
                ]
              }
            ]
          },
          "task_duration": {
            "unit": "ms",
            "series": [
              {
                "name": "total",
                "points": [
                  [
                    1788220800.0,
                    20
                  ]
                ]
              },
              {
                "name": "builder",
                "points": [
                  [
                    1788220800.0,
                    3
                  ]
                ]
              },
              {
                "name": "calls",
                "points": [
                  [
                    1788220800.0,
                    12
                  ]
                ]
              },
              {
                "name": "writer",
                "points": [
                  [
                    1788220800.0,
                    5
                  ]
                ]
              }
            ]
          },
          "calls": {
            "unit": "per_sec",
            "series": [
              {
                "name": "call_total",
                "points": [
                  [
                    1788220800.0,
                    10
                  ]
                ]
              },
              {
                "name": "result_count",
                "points": [
                  [
                    1788220800.0,
                    10
                  ]
                ]
              }
            ]
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/notebook/instance/metrics/container — Get CPU and memory metrics" id="get-notebook-instance-metrics-container">
    Get CPU and memory metrics.

    **Method**: `GET`<br />
    **Path**: `/v1/notebook/instance/metrics/container`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Notebook execution instance ID; 1–255 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `instance_id` | `string` | Notebook execution instance ID |
    | `from` | `number` | Metric range start in Unix seconds |
    | `to` | `number` | Metric range end in Unix seconds |
    | `step` | `integer` | Sampling interval in seconds |
    | `charts` | `object` | Charts keyed by metric name |

    <Expandable title="charts — Value fields">
      | Field | Type | Description |
      | - | - | - |
      | `unit` | `string` | Metric unit |
      | `series` | `object[]` | Chart series |

      <Expandable title="series — Item fields">
        | Field | Type | Description |
        | - | - | - |
        | `name` | `string` | Name |
        | `points` | `number[][]` | Samples, each represented as \[Unix seconds, value] |
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/notebook/instance/metrics/container \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode id=01900000000070008000000000000009
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "instance_id": "01900000000070008000000000000009",
        "from": 1788220800.0,
        "to": 1788220860.0,
        "step": 3,
        "charts": {
          "cpu": {
            "unit": "percent",
            "series": [
              {
                "name": "cpu_usage",
                "points": [
                  [
                    1788220800.0,
                    12.5
                  ],
                  [
                    1788220803.0,
                    12.5
                  ]
                ]
              }
            ]
          },
          "memory": {
            "unit": "bytes",
            "series": [
              {
                "name": "memory_usage",
                "points": [
                  [
                    1788220800.0,
                    104857600
                  ],
                  [
                    1788220803.0,
                    104857600
                  ]
                ]
              }
            ]
          },
          "net_rx": {
            "unit": "bytes_per_sec",
            "series": [
              {
                "name": "net_rx",
                "points": [
                  [
                    1788220800.0,
                    1024
                  ],
                  [
                    1788220803.0,
                    1024
                  ]
                ]
              }
            ]
          },
          "net_tx": {
            "unit": "bytes_per_sec",
            "series": [
              {
                "name": "net_tx",
                "points": [
                  [
                    1788220800.0,
                    512
                  ],
                  [
                    1788220803.0,
                    512
                  ]
                ]
              }
            ]
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/notebook/instance/set_background — Move an instance to the background" id="post-notebook-instance-set-background">
    Pass `background: true`. An instance cannot be moved back to the foreground.

    **Method**: `POST`<br />
    **Path**: `/v1/notebook/instance/set_background`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Notebook execution instance ID; 1–255 characters |
    | `background` | `boolean` | No | Whether to run in the background; Default `true` |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `data` | `null` | Operation completed with no response data |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/notebook/instance/set_background \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "01900000000070008000000000000009",
      "background": true
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": null
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/notebook/instance/specs — List available compute specifications" id="get-notebook-instance-specs">
    List available compute specifications.

    **Method**: `GET`<br />
    **Path**: `/v1/notebook/instance/specs`

    **Parameters**

    No request parameters.

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `allowed_quota_spec` | `object[]` | Available CPU and memory pairs |

    <Expandable title="allowed_quota_spec — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `max_cpu` | `integer` / `null` | CPU allocation; 100 represents 1 vCPU |
      | `max_memory` | `integer` / `null` | Memory allocation in bytes |
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/notebook/instance/specs \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID"
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "allowed_quota_spec": [
          {
            "max_cpu": 100,
            "max_memory": 4294967296
          },
          {
            "max_cpu": 200,
            "max_memory": 8589934592
          },
          {
            "max_cpu": 200,
            "max_memory": 17179869184
          },
          {
            "max_cpu": 200,
            "max_memory": 34359738368
          },
          {
            "max_cpu": 400,
            "max_memory": 17179869184
          },
          {
            "max_cpu": 400,
            "max_memory": 34359738368
          }
        ]
      }
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/notebook/list — List Notebooks" id="get-notebook-list">
    List Notebooks.

    **Method**: `GET`<br />
    **Path**: `/v1/notebook/list`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `start` | `integer` | No | Pagination offset, starting at 0; ≥ 0; Default `0` |
    | `limit` | `integer` | No | Maximum number of entries; ≥ 1; ≤ 100; Default `10` |
    | `order_by` | `string` | No | Sort field; Values: `"id"`, `"name"`, `"created_at"`, `"updated_at"`; Default `"updated_at"` |
    | `direction` | `string` | No | Sort direction; Values: `"asc"`, `"desc"`; Default `"desc"` |
    | `space` | `string` / `null` | No | Filter by Space; when omitted, list resources in visible Spaces; 1–64 characters |
    | `name` | `string` / `null` | No | Name substring filter |
    | `schedule_space` | `string` / `null` | No | Filter by the schedule Space; 1–64 characters |
    | `with_schedule` | `boolean` | No | Include schedule information; Default `false` |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `start` | `integer` | Pagination offset, starting at 0 |
    | `limit` | `integer` | Maximum number of entries |
    | `items` | `object[]` | Entries on this page |
    | `total_count` | `integer` | Total number of matching entries |

    <Expandable title="items — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `space` | `string` | Space ID |
      | `name` | `string` / `null` | Name |
      | `language` | `string` / `null` | Code language |
      | `parameters` | `object[]` | Parameter definitions |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `space_entity` | `object` / `null` | Details of the owning Space |
      | `schedule` | `object` / `null` | Schedule configuration snapshot returned only with with\_schedule=true; null if none exists |

      <Expandable title="parameters — Item fields">
        | Field | Type | Description |
        | - | - | - |
        | `name` | `string` / `null` | Name |
        | `type` | `string` | Logical parameter type; see [Data types](/reference/data-types) |
        | `options` | `JSON[]` / `null` | Allowed choices for the parameter |
        | `default` | `object` / `null` | Default parameter value |
        | `id` | `JSON` / `null` | Unique object ID |
        | `order` | `integer` / `null` | Parameter order; consecutive numbering is not required |

        <Expandable title="default — Fields">
          | Field | Type | Description |
          | - | - | - |
          | `value` | `JSON` | Argument value |
        </Expandable>
      </Expandable>

      <Expandable title="space_entity — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `description` | `string` / `null` | Description |
        | `account_id` | `string` | Account ID |
        | `status` | `string` | Status |
        | `visibility` | `string` | Visibility: public, org, or private |
        | `dep_count` | `integer` | Dependency count |
        | `content_count` | `integer` | Number of content entries |
        | `created_at` | `number` | Creation time in Unix seconds |
        | `updated_at` | `number` | Last update time in Unix seconds |
        | `account` | `object` / `null` | Account details |

        <Expandable title="account — Fields">
          | Field | Type | Description |
          | - | - | - |
          | `id` | `string` | Unique object ID |
          | `type` | `string` | Account type: personal or org |
          | `slug` | `string` / `null` | Account slug used for display and URLs |
          | `display_name` | `string` / `null` | Account display name |
          | `avatar_url` | `string` / `null` | Avatar URL |
          | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
        </Expandable>
      </Expandable>

      <Expandable title="schedule — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `space` | `string` | Space ID |
        | `content_type` | `string` / `null` | Target content type |
        | `content_id` | `string` / `null` | Target content ID |
        | `cron` | `string` / `null` | Cron expression |
        | `arguments` | `object[]` | Argument values for this execution |
        | `name` | `string` / `null` | Name |
        | `mode` | `string` / `null` | Schedule mode |
        | `max_cpu` | `integer` / `null` | CPU allocation; 100 represents 1 vCPU |
        | `max_memory` | `integer` / `null` | Memory allocation in bytes |
        | `created_at` | `number` | Creation time in Unix seconds |
        | `updated_at` | `number` | Last update time in Unix seconds |

        <Expandable title="arguments — Item fields">
          | Field | Type | Description |
          | - | - | - |
          | `value` | `JSON` | Argument value |
          | `name` | `string` / `null` | Name of the matching parameter |
          | `order` | `integer` / `null` | Omit for every argument, or use consecutive values from 0 to determine argument order |
        </Expandable>
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/notebook/list \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode space=demo \
      --data-urlencode limit=10 \
      --data-urlencode with_schedule=true
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "items": [
          {
            "id": "01900000000070008000000000000002",
            "space": "demo",
            "name": "print_message",
            "language": "python",
            "parameters": [],
            "created_at": 1788220800.0,
            "updated_at": 1788220800.0,
            "space_entity": {
              "id": "demo",
              "description": "Example resources",
              "account_id": "0190000000007000800000000000000b",
              "status": "active",
              "visibility": "public",
              "dep_count": 0,
              "content_count": 6,
              "created_at": 1788220800.0,
              "updated_at": 1788220800.0,
              "account": {
                "id": "0190000000007000800000000000000b",
                "type": "org",
                "slug": "example-team",
                "display_name": "Example team",
                "avatar_url": null,
                "avatar_thumbnail_url": null
              }
            },
            "schedule": null
          }
        ],
        "total_count": 1,
        "start": 0,
        "limit": 10
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/notebook/run — Run a Notebook" id="post-notebook-run">
    Starts an asynchronous instance. Supply a saved Notebook `id` or inline `code`. When both are supplied, the inline code and parameter definitions take precedence. Use a compute specification pair returned by `/v1/notebook/instance/specs`.

    **Method**: `POST`<br />
    **Path**: `/v1/notebook/run`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` / `null` | No | Unique object ID; 1–32 characters |
    | `code` | `string` / `null` | No | Executable code; SQL for a Query |
    | `parameters` | `object[]` / `null` | No | Parameter definitions; updates replace the entire array |
    | `arguments` | `object[]` | No | Argument values for this execution |
    | `max_cpu` | `integer` | Yes | CPU allocation; 100 represents 1 vCPU; > 0 |
    | `max_memory` | `integer` | Yes | Memory allocation in bytes; > 0 |
    | `debug` | `boolean` | No | Whether to use debug mode; Default `false` |
    | `background` | `boolean` | No | Whether to run in the background; Default `false` |

    <Expandable title="parameters — Item fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `name` | `string` / `null` | Yes | Name |
      | `type` | `string` | Yes | Logical parameter type; see [Data types](/reference/data-types) |
      | `options` | `JSON[]` / `null` | No | Allowed choices for the parameter |
      | `default` | `object` / `null` | No | Default parameter value |
      | `id` | `JSON` / `null` | No | Unique object ID |
      | `order` | `integer` / `null` | No | Parameter order; consecutive numbering is not required; ≥ 0 |

      <Expandable title="default — Fields">
        | Field | Type | Required | Description |
        | - | - | - | - |
        | `value` | `JSON` | Yes | Argument value |
      </Expandable>
    </Expandable>

    <Expandable title="arguments — Item fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `value` | `JSON` | Yes | Argument value |
      | `name` | `string` / `null` | No | Name of the matching parameter |
      | `order` | `integer` / `null` | No | Omit for every argument, or use consecutive values from 0 to determine argument order; ≥ 0 |
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `notebook_id` | `string` / `null` | Notebook ID |
    | `name` | `string` / `null` | Name |
    | `code` | `string` / `null` | Code for this execution; omitted from instance lists |
    | `parameters` | `object[]` | Parameter definitions |
    | `arguments` | `object[]` | Argument values for this execution |
    | `max_memory` | `integer` / `null` | Memory allocation in bytes |
    | `max_cpu` | `integer` / `null` | CPU allocation; 100 represents 1 vCPU |
    | `max_network_rx` | `integer` / `null` | Recorded network receive allocation |
    | `max_network_tx` | `integer` / `null` | Recorded network transmit allocation |
    | `account_id` | `string` / `null` | Account ID |
    | `user_id` | `string` / `null` | ID of the user who started execution |
    | `schedule_id` | `string` / `null` | Schedule ID |
    | `background` | `boolean` / `null` | Whether to run in the background |
    | `debug` | `boolean` / `null` | Whether to use debug mode |
    | `deadline` | `number` / `null` | Foreground instance expiry in Unix seconds; null for background instances |
    | `status` | `string` | Status; Values: `"running"`, `"ended"` |
    | `exit_code` | `integer` / `null` | Exit code; null while running, 0 on success |
    | `oom_killed` | `boolean` / `null` | Whether the instance was terminated for exceeding memory |
    | `exited_at` | `number` / `null` | Exit time in Unix seconds; null while running |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `display_status` | `string` | Instance display status; Values: `"running"`, `"succeeded"`, `"failed"`, `"canceled"`, `"starting"` |
    | `launched` | `string` | How the instance was launched; Values: `"manual"`, `"schedule"` |
    | `exit_message` | `string` / `null` | Exit reason; null while running |
    | `account` | `object` / `null` | Account details |
    | `user` | `object` / `null` | Launcher details, or null if unavailable |
    | `notebook` | `object` / `null` | Related Notebook summary, or null if unavailable |
    | `schedule` | `object` / `null` | Related schedule, or null when none exists |

    <Expandable title="parameters — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `name` | `string` / `null` | Name |
      | `type` | `string` | Logical parameter type; see [Data types](/reference/data-types) |
      | `options` | `JSON[]` / `null` | Allowed choices for the parameter |
      | `default` | `object` / `null` | Default parameter value |
      | `id` | `JSON` / `null` | Unique object ID |
      | `order` | `integer` / `null` | Parameter order; consecutive numbering is not required |

      <Expandable title="default — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `value` | `JSON` | Argument value |
      </Expandable>
    </Expandable>

    <Expandable title="arguments — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `value` | `JSON` | Argument value |
      | `name` | `string` / `null` | Name of the matching parameter |
      | `order` | `integer` / `null` | Omit for every argument, or use consecutive values from 0 to determine argument order |
    </Expandable>

    <Expandable title="account — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `type` | `string` | Account type: personal or org |
      | `slug` | `string` / `null` | Account slug used for display and URLs |
      | `display_name` | `string` / `null` | Account display name |
      | `avatar_url` | `string` / `null` | Avatar URL |
      | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
    </Expandable>

    <Expandable title="user — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    <Expandable title="notebook — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `name` | `string` / `null` | Name |
      | `space` | `string` | Space ID |
    </Expandable>

    <Expandable title="schedule — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `space` | `string` | Space ID |
      | `content_type` | `string` / `null` | Target content type |
      | `content_id` | `string` / `null` | Target content ID |
      | `cron` | `string` / `null` | Cron expression |
      | `arguments` | `object[]` | Argument values for this execution |
      | `name` | `string` / `null` | Name |
      | `mode` | `string` / `null` | Schedule mode |
      | `max_cpu` | `integer` / `null` | CPU allocation; 100 represents 1 vCPU |
      | `max_memory` | `integer` / `null` | Memory allocation in bytes |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `deleted_at` | `number` / `null` | Deletion time in Unix seconds; null if not deleted |

      <Expandable title="arguments — Item fields">
        | Field | Type | Description |
        | - | - | - |
        | `value` | `JSON` | Argument value |
        | `name` | `string` / `null` | Name of the matching parameter |
        | `order` | `integer` / `null` | Omit for every argument, or use consecutive values from 0 to determine argument order |
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/notebook/run \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "01900000000070008000000000000002",
      "max_cpu": 100,
      "max_memory": 4294967296,
      "arguments": []
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "01900000000070008000000000000009",
        "notebook_id": "01900000000070008000000000000002",
        "name": "print_message",
        "code": "print(\"Hello, Chaintable\")",
        "parameters": [],
        "arguments": [],
        "max_cpu": 100,
        "max_memory": 4294967296,
        "max_network_rx": null,
        "max_network_tx": null,
        "account_id": "0190000000007000800000000000000b",
        "user_id": "0190000000007000800000000000000c",
        "schedule_id": null,
        "background": false,
        "debug": false,
        "deadline": 1788220950.0,
        "status": "running",
        "exit_code": null,
        "oom_killed": null,
        "exited_at": null,
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "display_status": "running",
        "launched": "manual",
        "exit_message": null,
        "account": {
          "id": "0190000000007000800000000000000b",
          "type": "org",
          "slug": "example-team",
          "display_name": "Example team",
          "avatar_url": null,
          "avatar_thumbnail_url": null
        },
        "user": {
          "id": "0190000000007000800000000000000c",
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "account": null
        },
        "notebook": {
          "id": "01900000000070008000000000000002",
          "name": "print_message",
          "space": "demo"
        },
        "schedule": null
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/notebook/update — Update a Notebook" id="post-notebook-update">
    Updates a Notebook, preserving omitted fields and replacing parameter definitions as a whole. Names follow the same rules as creation.

    **Method**: `POST`<br />
    **Path**: `/v1/notebook/update`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–255 characters |
    | `name` | `string` | No | Name; 1–255 characters |
    | `language` | `string` | No | Code language; Values: `"python"` |
    | `code` | `string` / `null` | No | Executable code; SQL for a Query |
    | `parameters` | `object[]` / `null` | No | Parameter definitions; updates replace the entire array |

    <Expandable title="parameters — Item fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `name` | `string` / `null` | Yes | Name |
      | `type` | `string` | Yes | Logical parameter type; see [Data types](/reference/data-types) |
      | `options` | `JSON[]` / `null` | No | Allowed choices for the parameter |
      | `default` | `object` / `null` | No | Default parameter value |
      | `id` | `JSON` / `null` | No | Unique object ID |
      | `order` | `integer` / `null` | No | Parameter order; consecutive numbering is not required; ≥ 0 |

      <Expandable title="default — Fields">
        | Field | Type | Required | Description |
        | - | - | - | - |
        | `value` | `JSON` | Yes | Argument value |
      </Expandable>
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `space` | `string` | Space ID |
    | `name` | `string` / `null` | Name |
    | `language` | `string` / `null` | Code language |
    | `code` | `string` / `null` | Notebook code; omitted from list responses |
    | `parameters` | `object[]` | Parameter definitions |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `space_entity` | `object` / `null` | Details of the owning Space |

    <Expandable title="parameters — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `name` | `string` / `null` | Name |
      | `type` | `string` | Logical parameter type; see [Data types](/reference/data-types) |
      | `options` | `JSON[]` / `null` | Allowed choices for the parameter |
      | `default` | `object` / `null` | Default parameter value |
      | `id` | `JSON` / `null` | Unique object ID |
      | `order` | `integer` / `null` | Parameter order; consecutive numbering is not required |

      <Expandable title="default — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `value` | `JSON` | Argument value |
      </Expandable>
    </Expandable>

    <Expandable title="space_entity — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `description` | `string` / `null` | Description |
      | `account_id` | `string` | Account ID |
      | `status` | `string` | Status |
      | `visibility` | `string` | Visibility: public, org, or private |
      | `dep_count` | `integer` | Dependency count |
      | `content_count` | `integer` | Number of content entries |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/notebook/update \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "01900000000070008000000000000002",
      "name": "print_message"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "01900000000070008000000000000002",
        "space": "demo",
        "name": "print_message",
        "language": "python",
        "code": "print(\"Hello, Chaintable\")",
        "parameters": [],
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "space_entity": {
          "id": "demo",
          "description": "Example resources",
          "account_id": "0190000000007000800000000000000b",
          "status": "active",
          "visibility": "public",
          "dep_count": 0,
          "content_count": 6,
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "account": {
            "id": "0190000000007000800000000000000b",
            "type": "org",
            "slug": "example-team",
            "display_name": "Example team",
            "avatar_url": null,
            "avatar_thumbnail_url": null
          }
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### query

<AccordionGroup>
  <Accordion title="GET /v1/query — Get a Query" id="get-query">
    Get a Query.

    **Method**: `GET`<br />
    **Path**: `/v1/query`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–255 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `space` | `string` | Space ID |
    | `name` | `string` / `null` | Name |
    | `language` | `string` / `null` | Code language |
    | `code` | `string` / `null` | SQL source; omitted from list responses |
    | `parameters` | `object[]` | Parameter definitions |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `space_entity` | `object` / `null` | Details of the owning Space |
    | `visualizations` | `object[]` | Visualizations in detail responses; list responses require with\_visualizations=true |
    | `is_starred` | `boolean` | Whether the calling user has starred the resource; returned in details, or lists with with\_star=true or sorting by star\_count |
    | `star_count` | `integer` | Number of stars; returned in details, or lists with with\_star=true or sorting by star\_count |

    <Expandable title="parameters — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `name` | `string` | Name |
      | `type` | `string` | Logical parameter type; see [Data types](/reference/data-types) |
      | `options` | `JSON[]` / `null` | Allowed choices for the parameter |
      | `default` | `object` / `null` | Default parameter value |
      | `id` | `string` / `null` | Parameter display ID stored with the definition |
      | `order` | `integer` / `null` | Omit for every parameter, or use consecutive values from 0 |

      <Expandable title="default — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `value` | `JSON` | Argument value |
      </Expandable>
    </Expandable>

    <Expandable title="space_entity — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `description` | `string` / `null` | Description |
      | `account_id` | `string` | Account ID |
      | `status` | `string` | Status |
      | `visibility` | `string` | Visibility: public, org, or private |
      | `dep_count` | `integer` | Dependency count |
      | `content_count` | `integer` | Number of content entries |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    <Expandable title="visualizations — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `query_id` | `string` / `null` | Query ID |
      | `name` | `string` / `null` | Name |
      | `type` | `string` | Type; Values: `"table"`, `"chart"`, `"counter"`, `"pivot"` |
      | `options` | `object` / `null` | Configuration selected by options.type; \{} or null clears it. If display columns are omitted, the website selects them from the result. Nested keys use snake\_case; unknown keys are rejected |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |

      <Expandable title="options — Fields">
        <Tabs>
          <Tab title="Table">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `description` | `string` / `null` | Description |
            | `type` | `string` | Type; Must be `"table"` |
            | `columns` | `object` / `null` | Display settings keyed by result column name |
            | `export_options` | `object` / `null` | Result export settings |

            <Expandable title="columns — Value fields">
              | Field | Type | Description |
              | - | - | - |
              | `name` | `string` / `null` | Name |
              | `title` | `string` / `null` | Display title |
              | `align` | `string` / `null` | Cell alignment; Values: `"left"`, `"center"`, `"right"` |
              | `type` | `string` / `null` | normal displays a regular cell; progress displays a progress bar; Values: `"normal"`, `"progress"` |
              | `format` | `string` / `null` | Number or date format string |
              | `hide` | `boolean` / `null` | Whether to hide the column |
              | `colored_positive` | `boolean` / `null` | Whether to color positive values |
              | `colored_negative` | `boolean` / `null` | Whether to color negative values |
              | `url_template` | `string` / `null` | Cell URL template; \{value} is replaced by the cell value |
            </Expandable>

            <Expandable title="export_options — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `enabled` | `boolean` / `null` | Whether exporting is enabled |
              | `formats` | `string[]` / `null` | Allowed export formats |
              | `filename` | `string` / `null` | Export filename |
              | `include_all_data` | `boolean` / `null` | Whether to export all data |
            </Expandable>
          </Tab>

          <Tab title="Bar / line / area / scatter">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `description` | `string` / `null` | Description |
            | `type` | `string` | Type; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
            | `x_column` | `string` / `null` | Result column for the x-axis |
            | `y_columns` | `string[]` / `null` | Numeric result columns; one series per column, with no duplicates |
            | `x_axis` | `object` / `null` | X-axis settings |
            | `y_axis` | `object` / `null` | Left y-axis settings |
            | `right_y_axis` | `object` / `null` | Right y-axis settings |
            | `legend` | `object` / `null` | Legend settings |
            | `series` | `object` / `null` | Keys are y-column names, or group values when group\_by is enabled |
            | `enable_stacking` | `boolean` / `null` | Whether to stack series |
            | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
            | `show_total_in_tooltip` | `boolean` / `null` | Whether to show the total in tooltips |
            | `group_by` | `string` / `null` | Group series by this column’s values; uses only the first y\_columns entry. An empty string disables grouping |
            | `normalize_to_percentage` | `boolean` / `null` | Normalize grouped values at each x position to 100% |
            | `when_duplicate_x` | `string` / `null` | For duplicate x values: first uses the first row, all keeps every row, sum adds the values; Values: `"first"`, `"all"`, `"sum"` |
            | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

            <Expandable title="x_axis — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
              | `label_format` | `string` / `null` | Tooltip or data-label format string |
              | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
              | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
              | `min` | `number` / `null` | Axis minimum; cannot exceed max |
              | `max` | `number` / `null` | Axis maximum |
              | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
              | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
              | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
              | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
              | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
              | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
              | `num_ticks` | `integer` / `null` | Number of ticks |
              | `width` | `number` / `null` | Axis width |
              | `reference_lines` | `object[]` / `null` | Axis reference lines |
              | `zones` | `object[]` / `null` | Highlighted axis regions |

              <Expandable title="reference_lines — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                | `stroke` | `string` | Reference line color as a CSS color |
                | `tick` | `object` / `null` | Reference line tick settings |

                <Expandable title="tick — Fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `show` | `boolean` / `null` | Whether to show the reference line tick |
                </Expandable>
              </Expandable>

              <Expandable title="zones — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `from` | `number` / `string` / `null` | Start of the highlighted region |
                | `to` | `number` / `string` / `null` | End of the highlighted region |
                | `color` | `string` / `null` | CSS color |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              </Expandable>
            </Expandable>

            <Expandable title="y_axis — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
              | `label_format` | `string` / `null` | Tooltip or data-label format string |
              | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
              | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
              | `min` | `number` / `null` | Axis minimum; cannot exceed max |
              | `max` | `number` / `null` | Axis maximum |
              | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
              | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
              | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
              | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
              | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
              | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
              | `num_ticks` | `integer` / `null` | Number of ticks |
              | `width` | `number` / `null` | Axis width |
              | `reference_lines` | `object[]` / `null` | Axis reference lines |
              | `zones` | `object[]` / `null` | Highlighted axis regions |

              <Expandable title="reference_lines — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                | `stroke` | `string` | Reference line color as a CSS color |
                | `tick` | `object` / `null` | Reference line tick settings |

                <Expandable title="tick — Fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `show` | `boolean` / `null` | Whether to show the reference line tick |
                </Expandable>
              </Expandable>

              <Expandable title="zones — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `from` | `number` / `string` / `null` | Start of the highlighted region |
                | `to` | `number` / `string` / `null` | End of the highlighted region |
                | `color` | `string` / `null` | CSS color |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              </Expandable>
            </Expandable>

            <Expandable title="right_y_axis — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
              | `label_format` | `string` / `null` | Tooltip or data-label format string |
              | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
              | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
              | `min` | `number` / `null` | Axis minimum; cannot exceed max |
              | `max` | `number` / `null` | Axis maximum |
              | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
              | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
              | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
              | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
              | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
              | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
              | `num_ticks` | `integer` / `null` | Number of ticks |
              | `width` | `number` / `null` | Axis width |
              | `reference_lines` | `object[]` / `null` | Axis reference lines |
              | `zones` | `object[]` / `null` | Highlighted axis regions |

              <Expandable title="reference_lines — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                | `stroke` | `string` | Reference line color as a CSS color |
                | `tick` | `object` / `null` | Reference line tick settings |

                <Expandable title="tick — Fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `show` | `boolean` / `null` | Whether to show the reference line tick |
                </Expandable>
              </Expandable>

              <Expandable title="zones — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `from` | `number` / `string` / `null` | Start of the highlighted region |
                | `to` | `number` / `string` / `null` | End of the highlighted region |
                | `color` | `string` / `null` | CSS color |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              </Expandable>
            </Expandable>

            <Expandable title="legend — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
              | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
              | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
            </Expandable>

            <Expandable title="series — Value fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Legend and tooltip title; defaults to the series name |
              | `type` | `string` / `null` | Series chart type; inherits options.type when omitted; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
              | `color` | `string` / `null` | CSS color |
              | `is_right` | `boolean` / `null` | Use the right axis; requires y\_axis.enable\_right\_axis |
              | `connect_nulls` | `boolean` / `null` | Whether lines connect across null values |
              | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              | `silent` | `boolean` / `null` | Whether to disable series interactions |
            </Expandable>
          </Tab>

          <Tab title="Pie">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `description` | `string` / `null` | Description |
            | `type` | `string` | Type; Must be `"pie"` |
            | `label_column` | `string` / `null` | Pie chart category column |
            | `value_column` | `string` / `null` | Pie chart value column |
            | `legend` | `object` / `null` | Legend settings |
            | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
            | `y_axis` | `object` / `null` | Only label\_format is used to format values |
            | `values_options` | `object` / `null` | Map of category values to slice color settings |
            | `series_title` | `string` / `null` | Series name in tooltips |
            | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

            <Expandable title="legend — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
              | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
              | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
            </Expandable>

            <Expandable title="y_axis — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
              | `label_format` | `string` / `null` | Tooltip or data-label format string |
              | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
              | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
              | `min` | `number` / `null` | Axis minimum; cannot exceed max |
              | `max` | `number` / `null` | Axis maximum |
              | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
              | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
              | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
              | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
              | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
              | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
              | `num_ticks` | `integer` / `null` | Number of ticks |
              | `width` | `number` / `null` | Axis width |
              | `reference_lines` | `object[]` / `null` | Axis reference lines |
              | `zones` | `object[]` / `null` | Highlighted axis regions |

              <Expandable title="reference_lines — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                | `stroke` | `string` | Reference line color as a CSS color |
                | `tick` | `object` / `null` | Reference line tick settings |

                <Expandable title="tick — Fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `show` | `boolean` / `null` | Whether to show the reference line tick |
                </Expandable>
              </Expandable>

              <Expandable title="zones — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `from` | `number` / `string` / `null` | Start of the highlighted region |
                | `to` | `number` / `string` / `null` | End of the highlighted region |
                | `color` | `string` / `null` | CSS color |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              </Expandable>
            </Expandable>

            <Expandable title="values_options — Value fields">
              | Field | Type | Description |
              | - | - | - |
              | `color` | `string` | CSS color |
            </Expandable>
          </Tab>

          <Tab title="Counter">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `description` | `string` / `null` | Description |
            | `type` | `string` | Type; Must be `"counter"` |
            | `column_name` | `string` / `null` | Numeric column displayed by the counter |
            | `row_number` | `integer` / `null` | Zero-based result row index; defaults to 0 |
            | `prefix` | `string` / `null` | Value prefix |
            | `suffix` | `string` / `null` | Value suffix |
            | `decimals` | `integer` / `null` | Decimal places; formatting follows the column type when omitted |
            | `colored_positive` | `boolean` / `null` | Whether to color positive values |
            | `colored_negative` | `boolean` / `null` | Whether to color negative values |
            | `label` | `string` / `null` | Display label or category |
          </Tab>
        </Tabs>
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/query \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode id=01900000000070008000000000000001
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "01900000000070008000000000000001",
        "space": "demo",
        "name": "Asset count",
        "language": "sql",
        "code": "SELECT COUNT(*) AS row_count FROM demo.asset_notes",
        "parameters": [],
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "space_entity": {
          "id": "demo",
          "description": "Example resources",
          "account_id": "0190000000007000800000000000000b",
          "status": "active",
          "visibility": "public",
          "dep_count": 0,
          "content_count": 6,
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "account": {
            "id": "0190000000007000800000000000000b",
            "type": "org",
            "slug": "example-team",
            "display_name": "Example team",
            "avatar_url": null,
            "avatar_thumbnail_url": null
          }
        },
        "visualizations": [
          {
            "id": "01900000000070008000000000000016",
            "query_id": "01900000000070008000000000000001",
            "name": "Query results",
            "type": "table",
            "options": {},
            "created_at": 1788220800.0,
            "updated_at": 1788220800.0
          }
        ],
        "is_starred": false,
        "star_count": 0
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/query/create — Create a Query" id="post-query-create">
    Creates a Query with a caller-supplied unique `id` and a default table visualization.

    **Method**: `POST`<br />
    **Path**: `/v1/query/create`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–255 characters |
    | `space` | `string` | Yes | Space ID; 1–64 characters |
    | `name` | `string` | Yes | Name; 1–64 characters |
    | `code` | `string` / `null` | No | Executable code; SQL for a Query |
    | `language` | `string` | No | Query language; use sql for execution; Values: `"sql"`, `"python"`; Default `"sql"` |
    | `parameters` | `object[]` / `null` | No | Parameter definitions; updates replace the entire array |

    <Expandable title="parameters — Item fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `name` | `string` | Yes | Name; 1–64 characters |
      | `type` | `string` | Yes | Logical parameter type; see [Data types](/reference/data-types); 1–64 characters |
      | `options` | `JSON[]` / `null` | No | Allowed choices for the parameter |
      | `default` | `object` / `null` | No | Default parameter value |
      | `id` | `string` / `null` | No | Parameter display ID stored with the definition; ≤ 64 characters |
      | `order` | `integer` / `null` | No | Omit for every parameter, or use consecutive values from 0; ≥ 0 |

      <Expandable title="default — Fields">
        | Field | Type | Required | Description |
        | - | - | - | - |
        | `value` | `JSON` | Yes | Argument value |
      </Expandable>
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `space` | `string` | Space ID |
    | `name` | `string` / `null` | Name |
    | `language` | `string` / `null` | Code language |
    | `code` | `string` / `null` | SQL source; omitted from list responses |
    | `parameters` | `object[]` | Parameter definitions |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `space_entity` | `object` / `null` | Details of the owning Space |
    | `visualizations` | `object[]` | Visualizations in detail responses; list responses require with\_visualizations=true |
    | `is_starred` | `boolean` | Whether the calling user has starred the resource; returned in details, or lists with with\_star=true or sorting by star\_count |
    | `star_count` | `integer` | Number of stars; returned in details, or lists with with\_star=true or sorting by star\_count |

    <Expandable title="parameters — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `name` | `string` | Name |
      | `type` | `string` | Logical parameter type; see [Data types](/reference/data-types) |
      | `options` | `JSON[]` / `null` | Allowed choices for the parameter |
      | `default` | `object` / `null` | Default parameter value |
      | `id` | `string` / `null` | Parameter display ID stored with the definition |
      | `order` | `integer` / `null` | Omit for every parameter, or use consecutive values from 0 |

      <Expandable title="default — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `value` | `JSON` | Argument value |
      </Expandable>
    </Expandable>

    <Expandable title="space_entity — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `description` | `string` / `null` | Description |
      | `account_id` | `string` | Account ID |
      | `status` | `string` | Status |
      | `visibility` | `string` | Visibility: public, org, or private |
      | `dep_count` | `integer` | Dependency count |
      | `content_count` | `integer` | Number of content entries |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    <Expandable title="visualizations — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `query_id` | `string` / `null` | Query ID |
      | `name` | `string` / `null` | Name |
      | `type` | `string` | Type; Values: `"table"`, `"chart"`, `"counter"`, `"pivot"` |
      | `options` | `object` / `null` | Configuration selected by options.type; \{} or null clears it. If display columns are omitted, the website selects them from the result. Nested keys use snake\_case; unknown keys are rejected |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |

      <Expandable title="options — Fields">
        <Tabs>
          <Tab title="Table">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `description` | `string` / `null` | Description |
            | `type` | `string` | Type; Must be `"table"` |
            | `columns` | `object` / `null` | Display settings keyed by result column name |
            | `export_options` | `object` / `null` | Result export settings |

            <Expandable title="columns — Value fields">
              | Field | Type | Description |
              | - | - | - |
              | `name` | `string` / `null` | Name |
              | `title` | `string` / `null` | Display title |
              | `align` | `string` / `null` | Cell alignment; Values: `"left"`, `"center"`, `"right"` |
              | `type` | `string` / `null` | normal displays a regular cell; progress displays a progress bar; Values: `"normal"`, `"progress"` |
              | `format` | `string` / `null` | Number or date format string |
              | `hide` | `boolean` / `null` | Whether to hide the column |
              | `colored_positive` | `boolean` / `null` | Whether to color positive values |
              | `colored_negative` | `boolean` / `null` | Whether to color negative values |
              | `url_template` | `string` / `null` | Cell URL template; \{value} is replaced by the cell value |
            </Expandable>

            <Expandable title="export_options — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `enabled` | `boolean` / `null` | Whether exporting is enabled |
              | `formats` | `string[]` / `null` | Allowed export formats |
              | `filename` | `string` / `null` | Export filename |
              | `include_all_data` | `boolean` / `null` | Whether to export all data |
            </Expandable>
          </Tab>

          <Tab title="Bar / line / area / scatter">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `description` | `string` / `null` | Description |
            | `type` | `string` | Type; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
            | `x_column` | `string` / `null` | Result column for the x-axis |
            | `y_columns` | `string[]` / `null` | Numeric result columns; one series per column, with no duplicates |
            | `x_axis` | `object` / `null` | X-axis settings |
            | `y_axis` | `object` / `null` | Left y-axis settings |
            | `right_y_axis` | `object` / `null` | Right y-axis settings |
            | `legend` | `object` / `null` | Legend settings |
            | `series` | `object` / `null` | Keys are y-column names, or group values when group\_by is enabled |
            | `enable_stacking` | `boolean` / `null` | Whether to stack series |
            | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
            | `show_total_in_tooltip` | `boolean` / `null` | Whether to show the total in tooltips |
            | `group_by` | `string` / `null` | Group series by this column’s values; uses only the first y\_columns entry. An empty string disables grouping |
            | `normalize_to_percentage` | `boolean` / `null` | Normalize grouped values at each x position to 100% |
            | `when_duplicate_x` | `string` / `null` | For duplicate x values: first uses the first row, all keeps every row, sum adds the values; Values: `"first"`, `"all"`, `"sum"` |
            | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

            <Expandable title="x_axis — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
              | `label_format` | `string` / `null` | Tooltip or data-label format string |
              | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
              | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
              | `min` | `number` / `null` | Axis minimum; cannot exceed max |
              | `max` | `number` / `null` | Axis maximum |
              | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
              | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
              | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
              | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
              | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
              | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
              | `num_ticks` | `integer` / `null` | Number of ticks |
              | `width` | `number` / `null` | Axis width |
              | `reference_lines` | `object[]` / `null` | Axis reference lines |
              | `zones` | `object[]` / `null` | Highlighted axis regions |

              <Expandable title="reference_lines — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                | `stroke` | `string` | Reference line color as a CSS color |
                | `tick` | `object` / `null` | Reference line tick settings |

                <Expandable title="tick — Fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `show` | `boolean` / `null` | Whether to show the reference line tick |
                </Expandable>
              </Expandable>

              <Expandable title="zones — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `from` | `number` / `string` / `null` | Start of the highlighted region |
                | `to` | `number` / `string` / `null` | End of the highlighted region |
                | `color` | `string` / `null` | CSS color |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              </Expandable>
            </Expandable>

            <Expandable title="y_axis — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
              | `label_format` | `string` / `null` | Tooltip or data-label format string |
              | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
              | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
              | `min` | `number` / `null` | Axis minimum; cannot exceed max |
              | `max` | `number` / `null` | Axis maximum |
              | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
              | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
              | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
              | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
              | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
              | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
              | `num_ticks` | `integer` / `null` | Number of ticks |
              | `width` | `number` / `null` | Axis width |
              | `reference_lines` | `object[]` / `null` | Axis reference lines |
              | `zones` | `object[]` / `null` | Highlighted axis regions |

              <Expandable title="reference_lines — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                | `stroke` | `string` | Reference line color as a CSS color |
                | `tick` | `object` / `null` | Reference line tick settings |

                <Expandable title="tick — Fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `show` | `boolean` / `null` | Whether to show the reference line tick |
                </Expandable>
              </Expandable>

              <Expandable title="zones — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `from` | `number` / `string` / `null` | Start of the highlighted region |
                | `to` | `number` / `string` / `null` | End of the highlighted region |
                | `color` | `string` / `null` | CSS color |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              </Expandable>
            </Expandable>

            <Expandable title="right_y_axis — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
              | `label_format` | `string` / `null` | Tooltip or data-label format string |
              | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
              | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
              | `min` | `number` / `null` | Axis minimum; cannot exceed max |
              | `max` | `number` / `null` | Axis maximum |
              | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
              | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
              | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
              | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
              | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
              | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
              | `num_ticks` | `integer` / `null` | Number of ticks |
              | `width` | `number` / `null` | Axis width |
              | `reference_lines` | `object[]` / `null` | Axis reference lines |
              | `zones` | `object[]` / `null` | Highlighted axis regions |

              <Expandable title="reference_lines — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                | `stroke` | `string` | Reference line color as a CSS color |
                | `tick` | `object` / `null` | Reference line tick settings |

                <Expandable title="tick — Fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `show` | `boolean` / `null` | Whether to show the reference line tick |
                </Expandable>
              </Expandable>

              <Expandable title="zones — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `from` | `number` / `string` / `null` | Start of the highlighted region |
                | `to` | `number` / `string` / `null` | End of the highlighted region |
                | `color` | `string` / `null` | CSS color |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              </Expandable>
            </Expandable>

            <Expandable title="legend — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
              | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
              | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
            </Expandable>

            <Expandable title="series — Value fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Legend and tooltip title; defaults to the series name |
              | `type` | `string` / `null` | Series chart type; inherits options.type when omitted; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
              | `color` | `string` / `null` | CSS color |
              | `is_right` | `boolean` / `null` | Use the right axis; requires y\_axis.enable\_right\_axis |
              | `connect_nulls` | `boolean` / `null` | Whether lines connect across null values |
              | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              | `silent` | `boolean` / `null` | Whether to disable series interactions |
            </Expandable>
          </Tab>

          <Tab title="Pie">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `description` | `string` / `null` | Description |
            | `type` | `string` | Type; Must be `"pie"` |
            | `label_column` | `string` / `null` | Pie chart category column |
            | `value_column` | `string` / `null` | Pie chart value column |
            | `legend` | `object` / `null` | Legend settings |
            | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
            | `y_axis` | `object` / `null` | Only label\_format is used to format values |
            | `values_options` | `object` / `null` | Map of category values to slice color settings |
            | `series_title` | `string` / `null` | Series name in tooltips |
            | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

            <Expandable title="legend — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
              | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
              | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
            </Expandable>

            <Expandable title="y_axis — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
              | `label_format` | `string` / `null` | Tooltip or data-label format string |
              | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
              | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
              | `min` | `number` / `null` | Axis minimum; cannot exceed max |
              | `max` | `number` / `null` | Axis maximum |
              | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
              | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
              | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
              | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
              | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
              | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
              | `num_ticks` | `integer` / `null` | Number of ticks |
              | `width` | `number` / `null` | Axis width |
              | `reference_lines` | `object[]` / `null` | Axis reference lines |
              | `zones` | `object[]` / `null` | Highlighted axis regions |

              <Expandable title="reference_lines — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                | `stroke` | `string` | Reference line color as a CSS color |
                | `tick` | `object` / `null` | Reference line tick settings |

                <Expandable title="tick — Fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `show` | `boolean` / `null` | Whether to show the reference line tick |
                </Expandable>
              </Expandable>

              <Expandable title="zones — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `from` | `number` / `string` / `null` | Start of the highlighted region |
                | `to` | `number` / `string` / `null` | End of the highlighted region |
                | `color` | `string` / `null` | CSS color |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              </Expandable>
            </Expandable>

            <Expandable title="values_options — Value fields">
              | Field | Type | Description |
              | - | - | - |
              | `color` | `string` | CSS color |
            </Expandable>
          </Tab>

          <Tab title="Counter">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `description` | `string` / `null` | Description |
            | `type` | `string` | Type; Must be `"counter"` |
            | `column_name` | `string` / `null` | Numeric column displayed by the counter |
            | `row_number` | `integer` / `null` | Zero-based result row index; defaults to 0 |
            | `prefix` | `string` / `null` | Value prefix |
            | `suffix` | `string` / `null` | Value suffix |
            | `decimals` | `integer` / `null` | Decimal places; formatting follows the column type when omitted |
            | `colored_positive` | `boolean` / `null` | Whether to color positive values |
            | `colored_negative` | `boolean` / `null` | Whether to color negative values |
            | `label` | `string` / `null` | Display label or category |
          </Tab>
        </Tabs>
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/query/create \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "01900000000070008000000000000001",
      "space": "demo",
      "name": "Asset count",
      "code": "SELECT COUNT(*) AS row_count FROM demo.asset_notes",
      "language": "sql"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "01900000000070008000000000000001",
        "space": "demo",
        "name": "Asset count",
        "language": "sql",
        "code": "SELECT COUNT(*) AS row_count FROM demo.asset_notes",
        "parameters": [],
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "space_entity": {
          "id": "demo",
          "description": "Example resources",
          "account_id": "0190000000007000800000000000000b",
          "status": "active",
          "visibility": "public",
          "dep_count": 0,
          "content_count": 6,
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "account": {
            "id": "0190000000007000800000000000000b",
            "type": "org",
            "slug": "example-team",
            "display_name": "Example team",
            "avatar_url": null,
            "avatar_thumbnail_url": null
          }
        },
        "visualizations": [
          {
            "id": "01900000000070008000000000000016",
            "query_id": "01900000000070008000000000000001",
            "name": "Query results",
            "type": "table",
            "options": {},
            "created_at": 1788220800.0,
            "updated_at": 1788220800.0
          }
        ],
        "is_starred": false,
        "star_count": 0
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/query/delete — Delete a Query" id="post-query-delete">
    Delete a Query.

    **Method**: `POST`<br />
    **Path**: `/v1/query/delete`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–255 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `data` | `null` | Operation completed with no response data |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/query/delete \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "01900000000070008000000000000001"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": null
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/query/job — Get query execution status" id="get-query-job">
    Check `job.status`. Successful result details are in `job_succeeded`; failures are in `job_failed`.

    **Method**: `GET`<br />
    **Path**: `/v1/query/job`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Query execution ID; 1–255 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `job` | `object` | Execution record |
    | `job_pending` | `object` | Pending-stage details; an empty object otherwise |
    | `job_running` | `object` | Running-stage details; an empty object otherwise |
    | `job_succeeded` | `object` | Success-stage details; an empty object otherwise |
    | `job_failed` | `object` | Failure-stage details; an empty object otherwise |

    <Expandable title="job — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `query_id` | `string` | Query ID |
      | `status` | `string` | Status; Values: `"pending"`, `"running"`, `"canceling"`, `"canceled"`, `"succeeded"`, `"failed"` |
      | `error_msg` | `string` / `null` | Execution error message; null if no error exists |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `started_at` | `number` / `null` | Start time in Unix seconds; null before execution starts |
      | `finished_at` | `number` / `null` | Completion time in Unix seconds; null before completion |
    </Expandable>

    <Expandable title="job_pending — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `position` | `integer` | Legend position; arranged automatically when omitted |
    </Expandable>

    <Expandable title="job_running — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `progress_percentage` | `number` | Execution progress percentage |
    </Expandable>

    <Expandable title="job_succeeded — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `query_result_id` | `string` | Query result ID used to fetch rows |
    </Expandable>

    <Expandable title="job_failed — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `error_msg` | `string` / `null` | Execution error message; null if no error exists |
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/query/job \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode id=01900000000070008000000000000006
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "job": {
          "id": "01900000000070008000000000000006",
          "query_id": "01900000000070008000000000000001",
          "status": "succeeded",
          "error_msg": null,
          "created_at": 1788220800.0,
          "updated_at": 1788220801.0,
          "started_at": 1788220800.0,
          "finished_at": 1788220801.0
        },
        "job_pending": {},
        "job_running": {},
        "job_succeeded": {
          "query_result_id": "01900000000070008000000000000007"
        },
        "job_failed": {}
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/query/job/cancel — Cancel a query execution" id="post-query-job-cancel">
    Cancel a query execution.

    **Method**: `POST`<br />
    **Path**: `/v1/query/job/cancel`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Query execution ID; 1–255 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `data` | `null` | Operation completed with no response data |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/query/job/cancel \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "01900000000070008000000000000006"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": null
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/query/job/latest — Find the latest matching execution" id="post-query-job-latest">
    Matches the Query ID, code, and arguments, preferring completed executions. Returns `job_id: null` when no match exists.

    **Method**: `POST`<br />
    **Path**: `/v1/query/job/latest`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–255 characters |
    | `code` | `string` | Yes | Executable code; SQL for a Query |
    | `arguments` | `object[]` / `null` | No | Argument values for this execution |

    <Expandable title="arguments — Item fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `name` | `string` | Yes | SQL placeholder name |
      | `value` | `JSON` | Yes | Value substituted for the SQL placeholder |
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `job_id` | `string` / `null` | Query execution ID; null if no matching job exists |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/query/job/latest \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "01900000000070008000000000000001",
      "code": "SELECT COUNT(*) AS row_count FROM demo.asset_notes",
      "arguments": []
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "job_id": "01900000000070008000000000000006"
      }
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/query/list — List Queries" id="get-query-list">
    List Queries.

    **Method**: `GET`<br />
    **Path**: `/v1/query/list`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `start` | `integer` | No | Pagination offset, starting at 0; ≥ 0; Default `0` |
    | `limit` | `integer` | No | Maximum number of entries; ≥ 1; ≤ 100; Default `10` |
    | `order_by` | `string` | No | Sort field; Values: `"id"`, `"name"`, `"created_at"`, `"updated_at"`, `"star_count"`; Default `"updated_at"` |
    | `direction` | `string` | No | Sort direction; Values: `"asc"`, `"desc"`; Default `"desc"` |
    | `space` | `string` / `null` | No | Filter by Space; when omitted, list resources in visible Spaces; 1–64 characters |
    | `name` | `string` / `null` | No | Name substring filter |
    | `with_star` | `boolean` | No | Include star information; Default `false` |
    | `with_schedule` | `boolean` | No | Include schedule information; Default `false` |
    | `with_visualizations` | `boolean` | No | Include visualizations; Default `false` |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `start` | `integer` | Pagination offset, starting at 0 |
    | `limit` | `integer` | Maximum number of entries |
    | `items` | `object[]` | Entries on this page |
    | `total_count` | `integer` | Total number of matching entries |

    <Expandable title="items — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `space` | `string` | Space ID |
      | `name` | `string` / `null` | Name |
      | `language` | `string` / `null` | Code language |
      | `parameters` | `object[]` | Parameter definitions |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `space_entity` | `object` / `null` | Details of the owning Space |
      | `visualizations` | `object[]` | Visualizations in detail responses; list responses require with\_visualizations=true |
      | `is_starred` | `boolean` | Whether the calling user has starred the resource; returned in details, or lists with with\_star=true or sorting by star\_count |
      | `star_count` | `integer` | Number of stars; returned in details, or lists with with\_star=true or sorting by star\_count |
      | `schedule` | `object` / `null` | Schedule configuration snapshot returned only with with\_schedule=true; null if none exists |

      <Expandable title="parameters — Item fields">
        | Field | Type | Description |
        | - | - | - |
        | `name` | `string` | Name |
        | `type` | `string` | Logical parameter type; see [Data types](/reference/data-types) |
        | `options` | `JSON[]` / `null` | Allowed choices for the parameter |
        | `default` | `object` / `null` | Default parameter value |
        | `id` | `string` / `null` | Parameter display ID stored with the definition |
        | `order` | `integer` / `null` | Omit for every parameter, or use consecutive values from 0 |

        <Expandable title="default — Fields">
          | Field | Type | Description |
          | - | - | - |
          | `value` | `JSON` | Argument value |
        </Expandable>
      </Expandable>

      <Expandable title="space_entity — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `description` | `string` / `null` | Description |
        | `account_id` | `string` | Account ID |
        | `status` | `string` | Status |
        | `visibility` | `string` | Visibility: public, org, or private |
        | `dep_count` | `integer` | Dependency count |
        | `content_count` | `integer` | Number of content entries |
        | `created_at` | `number` | Creation time in Unix seconds |
        | `updated_at` | `number` | Last update time in Unix seconds |
        | `account` | `object` / `null` | Account details |

        <Expandable title="account — Fields">
          | Field | Type | Description |
          | - | - | - |
          | `id` | `string` | Unique object ID |
          | `type` | `string` | Account type: personal or org |
          | `slug` | `string` / `null` | Account slug used for display and URLs |
          | `display_name` | `string` / `null` | Account display name |
          | `avatar_url` | `string` / `null` | Avatar URL |
          | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
        </Expandable>
      </Expandable>

      <Expandable title="visualizations — Item fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `query_id` | `string` / `null` | Query ID |
        | `name` | `string` / `null` | Name |
        | `type` | `string` | Type; Values: `"table"`, `"chart"`, `"counter"`, `"pivot"` |
        | `options` | `object` / `null` | Configuration selected by options.type; \{} or null clears it. If display columns are omitted, the website selects them from the result. Nested keys use snake\_case; unknown keys are rejected |
        | `created_at` | `number` | Creation time in Unix seconds |
        | `updated_at` | `number` | Last update time in Unix seconds |

        <Expandable title="options — Fields">
          <Tabs>
            <Tab title="Table">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `description` | `string` / `null` | Description |
              | `type` | `string` | Type; Must be `"table"` |
              | `columns` | `object` / `null` | Display settings keyed by result column name |
              | `export_options` | `object` / `null` | Result export settings |

              <Expandable title="columns — Value fields">
                | Field | Type | Description |
                | - | - | - |
                | `name` | `string` / `null` | Name |
                | `title` | `string` / `null` | Display title |
                | `align` | `string` / `null` | Cell alignment; Values: `"left"`, `"center"`, `"right"` |
                | `type` | `string` / `null` | normal displays a regular cell; progress displays a progress bar; Values: `"normal"`, `"progress"` |
                | `format` | `string` / `null` | Number or date format string |
                | `hide` | `boolean` / `null` | Whether to hide the column |
                | `colored_positive` | `boolean` / `null` | Whether to color positive values |
                | `colored_negative` | `boolean` / `null` | Whether to color negative values |
                | `url_template` | `string` / `null` | Cell URL template; \{value} is replaced by the cell value |
              </Expandable>

              <Expandable title="export_options — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `enabled` | `boolean` / `null` | Whether exporting is enabled |
                | `formats` | `string[]` / `null` | Allowed export formats |
                | `filename` | `string` / `null` | Export filename |
                | `include_all_data` | `boolean` / `null` | Whether to export all data |
              </Expandable>
            </Tab>

            <Tab title="Bar / line / area / scatter">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `description` | `string` / `null` | Description |
              | `type` | `string` | Type; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
              | `x_column` | `string` / `null` | Result column for the x-axis |
              | `y_columns` | `string[]` / `null` | Numeric result columns; one series per column, with no duplicates |
              | `x_axis` | `object` / `null` | X-axis settings |
              | `y_axis` | `object` / `null` | Left y-axis settings |
              | `right_y_axis` | `object` / `null` | Right y-axis settings |
              | `legend` | `object` / `null` | Legend settings |
              | `series` | `object` / `null` | Keys are y-column names, or group values when group\_by is enabled |
              | `enable_stacking` | `boolean` / `null` | Whether to stack series |
              | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
              | `show_total_in_tooltip` | `boolean` / `null` | Whether to show the total in tooltips |
              | `group_by` | `string` / `null` | Group series by this column’s values; uses only the first y\_columns entry. An empty string disables grouping |
              | `normalize_to_percentage` | `boolean` / `null` | Normalize grouped values at each x position to 100% |
              | `when_duplicate_x` | `string` / `null` | For duplicate x values: first uses the first row, all keeps every row, sum adds the values; Values: `"first"`, `"all"`, `"sum"` |
              | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

              <Expandable title="x_axis — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `title` | `string` / `null` | Display title |
                | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
                | `label_format` | `string` / `null` | Tooltip or data-label format string |
                | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
                | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
                | `min` | `number` / `null` | Axis minimum; cannot exceed max |
                | `max` | `number` / `null` | Axis maximum |
                | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
                | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
                | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
                | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
                | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
                | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
                | `num_ticks` | `integer` / `null` | Number of ticks |
                | `width` | `number` / `null` | Axis width |
                | `reference_lines` | `object[]` / `null` | Axis reference lines |
                | `zones` | `object[]` / `null` | Highlighted axis regions |

                <Expandable title="reference_lines — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                  | `stroke` | `string` | Reference line color as a CSS color |
                  | `tick` | `object` / `null` | Reference line tick settings |

                  <Expandable title="tick — Fields">
                    | Field | Type | Description |
                    | - | - | - |
                    | `show` | `boolean` / `null` | Whether to show the reference line tick |
                  </Expandable>
                </Expandable>

                <Expandable title="zones — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `from` | `number` / `string` / `null` | Start of the highlighted region |
                  | `to` | `number` / `string` / `null` | End of the highlighted region |
                  | `color` | `string` / `null` | CSS color |
                  | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
                </Expandable>
              </Expandable>

              <Expandable title="y_axis — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `title` | `string` / `null` | Display title |
                | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
                | `label_format` | `string` / `null` | Tooltip or data-label format string |
                | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
                | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
                | `min` | `number` / `null` | Axis minimum; cannot exceed max |
                | `max` | `number` / `null` | Axis maximum |
                | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
                | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
                | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
                | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
                | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
                | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
                | `num_ticks` | `integer` / `null` | Number of ticks |
                | `width` | `number` / `null` | Axis width |
                | `reference_lines` | `object[]` / `null` | Axis reference lines |
                | `zones` | `object[]` / `null` | Highlighted axis regions |

                <Expandable title="reference_lines — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                  | `stroke` | `string` | Reference line color as a CSS color |
                  | `tick` | `object` / `null` | Reference line tick settings |

                  <Expandable title="tick — Fields">
                    | Field | Type | Description |
                    | - | - | - |
                    | `show` | `boolean` / `null` | Whether to show the reference line tick |
                  </Expandable>
                </Expandable>

                <Expandable title="zones — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `from` | `number` / `string` / `null` | Start of the highlighted region |
                  | `to` | `number` / `string` / `null` | End of the highlighted region |
                  | `color` | `string` / `null` | CSS color |
                  | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
                </Expandable>
              </Expandable>

              <Expandable title="right_y_axis — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `title` | `string` / `null` | Display title |
                | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
                | `label_format` | `string` / `null` | Tooltip or data-label format string |
                | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
                | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
                | `min` | `number` / `null` | Axis minimum; cannot exceed max |
                | `max` | `number` / `null` | Axis maximum |
                | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
                | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
                | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
                | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
                | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
                | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
                | `num_ticks` | `integer` / `null` | Number of ticks |
                | `width` | `number` / `null` | Axis width |
                | `reference_lines` | `object[]` / `null` | Axis reference lines |
                | `zones` | `object[]` / `null` | Highlighted axis regions |

                <Expandable title="reference_lines — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                  | `stroke` | `string` | Reference line color as a CSS color |
                  | `tick` | `object` / `null` | Reference line tick settings |

                  <Expandable title="tick — Fields">
                    | Field | Type | Description |
                    | - | - | - |
                    | `show` | `boolean` / `null` | Whether to show the reference line tick |
                  </Expandable>
                </Expandable>

                <Expandable title="zones — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `from` | `number` / `string` / `null` | Start of the highlighted region |
                  | `to` | `number` / `string` / `null` | End of the highlighted region |
                  | `color` | `string` / `null` | CSS color |
                  | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
                </Expandable>
              </Expandable>

              <Expandable title="legend — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
                | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
                | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
              </Expandable>

              <Expandable title="series — Value fields">
                | Field | Type | Description |
                | - | - | - |
                | `title` | `string` / `null` | Legend and tooltip title; defaults to the series name |
                | `type` | `string` / `null` | Series chart type; inherits options.type when omitted; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
                | `color` | `string` / `null` | CSS color |
                | `is_right` | `boolean` / `null` | Use the right axis; requires y\_axis.enable\_right\_axis |
                | `connect_nulls` | `boolean` / `null` | Whether lines connect across null values |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
                | `silent` | `boolean` / `null` | Whether to disable series interactions |
              </Expandable>
            </Tab>

            <Tab title="Pie">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `description` | `string` / `null` | Description |
              | `type` | `string` | Type; Must be `"pie"` |
              | `label_column` | `string` / `null` | Pie chart category column |
              | `value_column` | `string` / `null` | Pie chart value column |
              | `legend` | `object` / `null` | Legend settings |
              | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
              | `y_axis` | `object` / `null` | Only label\_format is used to format values |
              | `values_options` | `object` / `null` | Map of category values to slice color settings |
              | `series_title` | `string` / `null` | Series name in tooltips |
              | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

              <Expandable title="legend — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
                | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
                | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
              </Expandable>

              <Expandable title="y_axis — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `title` | `string` / `null` | Display title |
                | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
                | `label_format` | `string` / `null` | Tooltip or data-label format string |
                | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
                | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
                | `min` | `number` / `null` | Axis minimum; cannot exceed max |
                | `max` | `number` / `null` | Axis maximum |
                | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
                | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
                | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
                | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
                | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
                | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
                | `num_ticks` | `integer` / `null` | Number of ticks |
                | `width` | `number` / `null` | Axis width |
                | `reference_lines` | `object[]` / `null` | Axis reference lines |
                | `zones` | `object[]` / `null` | Highlighted axis regions |

                <Expandable title="reference_lines — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                  | `stroke` | `string` | Reference line color as a CSS color |
                  | `tick` | `object` / `null` | Reference line tick settings |

                  <Expandable title="tick — Fields">
                    | Field | Type | Description |
                    | - | - | - |
                    | `show` | `boolean` / `null` | Whether to show the reference line tick |
                  </Expandable>
                </Expandable>

                <Expandable title="zones — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `from` | `number` / `string` / `null` | Start of the highlighted region |
                  | `to` | `number` / `string` / `null` | End of the highlighted region |
                  | `color` | `string` / `null` | CSS color |
                  | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
                </Expandable>
              </Expandable>

              <Expandable title="values_options — Value fields">
                | Field | Type | Description |
                | - | - | - |
                | `color` | `string` | CSS color |
              </Expandable>
            </Tab>

            <Tab title="Counter">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `description` | `string` / `null` | Description |
              | `type` | `string` | Type; Must be `"counter"` |
              | `column_name` | `string` / `null` | Numeric column displayed by the counter |
              | `row_number` | `integer` / `null` | Zero-based result row index; defaults to 0 |
              | `prefix` | `string` / `null` | Value prefix |
              | `suffix` | `string` / `null` | Value suffix |
              | `decimals` | `integer` / `null` | Decimal places; formatting follows the column type when omitted |
              | `colored_positive` | `boolean` / `null` | Whether to color positive values |
              | `colored_negative` | `boolean` / `null` | Whether to color negative values |
              | `label` | `string` / `null` | Display label or category |
            </Tab>
          </Tabs>
        </Expandable>
      </Expandable>

      <Expandable title="schedule — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `space` | `string` | Space ID |
        | `content_type` | `string` / `null` | Target content type |
        | `content_id` | `string` / `null` | Target content ID |
        | `cron` | `string` / `null` | Cron expression |
        | `arguments` | `object[]` | Argument values for this execution |
        | `name` | `string` / `null` | Name |
        | `mode` | `string` / `null` | Schedule mode |
        | `max_cpu` | `integer` / `null` | CPU allocation; 100 represents 1 vCPU |
        | `max_memory` | `integer` / `null` | Memory allocation in bytes |
        | `created_at` | `number` | Creation time in Unix seconds |
        | `updated_at` | `number` | Last update time in Unix seconds |

        <Expandable title="arguments — Item fields">
          | Field | Type | Description |
          | - | - | - |
          | `value` | `JSON` | Argument value |
          | `name` | `string` / `null` | Name of the matching parameter |
          | `order` | `integer` / `null` | Omit for every argument, or use consecutive values from 0 to determine argument order |
        </Expandable>
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/query/list \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode space=demo \
      --data-urlencode limit=10 \
      --data-urlencode with_visualizations=true
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "items": [
          {
            "id": "01900000000070008000000000000001",
            "space": "demo",
            "name": "Asset count",
            "language": "sql",
            "parameters": [],
            "created_at": 1788220800.0,
            "updated_at": 1788220800.0,
            "space_entity": {
              "id": "demo",
              "description": "Example resources",
              "account_id": "0190000000007000800000000000000b",
              "status": "active",
              "visibility": "public",
              "dep_count": 0,
              "content_count": 6,
              "created_at": 1788220800.0,
              "updated_at": 1788220800.0,
              "account": {
                "id": "0190000000007000800000000000000b",
                "type": "org",
                "slug": "example-team",
                "display_name": "Example team",
                "avatar_url": null,
                "avatar_thumbnail_url": null
              }
            },
            "visualizations": [
              {
                "id": "01900000000070008000000000000005",
                "query_id": "01900000000070008000000000000001",
                "name": "Asset count",
                "type": "chart",
                "options": {
                  "type": "counter",
                  "column_name": "row_count",
                  "row_number": 0,
                  "decimals": 0
                },
                "created_at": 1788220800.0,
                "updated_at": 1788220800.0
              }
            ]
          }
        ],
        "total_count": 1,
        "start": 0,
        "limit": 10
      }
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/query/result — Read query results" id="get-query-result">
    `id` is a query result ID, not a Query ID or job ID. Use `metadata_only=true` to read metadata only.

    **Method**: `GET`<br />
    **Path**: `/v1/query/result`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `start` | `integer` | No | Pagination offset, starting at 0; ≥ 0; Default `0` |
    | `limit` | `integer` | No | Maximum number of entries; ≥ 1; ≤ 10000; Default `10` |
    | `id` | `string` | Yes | Query result ID; 1–255 characters |
    | `metadata_only` | `boolean` | No | Whether to return metadata only; Default `false` |
    | `search` | `string` / `null` | No | Search query for results |
    | `order_by` | `string` / `null` | No | Sort field |
    | `direction` | `string` | No | Sort direction; Values: `"asc"`, `"desc"`; Default `"desc"` |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `metadata` | `object` | Result columns and full-result statistics |
    | `data` | `object[]` | Rows keyed by column name; empty when metadata\_only=true |

    <Expandable title="metadata — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `columns` | `object[]` | Column definitions |
      | `statistics` | `object` | Full-result statistics |

      <Expandable title="columns — Item fields">
        | Field | Type | Description |
        | - | - | - |
        | `name` | `string` | Name |
        | `type` | `string` | Type |
      </Expandable>

      <Expandable title="statistics — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `rows_count` | `integer` | Number of returned rows |
        | `rows_size_bytes` | `integer` | Estimated result memory size in bytes |
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/query/result \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode id=01900000000070008000000000000007 \
      --data-urlencode limit=10
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "metadata": {
          "columns": [
            {
              "name": "row_count",
              "type": "BIGINT"
            }
          ],
          "statistics": {
            "rows_count": 1,
            "rows_size_bytes": 256
          }
        },
        "data": [
          {
            "row_count": 1
          }
        ]
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/query/run — Run a SQL query" id="post-query-run">
    Submits an asynchronous execution of a saved Query using the supplied SQL and arguments. Poll using `job_id`, then fetch results using `query_result_id`. Returns `409` if a job is already pending or running.

    **Method**: `POST`<br />
    **Path**: `/v1/query/run`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–255 characters |
    | `code` | `string` | Yes | Executable code; SQL for a Query |
    | `arguments` | `object[]` / `null` | No | Argument values for this execution |

    <Expandable title="arguments — Item fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `name` | `string` | Yes | SQL placeholder name |
      | `value` | `JSON` | Yes | Value substituted for the SQL placeholder |
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `job_id` | `string` / `null` | Query execution ID; null if no matching job exists |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/query/run \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "01900000000070008000000000000001",
      "code": "SELECT COUNT(*) AS row_count FROM demo.asset_notes",
      "arguments": []
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "job_id": "01900000000070008000000000000006"
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/query/update — Update a Query" id="post-query-update">
    Update a Query.

    **Method**: `POST`<br />
    **Path**: `/v1/query/update`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–255 characters |
    | `name` | `string` | No | Name; 1–64 characters |
    | `code` | `string` / `null` | No | Executable code; SQL for a Query |
    | `parameters` | `object[]` / `null` | No | Parameter definitions; updates replace the entire array |

    <Expandable title="parameters — Item fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `name` | `string` | Yes | Name; 1–64 characters |
      | `type` | `string` | Yes | Logical parameter type; see [Data types](/reference/data-types); 1–64 characters |
      | `options` | `JSON[]` / `null` | No | Allowed choices for the parameter |
      | `default` | `object` / `null` | No | Default parameter value |
      | `id` | `string` / `null` | No | Parameter display ID stored with the definition; ≤ 64 characters |
      | `order` | `integer` / `null` | No | Omit for every parameter, or use consecutive values from 0; ≥ 0 |

      <Expandable title="default — Fields">
        | Field | Type | Required | Description |
        | - | - | - | - |
        | `value` | `JSON` | Yes | Argument value |
      </Expandable>
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `space` | `string` | Space ID |
    | `name` | `string` / `null` | Name |
    | `language` | `string` / `null` | Code language |
    | `code` | `string` / `null` | SQL source; omitted from list responses |
    | `parameters` | `object[]` | Parameter definitions |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `space_entity` | `object` / `null` | Details of the owning Space |
    | `visualizations` | `object[]` | Visualizations in detail responses; list responses require with\_visualizations=true |
    | `is_starred` | `boolean` | Whether the calling user has starred the resource; returned in details, or lists with with\_star=true or sorting by star\_count |
    | `star_count` | `integer` | Number of stars; returned in details, or lists with with\_star=true or sorting by star\_count |

    <Expandable title="parameters — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `name` | `string` | Name |
      | `type` | `string` | Logical parameter type; see [Data types](/reference/data-types) |
      | `options` | `JSON[]` / `null` | Allowed choices for the parameter |
      | `default` | `object` / `null` | Default parameter value |
      | `id` | `string` / `null` | Parameter display ID stored with the definition |
      | `order` | `integer` / `null` | Omit for every parameter, or use consecutive values from 0 |

      <Expandable title="default — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `value` | `JSON` | Argument value |
      </Expandable>
    </Expandable>

    <Expandable title="space_entity — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `description` | `string` / `null` | Description |
      | `account_id` | `string` | Account ID |
      | `status` | `string` | Status |
      | `visibility` | `string` | Visibility: public, org, or private |
      | `dep_count` | `integer` | Dependency count |
      | `content_count` | `integer` | Number of content entries |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    <Expandable title="visualizations — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `query_id` | `string` / `null` | Query ID |
      | `name` | `string` / `null` | Name |
      | `type` | `string` | Type; Values: `"table"`, `"chart"`, `"counter"`, `"pivot"` |
      | `options` | `object` / `null` | Configuration selected by options.type; \{} or null clears it. If display columns are omitted, the website selects them from the result. Nested keys use snake\_case; unknown keys are rejected |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |

      <Expandable title="options — Fields">
        <Tabs>
          <Tab title="Table">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `description` | `string` / `null` | Description |
            | `type` | `string` | Type; Must be `"table"` |
            | `columns` | `object` / `null` | Display settings keyed by result column name |
            | `export_options` | `object` / `null` | Result export settings |

            <Expandable title="columns — Value fields">
              | Field | Type | Description |
              | - | - | - |
              | `name` | `string` / `null` | Name |
              | `title` | `string` / `null` | Display title |
              | `align` | `string` / `null` | Cell alignment; Values: `"left"`, `"center"`, `"right"` |
              | `type` | `string` / `null` | normal displays a regular cell; progress displays a progress bar; Values: `"normal"`, `"progress"` |
              | `format` | `string` / `null` | Number or date format string |
              | `hide` | `boolean` / `null` | Whether to hide the column |
              | `colored_positive` | `boolean` / `null` | Whether to color positive values |
              | `colored_negative` | `boolean` / `null` | Whether to color negative values |
              | `url_template` | `string` / `null` | Cell URL template; \{value} is replaced by the cell value |
            </Expandable>

            <Expandable title="export_options — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `enabled` | `boolean` / `null` | Whether exporting is enabled |
              | `formats` | `string[]` / `null` | Allowed export formats |
              | `filename` | `string` / `null` | Export filename |
              | `include_all_data` | `boolean` / `null` | Whether to export all data |
            </Expandable>
          </Tab>

          <Tab title="Bar / line / area / scatter">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `description` | `string` / `null` | Description |
            | `type` | `string` | Type; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
            | `x_column` | `string` / `null` | Result column for the x-axis |
            | `y_columns` | `string[]` / `null` | Numeric result columns; one series per column, with no duplicates |
            | `x_axis` | `object` / `null` | X-axis settings |
            | `y_axis` | `object` / `null` | Left y-axis settings |
            | `right_y_axis` | `object` / `null` | Right y-axis settings |
            | `legend` | `object` / `null` | Legend settings |
            | `series` | `object` / `null` | Keys are y-column names, or group values when group\_by is enabled |
            | `enable_stacking` | `boolean` / `null` | Whether to stack series |
            | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
            | `show_total_in_tooltip` | `boolean` / `null` | Whether to show the total in tooltips |
            | `group_by` | `string` / `null` | Group series by this column’s values; uses only the first y\_columns entry. An empty string disables grouping |
            | `normalize_to_percentage` | `boolean` / `null` | Normalize grouped values at each x position to 100% |
            | `when_duplicate_x` | `string` / `null` | For duplicate x values: first uses the first row, all keeps every row, sum adds the values; Values: `"first"`, `"all"`, `"sum"` |
            | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

            <Expandable title="x_axis — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
              | `label_format` | `string` / `null` | Tooltip or data-label format string |
              | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
              | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
              | `min` | `number` / `null` | Axis minimum; cannot exceed max |
              | `max` | `number` / `null` | Axis maximum |
              | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
              | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
              | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
              | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
              | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
              | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
              | `num_ticks` | `integer` / `null` | Number of ticks |
              | `width` | `number` / `null` | Axis width |
              | `reference_lines` | `object[]` / `null` | Axis reference lines |
              | `zones` | `object[]` / `null` | Highlighted axis regions |

              <Expandable title="reference_lines — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                | `stroke` | `string` | Reference line color as a CSS color |
                | `tick` | `object` / `null` | Reference line tick settings |

                <Expandable title="tick — Fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `show` | `boolean` / `null` | Whether to show the reference line tick |
                </Expandable>
              </Expandable>

              <Expandable title="zones — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `from` | `number` / `string` / `null` | Start of the highlighted region |
                | `to` | `number` / `string` / `null` | End of the highlighted region |
                | `color` | `string` / `null` | CSS color |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              </Expandable>
            </Expandable>

            <Expandable title="y_axis — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
              | `label_format` | `string` / `null` | Tooltip or data-label format string |
              | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
              | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
              | `min` | `number` / `null` | Axis minimum; cannot exceed max |
              | `max` | `number` / `null` | Axis maximum |
              | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
              | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
              | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
              | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
              | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
              | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
              | `num_ticks` | `integer` / `null` | Number of ticks |
              | `width` | `number` / `null` | Axis width |
              | `reference_lines` | `object[]` / `null` | Axis reference lines |
              | `zones` | `object[]` / `null` | Highlighted axis regions |

              <Expandable title="reference_lines — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                | `stroke` | `string` | Reference line color as a CSS color |
                | `tick` | `object` / `null` | Reference line tick settings |

                <Expandable title="tick — Fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `show` | `boolean` / `null` | Whether to show the reference line tick |
                </Expandable>
              </Expandable>

              <Expandable title="zones — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `from` | `number` / `string` / `null` | Start of the highlighted region |
                | `to` | `number` / `string` / `null` | End of the highlighted region |
                | `color` | `string` / `null` | CSS color |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              </Expandable>
            </Expandable>

            <Expandable title="right_y_axis — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
              | `label_format` | `string` / `null` | Tooltip or data-label format string |
              | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
              | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
              | `min` | `number` / `null` | Axis minimum; cannot exceed max |
              | `max` | `number` / `null` | Axis maximum |
              | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
              | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
              | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
              | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
              | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
              | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
              | `num_ticks` | `integer` / `null` | Number of ticks |
              | `width` | `number` / `null` | Axis width |
              | `reference_lines` | `object[]` / `null` | Axis reference lines |
              | `zones` | `object[]` / `null` | Highlighted axis regions |

              <Expandable title="reference_lines — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                | `stroke` | `string` | Reference line color as a CSS color |
                | `tick` | `object` / `null` | Reference line tick settings |

                <Expandable title="tick — Fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `show` | `boolean` / `null` | Whether to show the reference line tick |
                </Expandable>
              </Expandable>

              <Expandable title="zones — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `from` | `number` / `string` / `null` | Start of the highlighted region |
                | `to` | `number` / `string` / `null` | End of the highlighted region |
                | `color` | `string` / `null` | CSS color |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              </Expandable>
            </Expandable>

            <Expandable title="legend — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
              | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
              | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
            </Expandable>

            <Expandable title="series — Value fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Legend and tooltip title; defaults to the series name |
              | `type` | `string` / `null` | Series chart type; inherits options.type when omitted; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
              | `color` | `string` / `null` | CSS color |
              | `is_right` | `boolean` / `null` | Use the right axis; requires y\_axis.enable\_right\_axis |
              | `connect_nulls` | `boolean` / `null` | Whether lines connect across null values |
              | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              | `silent` | `boolean` / `null` | Whether to disable series interactions |
            </Expandable>
          </Tab>

          <Tab title="Pie">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `description` | `string` / `null` | Description |
            | `type` | `string` | Type; Must be `"pie"` |
            | `label_column` | `string` / `null` | Pie chart category column |
            | `value_column` | `string` / `null` | Pie chart value column |
            | `legend` | `object` / `null` | Legend settings |
            | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
            | `y_axis` | `object` / `null` | Only label\_format is used to format values |
            | `values_options` | `object` / `null` | Map of category values to slice color settings |
            | `series_title` | `string` / `null` | Series name in tooltips |
            | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

            <Expandable title="legend — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
              | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
              | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
            </Expandable>

            <Expandable title="y_axis — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
              | `label_format` | `string` / `null` | Tooltip or data-label format string |
              | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
              | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
              | `min` | `number` / `null` | Axis minimum; cannot exceed max |
              | `max` | `number` / `null` | Axis maximum |
              | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
              | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
              | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
              | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
              | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
              | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
              | `num_ticks` | `integer` / `null` | Number of ticks |
              | `width` | `number` / `null` | Axis width |
              | `reference_lines` | `object[]` / `null` | Axis reference lines |
              | `zones` | `object[]` / `null` | Highlighted axis regions |

              <Expandable title="reference_lines — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                | `stroke` | `string` | Reference line color as a CSS color |
                | `tick` | `object` / `null` | Reference line tick settings |

                <Expandable title="tick — Fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `show` | `boolean` / `null` | Whether to show the reference line tick |
                </Expandable>
              </Expandable>

              <Expandable title="zones — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `from` | `number` / `string` / `null` | Start of the highlighted region |
                | `to` | `number` / `string` / `null` | End of the highlighted region |
                | `color` | `string` / `null` | CSS color |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              </Expandable>
            </Expandable>

            <Expandable title="values_options — Value fields">
              | Field | Type | Description |
              | - | - | - |
              | `color` | `string` | CSS color |
            </Expandable>
          </Tab>

          <Tab title="Counter">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `description` | `string` / `null` | Description |
            | `type` | `string` | Type; Must be `"counter"` |
            | `column_name` | `string` / `null` | Numeric column displayed by the counter |
            | `row_number` | `integer` / `null` | Zero-based result row index; defaults to 0 |
            | `prefix` | `string` / `null` | Value prefix |
            | `suffix` | `string` / `null` | Value suffix |
            | `decimals` | `integer` / `null` | Decimal places; formatting follows the column type when omitted |
            | `colored_positive` | `boolean` / `null` | Whether to color positive values |
            | `colored_negative` | `boolean` / `null` | Whether to color negative values |
            | `label` | `string` / `null` | Display label or category |
          </Tab>
        </Tabs>
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/query/update \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "01900000000070008000000000000001",
      "code": "SELECT COUNT(*) AS row_count FROM demo.asset_notes"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "01900000000070008000000000000001",
        "space": "demo",
        "name": "Asset count",
        "language": "sql",
        "code": "SELECT COUNT(*) AS row_count FROM demo.asset_notes",
        "parameters": [],
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "space_entity": {
          "id": "demo",
          "description": "Example resources",
          "account_id": "0190000000007000800000000000000b",
          "status": "active",
          "visibility": "public",
          "dep_count": 0,
          "content_count": 6,
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "account": {
            "id": "0190000000007000800000000000000b",
            "type": "org",
            "slug": "example-team",
            "display_name": "Example team",
            "avatar_url": null,
            "avatar_thumbnail_url": null
          }
        },
        "visualizations": [
          {
            "id": "01900000000070008000000000000016",
            "query_id": "01900000000070008000000000000001",
            "name": "Query results",
            "type": "table",
            "options": {},
            "created_at": 1788220800.0,
            "updated_at": 1788220800.0
          }
        ],
        "is_starred": false,
        "star_count": 0
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/query/visualization/create — Create a visualization" id="post-query-visualization-create">
    Creates a display configuration without executing SQL. Use `type=table` for `options.type=table`, or `type=chart` for bar, line, area, scatter, pie, or counter. All `options` fields are defined in the parameters below.

    **Method**: `POST`<br />
    **Path**: `/v1/query/visualization/create`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–255 characters |
    | `query_id` | `string` | Yes | Query ID; 1–255 characters |
    | `name` | `string` | Yes | Name; 1–64 characters |
    | `type` | `string` | Yes | Type; Values: `"table"`, `"chart"`, `"counter"` |
    | `options` | `object` / `null` | No | Configuration selected by options.type; \{} or null clears it. If display columns are omitted, the website selects them from the result. Nested keys use snake\_case; unknown keys are rejected |

    <Expandable title="options — Fields">
      <Tabs>
        <Tab title="Table">
          | Field | Type | Required | Description |
          | - | - | - | - |
          | `title` | `string` / `null` | No | Display title |
          | `description` | `string` / `null` | No | Description |
          | `type` | `string` | Yes | Type; Must be `"table"` |
          | `columns` | `object` / `null` | No | Display settings keyed by result column name |
          | `export_options` | `object` / `null` | No | Result export settings |

          <Expandable title="columns — Value fields">
            | Field | Type | Required | Description |
            | - | - | - | - |
            | `name` | `string` / `null` | No | Name |
            | `title` | `string` / `null` | No | Display title |
            | `align` | `string` / `null` | No | Cell alignment; Values: `"left"`, `"center"`, `"right"` |
            | `type` | `string` / `null` | No | normal displays a regular cell; progress displays a progress bar; Values: `"normal"`, `"progress"` |
            | `format` | `string` / `null` | No | Number or date format string |
            | `hide` | `boolean` / `null` | No | Whether to hide the column |
            | `colored_positive` | `boolean` / `null` | No | Whether to color positive values |
            | `colored_negative` | `boolean` / `null` | No | Whether to color negative values |
            | `url_template` | `string` / `null` | No | Cell URL template; \{value} is replaced by the cell value |
          </Expandable>

          <Expandable title="export_options — Fields">
            | Field | Type | Required | Description |
            | - | - | - | - |
            | `enabled` | `boolean` / `null` | No | Whether exporting is enabled |
            | `formats` | `string[]` / `null` | No | Allowed export formats |
            | `filename` | `string` / `null` | No | Export filename |
            | `include_all_data` | `boolean` / `null` | No | Whether to export all data |
          </Expandable>
        </Tab>

        <Tab title="Bar / line / area / scatter">
          | Field | Type | Required | Description |
          | - | - | - | - |
          | `title` | `string` / `null` | No | Display title |
          | `description` | `string` / `null` | No | Description |
          | `type` | `string` | Yes | Type; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
          | `x_column` | `string` / `null` | No | Result column for the x-axis |
          | `y_columns` | `string[]` / `null` | No | Numeric result columns; one series per column, with no duplicates |
          | `x_axis` | `object` / `null` | No | X-axis settings |
          | `y_axis` | `object` / `null` | No | Left y-axis settings |
          | `right_y_axis` | `object` / `null` | No | Right y-axis settings |
          | `legend` | `object` / `null` | No | Legend settings |
          | `series` | `object` / `null` | No | Keys are y-column names, or group values when group\_by is enabled |
          | `enable_stacking` | `boolean` / `null` | No | Whether to stack series |
          | `show_data_labels` | `boolean` / `null` | No | Whether to show data labels |
          | `show_total_in_tooltip` | `boolean` / `null` | No | Whether to show the total in tooltips |
          | `group_by` | `string` / `null` | No | Group series by this column’s values; uses only the first y\_columns entry. An empty string disables grouping |
          | `normalize_to_percentage` | `boolean` / `null` | No | Normalize grouped values at each x position to 100% |
          | `when_duplicate_x` | `string` / `null` | No | For duplicate x values: first uses the first row, all keeps every row, sum adds the values; Values: `"first"`, `"all"`, `"sum"` |
          | `show_legend` | `boolean` / `null` | No | Legacy legend toggle; use legend.show |

          <Expandable title="x_axis — Fields">
            | Field | Type | Required | Description |
            | - | - | - | - |
            | `title` | `string` / `null` | No | Display title |
            | `tick_format` | `string` / `null` | No | Tick format string, such as YYYY-MM-DD |
            | `label_format` | `string` / `null` | No | Tooltip or data-label format string |
            | `type` | `string` / `null` | No | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
            | `include_zero` | `boolean` / `null` | No | Whether the y-axis includes zero; included when omitted |
            | `min` | `number` / `null` | No | Axis minimum; cannot exceed max |
            | `max` | `number` / `null` | No | Axis maximum |
            | `sort_values` | `boolean` / `null` | No | Whether to sort x-axis values; sorted when omitted |
            | `reverse_values` | `boolean` / `null` | No | Whether to reverse axis order |
            | `enable_right_axis` | `boolean` / `null` | No | Enable the right axis for series with is\_right set |
            | `auto_tick` | `boolean` / `null` | No | Whether to determine ticks automatically |
            | `nice` | `boolean` / `null` | No | Whether to round axis bounds to convenient ticks |
            | `asymmetric_equal_domain` | `boolean` / `null` | No | Whether to expand identical bounds asymmetrically |
            | `num_ticks` | `integer` / `null` | No | Number of ticks; ≥ 1 |
            | `width` | `number` / `null` | No | Axis width; ≥ 0 |
            | `reference_lines` | `object[]` / `null` | No | Axis reference lines |
            | `zones` | `object[]` / `null` | No | Highlighted axis regions |

            <Expandable title="reference_lines — Item fields">
              | Field | Type | Required | Description |
              | - | - | - | - |
              | `value` | `number` / `string` | Yes | Reference line position; time axes can use a date string |
              | `stroke` | `string` | Yes | Reference line color as a CSS color |
              | `tick` | `object` / `null` | No | Reference line tick settings |

              <Expandable title="tick — Fields">
                | Field | Type | Required | Description |
                | - | - | - | - |
                | `show` | `boolean` / `null` | No | Whether to show the reference line tick |
              </Expandable>
            </Expandable>

            <Expandable title="zones — Item fields">
              | Field | Type | Required | Description |
              | - | - | - | - |
              | `from` | `number` / `string` / `null` | No | Start of the highlighted region |
              | `to` | `number` / `string` / `null` | No | End of the highlighted region |
              | `color` | `string` / `null` | No | CSS color |
              | `fill_gradient` | `string[]` / `null` | No | Gradient start and end colors; exactly two CSS colors; 2–2 items |
            </Expandable>
          </Expandable>

          <Expandable title="y_axis — Fields">
            | Field | Type | Required | Description |
            | - | - | - | - |
            | `title` | `string` / `null` | No | Display title |
            | `tick_format` | `string` / `null` | No | Tick format string, such as YYYY-MM-DD |
            | `label_format` | `string` / `null` | No | Tooltip or data-label format string |
            | `type` | `string` / `null` | No | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
            | `include_zero` | `boolean` / `null` | No | Whether the y-axis includes zero; included when omitted |
            | `min` | `number` / `null` | No | Axis minimum; cannot exceed max |
            | `max` | `number` / `null` | No | Axis maximum |
            | `sort_values` | `boolean` / `null` | No | Whether to sort x-axis values; sorted when omitted |
            | `reverse_values` | `boolean` / `null` | No | Whether to reverse axis order |
            | `enable_right_axis` | `boolean` / `null` | No | Enable the right axis for series with is\_right set |
            | `auto_tick` | `boolean` / `null` | No | Whether to determine ticks automatically |
            | `nice` | `boolean` / `null` | No | Whether to round axis bounds to convenient ticks |
            | `asymmetric_equal_domain` | `boolean` / `null` | No | Whether to expand identical bounds asymmetrically |
            | `num_ticks` | `integer` / `null` | No | Number of ticks; ≥ 1 |
            | `width` | `number` / `null` | No | Axis width; ≥ 0 |
            | `reference_lines` | `object[]` / `null` | No | Axis reference lines |
            | `zones` | `object[]` / `null` | No | Highlighted axis regions |

            <Expandable title="reference_lines — Item fields">
              | Field | Type | Required | Description |
              | - | - | - | - |
              | `value` | `number` / `string` | Yes | Reference line position; time axes can use a date string |
              | `stroke` | `string` | Yes | Reference line color as a CSS color |
              | `tick` | `object` / `null` | No | Reference line tick settings |

              <Expandable title="tick — Fields">
                | Field | Type | Required | Description |
                | - | - | - | - |
                | `show` | `boolean` / `null` | No | Whether to show the reference line tick |
              </Expandable>
            </Expandable>

            <Expandable title="zones — Item fields">
              | Field | Type | Required | Description |
              | - | - | - | - |
              | `from` | `number` / `string` / `null` | No | Start of the highlighted region |
              | `to` | `number` / `string` / `null` | No | End of the highlighted region |
              | `color` | `string` / `null` | No | CSS color |
              | `fill_gradient` | `string[]` / `null` | No | Gradient start and end colors; exactly two CSS colors; 2–2 items |
            </Expandable>
          </Expandable>

          <Expandable title="right_y_axis — Fields">
            | Field | Type | Required | Description |
            | - | - | - | - |
            | `title` | `string` / `null` | No | Display title |
            | `tick_format` | `string` / `null` | No | Tick format string, such as YYYY-MM-DD |
            | `label_format` | `string` / `null` | No | Tooltip or data-label format string |
            | `type` | `string` / `null` | No | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
            | `include_zero` | `boolean` / `null` | No | Whether the y-axis includes zero; included when omitted |
            | `min` | `number` / `null` | No | Axis minimum; cannot exceed max |
            | `max` | `number` / `null` | No | Axis maximum |
            | `sort_values` | `boolean` / `null` | No | Whether to sort x-axis values; sorted when omitted |
            | `reverse_values` | `boolean` / `null` | No | Whether to reverse axis order |
            | `enable_right_axis` | `boolean` / `null` | No | Enable the right axis for series with is\_right set |
            | `auto_tick` | `boolean` / `null` | No | Whether to determine ticks automatically |
            | `nice` | `boolean` / `null` | No | Whether to round axis bounds to convenient ticks |
            | `asymmetric_equal_domain` | `boolean` / `null` | No | Whether to expand identical bounds asymmetrically |
            | `num_ticks` | `integer` / `null` | No | Number of ticks; ≥ 1 |
            | `width` | `number` / `null` | No | Axis width; ≥ 0 |
            | `reference_lines` | `object[]` / `null` | No | Axis reference lines |
            | `zones` | `object[]` / `null` | No | Highlighted axis regions |

            <Expandable title="reference_lines — Item fields">
              | Field | Type | Required | Description |
              | - | - | - | - |
              | `value` | `number` / `string` | Yes | Reference line position; time axes can use a date string |
              | `stroke` | `string` | Yes | Reference line color as a CSS color |
              | `tick` | `object` / `null` | No | Reference line tick settings |

              <Expandable title="tick — Fields">
                | Field | Type | Required | Description |
                | - | - | - | - |
                | `show` | `boolean` / `null` | No | Whether to show the reference line tick |
              </Expandable>
            </Expandable>

            <Expandable title="zones — Item fields">
              | Field | Type | Required | Description |
              | - | - | - | - |
              | `from` | `number` / `string` / `null` | No | Start of the highlighted region |
              | `to` | `number` / `string` / `null` | No | End of the highlighted region |
              | `color` | `string` / `null` | No | CSS color |
              | `fill_gradient` | `string[]` / `null` | No | Gradient start and end colors; exactly two CSS colors; 2–2 items |
            </Expandable>
          </Expandable>

          <Expandable title="legend — Fields">
            | Field | Type | Required | Description |
            | - | - | - | - |
            | `show` | `boolean` / `null` | No | Whether to show; legends are shown when omitted |
            | `position` | `string` / `null` | No | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
            | `show_all` | `boolean` / `null` | No | Whether the pie legend lists every category |
          </Expandable>

          <Expandable title="series — Value fields">
            | Field | Type | Required | Description |
            | - | - | - | - |
            | `title` | `string` / `null` | No | Legend and tooltip title; defaults to the series name |
            | `type` | `string` / `null` | No | Series chart type; inherits options.type when omitted; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
            | `color` | `string` / `null` | No | CSS color |
            | `is_right` | `boolean` / `null` | No | Use the right axis; requires y\_axis.enable\_right\_axis |
            | `connect_nulls` | `boolean` / `null` | No | Whether lines connect across null values |
            | `fill_gradient` | `string[]` / `null` | No | Gradient start and end colors; exactly two CSS colors; 2–2 items |
            | `silent` | `boolean` / `null` | No | Whether to disable series interactions |
          </Expandable>
        </Tab>

        <Tab title="Pie">
          | Field | Type | Required | Description |
          | - | - | - | - |
          | `title` | `string` / `null` | No | Display title |
          | `description` | `string` / `null` | No | Description |
          | `type` | `string` | Yes | Type; Must be `"pie"` |
          | `label_column` | `string` / `null` | No | Pie chart category column |
          | `value_column` | `string` / `null` | No | Pie chart value column |
          | `legend` | `object` / `null` | No | Legend settings |
          | `show_data_labels` | `boolean` / `null` | No | Whether to show data labels |
          | `y_axis` | `object` / `null` | No | Only label\_format is used to format values |
          | `values_options` | `object` / `null` | No | Map of category values to slice color settings |
          | `series_title` | `string` / `null` | No | Series name in tooltips |
          | `show_legend` | `boolean` / `null` | No | Legacy legend toggle; use legend.show |

          <Expandable title="legend — Fields">
            | Field | Type | Required | Description |
            | - | - | - | - |
            | `show` | `boolean` / `null` | No | Whether to show; legends are shown when omitted |
            | `position` | `string` / `null` | No | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
            | `show_all` | `boolean` / `null` | No | Whether the pie legend lists every category |
          </Expandable>

          <Expandable title="y_axis — Fields">
            | Field | Type | Required | Description |
            | - | - | - | - |
            | `title` | `string` / `null` | No | Display title |
            | `tick_format` | `string` / `null` | No | Tick format string, such as YYYY-MM-DD |
            | `label_format` | `string` / `null` | No | Tooltip or data-label format string |
            | `type` | `string` / `null` | No | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
            | `include_zero` | `boolean` / `null` | No | Whether the y-axis includes zero; included when omitted |
            | `min` | `number` / `null` | No | Axis minimum; cannot exceed max |
            | `max` | `number` / `null` | No | Axis maximum |
            | `sort_values` | `boolean` / `null` | No | Whether to sort x-axis values; sorted when omitted |
            | `reverse_values` | `boolean` / `null` | No | Whether to reverse axis order |
            | `enable_right_axis` | `boolean` / `null` | No | Enable the right axis for series with is\_right set |
            | `auto_tick` | `boolean` / `null` | No | Whether to determine ticks automatically |
            | `nice` | `boolean` / `null` | No | Whether to round axis bounds to convenient ticks |
            | `asymmetric_equal_domain` | `boolean` / `null` | No | Whether to expand identical bounds asymmetrically |
            | `num_ticks` | `integer` / `null` | No | Number of ticks; ≥ 1 |
            | `width` | `number` / `null` | No | Axis width; ≥ 0 |
            | `reference_lines` | `object[]` / `null` | No | Axis reference lines |
            | `zones` | `object[]` / `null` | No | Highlighted axis regions |

            <Expandable title="reference_lines — Item fields">
              | Field | Type | Required | Description |
              | - | - | - | - |
              | `value` | `number` / `string` | Yes | Reference line position; time axes can use a date string |
              | `stroke` | `string` | Yes | Reference line color as a CSS color |
              | `tick` | `object` / `null` | No | Reference line tick settings |

              <Expandable title="tick — Fields">
                | Field | Type | Required | Description |
                | - | - | - | - |
                | `show` | `boolean` / `null` | No | Whether to show the reference line tick |
              </Expandable>
            </Expandable>

            <Expandable title="zones — Item fields">
              | Field | Type | Required | Description |
              | - | - | - | - |
              | `from` | `number` / `string` / `null` | No | Start of the highlighted region |
              | `to` | `number` / `string` / `null` | No | End of the highlighted region |
              | `color` | `string` / `null` | No | CSS color |
              | `fill_gradient` | `string[]` / `null` | No | Gradient start and end colors; exactly two CSS colors; 2–2 items |
            </Expandable>
          </Expandable>

          <Expandable title="values_options — Value fields">
            | Field | Type | Required | Description |
            | - | - | - | - |
            | `color` | `string` | Yes | CSS color |
          </Expandable>
        </Tab>

        <Tab title="Counter">
          | Field | Type | Required | Description |
          | - | - | - | - |
          | `title` | `string` / `null` | No | Display title |
          | `description` | `string` / `null` | No | Description |
          | `type` | `string` | Yes | Type; Must be `"counter"` |
          | `column_name` | `string` / `null` | No | Numeric column displayed by the counter |
          | `row_number` | `integer` / `null` | No | Zero-based result row index; defaults to 0; ≥ 0 |
          | `prefix` | `string` / `null` | No | Value prefix |
          | `suffix` | `string` / `null` | No | Value suffix |
          | `decimals` | `integer` / `null` | No | Decimal places; formatting follows the column type when omitted; ≥ 0; ≤ 20 |
          | `colored_positive` | `boolean` / `null` | No | Whether to color positive values |
          | `colored_negative` | `boolean` / `null` | No | Whether to color negative values |
          | `label` | `string` / `null` | No | Display label or category |
        </Tab>
      </Tabs>
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `query_id` | `string` / `null` | Query ID |
    | `name` | `string` / `null` | Name |
    | `type` | `string` | Type; Values: `"table"`, `"chart"`, `"counter"`, `"pivot"` |
    | `options` | `object` / `null` | Configuration selected by options.type; \{} or null clears it. If display columns are omitted, the website selects them from the result. Nested keys use snake\_case; unknown keys are rejected |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |

    <Expandable title="options — Fields">
      <Tabs>
        <Tab title="Table">
          | Field | Type | Description |
          | - | - | - |
          | `title` | `string` / `null` | Display title |
          | `description` | `string` / `null` | Description |
          | `type` | `string` | Type; Must be `"table"` |
          | `columns` | `object` / `null` | Display settings keyed by result column name |
          | `export_options` | `object` / `null` | Result export settings |

          <Expandable title="columns — Value fields">
            | Field | Type | Description |
            | - | - | - |
            | `name` | `string` / `null` | Name |
            | `title` | `string` / `null` | Display title |
            | `align` | `string` / `null` | Cell alignment; Values: `"left"`, `"center"`, `"right"` |
            | `type` | `string` / `null` | normal displays a regular cell; progress displays a progress bar; Values: `"normal"`, `"progress"` |
            | `format` | `string` / `null` | Number or date format string |
            | `hide` | `boolean` / `null` | Whether to hide the column |
            | `colored_positive` | `boolean` / `null` | Whether to color positive values |
            | `colored_negative` | `boolean` / `null` | Whether to color negative values |
            | `url_template` | `string` / `null` | Cell URL template; \{value} is replaced by the cell value |
          </Expandable>

          <Expandable title="export_options — Fields">
            | Field | Type | Description |
            | - | - | - |
            | `enabled` | `boolean` / `null` | Whether exporting is enabled |
            | `formats` | `string[]` / `null` | Allowed export formats |
            | `filename` | `string` / `null` | Export filename |
            | `include_all_data` | `boolean` / `null` | Whether to export all data |
          </Expandable>
        </Tab>

        <Tab title="Bar / line / area / scatter">
          | Field | Type | Description |
          | - | - | - |
          | `title` | `string` / `null` | Display title |
          | `description` | `string` / `null` | Description |
          | `type` | `string` | Type; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
          | `x_column` | `string` / `null` | Result column for the x-axis |
          | `y_columns` | `string[]` / `null` | Numeric result columns; one series per column, with no duplicates |
          | `x_axis` | `object` / `null` | X-axis settings |
          | `y_axis` | `object` / `null` | Left y-axis settings |
          | `right_y_axis` | `object` / `null` | Right y-axis settings |
          | `legend` | `object` / `null` | Legend settings |
          | `series` | `object` / `null` | Keys are y-column names, or group values when group\_by is enabled |
          | `enable_stacking` | `boolean` / `null` | Whether to stack series |
          | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
          | `show_total_in_tooltip` | `boolean` / `null` | Whether to show the total in tooltips |
          | `group_by` | `string` / `null` | Group series by this column’s values; uses only the first y\_columns entry. An empty string disables grouping |
          | `normalize_to_percentage` | `boolean` / `null` | Normalize grouped values at each x position to 100% |
          | `when_duplicate_x` | `string` / `null` | For duplicate x values: first uses the first row, all keeps every row, sum adds the values; Values: `"first"`, `"all"`, `"sum"` |
          | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

          <Expandable title="x_axis — Fields">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
            | `label_format` | `string` / `null` | Tooltip or data-label format string |
            | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
            | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
            | `min` | `number` / `null` | Axis minimum; cannot exceed max |
            | `max` | `number` / `null` | Axis maximum |
            | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
            | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
            | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
            | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
            | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
            | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
            | `num_ticks` | `integer` / `null` | Number of ticks |
            | `width` | `number` / `null` | Axis width |
            | `reference_lines` | `object[]` / `null` | Axis reference lines |
            | `zones` | `object[]` / `null` | Highlighted axis regions |

            <Expandable title="reference_lines — Item fields">
              | Field | Type | Description |
              | - | - | - |
              | `value` | `number` / `string` | Reference line position; time axes can use a date string |
              | `stroke` | `string` | Reference line color as a CSS color |
              | `tick` | `object` / `null` | Reference line tick settings |

              <Expandable title="tick — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `show` | `boolean` / `null` | Whether to show the reference line tick |
              </Expandable>
            </Expandable>

            <Expandable title="zones — Item fields">
              | Field | Type | Description |
              | - | - | - |
              | `from` | `number` / `string` / `null` | Start of the highlighted region |
              | `to` | `number` / `string` / `null` | End of the highlighted region |
              | `color` | `string` / `null` | CSS color |
              | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
            </Expandable>
          </Expandable>

          <Expandable title="y_axis — Fields">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
            | `label_format` | `string` / `null` | Tooltip or data-label format string |
            | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
            | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
            | `min` | `number` / `null` | Axis minimum; cannot exceed max |
            | `max` | `number` / `null` | Axis maximum |
            | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
            | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
            | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
            | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
            | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
            | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
            | `num_ticks` | `integer` / `null` | Number of ticks |
            | `width` | `number` / `null` | Axis width |
            | `reference_lines` | `object[]` / `null` | Axis reference lines |
            | `zones` | `object[]` / `null` | Highlighted axis regions |

            <Expandable title="reference_lines — Item fields">
              | Field | Type | Description |
              | - | - | - |
              | `value` | `number` / `string` | Reference line position; time axes can use a date string |
              | `stroke` | `string` | Reference line color as a CSS color |
              | `tick` | `object` / `null` | Reference line tick settings |

              <Expandable title="tick — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `show` | `boolean` / `null` | Whether to show the reference line tick |
              </Expandable>
            </Expandable>

            <Expandable title="zones — Item fields">
              | Field | Type | Description |
              | - | - | - |
              | `from` | `number` / `string` / `null` | Start of the highlighted region |
              | `to` | `number` / `string` / `null` | End of the highlighted region |
              | `color` | `string` / `null` | CSS color |
              | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
            </Expandable>
          </Expandable>

          <Expandable title="right_y_axis — Fields">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
            | `label_format` | `string` / `null` | Tooltip or data-label format string |
            | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
            | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
            | `min` | `number` / `null` | Axis minimum; cannot exceed max |
            | `max` | `number` / `null` | Axis maximum |
            | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
            | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
            | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
            | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
            | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
            | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
            | `num_ticks` | `integer` / `null` | Number of ticks |
            | `width` | `number` / `null` | Axis width |
            | `reference_lines` | `object[]` / `null` | Axis reference lines |
            | `zones` | `object[]` / `null` | Highlighted axis regions |

            <Expandable title="reference_lines — Item fields">
              | Field | Type | Description |
              | - | - | - |
              | `value` | `number` / `string` | Reference line position; time axes can use a date string |
              | `stroke` | `string` | Reference line color as a CSS color |
              | `tick` | `object` / `null` | Reference line tick settings |

              <Expandable title="tick — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `show` | `boolean` / `null` | Whether to show the reference line tick |
              </Expandable>
            </Expandable>

            <Expandable title="zones — Item fields">
              | Field | Type | Description |
              | - | - | - |
              | `from` | `number` / `string` / `null` | Start of the highlighted region |
              | `to` | `number` / `string` / `null` | End of the highlighted region |
              | `color` | `string` / `null` | CSS color |
              | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
            </Expandable>
          </Expandable>

          <Expandable title="legend — Fields">
            | Field | Type | Description |
            | - | - | - |
            | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
            | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
            | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
          </Expandable>

          <Expandable title="series — Value fields">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Legend and tooltip title; defaults to the series name |
            | `type` | `string` / `null` | Series chart type; inherits options.type when omitted; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
            | `color` | `string` / `null` | CSS color |
            | `is_right` | `boolean` / `null` | Use the right axis; requires y\_axis.enable\_right\_axis |
            | `connect_nulls` | `boolean` / `null` | Whether lines connect across null values |
            | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
            | `silent` | `boolean` / `null` | Whether to disable series interactions |
          </Expandable>
        </Tab>

        <Tab title="Pie">
          | Field | Type | Description |
          | - | - | - |
          | `title` | `string` / `null` | Display title |
          | `description` | `string` / `null` | Description |
          | `type` | `string` | Type; Must be `"pie"` |
          | `label_column` | `string` / `null` | Pie chart category column |
          | `value_column` | `string` / `null` | Pie chart value column |
          | `legend` | `object` / `null` | Legend settings |
          | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
          | `y_axis` | `object` / `null` | Only label\_format is used to format values |
          | `values_options` | `object` / `null` | Map of category values to slice color settings |
          | `series_title` | `string` / `null` | Series name in tooltips |
          | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

          <Expandable title="legend — Fields">
            | Field | Type | Description |
            | - | - | - |
            | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
            | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
            | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
          </Expandable>

          <Expandable title="y_axis — Fields">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
            | `label_format` | `string` / `null` | Tooltip or data-label format string |
            | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
            | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
            | `min` | `number` / `null` | Axis minimum; cannot exceed max |
            | `max` | `number` / `null` | Axis maximum |
            | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
            | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
            | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
            | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
            | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
            | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
            | `num_ticks` | `integer` / `null` | Number of ticks |
            | `width` | `number` / `null` | Axis width |
            | `reference_lines` | `object[]` / `null` | Axis reference lines |
            | `zones` | `object[]` / `null` | Highlighted axis regions |

            <Expandable title="reference_lines — Item fields">
              | Field | Type | Description |
              | - | - | - |
              | `value` | `number` / `string` | Reference line position; time axes can use a date string |
              | `stroke` | `string` | Reference line color as a CSS color |
              | `tick` | `object` / `null` | Reference line tick settings |

              <Expandable title="tick — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `show` | `boolean` / `null` | Whether to show the reference line tick |
              </Expandable>
            </Expandable>

            <Expandable title="zones — Item fields">
              | Field | Type | Description |
              | - | - | - |
              | `from` | `number` / `string` / `null` | Start of the highlighted region |
              | `to` | `number` / `string` / `null` | End of the highlighted region |
              | `color` | `string` / `null` | CSS color |
              | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
            </Expandable>
          </Expandable>

          <Expandable title="values_options — Value fields">
            | Field | Type | Description |
            | - | - | - |
            | `color` | `string` | CSS color |
          </Expandable>
        </Tab>

        <Tab title="Counter">
          | Field | Type | Description |
          | - | - | - |
          | `title` | `string` / `null` | Display title |
          | `description` | `string` / `null` | Description |
          | `type` | `string` | Type; Must be `"counter"` |
          | `column_name` | `string` / `null` | Numeric column displayed by the counter |
          | `row_number` | `integer` / `null` | Zero-based result row index; defaults to 0 |
          | `prefix` | `string` / `null` | Value prefix |
          | `suffix` | `string` / `null` | Value suffix |
          | `decimals` | `integer` / `null` | Decimal places; formatting follows the column type when omitted |
          | `colored_positive` | `boolean` / `null` | Whether to color positive values |
          | `colored_negative` | `boolean` / `null` | Whether to color negative values |
          | `label` | `string` / `null` | Display label or category |
        </Tab>
      </Tabs>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/query/visualization/create \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "01900000000070008000000000000005",
      "query_id": "01900000000070008000000000000001",
      "name": "Asset count",
      "type": "chart",
      "options": {
        "type": "counter",
        "column_name": "row_count",
        "row_number": 0,
        "decimals": 0
      }
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "01900000000070008000000000000005",
        "query_id": "01900000000070008000000000000001",
        "name": "Asset count",
        "type": "chart",
        "options": {
          "type": "counter",
          "column_name": "row_count",
          "row_number": 0,
          "decimals": 0
        },
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/query/visualization/delete — Delete a visualization" id="post-query-visualization-delete">
    Delete a visualization.

    **Method**: `POST`<br />
    **Path**: `/v1/query/visualization/delete`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–255 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `data` | `null` | Operation completed with no response data |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/query/visualization/delete \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "01900000000070008000000000000005"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": null
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/query/visualization/ensure_default — Get or create the default visualization" id="post-query-visualization-ensure-default">
    Get or create the default visualization.

    **Method**: `POST`<br />
    **Path**: `/v1/query/visualization/ensure_default`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `query_id` | `string` | Yes | Query ID; 1–255 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `query_id` | `string` / `null` | Query ID |
    | `name` | `string` / `null` | Name |
    | `type` | `string` | Type; Values: `"table"`, `"chart"`, `"counter"`, `"pivot"` |
    | `options` | `object` / `null` | Configuration selected by options.type; \{} or null clears it. If display columns are omitted, the website selects them from the result. Nested keys use snake\_case; unknown keys are rejected |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |

    <Expandable title="options — Fields">
      <Tabs>
        <Tab title="Table">
          | Field | Type | Description |
          | - | - | - |
          | `title` | `string` / `null` | Display title |
          | `description` | `string` / `null` | Description |
          | `type` | `string` | Type; Must be `"table"` |
          | `columns` | `object` / `null` | Display settings keyed by result column name |
          | `export_options` | `object` / `null` | Result export settings |

          <Expandable title="columns — Value fields">
            | Field | Type | Description |
            | - | - | - |
            | `name` | `string` / `null` | Name |
            | `title` | `string` / `null` | Display title |
            | `align` | `string` / `null` | Cell alignment; Values: `"left"`, `"center"`, `"right"` |
            | `type` | `string` / `null` | normal displays a regular cell; progress displays a progress bar; Values: `"normal"`, `"progress"` |
            | `format` | `string` / `null` | Number or date format string |
            | `hide` | `boolean` / `null` | Whether to hide the column |
            | `colored_positive` | `boolean` / `null` | Whether to color positive values |
            | `colored_negative` | `boolean` / `null` | Whether to color negative values |
            | `url_template` | `string` / `null` | Cell URL template; \{value} is replaced by the cell value |
          </Expandable>

          <Expandable title="export_options — Fields">
            | Field | Type | Description |
            | - | - | - |
            | `enabled` | `boolean` / `null` | Whether exporting is enabled |
            | `formats` | `string[]` / `null` | Allowed export formats |
            | `filename` | `string` / `null` | Export filename |
            | `include_all_data` | `boolean` / `null` | Whether to export all data |
          </Expandable>
        </Tab>

        <Tab title="Bar / line / area / scatter">
          | Field | Type | Description |
          | - | - | - |
          | `title` | `string` / `null` | Display title |
          | `description` | `string` / `null` | Description |
          | `type` | `string` | Type; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
          | `x_column` | `string` / `null` | Result column for the x-axis |
          | `y_columns` | `string[]` / `null` | Numeric result columns; one series per column, with no duplicates |
          | `x_axis` | `object` / `null` | X-axis settings |
          | `y_axis` | `object` / `null` | Left y-axis settings |
          | `right_y_axis` | `object` / `null` | Right y-axis settings |
          | `legend` | `object` / `null` | Legend settings |
          | `series` | `object` / `null` | Keys are y-column names, or group values when group\_by is enabled |
          | `enable_stacking` | `boolean` / `null` | Whether to stack series |
          | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
          | `show_total_in_tooltip` | `boolean` / `null` | Whether to show the total in tooltips |
          | `group_by` | `string` / `null` | Group series by this column’s values; uses only the first y\_columns entry. An empty string disables grouping |
          | `normalize_to_percentage` | `boolean` / `null` | Normalize grouped values at each x position to 100% |
          | `when_duplicate_x` | `string` / `null` | For duplicate x values: first uses the first row, all keeps every row, sum adds the values; Values: `"first"`, `"all"`, `"sum"` |
          | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

          <Expandable title="x_axis — Fields">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
            | `label_format` | `string` / `null` | Tooltip or data-label format string |
            | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
            | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
            | `min` | `number` / `null` | Axis minimum; cannot exceed max |
            | `max` | `number` / `null` | Axis maximum |
            | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
            | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
            | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
            | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
            | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
            | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
            | `num_ticks` | `integer` / `null` | Number of ticks |
            | `width` | `number` / `null` | Axis width |
            | `reference_lines` | `object[]` / `null` | Axis reference lines |
            | `zones` | `object[]` / `null` | Highlighted axis regions |

            <Expandable title="reference_lines — Item fields">
              | Field | Type | Description |
              | - | - | - |
              | `value` | `number` / `string` | Reference line position; time axes can use a date string |
              | `stroke` | `string` | Reference line color as a CSS color |
              | `tick` | `object` / `null` | Reference line tick settings |

              <Expandable title="tick — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `show` | `boolean` / `null` | Whether to show the reference line tick |
              </Expandable>
            </Expandable>

            <Expandable title="zones — Item fields">
              | Field | Type | Description |
              | - | - | - |
              | `from` | `number` / `string` / `null` | Start of the highlighted region |
              | `to` | `number` / `string` / `null` | End of the highlighted region |
              | `color` | `string` / `null` | CSS color |
              | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
            </Expandable>
          </Expandable>

          <Expandable title="y_axis — Fields">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
            | `label_format` | `string` / `null` | Tooltip or data-label format string |
            | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
            | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
            | `min` | `number` / `null` | Axis minimum; cannot exceed max |
            | `max` | `number` / `null` | Axis maximum |
            | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
            | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
            | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
            | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
            | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
            | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
            | `num_ticks` | `integer` / `null` | Number of ticks |
            | `width` | `number` / `null` | Axis width |
            | `reference_lines` | `object[]` / `null` | Axis reference lines |
            | `zones` | `object[]` / `null` | Highlighted axis regions |

            <Expandable title="reference_lines — Item fields">
              | Field | Type | Description |
              | - | - | - |
              | `value` | `number` / `string` | Reference line position; time axes can use a date string |
              | `stroke` | `string` | Reference line color as a CSS color |
              | `tick` | `object` / `null` | Reference line tick settings |

              <Expandable title="tick — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `show` | `boolean` / `null` | Whether to show the reference line tick |
              </Expandable>
            </Expandable>

            <Expandable title="zones — Item fields">
              | Field | Type | Description |
              | - | - | - |
              | `from` | `number` / `string` / `null` | Start of the highlighted region |
              | `to` | `number` / `string` / `null` | End of the highlighted region |
              | `color` | `string` / `null` | CSS color |
              | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
            </Expandable>
          </Expandable>

          <Expandable title="right_y_axis — Fields">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
            | `label_format` | `string` / `null` | Tooltip or data-label format string |
            | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
            | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
            | `min` | `number` / `null` | Axis minimum; cannot exceed max |
            | `max` | `number` / `null` | Axis maximum |
            | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
            | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
            | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
            | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
            | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
            | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
            | `num_ticks` | `integer` / `null` | Number of ticks |
            | `width` | `number` / `null` | Axis width |
            | `reference_lines` | `object[]` / `null` | Axis reference lines |
            | `zones` | `object[]` / `null` | Highlighted axis regions |

            <Expandable title="reference_lines — Item fields">
              | Field | Type | Description |
              | - | - | - |
              | `value` | `number` / `string` | Reference line position; time axes can use a date string |
              | `stroke` | `string` | Reference line color as a CSS color |
              | `tick` | `object` / `null` | Reference line tick settings |

              <Expandable title="tick — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `show` | `boolean` / `null` | Whether to show the reference line tick |
              </Expandable>
            </Expandable>

            <Expandable title="zones — Item fields">
              | Field | Type | Description |
              | - | - | - |
              | `from` | `number` / `string` / `null` | Start of the highlighted region |
              | `to` | `number` / `string` / `null` | End of the highlighted region |
              | `color` | `string` / `null` | CSS color |
              | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
            </Expandable>
          </Expandable>

          <Expandable title="legend — Fields">
            | Field | Type | Description |
            | - | - | - |
            | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
            | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
            | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
          </Expandable>

          <Expandable title="series — Value fields">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Legend and tooltip title; defaults to the series name |
            | `type` | `string` / `null` | Series chart type; inherits options.type when omitted; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
            | `color` | `string` / `null` | CSS color |
            | `is_right` | `boolean` / `null` | Use the right axis; requires y\_axis.enable\_right\_axis |
            | `connect_nulls` | `boolean` / `null` | Whether lines connect across null values |
            | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
            | `silent` | `boolean` / `null` | Whether to disable series interactions |
          </Expandable>
        </Tab>

        <Tab title="Pie">
          | Field | Type | Description |
          | - | - | - |
          | `title` | `string` / `null` | Display title |
          | `description` | `string` / `null` | Description |
          | `type` | `string` | Type; Must be `"pie"` |
          | `label_column` | `string` / `null` | Pie chart category column |
          | `value_column` | `string` / `null` | Pie chart value column |
          | `legend` | `object` / `null` | Legend settings |
          | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
          | `y_axis` | `object` / `null` | Only label\_format is used to format values |
          | `values_options` | `object` / `null` | Map of category values to slice color settings |
          | `series_title` | `string` / `null` | Series name in tooltips |
          | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

          <Expandable title="legend — Fields">
            | Field | Type | Description |
            | - | - | - |
            | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
            | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
            | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
          </Expandable>

          <Expandable title="y_axis — Fields">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
            | `label_format` | `string` / `null` | Tooltip or data-label format string |
            | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
            | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
            | `min` | `number` / `null` | Axis minimum; cannot exceed max |
            | `max` | `number` / `null` | Axis maximum |
            | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
            | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
            | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
            | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
            | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
            | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
            | `num_ticks` | `integer` / `null` | Number of ticks |
            | `width` | `number` / `null` | Axis width |
            | `reference_lines` | `object[]` / `null` | Axis reference lines |
            | `zones` | `object[]` / `null` | Highlighted axis regions |

            <Expandable title="reference_lines — Item fields">
              | Field | Type | Description |
              | - | - | - |
              | `value` | `number` / `string` | Reference line position; time axes can use a date string |
              | `stroke` | `string` | Reference line color as a CSS color |
              | `tick` | `object` / `null` | Reference line tick settings |

              <Expandable title="tick — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `show` | `boolean` / `null` | Whether to show the reference line tick |
              </Expandable>
            </Expandable>

            <Expandable title="zones — Item fields">
              | Field | Type | Description |
              | - | - | - |
              | `from` | `number` / `string` / `null` | Start of the highlighted region |
              | `to` | `number` / `string` / `null` | End of the highlighted region |
              | `color` | `string` / `null` | CSS color |
              | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
            </Expandable>
          </Expandable>

          <Expandable title="values_options — Value fields">
            | Field | Type | Description |
            | - | - | - |
            | `color` | `string` | CSS color |
          </Expandable>
        </Tab>

        <Tab title="Counter">
          | Field | Type | Description |
          | - | - | - |
          | `title` | `string` / `null` | Display title |
          | `description` | `string` / `null` | Description |
          | `type` | `string` | Type; Must be `"counter"` |
          | `column_name` | `string` / `null` | Numeric column displayed by the counter |
          | `row_number` | `integer` / `null` | Zero-based result row index; defaults to 0 |
          | `prefix` | `string` / `null` | Value prefix |
          | `suffix` | `string` / `null` | Value suffix |
          | `decimals` | `integer` / `null` | Decimal places; formatting follows the column type when omitted |
          | `colored_positive` | `boolean` / `null` | Whether to color positive values |
          | `colored_negative` | `boolean` / `null` | Whether to color negative values |
          | `label` | `string` / `null` | Display label or category |
        </Tab>
      </Tabs>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/query/visualization/ensure_default \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "query_id": "01900000000070008000000000000001"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "01900000000070008000000000000016",
        "query_id": "01900000000070008000000000000001",
        "name": "Query results",
        "type": "table",
        "options": {},
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0
      }
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/query/visualization/list — List visualizations" id="get-query-visualization-list">
    List visualizations.

    **Method**: `GET`<br />
    **Path**: `/v1/query/visualization/list`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `start` | `integer` | No | Pagination offset, starting at 0; ≥ 0; Default `0` |
    | `limit` | `integer` | No | Maximum number of entries; ≥ 1; ≤ 1000; Default `100` |
    | `order_by` | `string` | No | Sort field; Values: `"id"`, `"name"`, `"created_at"`, `"updated_at"`; Default `"updated_at"` |
    | `direction` | `string` | No | Sort direction; Values: `"asc"`, `"desc"`; Default `"desc"` |
    | `query_id` | `string` | Yes | Query ID; 1–255 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `start` | `integer` | Pagination offset, starting at 0 |
    | `limit` | `integer` | Maximum number of entries |
    | `items` | `object[]` | Entries on this page |
    | `total_count` | `integer` | Total number of matching entries |

    <Expandable title="items — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `query_id` | `string` / `null` | Query ID |
      | `name` | `string` / `null` | Name |
      | `type` | `string` | Type; Values: `"table"`, `"chart"`, `"counter"`, `"pivot"` |
      | `options` | `object` / `null` | Configuration selected by options.type; \{} or null clears it. If display columns are omitted, the website selects them from the result. Nested keys use snake\_case; unknown keys are rejected |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |

      <Expandable title="options — Fields">
        <Tabs>
          <Tab title="Table">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `description` | `string` / `null` | Description |
            | `type` | `string` | Type; Must be `"table"` |
            | `columns` | `object` / `null` | Display settings keyed by result column name |
            | `export_options` | `object` / `null` | Result export settings |

            <Expandable title="columns — Value fields">
              | Field | Type | Description |
              | - | - | - |
              | `name` | `string` / `null` | Name |
              | `title` | `string` / `null` | Display title |
              | `align` | `string` / `null` | Cell alignment; Values: `"left"`, `"center"`, `"right"` |
              | `type` | `string` / `null` | normal displays a regular cell; progress displays a progress bar; Values: `"normal"`, `"progress"` |
              | `format` | `string` / `null` | Number or date format string |
              | `hide` | `boolean` / `null` | Whether to hide the column |
              | `colored_positive` | `boolean` / `null` | Whether to color positive values |
              | `colored_negative` | `boolean` / `null` | Whether to color negative values |
              | `url_template` | `string` / `null` | Cell URL template; \{value} is replaced by the cell value |
            </Expandable>

            <Expandable title="export_options — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `enabled` | `boolean` / `null` | Whether exporting is enabled |
              | `formats` | `string[]` / `null` | Allowed export formats |
              | `filename` | `string` / `null` | Export filename |
              | `include_all_data` | `boolean` / `null` | Whether to export all data |
            </Expandable>
          </Tab>

          <Tab title="Bar / line / area / scatter">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `description` | `string` / `null` | Description |
            | `type` | `string` | Type; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
            | `x_column` | `string` / `null` | Result column for the x-axis |
            | `y_columns` | `string[]` / `null` | Numeric result columns; one series per column, with no duplicates |
            | `x_axis` | `object` / `null` | X-axis settings |
            | `y_axis` | `object` / `null` | Left y-axis settings |
            | `right_y_axis` | `object` / `null` | Right y-axis settings |
            | `legend` | `object` / `null` | Legend settings |
            | `series` | `object` / `null` | Keys are y-column names, or group values when group\_by is enabled |
            | `enable_stacking` | `boolean` / `null` | Whether to stack series |
            | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
            | `show_total_in_tooltip` | `boolean` / `null` | Whether to show the total in tooltips |
            | `group_by` | `string` / `null` | Group series by this column’s values; uses only the first y\_columns entry. An empty string disables grouping |
            | `normalize_to_percentage` | `boolean` / `null` | Normalize grouped values at each x position to 100% |
            | `when_duplicate_x` | `string` / `null` | For duplicate x values: first uses the first row, all keeps every row, sum adds the values; Values: `"first"`, `"all"`, `"sum"` |
            | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

            <Expandable title="x_axis — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
              | `label_format` | `string` / `null` | Tooltip or data-label format string |
              | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
              | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
              | `min` | `number` / `null` | Axis minimum; cannot exceed max |
              | `max` | `number` / `null` | Axis maximum |
              | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
              | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
              | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
              | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
              | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
              | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
              | `num_ticks` | `integer` / `null` | Number of ticks |
              | `width` | `number` / `null` | Axis width |
              | `reference_lines` | `object[]` / `null` | Axis reference lines |
              | `zones` | `object[]` / `null` | Highlighted axis regions |

              <Expandable title="reference_lines — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                | `stroke` | `string` | Reference line color as a CSS color |
                | `tick` | `object` / `null` | Reference line tick settings |

                <Expandable title="tick — Fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `show` | `boolean` / `null` | Whether to show the reference line tick |
                </Expandable>
              </Expandable>

              <Expandable title="zones — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `from` | `number` / `string` / `null` | Start of the highlighted region |
                | `to` | `number` / `string` / `null` | End of the highlighted region |
                | `color` | `string` / `null` | CSS color |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              </Expandable>
            </Expandable>

            <Expandable title="y_axis — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
              | `label_format` | `string` / `null` | Tooltip or data-label format string |
              | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
              | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
              | `min` | `number` / `null` | Axis minimum; cannot exceed max |
              | `max` | `number` / `null` | Axis maximum |
              | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
              | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
              | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
              | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
              | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
              | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
              | `num_ticks` | `integer` / `null` | Number of ticks |
              | `width` | `number` / `null` | Axis width |
              | `reference_lines` | `object[]` / `null` | Axis reference lines |
              | `zones` | `object[]` / `null` | Highlighted axis regions |

              <Expandable title="reference_lines — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                | `stroke` | `string` | Reference line color as a CSS color |
                | `tick` | `object` / `null` | Reference line tick settings |

                <Expandable title="tick — Fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `show` | `boolean` / `null` | Whether to show the reference line tick |
                </Expandable>
              </Expandable>

              <Expandable title="zones — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `from` | `number` / `string` / `null` | Start of the highlighted region |
                | `to` | `number` / `string` / `null` | End of the highlighted region |
                | `color` | `string` / `null` | CSS color |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              </Expandable>
            </Expandable>

            <Expandable title="right_y_axis — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
              | `label_format` | `string` / `null` | Tooltip or data-label format string |
              | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
              | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
              | `min` | `number` / `null` | Axis minimum; cannot exceed max |
              | `max` | `number` / `null` | Axis maximum |
              | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
              | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
              | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
              | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
              | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
              | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
              | `num_ticks` | `integer` / `null` | Number of ticks |
              | `width` | `number` / `null` | Axis width |
              | `reference_lines` | `object[]` / `null` | Axis reference lines |
              | `zones` | `object[]` / `null` | Highlighted axis regions |

              <Expandable title="reference_lines — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                | `stroke` | `string` | Reference line color as a CSS color |
                | `tick` | `object` / `null` | Reference line tick settings |

                <Expandable title="tick — Fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `show` | `boolean` / `null` | Whether to show the reference line tick |
                </Expandable>
              </Expandable>

              <Expandable title="zones — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `from` | `number` / `string` / `null` | Start of the highlighted region |
                | `to` | `number` / `string` / `null` | End of the highlighted region |
                | `color` | `string` / `null` | CSS color |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              </Expandable>
            </Expandable>

            <Expandable title="legend — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
              | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
              | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
            </Expandable>

            <Expandable title="series — Value fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Legend and tooltip title; defaults to the series name |
              | `type` | `string` / `null` | Series chart type; inherits options.type when omitted; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
              | `color` | `string` / `null` | CSS color |
              | `is_right` | `boolean` / `null` | Use the right axis; requires y\_axis.enable\_right\_axis |
              | `connect_nulls` | `boolean` / `null` | Whether lines connect across null values |
              | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              | `silent` | `boolean` / `null` | Whether to disable series interactions |
            </Expandable>
          </Tab>

          <Tab title="Pie">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `description` | `string` / `null` | Description |
            | `type` | `string` | Type; Must be `"pie"` |
            | `label_column` | `string` / `null` | Pie chart category column |
            | `value_column` | `string` / `null` | Pie chart value column |
            | `legend` | `object` / `null` | Legend settings |
            | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
            | `y_axis` | `object` / `null` | Only label\_format is used to format values |
            | `values_options` | `object` / `null` | Map of category values to slice color settings |
            | `series_title` | `string` / `null` | Series name in tooltips |
            | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

            <Expandable title="legend — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
              | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
              | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
            </Expandable>

            <Expandable title="y_axis — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
              | `label_format` | `string` / `null` | Tooltip or data-label format string |
              | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
              | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
              | `min` | `number` / `null` | Axis minimum; cannot exceed max |
              | `max` | `number` / `null` | Axis maximum |
              | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
              | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
              | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
              | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
              | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
              | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
              | `num_ticks` | `integer` / `null` | Number of ticks |
              | `width` | `number` / `null` | Axis width |
              | `reference_lines` | `object[]` / `null` | Axis reference lines |
              | `zones` | `object[]` / `null` | Highlighted axis regions |

              <Expandable title="reference_lines — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                | `stroke` | `string` | Reference line color as a CSS color |
                | `tick` | `object` / `null` | Reference line tick settings |

                <Expandable title="tick — Fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `show` | `boolean` / `null` | Whether to show the reference line tick |
                </Expandable>
              </Expandable>

              <Expandable title="zones — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `from` | `number` / `string` / `null` | Start of the highlighted region |
                | `to` | `number` / `string` / `null` | End of the highlighted region |
                | `color` | `string` / `null` | CSS color |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              </Expandable>
            </Expandable>

            <Expandable title="values_options — Value fields">
              | Field | Type | Description |
              | - | - | - |
              | `color` | `string` | CSS color |
            </Expandable>
          </Tab>

          <Tab title="Counter">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `description` | `string` / `null` | Description |
            | `type` | `string` | Type; Must be `"counter"` |
            | `column_name` | `string` / `null` | Numeric column displayed by the counter |
            | `row_number` | `integer` / `null` | Zero-based result row index; defaults to 0 |
            | `prefix` | `string` / `null` | Value prefix |
            | `suffix` | `string` / `null` | Value suffix |
            | `decimals` | `integer` / `null` | Decimal places; formatting follows the column type when omitted |
            | `colored_positive` | `boolean` / `null` | Whether to color positive values |
            | `colored_negative` | `boolean` / `null` | Whether to color negative values |
            | `label` | `string` / `null` | Display label or category |
          </Tab>
        </Tabs>
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/query/visualization/list \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode query_id=01900000000070008000000000000001 \
      --data-urlencode limit=10
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "items": [
          {
            "id": "01900000000070008000000000000005",
            "query_id": "01900000000070008000000000000001",
            "name": "Asset count",
            "type": "chart",
            "options": {
              "type": "counter",
              "column_name": "row_count",
              "row_number": 0,
              "decimals": 0
            },
            "created_at": 1788220800.0,
            "updated_at": 1788220800.0
          }
        ],
        "total_count": 1,
        "start": 0,
        "limit": 10
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/query/visualization/update — Update a visualization" id="post-query-visualization-update">
    Updates the name or complete `options` without executing SQL. `options` replaces the stored configuration; `{}` or `null` clears it. Omitted top-level fields remain unchanged.

    **Method**: `POST`<br />
    **Path**: `/v1/query/visualization/update`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–255 characters |
    | `name` | `string` / `null` | No | Name; 1–64 characters |
    | `options` | `object` / `null` | No | Configuration selected by options.type; \{} or null clears it. If display columns are omitted, the website selects them from the result. Nested keys use snake\_case; unknown keys are rejected |

    <Expandable title="options — Fields">
      <Tabs>
        <Tab title="Table">
          | Field | Type | Required | Description |
          | - | - | - | - |
          | `title` | `string` / `null` | No | Display title |
          | `description` | `string` / `null` | No | Description |
          | `type` | `string` | Yes | Type; Must be `"table"` |
          | `columns` | `object` / `null` | No | Display settings keyed by result column name |
          | `export_options` | `object` / `null` | No | Result export settings |

          <Expandable title="columns — Value fields">
            | Field | Type | Required | Description |
            | - | - | - | - |
            | `name` | `string` / `null` | No | Name |
            | `title` | `string` / `null` | No | Display title |
            | `align` | `string` / `null` | No | Cell alignment; Values: `"left"`, `"center"`, `"right"` |
            | `type` | `string` / `null` | No | normal displays a regular cell; progress displays a progress bar; Values: `"normal"`, `"progress"` |
            | `format` | `string` / `null` | No | Number or date format string |
            | `hide` | `boolean` / `null` | No | Whether to hide the column |
            | `colored_positive` | `boolean` / `null` | No | Whether to color positive values |
            | `colored_negative` | `boolean` / `null` | No | Whether to color negative values |
            | `url_template` | `string` / `null` | No | Cell URL template; \{value} is replaced by the cell value |
          </Expandable>

          <Expandable title="export_options — Fields">
            | Field | Type | Required | Description |
            | - | - | - | - |
            | `enabled` | `boolean` / `null` | No | Whether exporting is enabled |
            | `formats` | `string[]` / `null` | No | Allowed export formats |
            | `filename` | `string` / `null` | No | Export filename |
            | `include_all_data` | `boolean` / `null` | No | Whether to export all data |
          </Expandable>
        </Tab>

        <Tab title="Bar / line / area / scatter">
          | Field | Type | Required | Description |
          | - | - | - | - |
          | `title` | `string` / `null` | No | Display title |
          | `description` | `string` / `null` | No | Description |
          | `type` | `string` | Yes | Type; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
          | `x_column` | `string` / `null` | No | Result column for the x-axis |
          | `y_columns` | `string[]` / `null` | No | Numeric result columns; one series per column, with no duplicates |
          | `x_axis` | `object` / `null` | No | X-axis settings |
          | `y_axis` | `object` / `null` | No | Left y-axis settings |
          | `right_y_axis` | `object` / `null` | No | Right y-axis settings |
          | `legend` | `object` / `null` | No | Legend settings |
          | `series` | `object` / `null` | No | Keys are y-column names, or group values when group\_by is enabled |
          | `enable_stacking` | `boolean` / `null` | No | Whether to stack series |
          | `show_data_labels` | `boolean` / `null` | No | Whether to show data labels |
          | `show_total_in_tooltip` | `boolean` / `null` | No | Whether to show the total in tooltips |
          | `group_by` | `string` / `null` | No | Group series by this column’s values; uses only the first y\_columns entry. An empty string disables grouping |
          | `normalize_to_percentage` | `boolean` / `null` | No | Normalize grouped values at each x position to 100% |
          | `when_duplicate_x` | `string` / `null` | No | For duplicate x values: first uses the first row, all keeps every row, sum adds the values; Values: `"first"`, `"all"`, `"sum"` |
          | `show_legend` | `boolean` / `null` | No | Legacy legend toggle; use legend.show |

          <Expandable title="x_axis — Fields">
            | Field | Type | Required | Description |
            | - | - | - | - |
            | `title` | `string` / `null` | No | Display title |
            | `tick_format` | `string` / `null` | No | Tick format string, such as YYYY-MM-DD |
            | `label_format` | `string` / `null` | No | Tooltip or data-label format string |
            | `type` | `string` / `null` | No | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
            | `include_zero` | `boolean` / `null` | No | Whether the y-axis includes zero; included when omitted |
            | `min` | `number` / `null` | No | Axis minimum; cannot exceed max |
            | `max` | `number` / `null` | No | Axis maximum |
            | `sort_values` | `boolean` / `null` | No | Whether to sort x-axis values; sorted when omitted |
            | `reverse_values` | `boolean` / `null` | No | Whether to reverse axis order |
            | `enable_right_axis` | `boolean` / `null` | No | Enable the right axis for series with is\_right set |
            | `auto_tick` | `boolean` / `null` | No | Whether to determine ticks automatically |
            | `nice` | `boolean` / `null` | No | Whether to round axis bounds to convenient ticks |
            | `asymmetric_equal_domain` | `boolean` / `null` | No | Whether to expand identical bounds asymmetrically |
            | `num_ticks` | `integer` / `null` | No | Number of ticks; ≥ 1 |
            | `width` | `number` / `null` | No | Axis width; ≥ 0 |
            | `reference_lines` | `object[]` / `null` | No | Axis reference lines |
            | `zones` | `object[]` / `null` | No | Highlighted axis regions |

            <Expandable title="reference_lines — Item fields">
              | Field | Type | Required | Description |
              | - | - | - | - |
              | `value` | `number` / `string` | Yes | Reference line position; time axes can use a date string |
              | `stroke` | `string` | Yes | Reference line color as a CSS color |
              | `tick` | `object` / `null` | No | Reference line tick settings |

              <Expandable title="tick — Fields">
                | Field | Type | Required | Description |
                | - | - | - | - |
                | `show` | `boolean` / `null` | No | Whether to show the reference line tick |
              </Expandable>
            </Expandable>

            <Expandable title="zones — Item fields">
              | Field | Type | Required | Description |
              | - | - | - | - |
              | `from` | `number` / `string` / `null` | No | Start of the highlighted region |
              | `to` | `number` / `string` / `null` | No | End of the highlighted region |
              | `color` | `string` / `null` | No | CSS color |
              | `fill_gradient` | `string[]` / `null` | No | Gradient start and end colors; exactly two CSS colors; 2–2 items |
            </Expandable>
          </Expandable>

          <Expandable title="y_axis — Fields">
            | Field | Type | Required | Description |
            | - | - | - | - |
            | `title` | `string` / `null` | No | Display title |
            | `tick_format` | `string` / `null` | No | Tick format string, such as YYYY-MM-DD |
            | `label_format` | `string` / `null` | No | Tooltip or data-label format string |
            | `type` | `string` / `null` | No | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
            | `include_zero` | `boolean` / `null` | No | Whether the y-axis includes zero; included when omitted |
            | `min` | `number` / `null` | No | Axis minimum; cannot exceed max |
            | `max` | `number` / `null` | No | Axis maximum |
            | `sort_values` | `boolean` / `null` | No | Whether to sort x-axis values; sorted when omitted |
            | `reverse_values` | `boolean` / `null` | No | Whether to reverse axis order |
            | `enable_right_axis` | `boolean` / `null` | No | Enable the right axis for series with is\_right set |
            | `auto_tick` | `boolean` / `null` | No | Whether to determine ticks automatically |
            | `nice` | `boolean` / `null` | No | Whether to round axis bounds to convenient ticks |
            | `asymmetric_equal_domain` | `boolean` / `null` | No | Whether to expand identical bounds asymmetrically |
            | `num_ticks` | `integer` / `null` | No | Number of ticks; ≥ 1 |
            | `width` | `number` / `null` | No | Axis width; ≥ 0 |
            | `reference_lines` | `object[]` / `null` | No | Axis reference lines |
            | `zones` | `object[]` / `null` | No | Highlighted axis regions |

            <Expandable title="reference_lines — Item fields">
              | Field | Type | Required | Description |
              | - | - | - | - |
              | `value` | `number` / `string` | Yes | Reference line position; time axes can use a date string |
              | `stroke` | `string` | Yes | Reference line color as a CSS color |
              | `tick` | `object` / `null` | No | Reference line tick settings |

              <Expandable title="tick — Fields">
                | Field | Type | Required | Description |
                | - | - | - | - |
                | `show` | `boolean` / `null` | No | Whether to show the reference line tick |
              </Expandable>
            </Expandable>

            <Expandable title="zones — Item fields">
              | Field | Type | Required | Description |
              | - | - | - | - |
              | `from` | `number` / `string` / `null` | No | Start of the highlighted region |
              | `to` | `number` / `string` / `null` | No | End of the highlighted region |
              | `color` | `string` / `null` | No | CSS color |
              | `fill_gradient` | `string[]` / `null` | No | Gradient start and end colors; exactly two CSS colors; 2–2 items |
            </Expandable>
          </Expandable>

          <Expandable title="right_y_axis — Fields">
            | Field | Type | Required | Description |
            | - | - | - | - |
            | `title` | `string` / `null` | No | Display title |
            | `tick_format` | `string` / `null` | No | Tick format string, such as YYYY-MM-DD |
            | `label_format` | `string` / `null` | No | Tooltip or data-label format string |
            | `type` | `string` / `null` | No | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
            | `include_zero` | `boolean` / `null` | No | Whether the y-axis includes zero; included when omitted |
            | `min` | `number` / `null` | No | Axis minimum; cannot exceed max |
            | `max` | `number` / `null` | No | Axis maximum |
            | `sort_values` | `boolean` / `null` | No | Whether to sort x-axis values; sorted when omitted |
            | `reverse_values` | `boolean` / `null` | No | Whether to reverse axis order |
            | `enable_right_axis` | `boolean` / `null` | No | Enable the right axis for series with is\_right set |
            | `auto_tick` | `boolean` / `null` | No | Whether to determine ticks automatically |
            | `nice` | `boolean` / `null` | No | Whether to round axis bounds to convenient ticks |
            | `asymmetric_equal_domain` | `boolean` / `null` | No | Whether to expand identical bounds asymmetrically |
            | `num_ticks` | `integer` / `null` | No | Number of ticks; ≥ 1 |
            | `width` | `number` / `null` | No | Axis width; ≥ 0 |
            | `reference_lines` | `object[]` / `null` | No | Axis reference lines |
            | `zones` | `object[]` / `null` | No | Highlighted axis regions |

            <Expandable title="reference_lines — Item fields">
              | Field | Type | Required | Description |
              | - | - | - | - |
              | `value` | `number` / `string` | Yes | Reference line position; time axes can use a date string |
              | `stroke` | `string` | Yes | Reference line color as a CSS color |
              | `tick` | `object` / `null` | No | Reference line tick settings |

              <Expandable title="tick — Fields">
                | Field | Type | Required | Description |
                | - | - | - | - |
                | `show` | `boolean` / `null` | No | Whether to show the reference line tick |
              </Expandable>
            </Expandable>

            <Expandable title="zones — Item fields">
              | Field | Type | Required | Description |
              | - | - | - | - |
              | `from` | `number` / `string` / `null` | No | Start of the highlighted region |
              | `to` | `number` / `string` / `null` | No | End of the highlighted region |
              | `color` | `string` / `null` | No | CSS color |
              | `fill_gradient` | `string[]` / `null` | No | Gradient start and end colors; exactly two CSS colors; 2–2 items |
            </Expandable>
          </Expandable>

          <Expandable title="legend — Fields">
            | Field | Type | Required | Description |
            | - | - | - | - |
            | `show` | `boolean` / `null` | No | Whether to show; legends are shown when omitted |
            | `position` | `string` / `null` | No | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
            | `show_all` | `boolean` / `null` | No | Whether the pie legend lists every category |
          </Expandable>

          <Expandable title="series — Value fields">
            | Field | Type | Required | Description |
            | - | - | - | - |
            | `title` | `string` / `null` | No | Legend and tooltip title; defaults to the series name |
            | `type` | `string` / `null` | No | Series chart type; inherits options.type when omitted; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
            | `color` | `string` / `null` | No | CSS color |
            | `is_right` | `boolean` / `null` | No | Use the right axis; requires y\_axis.enable\_right\_axis |
            | `connect_nulls` | `boolean` / `null` | No | Whether lines connect across null values |
            | `fill_gradient` | `string[]` / `null` | No | Gradient start and end colors; exactly two CSS colors; 2–2 items |
            | `silent` | `boolean` / `null` | No | Whether to disable series interactions |
          </Expandable>
        </Tab>

        <Tab title="Pie">
          | Field | Type | Required | Description |
          | - | - | - | - |
          | `title` | `string` / `null` | No | Display title |
          | `description` | `string` / `null` | No | Description |
          | `type` | `string` | Yes | Type; Must be `"pie"` |
          | `label_column` | `string` / `null` | No | Pie chart category column |
          | `value_column` | `string` / `null` | No | Pie chart value column |
          | `legend` | `object` / `null` | No | Legend settings |
          | `show_data_labels` | `boolean` / `null` | No | Whether to show data labels |
          | `y_axis` | `object` / `null` | No | Only label\_format is used to format values |
          | `values_options` | `object` / `null` | No | Map of category values to slice color settings |
          | `series_title` | `string` / `null` | No | Series name in tooltips |
          | `show_legend` | `boolean` / `null` | No | Legacy legend toggle; use legend.show |

          <Expandable title="legend — Fields">
            | Field | Type | Required | Description |
            | - | - | - | - |
            | `show` | `boolean` / `null` | No | Whether to show; legends are shown when omitted |
            | `position` | `string` / `null` | No | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
            | `show_all` | `boolean` / `null` | No | Whether the pie legend lists every category |
          </Expandable>

          <Expandable title="y_axis — Fields">
            | Field | Type | Required | Description |
            | - | - | - | - |
            | `title` | `string` / `null` | No | Display title |
            | `tick_format` | `string` / `null` | No | Tick format string, such as YYYY-MM-DD |
            | `label_format` | `string` / `null` | No | Tooltip or data-label format string |
            | `type` | `string` / `null` | No | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
            | `include_zero` | `boolean` / `null` | No | Whether the y-axis includes zero; included when omitted |
            | `min` | `number` / `null` | No | Axis minimum; cannot exceed max |
            | `max` | `number` / `null` | No | Axis maximum |
            | `sort_values` | `boolean` / `null` | No | Whether to sort x-axis values; sorted when omitted |
            | `reverse_values` | `boolean` / `null` | No | Whether to reverse axis order |
            | `enable_right_axis` | `boolean` / `null` | No | Enable the right axis for series with is\_right set |
            | `auto_tick` | `boolean` / `null` | No | Whether to determine ticks automatically |
            | `nice` | `boolean` / `null` | No | Whether to round axis bounds to convenient ticks |
            | `asymmetric_equal_domain` | `boolean` / `null` | No | Whether to expand identical bounds asymmetrically |
            | `num_ticks` | `integer` / `null` | No | Number of ticks; ≥ 1 |
            | `width` | `number` / `null` | No | Axis width; ≥ 0 |
            | `reference_lines` | `object[]` / `null` | No | Axis reference lines |
            | `zones` | `object[]` / `null` | No | Highlighted axis regions |

            <Expandable title="reference_lines — Item fields">
              | Field | Type | Required | Description |
              | - | - | - | - |
              | `value` | `number` / `string` | Yes | Reference line position; time axes can use a date string |
              | `stroke` | `string` | Yes | Reference line color as a CSS color |
              | `tick` | `object` / `null` | No | Reference line tick settings |

              <Expandable title="tick — Fields">
                | Field | Type | Required | Description |
                | - | - | - | - |
                | `show` | `boolean` / `null` | No | Whether to show the reference line tick |
              </Expandable>
            </Expandable>

            <Expandable title="zones — Item fields">
              | Field | Type | Required | Description |
              | - | - | - | - |
              | `from` | `number` / `string` / `null` | No | Start of the highlighted region |
              | `to` | `number` / `string` / `null` | No | End of the highlighted region |
              | `color` | `string` / `null` | No | CSS color |
              | `fill_gradient` | `string[]` / `null` | No | Gradient start and end colors; exactly two CSS colors; 2–2 items |
            </Expandable>
          </Expandable>

          <Expandable title="values_options — Value fields">
            | Field | Type | Required | Description |
            | - | - | - | - |
            | `color` | `string` | Yes | CSS color |
          </Expandable>
        </Tab>

        <Tab title="Counter">
          | Field | Type | Required | Description |
          | - | - | - | - |
          | `title` | `string` / `null` | No | Display title |
          | `description` | `string` / `null` | No | Description |
          | `type` | `string` | Yes | Type; Must be `"counter"` |
          | `column_name` | `string` / `null` | No | Numeric column displayed by the counter |
          | `row_number` | `integer` / `null` | No | Zero-based result row index; defaults to 0; ≥ 0 |
          | `prefix` | `string` / `null` | No | Value prefix |
          | `suffix` | `string` / `null` | No | Value suffix |
          | `decimals` | `integer` / `null` | No | Decimal places; formatting follows the column type when omitted; ≥ 0; ≤ 20 |
          | `colored_positive` | `boolean` / `null` | No | Whether to color positive values |
          | `colored_negative` | `boolean` / `null` | No | Whether to color negative values |
          | `label` | `string` / `null` | No | Display label or category |
        </Tab>
      </Tabs>
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `query_id` | `string` / `null` | Query ID |
    | `name` | `string` / `null` | Name |
    | `type` | `string` | Type; Values: `"table"`, `"chart"`, `"counter"`, `"pivot"` |
    | `options` | `object` / `null` | Configuration selected by options.type; \{} or null clears it. If display columns are omitted, the website selects them from the result. Nested keys use snake\_case; unknown keys are rejected |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |

    <Expandable title="options — Fields">
      <Tabs>
        <Tab title="Table">
          | Field | Type | Description |
          | - | - | - |
          | `title` | `string` / `null` | Display title |
          | `description` | `string` / `null` | Description |
          | `type` | `string` | Type; Must be `"table"` |
          | `columns` | `object` / `null` | Display settings keyed by result column name |
          | `export_options` | `object` / `null` | Result export settings |

          <Expandable title="columns — Value fields">
            | Field | Type | Description |
            | - | - | - |
            | `name` | `string` / `null` | Name |
            | `title` | `string` / `null` | Display title |
            | `align` | `string` / `null` | Cell alignment; Values: `"left"`, `"center"`, `"right"` |
            | `type` | `string` / `null` | normal displays a regular cell; progress displays a progress bar; Values: `"normal"`, `"progress"` |
            | `format` | `string` / `null` | Number or date format string |
            | `hide` | `boolean` / `null` | Whether to hide the column |
            | `colored_positive` | `boolean` / `null` | Whether to color positive values |
            | `colored_negative` | `boolean` / `null` | Whether to color negative values |
            | `url_template` | `string` / `null` | Cell URL template; \{value} is replaced by the cell value |
          </Expandable>

          <Expandable title="export_options — Fields">
            | Field | Type | Description |
            | - | - | - |
            | `enabled` | `boolean` / `null` | Whether exporting is enabled |
            | `formats` | `string[]` / `null` | Allowed export formats |
            | `filename` | `string` / `null` | Export filename |
            | `include_all_data` | `boolean` / `null` | Whether to export all data |
          </Expandable>
        </Tab>

        <Tab title="Bar / line / area / scatter">
          | Field | Type | Description |
          | - | - | - |
          | `title` | `string` / `null` | Display title |
          | `description` | `string` / `null` | Description |
          | `type` | `string` | Type; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
          | `x_column` | `string` / `null` | Result column for the x-axis |
          | `y_columns` | `string[]` / `null` | Numeric result columns; one series per column, with no duplicates |
          | `x_axis` | `object` / `null` | X-axis settings |
          | `y_axis` | `object` / `null` | Left y-axis settings |
          | `right_y_axis` | `object` / `null` | Right y-axis settings |
          | `legend` | `object` / `null` | Legend settings |
          | `series` | `object` / `null` | Keys are y-column names, or group values when group\_by is enabled |
          | `enable_stacking` | `boolean` / `null` | Whether to stack series |
          | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
          | `show_total_in_tooltip` | `boolean` / `null` | Whether to show the total in tooltips |
          | `group_by` | `string` / `null` | Group series by this column’s values; uses only the first y\_columns entry. An empty string disables grouping |
          | `normalize_to_percentage` | `boolean` / `null` | Normalize grouped values at each x position to 100% |
          | `when_duplicate_x` | `string` / `null` | For duplicate x values: first uses the first row, all keeps every row, sum adds the values; Values: `"first"`, `"all"`, `"sum"` |
          | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

          <Expandable title="x_axis — Fields">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
            | `label_format` | `string` / `null` | Tooltip or data-label format string |
            | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
            | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
            | `min` | `number` / `null` | Axis minimum; cannot exceed max |
            | `max` | `number` / `null` | Axis maximum |
            | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
            | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
            | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
            | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
            | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
            | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
            | `num_ticks` | `integer` / `null` | Number of ticks |
            | `width` | `number` / `null` | Axis width |
            | `reference_lines` | `object[]` / `null` | Axis reference lines |
            | `zones` | `object[]` / `null` | Highlighted axis regions |

            <Expandable title="reference_lines — Item fields">
              | Field | Type | Description |
              | - | - | - |
              | `value` | `number` / `string` | Reference line position; time axes can use a date string |
              | `stroke` | `string` | Reference line color as a CSS color |
              | `tick` | `object` / `null` | Reference line tick settings |

              <Expandable title="tick — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `show` | `boolean` / `null` | Whether to show the reference line tick |
              </Expandable>
            </Expandable>

            <Expandable title="zones — Item fields">
              | Field | Type | Description |
              | - | - | - |
              | `from` | `number` / `string` / `null` | Start of the highlighted region |
              | `to` | `number` / `string` / `null` | End of the highlighted region |
              | `color` | `string` / `null` | CSS color |
              | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
            </Expandable>
          </Expandable>

          <Expandable title="y_axis — Fields">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
            | `label_format` | `string` / `null` | Tooltip or data-label format string |
            | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
            | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
            | `min` | `number` / `null` | Axis minimum; cannot exceed max |
            | `max` | `number` / `null` | Axis maximum |
            | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
            | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
            | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
            | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
            | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
            | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
            | `num_ticks` | `integer` / `null` | Number of ticks |
            | `width` | `number` / `null` | Axis width |
            | `reference_lines` | `object[]` / `null` | Axis reference lines |
            | `zones` | `object[]` / `null` | Highlighted axis regions |

            <Expandable title="reference_lines — Item fields">
              | Field | Type | Description |
              | - | - | - |
              | `value` | `number` / `string` | Reference line position; time axes can use a date string |
              | `stroke` | `string` | Reference line color as a CSS color |
              | `tick` | `object` / `null` | Reference line tick settings |

              <Expandable title="tick — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `show` | `boolean` / `null` | Whether to show the reference line tick |
              </Expandable>
            </Expandable>

            <Expandable title="zones — Item fields">
              | Field | Type | Description |
              | - | - | - |
              | `from` | `number` / `string` / `null` | Start of the highlighted region |
              | `to` | `number` / `string` / `null` | End of the highlighted region |
              | `color` | `string` / `null` | CSS color |
              | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
            </Expandable>
          </Expandable>

          <Expandable title="right_y_axis — Fields">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
            | `label_format` | `string` / `null` | Tooltip or data-label format string |
            | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
            | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
            | `min` | `number` / `null` | Axis minimum; cannot exceed max |
            | `max` | `number` / `null` | Axis maximum |
            | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
            | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
            | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
            | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
            | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
            | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
            | `num_ticks` | `integer` / `null` | Number of ticks |
            | `width` | `number` / `null` | Axis width |
            | `reference_lines` | `object[]` / `null` | Axis reference lines |
            | `zones` | `object[]` / `null` | Highlighted axis regions |

            <Expandable title="reference_lines — Item fields">
              | Field | Type | Description |
              | - | - | - |
              | `value` | `number` / `string` | Reference line position; time axes can use a date string |
              | `stroke` | `string` | Reference line color as a CSS color |
              | `tick` | `object` / `null` | Reference line tick settings |

              <Expandable title="tick — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `show` | `boolean` / `null` | Whether to show the reference line tick |
              </Expandable>
            </Expandable>

            <Expandable title="zones — Item fields">
              | Field | Type | Description |
              | - | - | - |
              | `from` | `number` / `string` / `null` | Start of the highlighted region |
              | `to` | `number` / `string` / `null` | End of the highlighted region |
              | `color` | `string` / `null` | CSS color |
              | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
            </Expandable>
          </Expandable>

          <Expandable title="legend — Fields">
            | Field | Type | Description |
            | - | - | - |
            | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
            | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
            | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
          </Expandable>

          <Expandable title="series — Value fields">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Legend and tooltip title; defaults to the series name |
            | `type` | `string` / `null` | Series chart type; inherits options.type when omitted; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
            | `color` | `string` / `null` | CSS color |
            | `is_right` | `boolean` / `null` | Use the right axis; requires y\_axis.enable\_right\_axis |
            | `connect_nulls` | `boolean` / `null` | Whether lines connect across null values |
            | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
            | `silent` | `boolean` / `null` | Whether to disable series interactions |
          </Expandable>
        </Tab>

        <Tab title="Pie">
          | Field | Type | Description |
          | - | - | - |
          | `title` | `string` / `null` | Display title |
          | `description` | `string` / `null` | Description |
          | `type` | `string` | Type; Must be `"pie"` |
          | `label_column` | `string` / `null` | Pie chart category column |
          | `value_column` | `string` / `null` | Pie chart value column |
          | `legend` | `object` / `null` | Legend settings |
          | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
          | `y_axis` | `object` / `null` | Only label\_format is used to format values |
          | `values_options` | `object` / `null` | Map of category values to slice color settings |
          | `series_title` | `string` / `null` | Series name in tooltips |
          | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

          <Expandable title="legend — Fields">
            | Field | Type | Description |
            | - | - | - |
            | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
            | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
            | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
          </Expandable>

          <Expandable title="y_axis — Fields">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
            | `label_format` | `string` / `null` | Tooltip or data-label format string |
            | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
            | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
            | `min` | `number` / `null` | Axis minimum; cannot exceed max |
            | `max` | `number` / `null` | Axis maximum |
            | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
            | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
            | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
            | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
            | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
            | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
            | `num_ticks` | `integer` / `null` | Number of ticks |
            | `width` | `number` / `null` | Axis width |
            | `reference_lines` | `object[]` / `null` | Axis reference lines |
            | `zones` | `object[]` / `null` | Highlighted axis regions |

            <Expandable title="reference_lines — Item fields">
              | Field | Type | Description |
              | - | - | - |
              | `value` | `number` / `string` | Reference line position; time axes can use a date string |
              | `stroke` | `string` | Reference line color as a CSS color |
              | `tick` | `object` / `null` | Reference line tick settings |

              <Expandable title="tick — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `show` | `boolean` / `null` | Whether to show the reference line tick |
              </Expandable>
            </Expandable>

            <Expandable title="zones — Item fields">
              | Field | Type | Description |
              | - | - | - |
              | `from` | `number` / `string` / `null` | Start of the highlighted region |
              | `to` | `number` / `string` / `null` | End of the highlighted region |
              | `color` | `string` / `null` | CSS color |
              | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
            </Expandable>
          </Expandable>

          <Expandable title="values_options — Value fields">
            | Field | Type | Description |
            | - | - | - |
            | `color` | `string` | CSS color |
          </Expandable>
        </Tab>

        <Tab title="Counter">
          | Field | Type | Description |
          | - | - | - |
          | `title` | `string` / `null` | Display title |
          | `description` | `string` / `null` | Description |
          | `type` | `string` | Type; Must be `"counter"` |
          | `column_name` | `string` / `null` | Numeric column displayed by the counter |
          | `row_number` | `integer` / `null` | Zero-based result row index; defaults to 0 |
          | `prefix` | `string` / `null` | Value prefix |
          | `suffix` | `string` / `null` | Value suffix |
          | `decimals` | `integer` / `null` | Decimal places; formatting follows the column type when omitted |
          | `colored_positive` | `boolean` / `null` | Whether to color positive values |
          | `colored_negative` | `boolean` / `null` | Whether to color negative values |
          | `label` | `string` / `null` | Display label or category |
        </Tab>
      </Tabs>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/query/visualization/update \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "01900000000070008000000000000005",
      "name": "Total assets",
      "options": {
        "type": "counter",
        "column_name": "row_count",
        "decimals": 0
      }
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "01900000000070008000000000000005",
        "query_id": "01900000000070008000000000000001",
        "name": "Total assets",
        "type": "chart",
        "options": {
          "type": "counter",
          "column_name": "row_count",
          "decimals": 0
        },
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### dashboard

<AccordionGroup>
  <Accordion title="GET /v1/dashboard — Get a Dashboard" id="get-dashboard">
    Get a Dashboard.

    **Method**: `GET`<br />
    **Path**: `/v1/dashboard`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–32 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `space` | `string` | Space ID |
    | `name` | `string` / `null` | Name |
    | `options` | `object` | Configuration object |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `space_entity` | `object` / `null` | Details of the owning Space |
    | `widgets` | `object[]` | Widgets in detail, create, and update responses; omitted from lists |
    | `is_starred` | `boolean` | Whether the calling user has starred the resource; returned in details, or lists with with\_star=true or sorting by star\_count |
    | `star_count` | `integer` | Number of stars; returned in details, or lists with with\_star=true or sorting by star\_count |

    <Expandable title="options — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `layout` | `object` / `null` | Widget positions by screen size |

      <Expandable title="layout — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `lg` | `object` / `null` | Desktop layout with 6 columns; keys are Widget IDs, and x + w must not exceed 6 |
        | `sm` | `object` / `null` | Mobile layout with 1 column; keys are Widget IDs, and x must be 0 |

        <Expandable title="lg — Value fields">
          | Field | Type | Description |
          | - | - | - |
          | `x` | `integer` | Zero-based grid column |
          | `y` | `integer` | Zero-based grid row |
          | `w` | `integer` | Width in grid columns |
          | `h` | `integer` | Height in grid rows |
          | `min_w` | `integer` / `null` | Minimum width in grid columns; legacy layout field |
          | `min_h` | `integer` / `null` | Minimum height in grid rows; legacy layout field |
          | `max_w` | `integer` / `null` | Maximum width in grid columns; legacy layout field |
          | `max_h` | `integer` / `null` | Maximum height in grid rows; legacy layout field |
        </Expandable>

        <Expandable title="sm — Value fields">
          | Field | Type | Description |
          | - | - | - |
          | `x` | `integer` | Zero-based grid column |
          | `y` | `integer` | Zero-based grid row |
          | `w` | `integer` | Width in grid columns |
          | `h` | `integer` | Height in grid rows |
          | `min_w` | `integer` / `null` | Minimum width in grid columns; legacy layout field |
          | `min_h` | `integer` / `null` | Minimum height in grid rows; legacy layout field |
          | `max_w` | `integer` / `null` | Maximum width in grid columns; legacy layout field |
          | `max_h` | `integer` / `null` | Maximum height in grid rows; legacy layout field |
        </Expandable>
      </Expandable>
    </Expandable>

    <Expandable title="space_entity — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `description` | `string` / `null` | Description |
      | `account_id` | `string` | Account ID |
      | `status` | `string` | Status |
      | `visibility` | `string` | Visibility: public, org, or private |
      | `dep_count` | `integer` | Dependency count |
      | `content_count` | `integer` | Number of content entries |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    <Expandable title="widgets — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `dashboard_id` | `string` / `null` | Dashboard ID |
      | `type` | `string` | Type; Values: `"text"`, `"visualization"`, `"parameter"` |
      | `visualization_id` | `string` / `null` | Visualization ID |
      | `text_content` | `string` / `null` | Markdown text |
      | `options` | `object` | Display configuration; writes accept only \{} or null. Use the Visualization for chart settings and the Dashboard layout for positioning |
      | `entities` | `object[]` | Related resource list |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `entities_map` | `object` | Related content indexed by resource type and ID |
      | `visualization` | `object` / `null` | Referenced visualization; null if unreadable or deleted |
      | `parameters` | `object[]` / `null` | Parameter definitions |
      | `code` | `string` / `null` | Executable code; SQL for a Query |
      | `space_entity` | `object` / `null` | Details of the owning Space |
      | `query_name` | `string` / `null` | Referenced Query name; null if unavailable |

      <Expandable title="entities — Item fields">
        | Field | Type | Description |
        | - | - | - |
        | `type` | `string` | Type; Values: `"query"`, `"dashboard"`, `"notebook"`, `"table"`, `"field"`, `"function"`, `"contract"`, `"chain"`, `"schedule"`, `"page"`, `"issue"` |
        | `id` | `string` | Unique object ID |
        | `raw` | `string` | Original resource-reference text in the content |
      </Expandable>

      <Expandable title="entities_map — By resource type">
        <Expandable title="Resource fields by ID">
          | Field | Type | Description |
          | - | - | - |
          | `id` | `string` | Unique object ID |
          | `space` | `string` | Space ID |
          | `name` | `string` / `null` | Name |
          | `created_at` | `number` | Creation time in Unix seconds |
          | `updated_at` | `number` | Last update time in Unix seconds |
        </Expandable>
      </Expandable>

      <Expandable title="visualization — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `query_id` | `string` / `null` | Query ID |
        | `name` | `string` / `null` | Name |
        | `type` | `string` | Type; Values: `"table"`, `"chart"`, `"counter"`, `"pivot"` |
        | `options` | `object` / `null` | Configuration selected by options.type; \{} or null clears it. If display columns are omitted, the website selects them from the result. Nested keys use snake\_case; unknown keys are rejected |
        | `created_at` | `number` | Creation time in Unix seconds |
        | `updated_at` | `number` | Last update time in Unix seconds |

        <Expandable title="options — Fields">
          <Tabs>
            <Tab title="Table">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `description` | `string` / `null` | Description |
              | `type` | `string` | Type; Must be `"table"` |
              | `columns` | `object` / `null` | Display settings keyed by result column name |
              | `export_options` | `object` / `null` | Result export settings |

              <Expandable title="columns — Value fields">
                | Field | Type | Description |
                | - | - | - |
                | `name` | `string` / `null` | Name |
                | `title` | `string` / `null` | Display title |
                | `align` | `string` / `null` | Cell alignment; Values: `"left"`, `"center"`, `"right"` |
                | `type` | `string` / `null` | normal displays a regular cell; progress displays a progress bar; Values: `"normal"`, `"progress"` |
                | `format` | `string` / `null` | Number or date format string |
                | `hide` | `boolean` / `null` | Whether to hide the column |
                | `colored_positive` | `boolean` / `null` | Whether to color positive values |
                | `colored_negative` | `boolean` / `null` | Whether to color negative values |
                | `url_template` | `string` / `null` | Cell URL template; \{value} is replaced by the cell value |
              </Expandable>

              <Expandable title="export_options — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `enabled` | `boolean` / `null` | Whether exporting is enabled |
                | `formats` | `string[]` / `null` | Allowed export formats |
                | `filename` | `string` / `null` | Export filename |
                | `include_all_data` | `boolean` / `null` | Whether to export all data |
              </Expandable>
            </Tab>

            <Tab title="Bar / line / area / scatter">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `description` | `string` / `null` | Description |
              | `type` | `string` | Type; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
              | `x_column` | `string` / `null` | Result column for the x-axis |
              | `y_columns` | `string[]` / `null` | Numeric result columns; one series per column, with no duplicates |
              | `x_axis` | `object` / `null` | X-axis settings |
              | `y_axis` | `object` / `null` | Left y-axis settings |
              | `right_y_axis` | `object` / `null` | Right y-axis settings |
              | `legend` | `object` / `null` | Legend settings |
              | `series` | `object` / `null` | Keys are y-column names, or group values when group\_by is enabled |
              | `enable_stacking` | `boolean` / `null` | Whether to stack series |
              | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
              | `show_total_in_tooltip` | `boolean` / `null` | Whether to show the total in tooltips |
              | `group_by` | `string` / `null` | Group series by this column’s values; uses only the first y\_columns entry. An empty string disables grouping |
              | `normalize_to_percentage` | `boolean` / `null` | Normalize grouped values at each x position to 100% |
              | `when_duplicate_x` | `string` / `null` | For duplicate x values: first uses the first row, all keeps every row, sum adds the values; Values: `"first"`, `"all"`, `"sum"` |
              | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

              <Expandable title="x_axis — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `title` | `string` / `null` | Display title |
                | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
                | `label_format` | `string` / `null` | Tooltip or data-label format string |
                | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
                | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
                | `min` | `number` / `null` | Axis minimum; cannot exceed max |
                | `max` | `number` / `null` | Axis maximum |
                | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
                | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
                | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
                | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
                | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
                | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
                | `num_ticks` | `integer` / `null` | Number of ticks |
                | `width` | `number` / `null` | Axis width |
                | `reference_lines` | `object[]` / `null` | Axis reference lines |
                | `zones` | `object[]` / `null` | Highlighted axis regions |

                <Expandable title="reference_lines — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                  | `stroke` | `string` | Reference line color as a CSS color |
                  | `tick` | `object` / `null` | Reference line tick settings |

                  <Expandable title="tick — Fields">
                    | Field | Type | Description |
                    | - | - | - |
                    | `show` | `boolean` / `null` | Whether to show the reference line tick |
                  </Expandable>
                </Expandable>

                <Expandable title="zones — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `from` | `number` / `string` / `null` | Start of the highlighted region |
                  | `to` | `number` / `string` / `null` | End of the highlighted region |
                  | `color` | `string` / `null` | CSS color |
                  | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
                </Expandable>
              </Expandable>

              <Expandable title="y_axis — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `title` | `string` / `null` | Display title |
                | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
                | `label_format` | `string` / `null` | Tooltip or data-label format string |
                | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
                | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
                | `min` | `number` / `null` | Axis minimum; cannot exceed max |
                | `max` | `number` / `null` | Axis maximum |
                | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
                | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
                | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
                | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
                | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
                | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
                | `num_ticks` | `integer` / `null` | Number of ticks |
                | `width` | `number` / `null` | Axis width |
                | `reference_lines` | `object[]` / `null` | Axis reference lines |
                | `zones` | `object[]` / `null` | Highlighted axis regions |

                <Expandable title="reference_lines — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                  | `stroke` | `string` | Reference line color as a CSS color |
                  | `tick` | `object` / `null` | Reference line tick settings |

                  <Expandable title="tick — Fields">
                    | Field | Type | Description |
                    | - | - | - |
                    | `show` | `boolean` / `null` | Whether to show the reference line tick |
                  </Expandable>
                </Expandable>

                <Expandable title="zones — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `from` | `number` / `string` / `null` | Start of the highlighted region |
                  | `to` | `number` / `string` / `null` | End of the highlighted region |
                  | `color` | `string` / `null` | CSS color |
                  | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
                </Expandable>
              </Expandable>

              <Expandable title="right_y_axis — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `title` | `string` / `null` | Display title |
                | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
                | `label_format` | `string` / `null` | Tooltip or data-label format string |
                | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
                | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
                | `min` | `number` / `null` | Axis minimum; cannot exceed max |
                | `max` | `number` / `null` | Axis maximum |
                | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
                | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
                | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
                | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
                | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
                | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
                | `num_ticks` | `integer` / `null` | Number of ticks |
                | `width` | `number` / `null` | Axis width |
                | `reference_lines` | `object[]` / `null` | Axis reference lines |
                | `zones` | `object[]` / `null` | Highlighted axis regions |

                <Expandable title="reference_lines — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                  | `stroke` | `string` | Reference line color as a CSS color |
                  | `tick` | `object` / `null` | Reference line tick settings |

                  <Expandable title="tick — Fields">
                    | Field | Type | Description |
                    | - | - | - |
                    | `show` | `boolean` / `null` | Whether to show the reference line tick |
                  </Expandable>
                </Expandable>

                <Expandable title="zones — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `from` | `number` / `string` / `null` | Start of the highlighted region |
                  | `to` | `number` / `string` / `null` | End of the highlighted region |
                  | `color` | `string` / `null` | CSS color |
                  | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
                </Expandable>
              </Expandable>

              <Expandable title="legend — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
                | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
                | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
              </Expandable>

              <Expandable title="series — Value fields">
                | Field | Type | Description |
                | - | - | - |
                | `title` | `string` / `null` | Legend and tooltip title; defaults to the series name |
                | `type` | `string` / `null` | Series chart type; inherits options.type when omitted; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
                | `color` | `string` / `null` | CSS color |
                | `is_right` | `boolean` / `null` | Use the right axis; requires y\_axis.enable\_right\_axis |
                | `connect_nulls` | `boolean` / `null` | Whether lines connect across null values |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
                | `silent` | `boolean` / `null` | Whether to disable series interactions |
              </Expandable>
            </Tab>

            <Tab title="Pie">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `description` | `string` / `null` | Description |
              | `type` | `string` | Type; Must be `"pie"` |
              | `label_column` | `string` / `null` | Pie chart category column |
              | `value_column` | `string` / `null` | Pie chart value column |
              | `legend` | `object` / `null` | Legend settings |
              | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
              | `y_axis` | `object` / `null` | Only label\_format is used to format values |
              | `values_options` | `object` / `null` | Map of category values to slice color settings |
              | `series_title` | `string` / `null` | Series name in tooltips |
              | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

              <Expandable title="legend — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
                | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
                | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
              </Expandable>

              <Expandable title="y_axis — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `title` | `string` / `null` | Display title |
                | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
                | `label_format` | `string` / `null` | Tooltip or data-label format string |
                | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
                | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
                | `min` | `number` / `null` | Axis minimum; cannot exceed max |
                | `max` | `number` / `null` | Axis maximum |
                | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
                | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
                | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
                | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
                | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
                | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
                | `num_ticks` | `integer` / `null` | Number of ticks |
                | `width` | `number` / `null` | Axis width |
                | `reference_lines` | `object[]` / `null` | Axis reference lines |
                | `zones` | `object[]` / `null` | Highlighted axis regions |

                <Expandable title="reference_lines — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                  | `stroke` | `string` | Reference line color as a CSS color |
                  | `tick` | `object` / `null` | Reference line tick settings |

                  <Expandable title="tick — Fields">
                    | Field | Type | Description |
                    | - | - | - |
                    | `show` | `boolean` / `null` | Whether to show the reference line tick |
                  </Expandable>
                </Expandable>

                <Expandable title="zones — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `from` | `number` / `string` / `null` | Start of the highlighted region |
                  | `to` | `number` / `string` / `null` | End of the highlighted region |
                  | `color` | `string` / `null` | CSS color |
                  | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
                </Expandable>
              </Expandable>

              <Expandable title="values_options — Value fields">
                | Field | Type | Description |
                | - | - | - |
                | `color` | `string` | CSS color |
              </Expandable>
            </Tab>

            <Tab title="Counter">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `description` | `string` / `null` | Description |
              | `type` | `string` | Type; Must be `"counter"` |
              | `column_name` | `string` / `null` | Numeric column displayed by the counter |
              | `row_number` | `integer` / `null` | Zero-based result row index; defaults to 0 |
              | `prefix` | `string` / `null` | Value prefix |
              | `suffix` | `string` / `null` | Value suffix |
              | `decimals` | `integer` / `null` | Decimal places; formatting follows the column type when omitted |
              | `colored_positive` | `boolean` / `null` | Whether to color positive values |
              | `colored_negative` | `boolean` / `null` | Whether to color negative values |
              | `label` | `string` / `null` | Display label or category |
            </Tab>
          </Tabs>
        </Expandable>
      </Expandable>

      <Expandable title="parameters — Item fields">
        | Field | Type | Description |
        | - | - | - |
        | `name` | `string` | Name |
        | `type` | `string` | Logical parameter type; see [Data types](/reference/data-types) |
        | `options` | `JSON[]` / `null` | Allowed choices for the parameter |
        | `default` | `object` / `null` | Default parameter value |
        | `id` | `string` / `null` | Parameter display ID stored with the definition |
        | `order` | `integer` / `null` | Omit for every parameter, or use consecutive values from 0 |

        <Expandable title="default — Fields">
          | Field | Type | Description |
          | - | - | - |
          | `value` | `JSON` | Argument value |
        </Expandable>
      </Expandable>

      <Expandable title="space_entity — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `description` | `string` / `null` | Description |
        | `account_id` | `string` | Account ID |
        | `status` | `string` | Status |
        | `visibility` | `string` | Visibility: public, org, or private |
        | `dep_count` | `integer` | Dependency count |
        | `content_count` | `integer` | Number of content entries |
        | `created_at` | `number` | Creation time in Unix seconds |
        | `updated_at` | `number` | Last update time in Unix seconds |
        | `account` | `object` / `null` | Account details |

        <Expandable title="account — Fields">
          | Field | Type | Description |
          | - | - | - |
          | `id` | `string` | Unique object ID |
          | `type` | `string` | Account type: personal or org |
          | `slug` | `string` / `null` | Account slug used for display and URLs |
          | `display_name` | `string` / `null` | Account display name |
          | `avatar_url` | `string` / `null` | Avatar URL |
          | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
        </Expandable>
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/dashboard \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode id=01900000000070008000000000000003
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "01900000000070008000000000000003",
        "space": "demo",
        "name": "Asset overview",
        "options": {},
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "space_entity": {
          "id": "demo",
          "description": "Example resources",
          "account_id": "0190000000007000800000000000000b",
          "status": "active",
          "visibility": "public",
          "dep_count": 0,
          "content_count": 6,
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "account": {
            "id": "0190000000007000800000000000000b",
            "type": "org",
            "slug": "example-team",
            "display_name": "Example team",
            "avatar_url": null,
            "avatar_thumbnail_url": null
          }
        },
        "widgets": [
          {
            "id": "01900000000070008000000000000004",
            "dashboard_id": "01900000000070008000000000000003",
            "type": "visualization",
            "visualization_id": "01900000000070008000000000000005",
            "text_content": null,
            "options": {},
            "entities": [],
            "created_at": 1788220800.0,
            "updated_at": 1788220800.0,
            "visualization": {
              "id": "01900000000070008000000000000005",
              "query_id": "01900000000070008000000000000001",
              "name": "Asset count",
              "type": "chart",
              "options": {
                "type": "counter",
                "column_name": "row_count",
                "row_number": 0,
                "decimals": 0
              },
              "created_at": 1788220800.0,
              "updated_at": 1788220800.0
            },
            "parameters": [],
            "code": "SELECT COUNT(*) AS row_count FROM demo.asset_notes",
            "space_entity": {
              "id": "demo",
              "description": "Example resources",
              "account_id": "0190000000007000800000000000000b",
              "status": "active",
              "visibility": "public",
              "dep_count": 0,
              "content_count": 6,
              "created_at": 1788220800.0,
              "updated_at": 1788220800.0,
              "account": {
                "id": "0190000000007000800000000000000b",
                "type": "org",
                "slug": "example-team",
                "display_name": "Example team",
                "avatar_url": null,
                "avatar_thumbnail_url": null
              }
            },
            "query_name": "Asset count",
            "entities_map": {}
          }
        ],
        "is_starred": false,
        "star_count": 0
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/dashboard/create — Create a Dashboard" id="post-dashboard-create">
    Supply the Dashboard `id`, then add text or visualizations through the Widget endpoints.

    **Method**: `POST`<br />
    **Path**: `/v1/dashboard/create`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–32 characters |
    | `name` | `string` | Yes | Name; 1–64 characters |
    | `options` | `object` / `null` | No | Configuration object |
    | `space` | `string` | Yes | Space ID; 1–64 characters |

    <Expandable title="options — Fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `layout` | `object` / `null` | No | Widget positions by screen size |

      <Expandable title="layout — Fields">
        | Field | Type | Required | Description |
        | - | - | - | - |
        | `lg` | `object` / `null` | No | Desktop layout with 6 columns; keys are Widget IDs, and x + w must not exceed 6 |
        | `sm` | `object` / `null` | No | Mobile layout with 1 column; keys are Widget IDs, and x must be 0 |

        <Expandable title="lg — Value fields">
          | Field | Type | Required | Description |
          | - | - | - | - |
          | `x` | `integer` | Yes | Zero-based grid column; ≥ 0 |
          | `y` | `integer` | Yes | Zero-based grid row; ≥ 0 |
          | `w` | `integer` | Yes | Width in grid columns; ≥ 1; ≤ 6 |
          | `h` | `integer` | Yes | Height in grid rows; ≥ 1 |
          | `min_w` | `integer` / `null` | No | Minimum width in grid columns; legacy layout field; ≥ 1 |
          | `min_h` | `integer` / `null` | No | Minimum height in grid rows; legacy layout field; ≥ 1 |
          | `max_w` | `integer` / `null` | No | Maximum width in grid columns; legacy layout field; ≥ 1 |
          | `max_h` | `integer` / `null` | No | Maximum height in grid rows; legacy layout field; ≥ 1 |
        </Expandable>

        <Expandable title="sm — Value fields">
          | Field | Type | Required | Description |
          | - | - | - | - |
          | `x` | `integer` | Yes | Zero-based grid column; ≥ 0 |
          | `y` | `integer` | Yes | Zero-based grid row; ≥ 0 |
          | `w` | `integer` | Yes | Width in grid columns; ≥ 1; ≤ 6 |
          | `h` | `integer` | Yes | Height in grid rows; ≥ 1 |
          | `min_w` | `integer` / `null` | No | Minimum width in grid columns; legacy layout field; ≥ 1 |
          | `min_h` | `integer` / `null` | No | Minimum height in grid rows; legacy layout field; ≥ 1 |
          | `max_w` | `integer` / `null` | No | Maximum width in grid columns; legacy layout field; ≥ 1 |
          | `max_h` | `integer` / `null` | No | Maximum height in grid rows; legacy layout field; ≥ 1 |
        </Expandable>
      </Expandable>
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `space` | `string` | Space ID |
    | `name` | `string` / `null` | Name |
    | `options` | `object` | Configuration object |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `space_entity` | `object` / `null` | Details of the owning Space |
    | `widgets` | `object[]` | Widgets in detail, create, and update responses; omitted from lists |
    | `is_starred` | `boolean` | Whether the calling user has starred the resource; returned in details, or lists with with\_star=true or sorting by star\_count |
    | `star_count` | `integer` | Number of stars; returned in details, or lists with with\_star=true or sorting by star\_count |

    <Expandable title="options — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `layout` | `object` / `null` | Widget positions by screen size |

      <Expandable title="layout — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `lg` | `object` / `null` | Desktop layout with 6 columns; keys are Widget IDs, and x + w must not exceed 6 |
        | `sm` | `object` / `null` | Mobile layout with 1 column; keys are Widget IDs, and x must be 0 |

        <Expandable title="lg — Value fields">
          | Field | Type | Description |
          | - | - | - |
          | `x` | `integer` | Zero-based grid column |
          | `y` | `integer` | Zero-based grid row |
          | `w` | `integer` | Width in grid columns |
          | `h` | `integer` | Height in grid rows |
          | `min_w` | `integer` / `null` | Minimum width in grid columns; legacy layout field |
          | `min_h` | `integer` / `null` | Minimum height in grid rows; legacy layout field |
          | `max_w` | `integer` / `null` | Maximum width in grid columns; legacy layout field |
          | `max_h` | `integer` / `null` | Maximum height in grid rows; legacy layout field |
        </Expandable>

        <Expandable title="sm — Value fields">
          | Field | Type | Description |
          | - | - | - |
          | `x` | `integer` | Zero-based grid column |
          | `y` | `integer` | Zero-based grid row |
          | `w` | `integer` | Width in grid columns |
          | `h` | `integer` | Height in grid rows |
          | `min_w` | `integer` / `null` | Minimum width in grid columns; legacy layout field |
          | `min_h` | `integer` / `null` | Minimum height in grid rows; legacy layout field |
          | `max_w` | `integer` / `null` | Maximum width in grid columns; legacy layout field |
          | `max_h` | `integer` / `null` | Maximum height in grid rows; legacy layout field |
        </Expandable>
      </Expandable>
    </Expandable>

    <Expandable title="space_entity — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `description` | `string` / `null` | Description |
      | `account_id` | `string` | Account ID |
      | `status` | `string` | Status |
      | `visibility` | `string` | Visibility: public, org, or private |
      | `dep_count` | `integer` | Dependency count |
      | `content_count` | `integer` | Number of content entries |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    <Expandable title="widgets — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `dashboard_id` | `string` / `null` | Dashboard ID |
      | `type` | `string` | Type; Values: `"text"`, `"visualization"`, `"parameter"` |
      | `visualization_id` | `string` / `null` | Visualization ID |
      | `text_content` | `string` / `null` | Markdown text |
      | `options` | `object` | Display configuration; writes accept only \{} or null. Use the Visualization for chart settings and the Dashboard layout for positioning |
      | `entities` | `object[]` | Related resource list |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `entities_map` | `object` | Related content indexed by resource type and ID |
      | `visualization` | `object` / `null` | Referenced visualization; null if unreadable or deleted |
      | `parameters` | `object[]` / `null` | Parameter definitions |
      | `code` | `string` / `null` | Executable code; SQL for a Query |
      | `space_entity` | `object` / `null` | Details of the owning Space |
      | `query_name` | `string` / `null` | Referenced Query name; null if unavailable |

      <Expandable title="entities — Item fields">
        | Field | Type | Description |
        | - | - | - |
        | `type` | `string` | Type; Values: `"query"`, `"dashboard"`, `"notebook"`, `"table"`, `"field"`, `"function"`, `"contract"`, `"chain"`, `"schedule"`, `"page"`, `"issue"` |
        | `id` | `string` | Unique object ID |
        | `raw` | `string` | Original resource-reference text in the content |
      </Expandable>

      <Expandable title="entities_map — By resource type">
        <Expandable title="Resource fields by ID">
          | Field | Type | Description |
          | - | - | - |
          | `id` | `string` | Unique object ID |
          | `space` | `string` | Space ID |
          | `name` | `string` / `null` | Name |
          | `created_at` | `number` | Creation time in Unix seconds |
          | `updated_at` | `number` | Last update time in Unix seconds |
        </Expandable>
      </Expandable>

      <Expandable title="visualization — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `query_id` | `string` / `null` | Query ID |
        | `name` | `string` / `null` | Name |
        | `type` | `string` | Type; Values: `"table"`, `"chart"`, `"counter"`, `"pivot"` |
        | `options` | `object` / `null` | Configuration selected by options.type; \{} or null clears it. If display columns are omitted, the website selects them from the result. Nested keys use snake\_case; unknown keys are rejected |
        | `created_at` | `number` | Creation time in Unix seconds |
        | `updated_at` | `number` | Last update time in Unix seconds |

        <Expandable title="options — Fields">
          <Tabs>
            <Tab title="Table">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `description` | `string` / `null` | Description |
              | `type` | `string` | Type; Must be `"table"` |
              | `columns` | `object` / `null` | Display settings keyed by result column name |
              | `export_options` | `object` / `null` | Result export settings |

              <Expandable title="columns — Value fields">
                | Field | Type | Description |
                | - | - | - |
                | `name` | `string` / `null` | Name |
                | `title` | `string` / `null` | Display title |
                | `align` | `string` / `null` | Cell alignment; Values: `"left"`, `"center"`, `"right"` |
                | `type` | `string` / `null` | normal displays a regular cell; progress displays a progress bar; Values: `"normal"`, `"progress"` |
                | `format` | `string` / `null` | Number or date format string |
                | `hide` | `boolean` / `null` | Whether to hide the column |
                | `colored_positive` | `boolean` / `null` | Whether to color positive values |
                | `colored_negative` | `boolean` / `null` | Whether to color negative values |
                | `url_template` | `string` / `null` | Cell URL template; \{value} is replaced by the cell value |
              </Expandable>

              <Expandable title="export_options — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `enabled` | `boolean` / `null` | Whether exporting is enabled |
                | `formats` | `string[]` / `null` | Allowed export formats |
                | `filename` | `string` / `null` | Export filename |
                | `include_all_data` | `boolean` / `null` | Whether to export all data |
              </Expandable>
            </Tab>

            <Tab title="Bar / line / area / scatter">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `description` | `string` / `null` | Description |
              | `type` | `string` | Type; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
              | `x_column` | `string` / `null` | Result column for the x-axis |
              | `y_columns` | `string[]` / `null` | Numeric result columns; one series per column, with no duplicates |
              | `x_axis` | `object` / `null` | X-axis settings |
              | `y_axis` | `object` / `null` | Left y-axis settings |
              | `right_y_axis` | `object` / `null` | Right y-axis settings |
              | `legend` | `object` / `null` | Legend settings |
              | `series` | `object` / `null` | Keys are y-column names, or group values when group\_by is enabled |
              | `enable_stacking` | `boolean` / `null` | Whether to stack series |
              | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
              | `show_total_in_tooltip` | `boolean` / `null` | Whether to show the total in tooltips |
              | `group_by` | `string` / `null` | Group series by this column’s values; uses only the first y\_columns entry. An empty string disables grouping |
              | `normalize_to_percentage` | `boolean` / `null` | Normalize grouped values at each x position to 100% |
              | `when_duplicate_x` | `string` / `null` | For duplicate x values: first uses the first row, all keeps every row, sum adds the values; Values: `"first"`, `"all"`, `"sum"` |
              | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

              <Expandable title="x_axis — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `title` | `string` / `null` | Display title |
                | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
                | `label_format` | `string` / `null` | Tooltip or data-label format string |
                | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
                | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
                | `min` | `number` / `null` | Axis minimum; cannot exceed max |
                | `max` | `number` / `null` | Axis maximum |
                | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
                | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
                | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
                | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
                | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
                | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
                | `num_ticks` | `integer` / `null` | Number of ticks |
                | `width` | `number` / `null` | Axis width |
                | `reference_lines` | `object[]` / `null` | Axis reference lines |
                | `zones` | `object[]` / `null` | Highlighted axis regions |

                <Expandable title="reference_lines — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                  | `stroke` | `string` | Reference line color as a CSS color |
                  | `tick` | `object` / `null` | Reference line tick settings |

                  <Expandable title="tick — Fields">
                    | Field | Type | Description |
                    | - | - | - |
                    | `show` | `boolean` / `null` | Whether to show the reference line tick |
                  </Expandable>
                </Expandable>

                <Expandable title="zones — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `from` | `number` / `string` / `null` | Start of the highlighted region |
                  | `to` | `number` / `string` / `null` | End of the highlighted region |
                  | `color` | `string` / `null` | CSS color |
                  | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
                </Expandable>
              </Expandable>

              <Expandable title="y_axis — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `title` | `string` / `null` | Display title |
                | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
                | `label_format` | `string` / `null` | Tooltip or data-label format string |
                | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
                | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
                | `min` | `number` / `null` | Axis minimum; cannot exceed max |
                | `max` | `number` / `null` | Axis maximum |
                | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
                | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
                | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
                | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
                | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
                | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
                | `num_ticks` | `integer` / `null` | Number of ticks |
                | `width` | `number` / `null` | Axis width |
                | `reference_lines` | `object[]` / `null` | Axis reference lines |
                | `zones` | `object[]` / `null` | Highlighted axis regions |

                <Expandable title="reference_lines — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                  | `stroke` | `string` | Reference line color as a CSS color |
                  | `tick` | `object` / `null` | Reference line tick settings |

                  <Expandable title="tick — Fields">
                    | Field | Type | Description |
                    | - | - | - |
                    | `show` | `boolean` / `null` | Whether to show the reference line tick |
                  </Expandable>
                </Expandable>

                <Expandable title="zones — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `from` | `number` / `string` / `null` | Start of the highlighted region |
                  | `to` | `number` / `string` / `null` | End of the highlighted region |
                  | `color` | `string` / `null` | CSS color |
                  | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
                </Expandable>
              </Expandable>

              <Expandable title="right_y_axis — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `title` | `string` / `null` | Display title |
                | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
                | `label_format` | `string` / `null` | Tooltip or data-label format string |
                | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
                | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
                | `min` | `number` / `null` | Axis minimum; cannot exceed max |
                | `max` | `number` / `null` | Axis maximum |
                | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
                | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
                | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
                | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
                | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
                | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
                | `num_ticks` | `integer` / `null` | Number of ticks |
                | `width` | `number` / `null` | Axis width |
                | `reference_lines` | `object[]` / `null` | Axis reference lines |
                | `zones` | `object[]` / `null` | Highlighted axis regions |

                <Expandable title="reference_lines — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                  | `stroke` | `string` | Reference line color as a CSS color |
                  | `tick` | `object` / `null` | Reference line tick settings |

                  <Expandable title="tick — Fields">
                    | Field | Type | Description |
                    | - | - | - |
                    | `show` | `boolean` / `null` | Whether to show the reference line tick |
                  </Expandable>
                </Expandable>

                <Expandable title="zones — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `from` | `number` / `string` / `null` | Start of the highlighted region |
                  | `to` | `number` / `string` / `null` | End of the highlighted region |
                  | `color` | `string` / `null` | CSS color |
                  | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
                </Expandable>
              </Expandable>

              <Expandable title="legend — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
                | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
                | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
              </Expandable>

              <Expandable title="series — Value fields">
                | Field | Type | Description |
                | - | - | - |
                | `title` | `string` / `null` | Legend and tooltip title; defaults to the series name |
                | `type` | `string` / `null` | Series chart type; inherits options.type when omitted; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
                | `color` | `string` / `null` | CSS color |
                | `is_right` | `boolean` / `null` | Use the right axis; requires y\_axis.enable\_right\_axis |
                | `connect_nulls` | `boolean` / `null` | Whether lines connect across null values |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
                | `silent` | `boolean` / `null` | Whether to disable series interactions |
              </Expandable>
            </Tab>

            <Tab title="Pie">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `description` | `string` / `null` | Description |
              | `type` | `string` | Type; Must be `"pie"` |
              | `label_column` | `string` / `null` | Pie chart category column |
              | `value_column` | `string` / `null` | Pie chart value column |
              | `legend` | `object` / `null` | Legend settings |
              | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
              | `y_axis` | `object` / `null` | Only label\_format is used to format values |
              | `values_options` | `object` / `null` | Map of category values to slice color settings |
              | `series_title` | `string` / `null` | Series name in tooltips |
              | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

              <Expandable title="legend — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
                | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
                | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
              </Expandable>

              <Expandable title="y_axis — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `title` | `string` / `null` | Display title |
                | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
                | `label_format` | `string` / `null` | Tooltip or data-label format string |
                | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
                | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
                | `min` | `number` / `null` | Axis minimum; cannot exceed max |
                | `max` | `number` / `null` | Axis maximum |
                | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
                | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
                | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
                | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
                | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
                | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
                | `num_ticks` | `integer` / `null` | Number of ticks |
                | `width` | `number` / `null` | Axis width |
                | `reference_lines` | `object[]` / `null` | Axis reference lines |
                | `zones` | `object[]` / `null` | Highlighted axis regions |

                <Expandable title="reference_lines — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                  | `stroke` | `string` | Reference line color as a CSS color |
                  | `tick` | `object` / `null` | Reference line tick settings |

                  <Expandable title="tick — Fields">
                    | Field | Type | Description |
                    | - | - | - |
                    | `show` | `boolean` / `null` | Whether to show the reference line tick |
                  </Expandable>
                </Expandable>

                <Expandable title="zones — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `from` | `number` / `string` / `null` | Start of the highlighted region |
                  | `to` | `number` / `string` / `null` | End of the highlighted region |
                  | `color` | `string` / `null` | CSS color |
                  | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
                </Expandable>
              </Expandable>

              <Expandable title="values_options — Value fields">
                | Field | Type | Description |
                | - | - | - |
                | `color` | `string` | CSS color |
              </Expandable>
            </Tab>

            <Tab title="Counter">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `description` | `string` / `null` | Description |
              | `type` | `string` | Type; Must be `"counter"` |
              | `column_name` | `string` / `null` | Numeric column displayed by the counter |
              | `row_number` | `integer` / `null` | Zero-based result row index; defaults to 0 |
              | `prefix` | `string` / `null` | Value prefix |
              | `suffix` | `string` / `null` | Value suffix |
              | `decimals` | `integer` / `null` | Decimal places; formatting follows the column type when omitted |
              | `colored_positive` | `boolean` / `null` | Whether to color positive values |
              | `colored_negative` | `boolean` / `null` | Whether to color negative values |
              | `label` | `string` / `null` | Display label or category |
            </Tab>
          </Tabs>
        </Expandable>
      </Expandable>

      <Expandable title="parameters — Item fields">
        | Field | Type | Description |
        | - | - | - |
        | `name` | `string` | Name |
        | `type` | `string` | Logical parameter type; see [Data types](/reference/data-types) |
        | `options` | `JSON[]` / `null` | Allowed choices for the parameter |
        | `default` | `object` / `null` | Default parameter value |
        | `id` | `string` / `null` | Parameter display ID stored with the definition |
        | `order` | `integer` / `null` | Omit for every parameter, or use consecutive values from 0 |

        <Expandable title="default — Fields">
          | Field | Type | Description |
          | - | - | - |
          | `value` | `JSON` | Argument value |
        </Expandable>
      </Expandable>

      <Expandable title="space_entity — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `description` | `string` / `null` | Description |
        | `account_id` | `string` | Account ID |
        | `status` | `string` | Status |
        | `visibility` | `string` | Visibility: public, org, or private |
        | `dep_count` | `integer` | Dependency count |
        | `content_count` | `integer` | Number of content entries |
        | `created_at` | `number` | Creation time in Unix seconds |
        | `updated_at` | `number` | Last update time in Unix seconds |
        | `account` | `object` / `null` | Account details |

        <Expandable title="account — Fields">
          | Field | Type | Description |
          | - | - | - |
          | `id` | `string` | Unique object ID |
          | `type` | `string` | Account type: personal or org |
          | `slug` | `string` / `null` | Account slug used for display and URLs |
          | `display_name` | `string` / `null` | Account display name |
          | `avatar_url` | `string` / `null` | Avatar URL |
          | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
        </Expandable>
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/dashboard/create \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "01900000000070008000000000000003",
      "space": "demo",
      "name": "Asset overview"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "01900000000070008000000000000003",
        "space": "demo",
        "name": "Asset overview",
        "options": {},
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "space_entity": {
          "id": "demo",
          "description": "Example resources",
          "account_id": "0190000000007000800000000000000b",
          "status": "active",
          "visibility": "public",
          "dep_count": 0,
          "content_count": 6,
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "account": {
            "id": "0190000000007000800000000000000b",
            "type": "org",
            "slug": "example-team",
            "display_name": "Example team",
            "avatar_url": null,
            "avatar_thumbnail_url": null
          }
        },
        "widgets": [],
        "is_starred": false,
        "star_count": 0
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/dashboard/delete — Delete a Dashboard" id="post-dashboard-delete">
    Delete a Dashboard.

    **Method**: `POST`<br />
    **Path**: `/v1/dashboard/delete`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–32 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `data` | `null` | Operation completed with no response data |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/dashboard/delete \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "01900000000070008000000000000003"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": null
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/dashboard/list — List Dashboards" id="get-dashboard-list">
    List Dashboards.

    **Method**: `GET`<br />
    **Path**: `/v1/dashboard/list`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `start` | `integer` | No | Pagination offset, starting at 0; ≥ 0; Default `0` |
    | `limit` | `integer` | No | Maximum number of entries; ≥ 1; ≤ 100; Default `10` |
    | `order_by` | `string` | No | Sort field; Values: `"id"`, `"name"`, `"created_at"`, `"updated_at"`, `"star_count"`; Default `"updated_at"` |
    | `direction` | `string` | No | Sort direction; Values: `"asc"`, `"desc"`; Default `"desc"` |
    | `space` | `string` / `null` | No | Filter by Space; when omitted, list resources in visible Spaces; 1–64 characters |
    | `name` | `string` / `null` | No | Name substring filter |
    | `with_star` | `boolean` | No | Include star information; Default `false` |
    | `with_schedule` | `boolean` | No | Include schedule information; Default `false` |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `start` | `integer` | Pagination offset, starting at 0 |
    | `limit` | `integer` | Maximum number of entries |
    | `items` | `object[]` | Entries on this page |
    | `total_count` | `integer` | Total number of matching entries |

    <Expandable title="items — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `space` | `string` | Space ID |
      | `name` | `string` / `null` | Name |
      | `options` | `object` | Configuration object |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `space_entity` | `object` / `null` | Details of the owning Space |
      | `is_starred` | `boolean` | Whether the calling user has starred the resource; returned in details, or lists with with\_star=true or sorting by star\_count |
      | `star_count` | `integer` | Number of stars; returned in details, or lists with with\_star=true or sorting by star\_count |
      | `schedule` | `object` / `null` | Schedule configuration snapshot returned only with with\_schedule=true; null if none exists |

      <Expandable title="options — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `layout` | `object` / `null` | Widget positions by screen size |

        <Expandable title="layout — Fields">
          | Field | Type | Description |
          | - | - | - |
          | `lg` | `object` / `null` | Desktop layout with 6 columns; keys are Widget IDs, and x + w must not exceed 6 |
          | `sm` | `object` / `null` | Mobile layout with 1 column; keys are Widget IDs, and x must be 0 |

          <Expandable title="lg — Value fields">
            | Field | Type | Description |
            | - | - | - |
            | `x` | `integer` | Zero-based grid column |
            | `y` | `integer` | Zero-based grid row |
            | `w` | `integer` | Width in grid columns |
            | `h` | `integer` | Height in grid rows |
            | `min_w` | `integer` / `null` | Minimum width in grid columns; legacy layout field |
            | `min_h` | `integer` / `null` | Minimum height in grid rows; legacy layout field |
            | `max_w` | `integer` / `null` | Maximum width in grid columns; legacy layout field |
            | `max_h` | `integer` / `null` | Maximum height in grid rows; legacy layout field |
          </Expandable>

          <Expandable title="sm — Value fields">
            | Field | Type | Description |
            | - | - | - |
            | `x` | `integer` | Zero-based grid column |
            | `y` | `integer` | Zero-based grid row |
            | `w` | `integer` | Width in grid columns |
            | `h` | `integer` | Height in grid rows |
            | `min_w` | `integer` / `null` | Minimum width in grid columns; legacy layout field |
            | `min_h` | `integer` / `null` | Minimum height in grid rows; legacy layout field |
            | `max_w` | `integer` / `null` | Maximum width in grid columns; legacy layout field |
            | `max_h` | `integer` / `null` | Maximum height in grid rows; legacy layout field |
          </Expandable>
        </Expandable>
      </Expandable>

      <Expandable title="space_entity — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `description` | `string` / `null` | Description |
        | `account_id` | `string` | Account ID |
        | `status` | `string` | Status |
        | `visibility` | `string` | Visibility: public, org, or private |
        | `dep_count` | `integer` | Dependency count |
        | `content_count` | `integer` | Number of content entries |
        | `created_at` | `number` | Creation time in Unix seconds |
        | `updated_at` | `number` | Last update time in Unix seconds |
        | `account` | `object` / `null` | Account details |

        <Expandable title="account — Fields">
          | Field | Type | Description |
          | - | - | - |
          | `id` | `string` | Unique object ID |
          | `type` | `string` | Account type: personal or org |
          | `slug` | `string` / `null` | Account slug used for display and URLs |
          | `display_name` | `string` / `null` | Account display name |
          | `avatar_url` | `string` / `null` | Avatar URL |
          | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
        </Expandable>
      </Expandable>

      <Expandable title="schedule — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `space` | `string` | Space ID |
        | `content_type` | `string` / `null` | Target content type |
        | `content_id` | `string` / `null` | Target content ID |
        | `cron` | `string` / `null` | Cron expression |
        | `arguments` | `object[]` | Argument values for this execution |
        | `name` | `string` / `null` | Name |
        | `mode` | `string` / `null` | Schedule mode |
        | `max_cpu` | `integer` / `null` | CPU allocation; 100 represents 1 vCPU |
        | `max_memory` | `integer` / `null` | Memory allocation in bytes |
        | `created_at` | `number` | Creation time in Unix seconds |
        | `updated_at` | `number` | Last update time in Unix seconds |

        <Expandable title="arguments — Item fields">
          | Field | Type | Description |
          | - | - | - |
          | `value` | `JSON` | Argument value |
          | `name` | `string` / `null` | Name of the matching parameter |
          | `order` | `integer` / `null` | Omit for every argument, or use consecutive values from 0 to determine argument order |
        </Expandable>
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/dashboard/list \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode space=demo \
      --data-urlencode limit=10
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "items": [
          {
            "id": "01900000000070008000000000000003",
            "space": "demo",
            "name": "Asset overview",
            "options": {},
            "created_at": 1788220800.0,
            "updated_at": 1788220800.0,
            "space_entity": {
              "id": "demo",
              "description": "Example resources",
              "account_id": "0190000000007000800000000000000b",
              "status": "active",
              "visibility": "public",
              "dep_count": 0,
              "content_count": 6,
              "created_at": 1788220800.0,
              "updated_at": 1788220800.0,
              "account": {
                "id": "0190000000007000800000000000000b",
                "type": "org",
                "slug": "example-team",
                "display_name": "Example team",
                "avatar_url": null,
                "avatar_thumbnail_url": null
              }
            }
          }
        ],
        "total_count": 1,
        "start": 0,
        "limit": 10
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/dashboard/update — Update a Dashboard" id="post-dashboard-update">
    Updates the name, complete layout, or owning Space. `options` replaces the stored layout. `target_space` must be an editable Space in the same account.

    **Method**: `POST`<br />
    **Path**: `/v1/dashboard/update`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–32 characters |
    | `name` | `string` | No | Name; 1–64 characters |
    | `options` | `object` / `null` | No | Configuration object |
    | `target_space` | `string` | No | Target Space ID; 1–64 characters |

    <Expandable title="options — Fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `layout` | `object` / `null` | No | Widget positions by screen size |

      <Expandable title="layout — Fields">
        | Field | Type | Required | Description |
        | - | - | - | - |
        | `lg` | `object` / `null` | No | Desktop layout with 6 columns; keys are Widget IDs, and x + w must not exceed 6 |
        | `sm` | `object` / `null` | No | Mobile layout with 1 column; keys are Widget IDs, and x must be 0 |

        <Expandable title="lg — Value fields">
          | Field | Type | Required | Description |
          | - | - | - | - |
          | `x` | `integer` | Yes | Zero-based grid column; ≥ 0 |
          | `y` | `integer` | Yes | Zero-based grid row; ≥ 0 |
          | `w` | `integer` | Yes | Width in grid columns; ≥ 1; ≤ 6 |
          | `h` | `integer` | Yes | Height in grid rows; ≥ 1 |
          | `min_w` | `integer` / `null` | No | Minimum width in grid columns; legacy layout field; ≥ 1 |
          | `min_h` | `integer` / `null` | No | Minimum height in grid rows; legacy layout field; ≥ 1 |
          | `max_w` | `integer` / `null` | No | Maximum width in grid columns; legacy layout field; ≥ 1 |
          | `max_h` | `integer` / `null` | No | Maximum height in grid rows; legacy layout field; ≥ 1 |
        </Expandable>

        <Expandable title="sm — Value fields">
          | Field | Type | Required | Description |
          | - | - | - | - |
          | `x` | `integer` | Yes | Zero-based grid column; ≥ 0 |
          | `y` | `integer` | Yes | Zero-based grid row; ≥ 0 |
          | `w` | `integer` | Yes | Width in grid columns; ≥ 1; ≤ 6 |
          | `h` | `integer` | Yes | Height in grid rows; ≥ 1 |
          | `min_w` | `integer` / `null` | No | Minimum width in grid columns; legacy layout field; ≥ 1 |
          | `min_h` | `integer` / `null` | No | Minimum height in grid rows; legacy layout field; ≥ 1 |
          | `max_w` | `integer` / `null` | No | Maximum width in grid columns; legacy layout field; ≥ 1 |
          | `max_h` | `integer` / `null` | No | Maximum height in grid rows; legacy layout field; ≥ 1 |
        </Expandable>
      </Expandable>
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `space` | `string` | Space ID |
    | `name` | `string` / `null` | Name |
    | `options` | `object` | Configuration object |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `space_entity` | `object` / `null` | Details of the owning Space |
    | `widgets` | `object[]` | Widgets in detail, create, and update responses; omitted from lists |
    | `is_starred` | `boolean` | Whether the calling user has starred the resource; returned in details, or lists with with\_star=true or sorting by star\_count |
    | `star_count` | `integer` | Number of stars; returned in details, or lists with with\_star=true or sorting by star\_count |

    <Expandable title="options — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `layout` | `object` / `null` | Widget positions by screen size |

      <Expandable title="layout — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `lg` | `object` / `null` | Desktop layout with 6 columns; keys are Widget IDs, and x + w must not exceed 6 |
        | `sm` | `object` / `null` | Mobile layout with 1 column; keys are Widget IDs, and x must be 0 |

        <Expandable title="lg — Value fields">
          | Field | Type | Description |
          | - | - | - |
          | `x` | `integer` | Zero-based grid column |
          | `y` | `integer` | Zero-based grid row |
          | `w` | `integer` | Width in grid columns |
          | `h` | `integer` | Height in grid rows |
          | `min_w` | `integer` / `null` | Minimum width in grid columns; legacy layout field |
          | `min_h` | `integer` / `null` | Minimum height in grid rows; legacy layout field |
          | `max_w` | `integer` / `null` | Maximum width in grid columns; legacy layout field |
          | `max_h` | `integer` / `null` | Maximum height in grid rows; legacy layout field |
        </Expandable>

        <Expandable title="sm — Value fields">
          | Field | Type | Description |
          | - | - | - |
          | `x` | `integer` | Zero-based grid column |
          | `y` | `integer` | Zero-based grid row |
          | `w` | `integer` | Width in grid columns |
          | `h` | `integer` | Height in grid rows |
          | `min_w` | `integer` / `null` | Minimum width in grid columns; legacy layout field |
          | `min_h` | `integer` / `null` | Minimum height in grid rows; legacy layout field |
          | `max_w` | `integer` / `null` | Maximum width in grid columns; legacy layout field |
          | `max_h` | `integer` / `null` | Maximum height in grid rows; legacy layout field |
        </Expandable>
      </Expandable>
    </Expandable>

    <Expandable title="space_entity — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `description` | `string` / `null` | Description |
      | `account_id` | `string` | Account ID |
      | `status` | `string` | Status |
      | `visibility` | `string` | Visibility: public, org, or private |
      | `dep_count` | `integer` | Dependency count |
      | `content_count` | `integer` | Number of content entries |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    <Expandable title="widgets — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `dashboard_id` | `string` / `null` | Dashboard ID |
      | `type` | `string` | Type; Values: `"text"`, `"visualization"`, `"parameter"` |
      | `visualization_id` | `string` / `null` | Visualization ID |
      | `text_content` | `string` / `null` | Markdown text |
      | `options` | `object` | Display configuration; writes accept only \{} or null. Use the Visualization for chart settings and the Dashboard layout for positioning |
      | `entities` | `object[]` | Related resource list |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `entities_map` | `object` | Related content indexed by resource type and ID |
      | `visualization` | `object` / `null` | Referenced visualization; null if unreadable or deleted |
      | `parameters` | `object[]` / `null` | Parameter definitions |
      | `code` | `string` / `null` | Executable code; SQL for a Query |
      | `space_entity` | `object` / `null` | Details of the owning Space |
      | `query_name` | `string` / `null` | Referenced Query name; null if unavailable |

      <Expandable title="entities — Item fields">
        | Field | Type | Description |
        | - | - | - |
        | `type` | `string` | Type; Values: `"query"`, `"dashboard"`, `"notebook"`, `"table"`, `"field"`, `"function"`, `"contract"`, `"chain"`, `"schedule"`, `"page"`, `"issue"` |
        | `id` | `string` | Unique object ID |
        | `raw` | `string` | Original resource-reference text in the content |
      </Expandable>

      <Expandable title="entities_map — By resource type">
        <Expandable title="Resource fields by ID">
          | Field | Type | Description |
          | - | - | - |
          | `id` | `string` | Unique object ID |
          | `space` | `string` | Space ID |
          | `name` | `string` / `null` | Name |
          | `created_at` | `number` | Creation time in Unix seconds |
          | `updated_at` | `number` | Last update time in Unix seconds |
        </Expandable>
      </Expandable>

      <Expandable title="visualization — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `query_id` | `string` / `null` | Query ID |
        | `name` | `string` / `null` | Name |
        | `type` | `string` | Type; Values: `"table"`, `"chart"`, `"counter"`, `"pivot"` |
        | `options` | `object` / `null` | Configuration selected by options.type; \{} or null clears it. If display columns are omitted, the website selects them from the result. Nested keys use snake\_case; unknown keys are rejected |
        | `created_at` | `number` | Creation time in Unix seconds |
        | `updated_at` | `number` | Last update time in Unix seconds |

        <Expandable title="options — Fields">
          <Tabs>
            <Tab title="Table">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `description` | `string` / `null` | Description |
              | `type` | `string` | Type; Must be `"table"` |
              | `columns` | `object` / `null` | Display settings keyed by result column name |
              | `export_options` | `object` / `null` | Result export settings |

              <Expandable title="columns — Value fields">
                | Field | Type | Description |
                | - | - | - |
                | `name` | `string` / `null` | Name |
                | `title` | `string` / `null` | Display title |
                | `align` | `string` / `null` | Cell alignment; Values: `"left"`, `"center"`, `"right"` |
                | `type` | `string` / `null` | normal displays a regular cell; progress displays a progress bar; Values: `"normal"`, `"progress"` |
                | `format` | `string` / `null` | Number or date format string |
                | `hide` | `boolean` / `null` | Whether to hide the column |
                | `colored_positive` | `boolean` / `null` | Whether to color positive values |
                | `colored_negative` | `boolean` / `null` | Whether to color negative values |
                | `url_template` | `string` / `null` | Cell URL template; \{value} is replaced by the cell value |
              </Expandable>

              <Expandable title="export_options — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `enabled` | `boolean` / `null` | Whether exporting is enabled |
                | `formats` | `string[]` / `null` | Allowed export formats |
                | `filename` | `string` / `null` | Export filename |
                | `include_all_data` | `boolean` / `null` | Whether to export all data |
              </Expandable>
            </Tab>

            <Tab title="Bar / line / area / scatter">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `description` | `string` / `null` | Description |
              | `type` | `string` | Type; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
              | `x_column` | `string` / `null` | Result column for the x-axis |
              | `y_columns` | `string[]` / `null` | Numeric result columns; one series per column, with no duplicates |
              | `x_axis` | `object` / `null` | X-axis settings |
              | `y_axis` | `object` / `null` | Left y-axis settings |
              | `right_y_axis` | `object` / `null` | Right y-axis settings |
              | `legend` | `object` / `null` | Legend settings |
              | `series` | `object` / `null` | Keys are y-column names, or group values when group\_by is enabled |
              | `enable_stacking` | `boolean` / `null` | Whether to stack series |
              | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
              | `show_total_in_tooltip` | `boolean` / `null` | Whether to show the total in tooltips |
              | `group_by` | `string` / `null` | Group series by this column’s values; uses only the first y\_columns entry. An empty string disables grouping |
              | `normalize_to_percentage` | `boolean` / `null` | Normalize grouped values at each x position to 100% |
              | `when_duplicate_x` | `string` / `null` | For duplicate x values: first uses the first row, all keeps every row, sum adds the values; Values: `"first"`, `"all"`, `"sum"` |
              | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

              <Expandable title="x_axis — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `title` | `string` / `null` | Display title |
                | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
                | `label_format` | `string` / `null` | Tooltip or data-label format string |
                | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
                | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
                | `min` | `number` / `null` | Axis minimum; cannot exceed max |
                | `max` | `number` / `null` | Axis maximum |
                | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
                | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
                | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
                | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
                | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
                | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
                | `num_ticks` | `integer` / `null` | Number of ticks |
                | `width` | `number` / `null` | Axis width |
                | `reference_lines` | `object[]` / `null` | Axis reference lines |
                | `zones` | `object[]` / `null` | Highlighted axis regions |

                <Expandable title="reference_lines — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                  | `stroke` | `string` | Reference line color as a CSS color |
                  | `tick` | `object` / `null` | Reference line tick settings |

                  <Expandable title="tick — Fields">
                    | Field | Type | Description |
                    | - | - | - |
                    | `show` | `boolean` / `null` | Whether to show the reference line tick |
                  </Expandable>
                </Expandable>

                <Expandable title="zones — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `from` | `number` / `string` / `null` | Start of the highlighted region |
                  | `to` | `number` / `string` / `null` | End of the highlighted region |
                  | `color` | `string` / `null` | CSS color |
                  | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
                </Expandable>
              </Expandable>

              <Expandable title="y_axis — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `title` | `string` / `null` | Display title |
                | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
                | `label_format` | `string` / `null` | Tooltip or data-label format string |
                | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
                | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
                | `min` | `number` / `null` | Axis minimum; cannot exceed max |
                | `max` | `number` / `null` | Axis maximum |
                | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
                | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
                | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
                | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
                | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
                | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
                | `num_ticks` | `integer` / `null` | Number of ticks |
                | `width` | `number` / `null` | Axis width |
                | `reference_lines` | `object[]` / `null` | Axis reference lines |
                | `zones` | `object[]` / `null` | Highlighted axis regions |

                <Expandable title="reference_lines — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                  | `stroke` | `string` | Reference line color as a CSS color |
                  | `tick` | `object` / `null` | Reference line tick settings |

                  <Expandable title="tick — Fields">
                    | Field | Type | Description |
                    | - | - | - |
                    | `show` | `boolean` / `null` | Whether to show the reference line tick |
                  </Expandable>
                </Expandable>

                <Expandable title="zones — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `from` | `number` / `string` / `null` | Start of the highlighted region |
                  | `to` | `number` / `string` / `null` | End of the highlighted region |
                  | `color` | `string` / `null` | CSS color |
                  | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
                </Expandable>
              </Expandable>

              <Expandable title="right_y_axis — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `title` | `string` / `null` | Display title |
                | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
                | `label_format` | `string` / `null` | Tooltip or data-label format string |
                | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
                | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
                | `min` | `number` / `null` | Axis minimum; cannot exceed max |
                | `max` | `number` / `null` | Axis maximum |
                | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
                | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
                | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
                | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
                | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
                | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
                | `num_ticks` | `integer` / `null` | Number of ticks |
                | `width` | `number` / `null` | Axis width |
                | `reference_lines` | `object[]` / `null` | Axis reference lines |
                | `zones` | `object[]` / `null` | Highlighted axis regions |

                <Expandable title="reference_lines — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                  | `stroke` | `string` | Reference line color as a CSS color |
                  | `tick` | `object` / `null` | Reference line tick settings |

                  <Expandable title="tick — Fields">
                    | Field | Type | Description |
                    | - | - | - |
                    | `show` | `boolean` / `null` | Whether to show the reference line tick |
                  </Expandable>
                </Expandable>

                <Expandable title="zones — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `from` | `number` / `string` / `null` | Start of the highlighted region |
                  | `to` | `number` / `string` / `null` | End of the highlighted region |
                  | `color` | `string` / `null` | CSS color |
                  | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
                </Expandable>
              </Expandable>

              <Expandable title="legend — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
                | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
                | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
              </Expandable>

              <Expandable title="series — Value fields">
                | Field | Type | Description |
                | - | - | - |
                | `title` | `string` / `null` | Legend and tooltip title; defaults to the series name |
                | `type` | `string` / `null` | Series chart type; inherits options.type when omitted; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
                | `color` | `string` / `null` | CSS color |
                | `is_right` | `boolean` / `null` | Use the right axis; requires y\_axis.enable\_right\_axis |
                | `connect_nulls` | `boolean` / `null` | Whether lines connect across null values |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
                | `silent` | `boolean` / `null` | Whether to disable series interactions |
              </Expandable>
            </Tab>

            <Tab title="Pie">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `description` | `string` / `null` | Description |
              | `type` | `string` | Type; Must be `"pie"` |
              | `label_column` | `string` / `null` | Pie chart category column |
              | `value_column` | `string` / `null` | Pie chart value column |
              | `legend` | `object` / `null` | Legend settings |
              | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
              | `y_axis` | `object` / `null` | Only label\_format is used to format values |
              | `values_options` | `object` / `null` | Map of category values to slice color settings |
              | `series_title` | `string` / `null` | Series name in tooltips |
              | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

              <Expandable title="legend — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
                | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
                | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
              </Expandable>

              <Expandable title="y_axis — Fields">
                | Field | Type | Description |
                | - | - | - |
                | `title` | `string` / `null` | Display title |
                | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
                | `label_format` | `string` / `null` | Tooltip or data-label format string |
                | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
                | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
                | `min` | `number` / `null` | Axis minimum; cannot exceed max |
                | `max` | `number` / `null` | Axis maximum |
                | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
                | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
                | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
                | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
                | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
                | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
                | `num_ticks` | `integer` / `null` | Number of ticks |
                | `width` | `number` / `null` | Axis width |
                | `reference_lines` | `object[]` / `null` | Axis reference lines |
                | `zones` | `object[]` / `null` | Highlighted axis regions |

                <Expandable title="reference_lines — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                  | `stroke` | `string` | Reference line color as a CSS color |
                  | `tick` | `object` / `null` | Reference line tick settings |

                  <Expandable title="tick — Fields">
                    | Field | Type | Description |
                    | - | - | - |
                    | `show` | `boolean` / `null` | Whether to show the reference line tick |
                  </Expandable>
                </Expandable>

                <Expandable title="zones — Item fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `from` | `number` / `string` / `null` | Start of the highlighted region |
                  | `to` | `number` / `string` / `null` | End of the highlighted region |
                  | `color` | `string` / `null` | CSS color |
                  | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
                </Expandable>
              </Expandable>

              <Expandable title="values_options — Value fields">
                | Field | Type | Description |
                | - | - | - |
                | `color` | `string` | CSS color |
              </Expandable>
            </Tab>

            <Tab title="Counter">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `description` | `string` / `null` | Description |
              | `type` | `string` | Type; Must be `"counter"` |
              | `column_name` | `string` / `null` | Numeric column displayed by the counter |
              | `row_number` | `integer` / `null` | Zero-based result row index; defaults to 0 |
              | `prefix` | `string` / `null` | Value prefix |
              | `suffix` | `string` / `null` | Value suffix |
              | `decimals` | `integer` / `null` | Decimal places; formatting follows the column type when omitted |
              | `colored_positive` | `boolean` / `null` | Whether to color positive values |
              | `colored_negative` | `boolean` / `null` | Whether to color negative values |
              | `label` | `string` / `null` | Display label or category |
            </Tab>
          </Tabs>
        </Expandable>
      </Expandable>

      <Expandable title="parameters — Item fields">
        | Field | Type | Description |
        | - | - | - |
        | `name` | `string` | Name |
        | `type` | `string` | Logical parameter type; see [Data types](/reference/data-types) |
        | `options` | `JSON[]` / `null` | Allowed choices for the parameter |
        | `default` | `object` / `null` | Default parameter value |
        | `id` | `string` / `null` | Parameter display ID stored with the definition |
        | `order` | `integer` / `null` | Omit for every parameter, or use consecutive values from 0 |

        <Expandable title="default — Fields">
          | Field | Type | Description |
          | - | - | - |
          | `value` | `JSON` | Argument value |
        </Expandable>
      </Expandable>

      <Expandable title="space_entity — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `description` | `string` / `null` | Description |
        | `account_id` | `string` | Account ID |
        | `status` | `string` | Status |
        | `visibility` | `string` | Visibility: public, org, or private |
        | `dep_count` | `integer` | Dependency count |
        | `content_count` | `integer` | Number of content entries |
        | `created_at` | `number` | Creation time in Unix seconds |
        | `updated_at` | `number` | Last update time in Unix seconds |
        | `account` | `object` / `null` | Account details |

        <Expandable title="account — Fields">
          | Field | Type | Description |
          | - | - | - |
          | `id` | `string` | Unique object ID |
          | `type` | `string` | Account type: personal or org |
          | `slug` | `string` / `null` | Account slug used for display and URLs |
          | `display_name` | `string` / `null` | Account display name |
          | `avatar_url` | `string` / `null` | Avatar URL |
          | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
        </Expandable>
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/dashboard/update \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "01900000000070008000000000000003",
      "options": {
        "layout": {
          "lg": {
            "01900000000070008000000000000004": {
              "x": 0,
              "y": 0,
              "w": 3,
              "h": 8
            }
          },
          "sm": {
            "01900000000070008000000000000004": {
              "x": 0,
              "y": 0,
              "w": 1,
              "h": 8
            }
          }
        }
      }
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "01900000000070008000000000000003",
        "space": "demo",
        "name": "Asset overview",
        "options": {
          "layout": {
            "lg": {
              "01900000000070008000000000000004": {
                "x": 0,
                "y": 0,
                "w": 3,
                "h": 8
              }
            },
            "sm": {
              "01900000000070008000000000000004": {
                "x": 0,
                "y": 0,
                "w": 1,
                "h": 8
              }
            }
          }
        },
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "space_entity": {
          "id": "demo",
          "description": "Example resources",
          "account_id": "0190000000007000800000000000000b",
          "status": "active",
          "visibility": "public",
          "dep_count": 0,
          "content_count": 6,
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "account": {
            "id": "0190000000007000800000000000000b",
            "type": "org",
            "slug": "example-team",
            "display_name": "Example team",
            "avatar_url": null,
            "avatar_thumbnail_url": null
          }
        },
        "widgets": [],
        "is_starred": false,
        "star_count": 0
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/dashboard/widget/create — Add a Widget" id="post-dashboard-widget-create">
    Adds text or an existing visualization. `visualization_id` is required for `type=visualization` and disallowed for other types. Chart settings belong to the Visualization; positioning belongs to the Dashboard layout.

    **Method**: `POST`<br />
    **Path**: `/v1/dashboard/widget/create`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–32 characters |
    | `dashboard_id` | `string` | Yes | Dashboard ID; 1–32 characters |
    | `type` | `string` | Yes | Type; Values: `"text"`, `"visualization"`, `"parameter"` |
    | `text_content` | `string` / `null` | No | Markdown text |
    | `visualization_id` | `string` / `null` | No | Visualization ID; 1–32 characters |
    | `options` | `object` / `null` | No | Display configuration; writes accept only \{} or null. Use the Visualization for chart settings and the Dashboard layout for positioning |
    | `entities` | `object[]` | No | Related resource list |

    <Expandable title="entities — Item fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `type` | `string` | Yes | Type; Values: `"query"`, `"dashboard"`, `"notebook"`, `"table"`, `"field"`, `"function"`, `"contract"`, `"chain"`, `"schedule"`, `"page"`, `"issue"` |
      | `id` | `string` | Yes | Unique object ID; 1–255 characters |
      | `raw` | `string` | Yes | Original resource-reference text in the content; 1–255 characters |
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `dashboard_id` | `string` / `null` | Dashboard ID |
    | `type` | `string` | Type; Values: `"text"`, `"visualization"`, `"parameter"` |
    | `visualization_id` | `string` / `null` | Visualization ID |
    | `text_content` | `string` / `null` | Markdown text |
    | `options` | `object` | Display configuration; writes accept only \{} or null. Use the Visualization for chart settings and the Dashboard layout for positioning |
    | `entities` | `object[]` | Related resource list |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `entities_map` | `object` | Related content indexed by resource type and ID |
    | `visualization` | `object` / `null` | Referenced visualization; null if unreadable or deleted |
    | `parameters` | `object[]` / `null` | Parameter definitions |
    | `code` | `string` / `null` | Executable code; SQL for a Query |
    | `space_entity` | `object` / `null` | Details of the owning Space |
    | `query_name` | `string` / `null` | Referenced Query name; null if unavailable |

    <Expandable title="entities — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `type` | `string` | Type; Values: `"query"`, `"dashboard"`, `"notebook"`, `"table"`, `"field"`, `"function"`, `"contract"`, `"chain"`, `"schedule"`, `"page"`, `"issue"` |
      | `id` | `string` | Unique object ID |
      | `raw` | `string` | Original resource-reference text in the content |
    </Expandable>

    <Expandable title="entities_map — By resource type">
      <Expandable title="Resource fields by ID">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `space` | `string` | Space ID |
        | `name` | `string` / `null` | Name |
        | `created_at` | `number` | Creation time in Unix seconds |
        | `updated_at` | `number` | Last update time in Unix seconds |
      </Expandable>
    </Expandable>

    <Expandable title="visualization — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `query_id` | `string` / `null` | Query ID |
      | `name` | `string` / `null` | Name |
      | `type` | `string` | Type; Values: `"table"`, `"chart"`, `"counter"`, `"pivot"` |
      | `options` | `object` / `null` | Configuration selected by options.type; \{} or null clears it. If display columns are omitted, the website selects them from the result. Nested keys use snake\_case; unknown keys are rejected |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |

      <Expandable title="options — Fields">
        <Tabs>
          <Tab title="Table">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `description` | `string` / `null` | Description |
            | `type` | `string` | Type; Must be `"table"` |
            | `columns` | `object` / `null` | Display settings keyed by result column name |
            | `export_options` | `object` / `null` | Result export settings |

            <Expandable title="columns — Value fields">
              | Field | Type | Description |
              | - | - | - |
              | `name` | `string` / `null` | Name |
              | `title` | `string` / `null` | Display title |
              | `align` | `string` / `null` | Cell alignment; Values: `"left"`, `"center"`, `"right"` |
              | `type` | `string` / `null` | normal displays a regular cell; progress displays a progress bar; Values: `"normal"`, `"progress"` |
              | `format` | `string` / `null` | Number or date format string |
              | `hide` | `boolean` / `null` | Whether to hide the column |
              | `colored_positive` | `boolean` / `null` | Whether to color positive values |
              | `colored_negative` | `boolean` / `null` | Whether to color negative values |
              | `url_template` | `string` / `null` | Cell URL template; \{value} is replaced by the cell value |
            </Expandable>

            <Expandable title="export_options — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `enabled` | `boolean` / `null` | Whether exporting is enabled |
              | `formats` | `string[]` / `null` | Allowed export formats |
              | `filename` | `string` / `null` | Export filename |
              | `include_all_data` | `boolean` / `null` | Whether to export all data |
            </Expandable>
          </Tab>

          <Tab title="Bar / line / area / scatter">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `description` | `string` / `null` | Description |
            | `type` | `string` | Type; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
            | `x_column` | `string` / `null` | Result column for the x-axis |
            | `y_columns` | `string[]` / `null` | Numeric result columns; one series per column, with no duplicates |
            | `x_axis` | `object` / `null` | X-axis settings |
            | `y_axis` | `object` / `null` | Left y-axis settings |
            | `right_y_axis` | `object` / `null` | Right y-axis settings |
            | `legend` | `object` / `null` | Legend settings |
            | `series` | `object` / `null` | Keys are y-column names, or group values when group\_by is enabled |
            | `enable_stacking` | `boolean` / `null` | Whether to stack series |
            | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
            | `show_total_in_tooltip` | `boolean` / `null` | Whether to show the total in tooltips |
            | `group_by` | `string` / `null` | Group series by this column’s values; uses only the first y\_columns entry. An empty string disables grouping |
            | `normalize_to_percentage` | `boolean` / `null` | Normalize grouped values at each x position to 100% |
            | `when_duplicate_x` | `string` / `null` | For duplicate x values: first uses the first row, all keeps every row, sum adds the values; Values: `"first"`, `"all"`, `"sum"` |
            | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

            <Expandable title="x_axis — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
              | `label_format` | `string` / `null` | Tooltip or data-label format string |
              | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
              | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
              | `min` | `number` / `null` | Axis minimum; cannot exceed max |
              | `max` | `number` / `null` | Axis maximum |
              | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
              | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
              | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
              | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
              | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
              | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
              | `num_ticks` | `integer` / `null` | Number of ticks |
              | `width` | `number` / `null` | Axis width |
              | `reference_lines` | `object[]` / `null` | Axis reference lines |
              | `zones` | `object[]` / `null` | Highlighted axis regions |

              <Expandable title="reference_lines — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                | `stroke` | `string` | Reference line color as a CSS color |
                | `tick` | `object` / `null` | Reference line tick settings |

                <Expandable title="tick — Fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `show` | `boolean` / `null` | Whether to show the reference line tick |
                </Expandable>
              </Expandable>

              <Expandable title="zones — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `from` | `number` / `string` / `null` | Start of the highlighted region |
                | `to` | `number` / `string` / `null` | End of the highlighted region |
                | `color` | `string` / `null` | CSS color |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              </Expandable>
            </Expandable>

            <Expandable title="y_axis — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
              | `label_format` | `string` / `null` | Tooltip or data-label format string |
              | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
              | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
              | `min` | `number` / `null` | Axis minimum; cannot exceed max |
              | `max` | `number` / `null` | Axis maximum |
              | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
              | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
              | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
              | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
              | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
              | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
              | `num_ticks` | `integer` / `null` | Number of ticks |
              | `width` | `number` / `null` | Axis width |
              | `reference_lines` | `object[]` / `null` | Axis reference lines |
              | `zones` | `object[]` / `null` | Highlighted axis regions |

              <Expandable title="reference_lines — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                | `stroke` | `string` | Reference line color as a CSS color |
                | `tick` | `object` / `null` | Reference line tick settings |

                <Expandable title="tick — Fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `show` | `boolean` / `null` | Whether to show the reference line tick |
                </Expandable>
              </Expandable>

              <Expandable title="zones — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `from` | `number` / `string` / `null` | Start of the highlighted region |
                | `to` | `number` / `string` / `null` | End of the highlighted region |
                | `color` | `string` / `null` | CSS color |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              </Expandable>
            </Expandable>

            <Expandable title="right_y_axis — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
              | `label_format` | `string` / `null` | Tooltip or data-label format string |
              | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
              | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
              | `min` | `number` / `null` | Axis minimum; cannot exceed max |
              | `max` | `number` / `null` | Axis maximum |
              | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
              | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
              | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
              | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
              | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
              | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
              | `num_ticks` | `integer` / `null` | Number of ticks |
              | `width` | `number` / `null` | Axis width |
              | `reference_lines` | `object[]` / `null` | Axis reference lines |
              | `zones` | `object[]` / `null` | Highlighted axis regions |

              <Expandable title="reference_lines — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                | `stroke` | `string` | Reference line color as a CSS color |
                | `tick` | `object` / `null` | Reference line tick settings |

                <Expandable title="tick — Fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `show` | `boolean` / `null` | Whether to show the reference line tick |
                </Expandable>
              </Expandable>

              <Expandable title="zones — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `from` | `number` / `string` / `null` | Start of the highlighted region |
                | `to` | `number` / `string` / `null` | End of the highlighted region |
                | `color` | `string` / `null` | CSS color |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              </Expandable>
            </Expandable>

            <Expandable title="legend — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
              | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
              | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
            </Expandable>

            <Expandable title="series — Value fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Legend and tooltip title; defaults to the series name |
              | `type` | `string` / `null` | Series chart type; inherits options.type when omitted; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
              | `color` | `string` / `null` | CSS color |
              | `is_right` | `boolean` / `null` | Use the right axis; requires y\_axis.enable\_right\_axis |
              | `connect_nulls` | `boolean` / `null` | Whether lines connect across null values |
              | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              | `silent` | `boolean` / `null` | Whether to disable series interactions |
            </Expandable>
          </Tab>

          <Tab title="Pie">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `description` | `string` / `null` | Description |
            | `type` | `string` | Type; Must be `"pie"` |
            | `label_column` | `string` / `null` | Pie chart category column |
            | `value_column` | `string` / `null` | Pie chart value column |
            | `legend` | `object` / `null` | Legend settings |
            | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
            | `y_axis` | `object` / `null` | Only label\_format is used to format values |
            | `values_options` | `object` / `null` | Map of category values to slice color settings |
            | `series_title` | `string` / `null` | Series name in tooltips |
            | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

            <Expandable title="legend — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
              | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
              | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
            </Expandable>

            <Expandable title="y_axis — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
              | `label_format` | `string` / `null` | Tooltip or data-label format string |
              | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
              | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
              | `min` | `number` / `null` | Axis minimum; cannot exceed max |
              | `max` | `number` / `null` | Axis maximum |
              | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
              | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
              | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
              | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
              | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
              | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
              | `num_ticks` | `integer` / `null` | Number of ticks |
              | `width` | `number` / `null` | Axis width |
              | `reference_lines` | `object[]` / `null` | Axis reference lines |
              | `zones` | `object[]` / `null` | Highlighted axis regions |

              <Expandable title="reference_lines — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                | `stroke` | `string` | Reference line color as a CSS color |
                | `tick` | `object` / `null` | Reference line tick settings |

                <Expandable title="tick — Fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `show` | `boolean` / `null` | Whether to show the reference line tick |
                </Expandable>
              </Expandable>

              <Expandable title="zones — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `from` | `number` / `string` / `null` | Start of the highlighted region |
                | `to` | `number` / `string` / `null` | End of the highlighted region |
                | `color` | `string` / `null` | CSS color |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              </Expandable>
            </Expandable>

            <Expandable title="values_options — Value fields">
              | Field | Type | Description |
              | - | - | - |
              | `color` | `string` | CSS color |
            </Expandable>
          </Tab>

          <Tab title="Counter">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `description` | `string` / `null` | Description |
            | `type` | `string` | Type; Must be `"counter"` |
            | `column_name` | `string` / `null` | Numeric column displayed by the counter |
            | `row_number` | `integer` / `null` | Zero-based result row index; defaults to 0 |
            | `prefix` | `string` / `null` | Value prefix |
            | `suffix` | `string` / `null` | Value suffix |
            | `decimals` | `integer` / `null` | Decimal places; formatting follows the column type when omitted |
            | `colored_positive` | `boolean` / `null` | Whether to color positive values |
            | `colored_negative` | `boolean` / `null` | Whether to color negative values |
            | `label` | `string` / `null` | Display label or category |
          </Tab>
        </Tabs>
      </Expandable>
    </Expandable>

    <Expandable title="parameters — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `name` | `string` | Name |
      | `type` | `string` | Logical parameter type; see [Data types](/reference/data-types) |
      | `options` | `JSON[]` / `null` | Allowed choices for the parameter |
      | `default` | `object` / `null` | Default parameter value |
      | `id` | `string` / `null` | Parameter display ID stored with the definition |
      | `order` | `integer` / `null` | Omit for every parameter, or use consecutive values from 0 |

      <Expandable title="default — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `value` | `JSON` | Argument value |
      </Expandable>
    </Expandable>

    <Expandable title="space_entity — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `description` | `string` / `null` | Description |
      | `account_id` | `string` | Account ID |
      | `status` | `string` | Status |
      | `visibility` | `string` | Visibility: public, org, or private |
      | `dep_count` | `integer` | Dependency count |
      | `content_count` | `integer` | Number of content entries |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/dashboard/widget/create \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "01900000000070008000000000000004",
      "dashboard_id": "01900000000070008000000000000003",
      "type": "visualization",
      "visualization_id": "01900000000070008000000000000005"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "01900000000070008000000000000004",
        "dashboard_id": "01900000000070008000000000000003",
        "type": "visualization",
        "visualization_id": "01900000000070008000000000000005",
        "text_content": null,
        "options": {},
        "entities": [],
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "entities_map": {},
        "visualization": {
          "id": "01900000000070008000000000000005",
          "query_id": "01900000000070008000000000000001",
          "name": "Asset count",
          "type": "chart",
          "options": {
            "type": "counter",
            "column_name": "row_count",
            "row_number": 0,
            "decimals": 0
          },
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0
        },
        "parameters": [],
        "code": "SELECT COUNT(*) AS row_count FROM demo.asset_notes",
        "space_entity": {
          "id": "demo",
          "description": "Example resources",
          "account_id": "0190000000007000800000000000000b",
          "status": "active",
          "visibility": "public",
          "dep_count": 0,
          "content_count": 6,
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "account": {
            "id": "0190000000007000800000000000000b",
            "type": "org",
            "slug": "example-team",
            "display_name": "Example team",
            "avatar_url": null,
            "avatar_thumbnail_url": null
          }
        },
        "query_name": "Asset count"
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/dashboard/widget/delete — Delete a Widget" id="post-dashboard-widget-delete">
    Delete a Widget.

    **Method**: `POST`<br />
    **Path**: `/v1/dashboard/widget/delete`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–32 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `data` | `null` | Operation completed with no response data |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/dashboard/widget/delete \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "01900000000070008000000000000004"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": null
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/dashboard/widget/update — Update a Widget" id="post-dashboard-widget-update">
    Updates Widget content. Its Dashboard, type, and visualization reference cannot change. To use another visualization, delete and recreate the Widget.

    **Method**: `POST`<br />
    **Path**: `/v1/dashboard/widget/update`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–32 characters |
    | `text_content` | `string` / `null` | No | Markdown text |
    | `options` | `object` / `null` | No | Display configuration; writes accept only \{} or null. Use the Visualization for chart settings and the Dashboard layout for positioning |
    | `entities` | `object[]` / `null` | No | Related resource list |

    <Expandable title="entities — Item fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `type` | `string` | Yes | Type; Values: `"query"`, `"dashboard"`, `"notebook"`, `"table"`, `"field"`, `"function"`, `"contract"`, `"chain"`, `"schedule"`, `"page"`, `"issue"` |
      | `id` | `string` | Yes | Unique object ID; 1–255 characters |
      | `raw` | `string` | Yes | Original resource-reference text in the content; 1–255 characters |
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `dashboard_id` | `string` / `null` | Dashboard ID |
    | `type` | `string` | Type; Values: `"text"`, `"visualization"`, `"parameter"` |
    | `visualization_id` | `string` / `null` | Visualization ID |
    | `text_content` | `string` / `null` | Markdown text |
    | `options` | `object` | Display configuration; writes accept only \{} or null. Use the Visualization for chart settings and the Dashboard layout for positioning |
    | `entities` | `object[]` | Related resource list |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `entities_map` | `object` | Related content indexed by resource type and ID |
    | `visualization` | `object` / `null` | Referenced visualization; null if unreadable or deleted |
    | `parameters` | `object[]` / `null` | Parameter definitions |
    | `code` | `string` / `null` | Executable code; SQL for a Query |
    | `space_entity` | `object` / `null` | Details of the owning Space |
    | `query_name` | `string` / `null` | Referenced Query name; null if unavailable |

    <Expandable title="entities — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `type` | `string` | Type; Values: `"query"`, `"dashboard"`, `"notebook"`, `"table"`, `"field"`, `"function"`, `"contract"`, `"chain"`, `"schedule"`, `"page"`, `"issue"` |
      | `id` | `string` | Unique object ID |
      | `raw` | `string` | Original resource-reference text in the content |
    </Expandable>

    <Expandable title="entities_map — By resource type">
      <Expandable title="Resource fields by ID">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `space` | `string` | Space ID |
        | `name` | `string` / `null` | Name |
        | `created_at` | `number` | Creation time in Unix seconds |
        | `updated_at` | `number` | Last update time in Unix seconds |
      </Expandable>
    </Expandable>

    <Expandable title="visualization — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `query_id` | `string` / `null` | Query ID |
      | `name` | `string` / `null` | Name |
      | `type` | `string` | Type; Values: `"table"`, `"chart"`, `"counter"`, `"pivot"` |
      | `options` | `object` / `null` | Configuration selected by options.type; \{} or null clears it. If display columns are omitted, the website selects them from the result. Nested keys use snake\_case; unknown keys are rejected |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |

      <Expandable title="options — Fields">
        <Tabs>
          <Tab title="Table">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `description` | `string` / `null` | Description |
            | `type` | `string` | Type; Must be `"table"` |
            | `columns` | `object` / `null` | Display settings keyed by result column name |
            | `export_options` | `object` / `null` | Result export settings |

            <Expandable title="columns — Value fields">
              | Field | Type | Description |
              | - | - | - |
              | `name` | `string` / `null` | Name |
              | `title` | `string` / `null` | Display title |
              | `align` | `string` / `null` | Cell alignment; Values: `"left"`, `"center"`, `"right"` |
              | `type` | `string` / `null` | normal displays a regular cell; progress displays a progress bar; Values: `"normal"`, `"progress"` |
              | `format` | `string` / `null` | Number or date format string |
              | `hide` | `boolean` / `null` | Whether to hide the column |
              | `colored_positive` | `boolean` / `null` | Whether to color positive values |
              | `colored_negative` | `boolean` / `null` | Whether to color negative values |
              | `url_template` | `string` / `null` | Cell URL template; \{value} is replaced by the cell value |
            </Expandable>

            <Expandable title="export_options — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `enabled` | `boolean` / `null` | Whether exporting is enabled |
              | `formats` | `string[]` / `null` | Allowed export formats |
              | `filename` | `string` / `null` | Export filename |
              | `include_all_data` | `boolean` / `null` | Whether to export all data |
            </Expandable>
          </Tab>

          <Tab title="Bar / line / area / scatter">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `description` | `string` / `null` | Description |
            | `type` | `string` | Type; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
            | `x_column` | `string` / `null` | Result column for the x-axis |
            | `y_columns` | `string[]` / `null` | Numeric result columns; one series per column, with no duplicates |
            | `x_axis` | `object` / `null` | X-axis settings |
            | `y_axis` | `object` / `null` | Left y-axis settings |
            | `right_y_axis` | `object` / `null` | Right y-axis settings |
            | `legend` | `object` / `null` | Legend settings |
            | `series` | `object` / `null` | Keys are y-column names, or group values when group\_by is enabled |
            | `enable_stacking` | `boolean` / `null` | Whether to stack series |
            | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
            | `show_total_in_tooltip` | `boolean` / `null` | Whether to show the total in tooltips |
            | `group_by` | `string` / `null` | Group series by this column’s values; uses only the first y\_columns entry. An empty string disables grouping |
            | `normalize_to_percentage` | `boolean` / `null` | Normalize grouped values at each x position to 100% |
            | `when_duplicate_x` | `string` / `null` | For duplicate x values: first uses the first row, all keeps every row, sum adds the values; Values: `"first"`, `"all"`, `"sum"` |
            | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

            <Expandable title="x_axis — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
              | `label_format` | `string` / `null` | Tooltip or data-label format string |
              | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
              | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
              | `min` | `number` / `null` | Axis minimum; cannot exceed max |
              | `max` | `number` / `null` | Axis maximum |
              | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
              | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
              | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
              | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
              | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
              | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
              | `num_ticks` | `integer` / `null` | Number of ticks |
              | `width` | `number` / `null` | Axis width |
              | `reference_lines` | `object[]` / `null` | Axis reference lines |
              | `zones` | `object[]` / `null` | Highlighted axis regions |

              <Expandable title="reference_lines — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                | `stroke` | `string` | Reference line color as a CSS color |
                | `tick` | `object` / `null` | Reference line tick settings |

                <Expandable title="tick — Fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `show` | `boolean` / `null` | Whether to show the reference line tick |
                </Expandable>
              </Expandable>

              <Expandable title="zones — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `from` | `number` / `string` / `null` | Start of the highlighted region |
                | `to` | `number` / `string` / `null` | End of the highlighted region |
                | `color` | `string` / `null` | CSS color |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              </Expandable>
            </Expandable>

            <Expandable title="y_axis — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
              | `label_format` | `string` / `null` | Tooltip or data-label format string |
              | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
              | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
              | `min` | `number` / `null` | Axis minimum; cannot exceed max |
              | `max` | `number` / `null` | Axis maximum |
              | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
              | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
              | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
              | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
              | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
              | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
              | `num_ticks` | `integer` / `null` | Number of ticks |
              | `width` | `number` / `null` | Axis width |
              | `reference_lines` | `object[]` / `null` | Axis reference lines |
              | `zones` | `object[]` / `null` | Highlighted axis regions |

              <Expandable title="reference_lines — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                | `stroke` | `string` | Reference line color as a CSS color |
                | `tick` | `object` / `null` | Reference line tick settings |

                <Expandable title="tick — Fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `show` | `boolean` / `null` | Whether to show the reference line tick |
                </Expandable>
              </Expandable>

              <Expandable title="zones — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `from` | `number` / `string` / `null` | Start of the highlighted region |
                | `to` | `number` / `string` / `null` | End of the highlighted region |
                | `color` | `string` / `null` | CSS color |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              </Expandable>
            </Expandable>

            <Expandable title="right_y_axis — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
              | `label_format` | `string` / `null` | Tooltip or data-label format string |
              | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
              | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
              | `min` | `number` / `null` | Axis minimum; cannot exceed max |
              | `max` | `number` / `null` | Axis maximum |
              | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
              | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
              | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
              | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
              | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
              | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
              | `num_ticks` | `integer` / `null` | Number of ticks |
              | `width` | `number` / `null` | Axis width |
              | `reference_lines` | `object[]` / `null` | Axis reference lines |
              | `zones` | `object[]` / `null` | Highlighted axis regions |

              <Expandable title="reference_lines — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                | `stroke` | `string` | Reference line color as a CSS color |
                | `tick` | `object` / `null` | Reference line tick settings |

                <Expandable title="tick — Fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `show` | `boolean` / `null` | Whether to show the reference line tick |
                </Expandable>
              </Expandable>

              <Expandable title="zones — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `from` | `number` / `string` / `null` | Start of the highlighted region |
                | `to` | `number` / `string` / `null` | End of the highlighted region |
                | `color` | `string` / `null` | CSS color |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              </Expandable>
            </Expandable>

            <Expandable title="legend — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
              | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
              | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
            </Expandable>

            <Expandable title="series — Value fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Legend and tooltip title; defaults to the series name |
              | `type` | `string` / `null` | Series chart type; inherits options.type when omitted; Values: `"bar"`, `"line"`, `"area"`, `"scatter"` |
              | `color` | `string` / `null` | CSS color |
              | `is_right` | `boolean` / `null` | Use the right axis; requires y\_axis.enable\_right\_axis |
              | `connect_nulls` | `boolean` / `null` | Whether lines connect across null values |
              | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              | `silent` | `boolean` / `null` | Whether to disable series interactions |
            </Expandable>
          </Tab>

          <Tab title="Pie">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `description` | `string` / `null` | Description |
            | `type` | `string` | Type; Must be `"pie"` |
            | `label_column` | `string` / `null` | Pie chart category column |
            | `value_column` | `string` / `null` | Pie chart value column |
            | `legend` | `object` / `null` | Legend settings |
            | `show_data_labels` | `boolean` / `null` | Whether to show data labels |
            | `y_axis` | `object` / `null` | Only label\_format is used to format values |
            | `values_options` | `object` / `null` | Map of category values to slice color settings |
            | `series_title` | `string` / `null` | Series name in tooltips |
            | `show_legend` | `boolean` / `null` | Legacy legend toggle; use legend.show |

            <Expandable title="legend — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `show` | `boolean` / `null` | Whether to show; legends are shown when omitted |
              | `position` | `string` / `null` | Legend position; arranged automatically when omitted; Values: `"top"`, `"right"`, `"bottom"`, `"left"` |
              | `show_all` | `boolean` / `null` | Whether the pie legend lists every category |
            </Expandable>

            <Expandable title="y_axis — Fields">
              | Field | Type | Description |
              | - | - | - |
              | `title` | `string` / `null` | Display title |
              | `tick_format` | `string` / `null` | Tick format string, such as YYYY-MM-DD |
              | `label_format` | `string` / `null` | Tooltip or data-label format string |
              | `type` | `string` / `null` | X-axis type can be inferred from the column; y-axes use linear or log; Values: `"linear"`, `"band"`, `"time"`, `"log"` |
              | `include_zero` | `boolean` / `null` | Whether the y-axis includes zero; included when omitted |
              | `min` | `number` / `null` | Axis minimum; cannot exceed max |
              | `max` | `number` / `null` | Axis maximum |
              | `sort_values` | `boolean` / `null` | Whether to sort x-axis values; sorted when omitted |
              | `reverse_values` | `boolean` / `null` | Whether to reverse axis order |
              | `enable_right_axis` | `boolean` / `null` | Enable the right axis for series with is\_right set |
              | `auto_tick` | `boolean` / `null` | Whether to determine ticks automatically |
              | `nice` | `boolean` / `null` | Whether to round axis bounds to convenient ticks |
              | `asymmetric_equal_domain` | `boolean` / `null` | Whether to expand identical bounds asymmetrically |
              | `num_ticks` | `integer` / `null` | Number of ticks |
              | `width` | `number` / `null` | Axis width |
              | `reference_lines` | `object[]` / `null` | Axis reference lines |
              | `zones` | `object[]` / `null` | Highlighted axis regions |

              <Expandable title="reference_lines — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `value` | `number` / `string` | Reference line position; time axes can use a date string |
                | `stroke` | `string` | Reference line color as a CSS color |
                | `tick` | `object` / `null` | Reference line tick settings |

                <Expandable title="tick — Fields">
                  | Field | Type | Description |
                  | - | - | - |
                  | `show` | `boolean` / `null` | Whether to show the reference line tick |
                </Expandable>
              </Expandable>

              <Expandable title="zones — Item fields">
                | Field | Type | Description |
                | - | - | - |
                | `from` | `number` / `string` / `null` | Start of the highlighted region |
                | `to` | `number` / `string` / `null` | End of the highlighted region |
                | `color` | `string` / `null` | CSS color |
                | `fill_gradient` | `string[]` / `null` | Gradient start and end colors; exactly two CSS colors |
              </Expandable>
            </Expandable>

            <Expandable title="values_options — Value fields">
              | Field | Type | Description |
              | - | - | - |
              | `color` | `string` | CSS color |
            </Expandable>
          </Tab>

          <Tab title="Counter">
            | Field | Type | Description |
            | - | - | - |
            | `title` | `string` / `null` | Display title |
            | `description` | `string` / `null` | Description |
            | `type` | `string` | Type; Must be `"counter"` |
            | `column_name` | `string` / `null` | Numeric column displayed by the counter |
            | `row_number` | `integer` / `null` | Zero-based result row index; defaults to 0 |
            | `prefix` | `string` / `null` | Value prefix |
            | `suffix` | `string` / `null` | Value suffix |
            | `decimals` | `integer` / `null` | Decimal places; formatting follows the column type when omitted |
            | `colored_positive` | `boolean` / `null` | Whether to color positive values |
            | `colored_negative` | `boolean` / `null` | Whether to color negative values |
            | `label` | `string` / `null` | Display label or category |
          </Tab>
        </Tabs>
      </Expandable>
    </Expandable>

    <Expandable title="parameters — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `name` | `string` | Name |
      | `type` | `string` | Logical parameter type; see [Data types](/reference/data-types) |
      | `options` | `JSON[]` / `null` | Allowed choices for the parameter |
      | `default` | `object` / `null` | Default parameter value |
      | `id` | `string` / `null` | Parameter display ID stored with the definition |
      | `order` | `integer` / `null` | Omit for every parameter, or use consecutive values from 0 |

      <Expandable title="default — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `value` | `JSON` | Argument value |
      </Expandable>
    </Expandable>

    <Expandable title="space_entity — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `description` | `string` / `null` | Description |
      | `account_id` | `string` | Account ID |
      | `status` | `string` | Status |
      | `visibility` | `string` | Visibility: public, org, or private |
      | `dep_count` | `integer` | Dependency count |
      | `content_count` | `integer` | Number of content entries |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/dashboard/widget/update \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "01900000000070008000000000000015",
      "text_content": "# Asset overview"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "01900000000070008000000000000015",
        "dashboard_id": "01900000000070008000000000000003",
        "type": "text",
        "visualization_id": null,
        "text_content": "# Asset overview",
        "options": {},
        "entities": [],
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "entities_map": {}
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### schedule

The calling account must own the schedule’s Space, and the user must have write access to that Space. The target content must belong to the same account.

<AccordionGroup>
  <Accordion title="GET /v1/schedule — Get a schedule" id="get-schedule">
    Look up by `id` or by the complete `space`, `content_type`, and `content_id` combination; do not mix them. Content lookup returns the most recently updated matching schedule, or `null`.

    **Method**: `GET`<br />
    **Path**: `/v1/schedule`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` / `null` | No | Unique object ID; 1–255 characters |
    | `space` | `string` / `null` | No | Space ID; 1–64 characters |
    | `content_type` | `string` / `null` | No | Target content type; Values: `"query"`, `"dashboard"`, `"notebook"` |
    | `content_id` | `string` / `null` | No | Target content ID; 1–255 characters |

    **Returns**

    `data` is `null` if content lookup finds no schedule.

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `space` | `string` | Space ID |
    | `content_type` | `string` / `null` | Target content type |
    | `content_id` | `string` / `null` | Target content ID |
    | `cron` | `string` / `null` | Cron expression |
    | `arguments` | `object[]` | Argument values for this execution |
    | `name` | `string` / `null` | Name |
    | `mode` | `string` / `null` | Schedule mode |
    | `max_cpu` | `integer` / `null` | CPU allocation; 100 represents 1 vCPU |
    | `max_memory` | `integer` / `null` | Memory allocation in bytes |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `space_entity` | `object` / `null` | Details of the owning Space |
    | `account_id` | `string` | Account ID |
    | `enabled` | `boolean` / `null` | Whether the schedule is enabled |
    | `next_run_at` | `number` / `null` | Next run time in Unix seconds; null if none is planned |
    | `runtime_status` | `string` / `null` | Continuous schedule state; null for cron schedules; Values: `"running"`, `"stopping"`, `"starting"`, `"stopped"` |
    | `instance` | `object` / `null` | Instance summary for a continuous schedule |
    | `recent_runs` | `object[]` | Recent schedule runs |
    | `content` | `object` / `null` | Target content summary; null if unavailable |

    <Expandable title="arguments — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `value` | `JSON` | Argument value |
      | `name` | `string` / `null` | Name of the matching parameter |
      | `order` | `integer` / `null` | Omit for every argument, or use consecutive values from 0 to determine argument order |
    </Expandable>

    <Expandable title="space_entity — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `description` | `string` / `null` | Description |
      | `account_id` | `string` | Account ID |
      | `status` | `string` | Status |
      | `visibility` | `string` | Visibility: public, org, or private |
      | `dep_count` | `integer` | Dependency count |
      | `content_count` | `integer` | Number of content entries |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    <Expandable title="instance — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` / `null` | Unique object ID |
      | `status` | `string` / `null` | Status |
      | `display_status` | `string` | Instance display status; Values: `"running"`, `"succeeded"`, `"failed"`, `"canceled"`, `"starting"` |
      | `exit_code` | `integer` / `null` | Exit code; null while running, 0 on success |
      | `exit_message` | `string` / `null` | Exit reason; null while running |
      | `created_at` | `number` / `null` | Creation time in Unix seconds |
      | `exited_at` | `number` / `null` | Exit time in Unix seconds; null while running |
    </Expandable>

    <Expandable title="recent_runs — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `status` | `string` | Status |
      | `display_status` | `string` | Instance display status |
      | `exit_code` | `integer` / `null` | Exit code; null while running, 0 on success |
      | `planned_at` | `number` / `null` | Planned execution time in Unix seconds |
      | `started_at` | `number` / `null` | Start time in Unix seconds; null before execution starts |
      | `finished_at` | `number` / `null` | Completion time in Unix seconds; null before completion |
      | `message` | `string` / `null` | Description or error message |
      | `instance_id` | `string` / `null` | Notebook execution instance ID |
    </Expandable>

    <Expandable title="content — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `space` | `string` | Space ID |
      | `name` | `string` / `null` | Name |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `language` | `string` / `null` | Code language |
      | `parameters` | `object[]` | Parameter definitions |
      | `space_entity` | `object` / `null` | Details of the owning Space |

      <Expandable title="parameters — Item fields">
        | Field | Type | Description |
        | - | - | - |
        | `name` | `string` / `null` | Parameter name |
        | `type` | `string` | Logical parameter type, such as INT, STRING, or ADDRESS; see [Data types](/reference/data-types) |
        | `options` | `JSON[]` / `null` | Allowed choices for the parameter |
        | `default` | `object` / `null` | Default parameter value |
        | `id` | `JSON` / `null` | Parameter display ID; generated by the service in responses |
        | `order` | `integer` / `null` | Parameter order; Function parameters must all omit it or use consecutive values from 0 |

        <Expandable title="default — Fields">
          | Field | Type | Description |
          | - | - | - |
          | `value` | `JSON` | Argument value |
        </Expandable>
      </Expandable>

      <Expandable title="space_entity — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `description` | `string` / `null` | Description |
        | `account_id` | `string` | Account ID |
        | `status` | `string` | Status |
        | `visibility` | `string` | Visibility: public, org, or private |
        | `dep_count` | `integer` | Dependency count |
        | `content_count` | `integer` | Number of content entries |
        | `created_at` | `number` | Creation time in Unix seconds |
        | `updated_at` | `number` | Last update time in Unix seconds |
        | `account` | `object` / `null` | Account details |

        <Expandable title="account — Fields">
          | Field | Type | Description |
          | - | - | - |
          | `id` | `string` | Unique object ID |
          | `type` | `string` | Account type: personal or org |
          | `slug` | `string` / `null` | Account slug used for display and URLs |
          | `display_name` | `string` / `null` | Account display name |
          | `avatar_url` | `string` / `null` | Avatar URL |
          | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
        </Expandable>
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/schedule \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode id=0190000000007000800000000000000a
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "0190000000007000800000000000000a",
        "space": "demo",
        "content_type": "notebook",
        "content_id": "01900000000070008000000000000002",
        "name": "Hourly message",
        "mode": "crontab",
        "cron": "0 * * * *",
        "arguments": [],
        "max_cpu": 100,
        "max_memory": 4294967296,
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "space_entity": {
          "id": "demo",
          "description": "Example resources",
          "account_id": "0190000000007000800000000000000b",
          "status": "active",
          "visibility": "public",
          "dep_count": 0,
          "content_count": 6,
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "account": {
            "id": "0190000000007000800000000000000b",
            "type": "org",
            "slug": "example-team",
            "display_name": "Example team",
            "avatar_url": null,
            "avatar_thumbnail_url": null
          }
        },
        "account_id": "0190000000007000800000000000000b",
        "enabled": true,
        "next_run_at": 1788224400.0,
        "runtime_status": null,
        "instance": null,
        "recent_runs": [],
        "content": {
          "id": "01900000000070008000000000000002",
          "name": "print_message",
          "space": "demo",
          "language": "python",
          "parameters": [],
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "space_entity": {
            "id": "demo",
            "description": "Example resources",
            "account_id": "0190000000007000800000000000000b",
            "status": "active",
            "visibility": "public",
            "dep_count": 0,
            "content_count": 6,
            "created_at": 1788220800.0,
            "updated_at": 1788220800.0,
            "account": {
              "id": "0190000000007000800000000000000b",
              "type": "org",
              "slug": "example-team",
              "display_name": "Example team",
              "avatar_url": null,
              "avatar_thumbnail_url": null
            }
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/schedule/create — Create a schedule" id="post-schedule-create">
    The schedule is enabled on creation. `crontab` requires a Cron expression; `perpetual` supports Notebooks only. Notebook schedules require a valid CPU and memory pair.

    **Method**: `POST`<br />
    **Path**: `/v1/schedule/create`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `content_type` | `string` | Yes | Target content type; Values: `"query"`, `"dashboard"`, `"notebook"` |
    | `content_id` | `string` | Yes | Target content ID; 32–32 characters; Pattern: `^[0-9a-f]{32}$` |
    | `name` | `string` / `null` | No | Name; ≤ 128 characters |
    | `mode` | `string` | No | Schedule mode; Values: `"crontab"`, `"perpetual"`; Default `"crontab"` |
    | `cron` | `string` / `null` | No | Cron expression; ≤ 128 characters |
    | `arguments` | `object[]` | No | Argument values for this execution |
    | `max_cpu` | `integer` / `null` | No | CPU allocation; 100 represents 1 vCPU; > 0 |
    | `max_memory` | `integer` / `null` | No | Memory allocation in bytes; > 0 |
    | `space` | `string` | Yes | Space ID; 1–64 characters |

    <Expandable title="arguments — Item fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `value` | `JSON` | Yes | Argument value |
      | `name` | `string` / `null` | No | Name of the matching parameter |
      | `order` | `integer` / `null` | No | Omit for every argument, or use consecutive values from 0 to determine argument order; ≥ 0 |
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `space` | `string` | Space ID |
    | `content_type` | `string` / `null` | Target content type |
    | `content_id` | `string` / `null` | Target content ID |
    | `cron` | `string` / `null` | Cron expression |
    | `arguments` | `object[]` | Argument values for this execution |
    | `name` | `string` / `null` | Name |
    | `mode` | `string` / `null` | Schedule mode |
    | `max_cpu` | `integer` / `null` | CPU allocation; 100 represents 1 vCPU |
    | `max_memory` | `integer` / `null` | Memory allocation in bytes |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `space_entity` | `object` / `null` | Details of the owning Space |
    | `account_id` | `string` | Account ID |
    | `enabled` | `boolean` / `null` | Whether the schedule is enabled |
    | `next_run_at` | `number` / `null` | Next run time in Unix seconds; null if none is planned |
    | `runtime_status` | `string` / `null` | Continuous schedule state; null for cron schedules; Values: `"running"`, `"stopping"`, `"starting"`, `"stopped"` |
    | `instance` | `object` / `null` | Instance summary for a continuous schedule |
    | `recent_runs` | `object[]` | Recent schedule runs |
    | `content` | `object` / `null` | Target content summary; null if unavailable |

    <Expandable title="arguments — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `value` | `JSON` | Argument value |
      | `name` | `string` / `null` | Name of the matching parameter |
      | `order` | `integer` / `null` | Omit for every argument, or use consecutive values from 0 to determine argument order |
    </Expandable>

    <Expandable title="space_entity — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `description` | `string` / `null` | Description |
      | `account_id` | `string` | Account ID |
      | `status` | `string` | Status |
      | `visibility` | `string` | Visibility: public, org, or private |
      | `dep_count` | `integer` | Dependency count |
      | `content_count` | `integer` | Number of content entries |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    <Expandable title="instance — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` / `null` | Unique object ID |
      | `status` | `string` / `null` | Status |
      | `display_status` | `string` | Instance display status; Values: `"running"`, `"succeeded"`, `"failed"`, `"canceled"`, `"starting"` |
      | `exit_code` | `integer` / `null` | Exit code; null while running, 0 on success |
      | `exit_message` | `string` / `null` | Exit reason; null while running |
      | `created_at` | `number` / `null` | Creation time in Unix seconds |
      | `exited_at` | `number` / `null` | Exit time in Unix seconds; null while running |
    </Expandable>

    <Expandable title="recent_runs — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `status` | `string` | Status |
      | `display_status` | `string` | Instance display status |
      | `exit_code` | `integer` / `null` | Exit code; null while running, 0 on success |
      | `planned_at` | `number` / `null` | Planned execution time in Unix seconds |
      | `started_at` | `number` / `null` | Start time in Unix seconds; null before execution starts |
      | `finished_at` | `number` / `null` | Completion time in Unix seconds; null before completion |
      | `message` | `string` / `null` | Description or error message |
      | `instance_id` | `string` / `null` | Notebook execution instance ID |
    </Expandable>

    <Expandable title="content — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `space` | `string` | Space ID |
      | `name` | `string` / `null` | Name |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `language` | `string` / `null` | Code language |
      | `parameters` | `object[]` | Parameter definitions |
      | `space_entity` | `object` / `null` | Details of the owning Space |

      <Expandable title="parameters — Item fields">
        | Field | Type | Description |
        | - | - | - |
        | `name` | `string` / `null` | Parameter name |
        | `type` | `string` | Logical parameter type, such as INT, STRING, or ADDRESS; see [Data types](/reference/data-types) |
        | `options` | `JSON[]` / `null` | Allowed choices for the parameter |
        | `default` | `object` / `null` | Default parameter value |
        | `id` | `JSON` / `null` | Parameter display ID; generated by the service in responses |
        | `order` | `integer` / `null` | Parameter order; Function parameters must all omit it or use consecutive values from 0 |

        <Expandable title="default — Fields">
          | Field | Type | Description |
          | - | - | - |
          | `value` | `JSON` | Argument value |
        </Expandable>
      </Expandable>

      <Expandable title="space_entity — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `description` | `string` / `null` | Description |
        | `account_id` | `string` | Account ID |
        | `status` | `string` | Status |
        | `visibility` | `string` | Visibility: public, org, or private |
        | `dep_count` | `integer` | Dependency count |
        | `content_count` | `integer` | Number of content entries |
        | `created_at` | `number` | Creation time in Unix seconds |
        | `updated_at` | `number` | Last update time in Unix seconds |
        | `account` | `object` / `null` | Account details |

        <Expandable title="account — Fields">
          | Field | Type | Description |
          | - | - | - |
          | `id` | `string` | Unique object ID |
          | `type` | `string` | Account type: personal or org |
          | `slug` | `string` / `null` | Account slug used for display and URLs |
          | `display_name` | `string` / `null` | Account display name |
          | `avatar_url` | `string` / `null` | Avatar URL |
          | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
        </Expandable>
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/schedule/create \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "space": "demo",
      "content_type": "notebook",
      "content_id": "01900000000070008000000000000002",
      "name": "Hourly message",
      "mode": "crontab",
      "cron": "0 * * * *",
      "arguments": [],
      "max_cpu": 100,
      "max_memory": 4294967296
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "0190000000007000800000000000000a",
        "space": "demo",
        "content_type": "notebook",
        "content_id": "01900000000070008000000000000002",
        "name": "Hourly message",
        "mode": "crontab",
        "cron": "0 * * * *",
        "arguments": [],
        "max_cpu": 100,
        "max_memory": 4294967296,
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "space_entity": {
          "id": "demo",
          "description": "Example resources",
          "account_id": "0190000000007000800000000000000b",
          "status": "active",
          "visibility": "public",
          "dep_count": 0,
          "content_count": 6,
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "account": {
            "id": "0190000000007000800000000000000b",
            "type": "org",
            "slug": "example-team",
            "display_name": "Example team",
            "avatar_url": null,
            "avatar_thumbnail_url": null
          }
        },
        "account_id": "0190000000007000800000000000000b",
        "enabled": true,
        "next_run_at": 1788224400.0,
        "runtime_status": null,
        "instance": null,
        "recent_runs": [],
        "content": {
          "id": "01900000000070008000000000000002",
          "name": "print_message",
          "space": "demo",
          "language": "python",
          "parameters": [],
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "space_entity": {
            "id": "demo",
            "description": "Example resources",
            "account_id": "0190000000007000800000000000000b",
            "status": "active",
            "visibility": "public",
            "dep_count": 0,
            "content_count": 6,
            "created_at": 1788220800.0,
            "updated_at": 1788220800.0,
            "account": {
              "id": "0190000000007000800000000000000b",
              "type": "org",
              "slug": "example-team",
              "display_name": "Example team",
              "avatar_url": null,
              "avatar_thumbnail_url": null
            }
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/schedule/delete — Delete a schedule" id="post-schedule-delete">
    Delete a schedule.

    **Method**: `POST`<br />
    **Path**: `/v1/schedule/delete`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–255 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `data` | `null` | Operation completed with no response data |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/schedule/delete \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "0190000000007000800000000000000a"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": null
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/schedule/disable — Disable a schedule" id="post-schedule-disable">
    Disable a schedule.

    **Method**: `POST`<br />
    **Path**: `/v1/schedule/disable`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–255 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `data` | `null` | Operation completed with no response data |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/schedule/disable \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "0190000000007000800000000000000a"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": null
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/schedule/enable — Enable a schedule" id="post-schedule-enable">
    Enable a schedule.

    **Method**: `POST`<br />
    **Path**: `/v1/schedule/enable`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–255 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `data` | `null` | Operation completed with no response data |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/schedule/enable \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "0190000000007000800000000000000a"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": null
    }
    ```
  </Accordion>

  <Accordion title="GET /v1/schedule/list — List schedules" id="get-schedule-list">
    List schedules.

    **Method**: `GET`<br />
    **Path**: `/v1/schedule/list`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `start` | `integer` | No | Pagination offset, starting at 0; ≥ 0; Default `0` |
    | `limit` | `integer` | No | Maximum number of entries; ≥ 1; ≤ 100; Default `20` |
    | `order_by` | `string` | No | Sort field; Values: `"id"`, `"name"`, `"created_at"`, `"updated_at"`; Default `"updated_at"` |
    | `direction` | `string` | No | Sort direction; Values: `"asc"`, `"desc"`; Default `"desc"` |
    | `space` | `string` | Yes | Filter by Space; when omitted, list resources in visible Spaces; 1–64 characters |
    | `content_type` | `string` / `null` | No | Target content type; Values: `"query"`, `"dashboard"`, `"notebook"` |
    | `content_id` | `string` / `null` | No | Target content ID; 1–255 characters |
    | `mode` | `string` / `null` | No | Schedule mode; Values: `"crontab"`, `"perpetual"` |
    | `keyword` | `string` / `null` | No | Search keyword; ≤ 128 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `start` | `integer` | Pagination offset, starting at 0 |
    | `limit` | `integer` | Maximum number of entries |
    | `items` | `object[]` | Entries on this page |
    | `total_count` | `integer` | Total number of matching entries |

    <Expandable title="items — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `space` | `string` | Space ID |
      | `content_type` | `string` / `null` | Target content type |
      | `content_id` | `string` / `null` | Target content ID |
      | `cron` | `string` / `null` | Cron expression |
      | `arguments` | `object[]` | Argument values for this execution |
      | `name` | `string` / `null` | Name |
      | `mode` | `string` / `null` | Schedule mode |
      | `max_cpu` | `integer` / `null` | CPU allocation; 100 represents 1 vCPU |
      | `max_memory` | `integer` / `null` | Memory allocation in bytes |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `space_entity` | `object` / `null` | Details of the owning Space |
      | `account_id` | `string` | Account ID |
      | `enabled` | `boolean` / `null` | Whether the schedule is enabled |
      | `next_run_at` | `number` / `null` | Next run time in Unix seconds; null if none is planned |
      | `runtime_status` | `string` / `null` | Continuous schedule state; null for cron schedules; Values: `"running"`, `"stopping"`, `"starting"`, `"stopped"` |
      | `instance` | `object` / `null` | Instance summary for a continuous schedule |
      | `recent_runs` | `object[]` | Recent schedule runs |
      | `content` | `object` / `null` | Target content summary; null if unavailable |

      <Expandable title="arguments — Item fields">
        | Field | Type | Description |
        | - | - | - |
        | `value` | `JSON` | Argument value |
        | `name` | `string` / `null` | Name of the matching parameter |
        | `order` | `integer` / `null` | Omit for every argument, or use consecutive values from 0 to determine argument order |
      </Expandable>

      <Expandable title="space_entity — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `description` | `string` / `null` | Description |
        | `account_id` | `string` | Account ID |
        | `status` | `string` | Status |
        | `visibility` | `string` | Visibility: public, org, or private |
        | `dep_count` | `integer` | Dependency count |
        | `content_count` | `integer` | Number of content entries |
        | `created_at` | `number` | Creation time in Unix seconds |
        | `updated_at` | `number` | Last update time in Unix seconds |
        | `account` | `object` / `null` | Account details |

        <Expandable title="account — Fields">
          | Field | Type | Description |
          | - | - | - |
          | `id` | `string` | Unique object ID |
          | `type` | `string` | Account type: personal or org |
          | `slug` | `string` / `null` | Account slug used for display and URLs |
          | `display_name` | `string` / `null` | Account display name |
          | `avatar_url` | `string` / `null` | Avatar URL |
          | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
        </Expandable>
      </Expandable>

      <Expandable title="instance — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` / `null` | Unique object ID |
        | `status` | `string` / `null` | Status |
        | `display_status` | `string` | Instance display status; Values: `"running"`, `"succeeded"`, `"failed"`, `"canceled"`, `"starting"` |
        | `exit_code` | `integer` / `null` | Exit code; null while running, 0 on success |
        | `exit_message` | `string` / `null` | Exit reason; null while running |
        | `created_at` | `number` / `null` | Creation time in Unix seconds |
        | `exited_at` | `number` / `null` | Exit time in Unix seconds; null while running |
      </Expandable>

      <Expandable title="recent_runs — Item fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `status` | `string` | Status |
        | `display_status` | `string` | Instance display status |
        | `exit_code` | `integer` / `null` | Exit code; null while running, 0 on success |
        | `planned_at` | `number` / `null` | Planned execution time in Unix seconds |
        | `started_at` | `number` / `null` | Start time in Unix seconds; null before execution starts |
        | `finished_at` | `number` / `null` | Completion time in Unix seconds; null before completion |
        | `message` | `string` / `null` | Description or error message |
        | `instance_id` | `string` / `null` | Notebook execution instance ID |
      </Expandable>

      <Expandable title="content — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `space` | `string` | Space ID |
        | `name` | `string` / `null` | Name |
        | `created_at` | `number` | Creation time in Unix seconds |
        | `updated_at` | `number` | Last update time in Unix seconds |
        | `language` | `string` / `null` | Code language |
        | `parameters` | `object[]` | Parameter definitions |
        | `space_entity` | `object` / `null` | Details of the owning Space |

        <Expandable title="parameters — Item fields">
          | Field | Type | Description |
          | - | - | - |
          | `name` | `string` / `null` | Parameter name |
          | `type` | `string` | Logical parameter type, such as INT, STRING, or ADDRESS; see [Data types](/reference/data-types) |
          | `options` | `JSON[]` / `null` | Allowed choices for the parameter |
          | `default` | `object` / `null` | Default parameter value |
          | `id` | `JSON` / `null` | Parameter display ID; generated by the service in responses |
          | `order` | `integer` / `null` | Parameter order; Function parameters must all omit it or use consecutive values from 0 |

          <Expandable title="default — Fields">
            | Field | Type | Description |
            | - | - | - |
            | `value` | `JSON` | Argument value |
          </Expandable>
        </Expandable>

        <Expandable title="space_entity — Fields">
          | Field | Type | Description |
          | - | - | - |
          | `id` | `string` | Unique object ID |
          | `description` | `string` / `null` | Description |
          | `account_id` | `string` | Account ID |
          | `status` | `string` | Status |
          | `visibility` | `string` | Visibility: public, org, or private |
          | `dep_count` | `integer` | Dependency count |
          | `content_count` | `integer` | Number of content entries |
          | `created_at` | `number` | Creation time in Unix seconds |
          | `updated_at` | `number` | Last update time in Unix seconds |
          | `account` | `object` / `null` | Account details |

          <Expandable title="account — Fields">
            | Field | Type | Description |
            | - | - | - |
            | `id` | `string` | Unique object ID |
            | `type` | `string` | Account type: personal or org |
            | `slug` | `string` / `null` | Account slug used for display and URLs |
            | `display_name` | `string` / `null` | Account display name |
            | `avatar_url` | `string` / `null` | Avatar URL |
            | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
          </Expandable>
        </Expandable>
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl --get https://api.chaintable.com/v1/schedule/list \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      --data-urlencode space=demo \
      --data-urlencode limit=10
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "items": [
          {
            "id": "0190000000007000800000000000000a",
            "space": "demo",
            "content_type": "notebook",
            "content_id": "01900000000070008000000000000002",
            "name": "Hourly message",
            "mode": "crontab",
            "cron": "0 * * * *",
            "arguments": [],
            "max_cpu": 100,
            "max_memory": 4294967296,
            "created_at": 1788220800.0,
            "updated_at": 1788220800.0,
            "space_entity": {
              "id": "demo",
              "description": "Example resources",
              "account_id": "0190000000007000800000000000000b",
              "status": "active",
              "visibility": "public",
              "dep_count": 0,
              "content_count": 6,
              "created_at": 1788220800.0,
              "updated_at": 1788220800.0,
              "account": {
                "id": "0190000000007000800000000000000b",
                "type": "org",
                "slug": "example-team",
                "display_name": "Example team",
                "avatar_url": null,
                "avatar_thumbnail_url": null
              }
            },
            "account_id": "0190000000007000800000000000000b",
            "enabled": true,
            "next_run_at": 1788224400.0,
            "runtime_status": null,
            "instance": null,
            "recent_runs": [],
            "content": {
              "id": "01900000000070008000000000000002",
              "name": "print_message",
              "space": "demo",
              "language": "python",
              "parameters": [],
              "created_at": 1788220800.0,
              "updated_at": 1788220800.0,
              "space_entity": {
                "id": "demo",
                "description": "Example resources",
                "account_id": "0190000000007000800000000000000b",
                "status": "active",
                "visibility": "public",
                "dep_count": 0,
                "content_count": 6,
                "created_at": 1788220800.0,
                "updated_at": 1788220800.0,
                "account": {
                  "id": "0190000000007000800000000000000b",
                  "type": "org",
                  "slug": "example-team",
                  "display_name": "Example team",
                  "avatar_url": null,
                  "avatar_thumbnail_url": null
                }
              }
            }
          }
        ],
        "total_count": 1,
        "start": 0,
        "limit": 10
      }
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/schedule/restart — Restart a continuous schedule" id="post-schedule-restart">
    Only supports `perpetual`; other modes return `409`.

    **Method**: `POST`<br />
    **Path**: `/v1/schedule/restart`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–255 characters |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `data` | `null` | Operation completed with no response data |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/schedule/restart \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "01900000000070008000000000000019"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": null
    }
    ```
  </Accordion>

  <Accordion title="POST /v1/schedule/update — Update a schedule" id="post-schedule-update">
    Updates execution settings without changing the target content, Space, or mode. Changes to a continuous schedule do not restart its instance automatically; use the restart endpoint. Supply max\_cpu and max\_memory together when changing the compute specification.

    **Method**: `POST`<br />
    **Path**: `/v1/schedule/update`

    **Parameters**

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `id` | `string` | Yes | Unique object ID; 1–255 characters |
    | `name` | `string` / `null` | No | Name; ≤ 128 characters |
    | `cron` | `string` / `null` | No | Cron expression; ≤ 128 characters |
    | `arguments` | `object[]` | No | Argument values for this execution |
    | `max_cpu` | `integer` | No | CPU allocation; 100 represents 1 vCPU; > 0 |
    | `max_memory` | `integer` | No | Memory allocation in bytes; > 0 |

    <Expandable title="arguments — Item fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `value` | `JSON` | Yes | Argument value |
      | `name` | `string` / `null` | No | Name of the matching parameter |
      | `order` | `integer` / `null` | No | Omit for every argument, or use consecutive values from 0 to determine argument order; ≥ 0 |
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `id` | `string` | Unique object ID |
    | `space` | `string` | Space ID |
    | `content_type` | `string` / `null` | Target content type |
    | `content_id` | `string` / `null` | Target content ID |
    | `cron` | `string` / `null` | Cron expression |
    | `arguments` | `object[]` | Argument values for this execution |
    | `name` | `string` / `null` | Name |
    | `mode` | `string` / `null` | Schedule mode |
    | `max_cpu` | `integer` / `null` | CPU allocation; 100 represents 1 vCPU |
    | `max_memory` | `integer` / `null` | Memory allocation in bytes |
    | `created_at` | `number` | Creation time in Unix seconds |
    | `updated_at` | `number` | Last update time in Unix seconds |
    | `space_entity` | `object` / `null` | Details of the owning Space |
    | `account_id` | `string` | Account ID |
    | `enabled` | `boolean` / `null` | Whether the schedule is enabled |
    | `next_run_at` | `number` / `null` | Next run time in Unix seconds; null if none is planned |
    | `runtime_status` | `string` / `null` | Continuous schedule state; null for cron schedules; Values: `"running"`, `"stopping"`, `"starting"`, `"stopped"` |
    | `instance` | `object` / `null` | Instance summary for a continuous schedule |
    | `recent_runs` | `object[]` | Recent schedule runs |
    | `content` | `object` / `null` | Target content summary; null if unavailable |

    <Expandable title="arguments — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `value` | `JSON` | Argument value |
      | `name` | `string` / `null` | Name of the matching parameter |
      | `order` | `integer` / `null` | Omit for every argument, or use consecutive values from 0 to determine argument order |
    </Expandable>

    <Expandable title="space_entity — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `description` | `string` / `null` | Description |
      | `account_id` | `string` | Account ID |
      | `status` | `string` | Status |
      | `visibility` | `string` | Visibility: public, org, or private |
      | `dep_count` | `integer` | Dependency count |
      | `content_count` | `integer` | Number of content entries |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `account` | `object` / `null` | Account details |

      <Expandable title="account — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `type` | `string` | Account type: personal or org |
        | `slug` | `string` / `null` | Account slug used for display and URLs |
        | `display_name` | `string` / `null` | Account display name |
        | `avatar_url` | `string` / `null` | Avatar URL |
        | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
      </Expandable>
    </Expandable>

    <Expandable title="instance — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` / `null` | Unique object ID |
      | `status` | `string` / `null` | Status |
      | `display_status` | `string` | Instance display status; Values: `"running"`, `"succeeded"`, `"failed"`, `"canceled"`, `"starting"` |
      | `exit_code` | `integer` / `null` | Exit code; null while running, 0 on success |
      | `exit_message` | `string` / `null` | Exit reason; null while running |
      | `created_at` | `number` / `null` | Creation time in Unix seconds |
      | `exited_at` | `number` / `null` | Exit time in Unix seconds; null while running |
    </Expandable>

    <Expandable title="recent_runs — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `status` | `string` | Status |
      | `display_status` | `string` | Instance display status |
      | `exit_code` | `integer` / `null` | Exit code; null while running, 0 on success |
      | `planned_at` | `number` / `null` | Planned execution time in Unix seconds |
      | `started_at` | `number` / `null` | Start time in Unix seconds; null before execution starts |
      | `finished_at` | `number` / `null` | Completion time in Unix seconds; null before completion |
      | `message` | `string` / `null` | Description or error message |
      | `instance_id` | `string` / `null` | Notebook execution instance ID |
    </Expandable>

    <Expandable title="content — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Unique object ID |
      | `space` | `string` | Space ID |
      | `name` | `string` / `null` | Name |
      | `created_at` | `number` | Creation time in Unix seconds |
      | `updated_at` | `number` | Last update time in Unix seconds |
      | `language` | `string` / `null` | Code language |
      | `parameters` | `object[]` | Parameter definitions |
      | `space_entity` | `object` / `null` | Details of the owning Space |

      <Expandable title="parameters — Item fields">
        | Field | Type | Description |
        | - | - | - |
        | `name` | `string` / `null` | Parameter name |
        | `type` | `string` | Logical parameter type, such as INT, STRING, or ADDRESS; see [Data types](/reference/data-types) |
        | `options` | `JSON[]` / `null` | Allowed choices for the parameter |
        | `default` | `object` / `null` | Default parameter value |
        | `id` | `JSON` / `null` | Parameter display ID; generated by the service in responses |
        | `order` | `integer` / `null` | Parameter order; Function parameters must all omit it or use consecutive values from 0 |

        <Expandable title="default — Fields">
          | Field | Type | Description |
          | - | - | - |
          | `value` | `JSON` | Argument value |
        </Expandable>
      </Expandable>

      <Expandable title="space_entity — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `id` | `string` | Unique object ID |
        | `description` | `string` / `null` | Description |
        | `account_id` | `string` | Account ID |
        | `status` | `string` | Status |
        | `visibility` | `string` | Visibility: public, org, or private |
        | `dep_count` | `integer` | Dependency count |
        | `content_count` | `integer` | Number of content entries |
        | `created_at` | `number` | Creation time in Unix seconds |
        | `updated_at` | `number` | Last update time in Unix seconds |
        | `account` | `object` / `null` | Account details |

        <Expandable title="account — Fields">
          | Field | Type | Description |
          | - | - | - |
          | `id` | `string` | Unique object ID |
          | `type` | `string` | Account type: personal or org |
          | `slug` | `string` / `null` | Account slug used for display and URLs |
          | `display_name` | `string` / `null` | Account display name |
          | `avatar_url` | `string` / `null` | Avatar URL |
          | `avatar_thumbnail_url` | `string` / `null` | Avatar thumbnail URL |
        </Expandable>
      </Expandable>
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/schedule/update \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID" \
      -H 'Content-Type: application/json' \
      --data '{
      "id": "0190000000007000800000000000000a",
      "cron": "*/30 * * * *"
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "id": "0190000000007000800000000000000a",
        "space": "demo",
        "content_type": "notebook",
        "content_id": "01900000000070008000000000000002",
        "name": "Hourly message",
        "mode": "crontab",
        "cron": "*/30 * * * *",
        "arguments": [],
        "max_cpu": 100,
        "max_memory": 4294967296,
        "created_at": 1788220800.0,
        "updated_at": 1788220800.0,
        "space_entity": {
          "id": "demo",
          "description": "Example resources",
          "account_id": "0190000000007000800000000000000b",
          "status": "active",
          "visibility": "public",
          "dep_count": 0,
          "content_count": 6,
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "account": {
            "id": "0190000000007000800000000000000b",
            "type": "org",
            "slug": "example-team",
            "display_name": "Example team",
            "avatar_url": null,
            "avatar_thumbnail_url": null
          }
        },
        "account_id": "0190000000007000800000000000000b",
        "enabled": true,
        "next_run_at": 1788222600.0,
        "runtime_status": null,
        "instance": null,
        "recent_runs": [],
        "content": {
          "id": "01900000000070008000000000000002",
          "name": "print_message",
          "space": "demo",
          "language": "python",
          "parameters": [],
          "created_at": 1788220800.0,
          "updated_at": 1788220800.0,
          "space_entity": {
            "id": "demo",
            "description": "Example resources",
            "account_id": "0190000000007000800000000000000b",
            "status": "active",
            "visibility": "public",
            "dep_count": 0,
            "content_count": 6,
            "created_at": 1788220800.0,
            "updated_at": 1788220800.0,
            "account": {
              "id": "0190000000007000800000000000000b",
              "type": "org",
              "slug": "example-team",
              "display_name": "Example team",
              "avatar_url": null,
              "avatar_thumbnail_url": null
            }
          }
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### chain

<AccordionGroup>
  <Accordion title="GET /v1/chain/list — List supported chains" id="get-chain-list">
    Returns supported chains. The `items` array is not paginated.

    **Method**: `GET`<br />
    **Path**: `/v1/chain/list`

    **Parameters**

    No request parameters.

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `items` | `object[]` | Entries on this page |

    <Expandable title="items — Item fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Platform chain identifier, such as eth |
      | `name` | `string` | Name |
      | `avatar_url` | `string` | Avatar URL |
      | `chain_id` | `integer` | EIP-155 chain number, such as 1 for Ethereum |
      | `status` | `string` | Chain state: supported, developing, or deprecated |
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/chain/list \
      -H "Authorization: Bearer $CHAINTABLE_PERSONAL_ACCESS_TOKEN" \
      -H "X-Account-ID: $CHAINTABLE_ACCOUNT_ID"
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "items": [
          {
            "id": "eth",
            "name": "Ethereum",
            "avatar_url": "https://example.com/eth.png",
            "chain_id": 1,
            "status": "supported"
          }
        ]
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### leafage

<div id="post-leafage-chain-id" />

Read EVM data or simulate contract calls through Chaintable. The methods below share one JSON-RPC endpoint.

**HTTP method**: `POST`<br />
**Path**: `/v1/leafage/{chain_id}`

**Request format**

| Field | Type | Required | Description |
| - | - | - | - |
| `chain_id` | `integer` | Yes | Path parameter: EIP-155 chain number, such as 1 for Ethereum |

| Field | Type | Required | Description |
| - | - | - | - |
| `jsonrpc` | `string` | Yes | JSON-RPC version; Must be `"2.0"` |
| `id` | `integer` / `string` / `null` | No | JSON-RPC request ID used to match the response |
| `method` | `string` | Yes | Leafage method name |
| `params` | `JSON[]` | No | Positional method arguments |

Supply `params` in the order listed for each method. `?` marks optional trailing arguments; use `null` as a placeholder when supplying a later argument.

**Response format**

| Field | Type | Description |
| - | - | - |
| `jsonrpc` | `string` | JSON-RPC version; Must be `"2.0"` |
| `id` | `JSON` | JSON-RPC ID corresponding to the request |
| `result` | `JSON` | Upstream result; mutually exclusive with error |
| `error` | `object` | Upstream error; mutually exclusive with result |

<Expandable title="error — Fields">
  | Field | Type | Description |
  | - | - | - |
  | `code` | `integer` | Upstream JSON-RPC error code |
  | `message` | `string` | Description or error message |
  | `data` | `JSON` | Optional data attached to the upstream error |
</Expandable>

<AccordionGroup>
  <Accordion title="blockIsValid — Check block validity" id="leafage-block-is-valid">
    Checks whether the specified block is valid.

    **Method**: `blockIsValid`

    **Parameters**

    `params: [block_id]`

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `block_id` | `string` | Yes | Block hash |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `result` | `boolean` | Whether the block is valid |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/leafage/1 \
      -H "AccessKey: $CHAINTABLE_ACCESS_KEY" \
      -H 'Content-Type: application/json' \
      --data '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "blockIsValid",
      "params": [
        "0xf5e1d15a3e380006bd271e73c8eeed75fafc3ae6942b16f63c21361079bba709"
      ]
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "jsonrpc": "2.0",
        "id": 1,
        "result": true
      }
    }
    ```
  </Accordion>

  <Accordion title="getLatestBlock — Get the latest block" id="leafage-get-latest-block">
    Returns information about the latest block.

    **Method**: `getLatestBlock`

    **Parameters**

    No parameters. Pass `[]` as `params`.

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `result` | `object` | Latest block details |

    <Expandable title="result — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Block hash |
      | `height` | `integer` | Block height |
      | `timestamp` | `integer` | Block timestamp in Unix seconds |
      | `parent_id` | `string` | Parent block hash |
      | `base_fee_per_gas` | `integer` | Block base fee per gas |
      | `miner` | `string` | Block producer address |
      | `gas_limit` | `integer` | Gas limit |
      | `gas_used` | `integer` | Gas used |
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/leafage/1 \
      -H "AccessKey: $CHAINTABLE_ACCESS_KEY" \
      -H 'Content-Type: application/json' \
      --data '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "getLatestBlock",
      "params": []
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "jsonrpc": "2.0",
        "id": 1,
        "result": {
          "base_fee_per_gas": 102802309,
          "gas_limit": 60000000,
          "gas_used": 7510076,
          "height": 26154104,
          "id": "0xb66a4b6766bd638be6968689ce4e94d2685f4ef9b6d3374d2e1796365c55bdd0",
          "miner": "0x388c818ca8b9251b393131c08a736a67ccb19297",
          "parent_id": "0x3a3efad4b46701971a6df1f5d9255e8d0da0c908c7879158e1e81a8c1abf268f",
          "timestamp": 1791539891
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="getBlockById — Get a block by hash" id="leafage-get-block-by-id">
    Returns block details for a block hash.

    **Method**: `getBlockById`

    **Parameters**

    `params: [block_id]`

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `block_id` | `string` | Yes | Block hash |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `result` | `object` | Details of the specified block |

    <Expandable title="result — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Block hash |
      | `height` | `integer` | Block height |
      | `timestamp` | `integer` | Block timestamp in Unix seconds |
      | `parent_id` | `string` | Parent block hash |
      | `base_fee_per_gas` | `integer` | Block base fee per gas |
      | `miner` | `string` | Block producer address |
      | `gas_limit` | `integer` | Gas limit |
      | `gas_used` | `integer` | Gas used |
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/leafage/1 \
      -H "AccessKey: $CHAINTABLE_ACCESS_KEY" \
      -H 'Content-Type: application/json' \
      --data '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "getBlockById",
      "params": [
        "0xf5e1d15a3e380006bd271e73c8eeed75fafc3ae6942b16f63c21361079bba709"
      ]
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "jsonrpc": "2.0",
        "id": 1,
        "result": {
          "base_fee_per_gas": 18191470273,
          "gas_limit": 30000000,
          "gas_used": 13952884,
          "height": 21000000,
          "id": "0xf5e1d15a3e380006bd271e73c8eeed75fafc3ae6942b16f63c21361079bba709",
          "miner": "0x95222290dd7278aa3ddd389cc1e1d165cc4bafe5",
          "parent_id": "0x215f1fa046ff46999f1a91973d7cc39c6d4e7aa64d3de3a40d31591f543c3386",
          "timestamp": 1729345547
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="getBlockByHeight — Get a block by height" id="leafage-get-block-by-height">
    Returns block details for a block height.

    **Method**: `getBlockByHeight`

    **Parameters**

    `params: [block_height]`

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `block_height` | `integer` | Yes | Block height as an integer |

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `result` | `object` | Details of the block at the specified height |

    <Expandable title="result — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `id` | `string` | Block hash |
      | `height` | `integer` | Block height |
      | `timestamp` | `integer` | Block timestamp in Unix seconds |
      | `parent_id` | `string` | Parent block hash |
      | `base_fee_per_gas` | `integer` | Block base fee per gas |
      | `miner` | `string` | Block producer address |
      | `gas_limit` | `integer` | Gas limit |
      | `gas_used` | `integer` | Gas used |
    </Expandable>

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/leafage/1 \
      -H "AccessKey: $CHAINTABLE_ACCESS_KEY" \
      -H 'Content-Type: application/json' \
      --data '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "getBlockByHeight",
      "params": [
        21000000
      ]
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "jsonrpc": "2.0",
        "id": 1,
        "result": {
          "base_fee_per_gas": 18191470273,
          "gas_limit": 30000000,
          "gas_used": 13952884,
          "height": 21000000,
          "id": "0xf5e1d15a3e380006bd271e73c8eeed75fafc3ae6942b16f63c21361079bba709",
          "miner": "0x95222290dd7278aa3ddd389cc1e1d165cc4bafe5",
          "parent_id": "0x215f1fa046ff46999f1a91973d7cc39c6d4e7aa64d3de3a40d31591f543c3386",
          "timestamp": 1729345547
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="getAddressBalance — Get an address balance" id="leafage-get-address-balance">
    Returns the native token balance of an address.

    **Method**: `getAddressBalance`

    **Parameters**

    `params: [address, block_context?]`

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `address` | `string` | Yes | EVM address to query |
    | `block_context` | `object` | No | State to read; defaults to the latest state |

    <Expandable title="block_context — Fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `block_id` | `string` | Yes | Block hash, hexadecimal height, or latest |
      | `type` | `string` | Yes | Equals reads the specified block; Contains checks that the block is valid and canonical, then reads the latest state, otherwise returning an error; Values: `"Equals"`, `"Contains"` |
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `result` | `string` | Native token balance as a hexadecimal U256 string in the smallest unit |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/leafage/1 \
      -H "AccessKey: $CHAINTABLE_ACCESS_KEY" \
      -H 'Content-Type: application/json' \
      --data '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "getAddressBalance",
      "params": [
        "0x3333333333333333333333333333333333333333",
        {
          "block_id": "latest",
          "type": "Equals"
        }
      ]
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "jsonrpc": "2.0",
        "id": 1,
        "result": "0xde0b6b3a7640000"
      }
    }
    ```
  </Accordion>

  <Accordion title="getAddressNonce — Get an address nonce" id="leafage-get-address-nonce">
    Returns the nonce of an address.

    **Method**: `getAddressNonce`

    **Parameters**

    `params: [address, block_context?]`

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `address` | `string` | Yes | EVM address to query |
    | `block_context` | `object` | No | State to read; defaults to the latest state |

    <Expandable title="block_context — Fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `block_id` | `string` | Yes | Block hash, hexadecimal height, or latest |
      | `type` | `string` | Yes | Equals reads the specified block; Contains checks that the block is valid and canonical, then reads the latest state, otherwise returning an error; Values: `"Equals"`, `"Contains"` |
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `result` | `string` | Address nonce as a hexadecimal U256 string |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/leafage/1 \
      -H "AccessKey: $CHAINTABLE_ACCESS_KEY" \
      -H 'Content-Type: application/json' \
      --data '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "getAddressNonce",
      "params": [
        "0x3333333333333333333333333333333333333333",
        {
          "block_id": "latest",
          "type": "Equals"
        }
      ]
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "jsonrpc": "2.0",
        "id": 1,
        "result": "0x2a"
      }
    }
    ```
  </Accordion>

  <Accordion title="getAddressCode — Get contract code" id="leafage-get-address-code">
    Returns the contract bytecode at an address.

    **Method**: `getAddressCode`

    **Parameters**

    `params: [address, block_context?]`

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `address` | `string` | Yes | EVM address to query |
    | `block_context` | `object` | No | State to read; defaults to the latest state |

    <Expandable title="block_context — Fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `block_id` | `string` | Yes | Block hash, hexadecimal height, or latest |
      | `type` | `string` | Yes | Equals reads the specified block; Contains checks that the block is valid and canonical, then reads the latest state, otherwise returning an error; Values: `"Equals"`, `"Contains"` |
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `result` | `string` | Contract bytecode as a hexadecimal string; 0x when no code exists |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/leafage/1 \
      -H "AccessKey: $CHAINTABLE_ACCESS_KEY" \
      -H 'Content-Type: application/json' \
      --data '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "getAddressCode",
      "params": [
        "0x3333333333333333333333333333333333333333",
        {
          "block_id": "latest",
          "type": "Equals"
        }
      ]
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "jsonrpc": "2.0",
        "id": 1,
        "result": "0x"
      }
    }
    ```
  </Accordion>

  <Accordion title="getStorageAt — Get a storage slot" id="leafage-get-storage-at">
    Returns the value in a specified contract storage slot.

    **Method**: `getStorageAt`

    **Parameters**

    `params: [address, position, block_context?]`

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `address` | `string` | Yes | EVM address to query |
    | `position` | `string` | Yes | Storage slot position as a hexadecimal value |
    | `block_context` | `object` | No | State to read; defaults to the latest state |

    <Expandable title="block_context — Fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `block_id` | `string` | Yes | Block hash, hexadecimal height, or latest |
      | `type` | `string` | Yes | Equals reads the specified block; Contains checks that the block is valid and canonical, then reads the latest state, otherwise returning an error; Values: `"Equals"`, `"Contains"` |
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `result` | `string` | Storage slot value as a hexadecimal string |

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/leafage/1 \
      -H "AccessKey: $CHAINTABLE_ACCESS_KEY" \
      -H 'Content-Type: application/json' \
      --data '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "getStorageAt",
      "params": [
        "0xA0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
        "0x1",
        {
          "block_id": "latest",
          "type": "Equals"
        }
      ]
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "jsonrpc": "2.0",
        "id": 1,
        "result": "0x0000000000000000000000000000000000000000000000000000000000000000"
      }
    }
    ```
  </Accordion>

  <Accordion title="contractMultiCall — Call contracts in a batch" id="leafage-contract-multi-call">
    Simulates contract calls in a batch and returns results in call order. Block and account overrides apply only to the simulation and do not change on-chain state.

    **Method**: `contractMultiCall`

    **Parameters**

    `params: [calls, block_context?, block_overrides?, state_overrides?, fast_fail?, use_parallel?, disable_cache?]`

    | Field | Type | Required | Description |
    | - | - | - | - |
    | `calls` | `object[]` | Yes | Contract calls; one simulated call per entry |
    | `block_context` | `object` | No | State to read; defaults to the latest state |
    | `block_overrides` | `object` | No | Overrides for the simulated block environment |
    | `state_overrides` | `object` | No | Account state overrides keyed by EVM address |
    | `fast_fail` | `boolean` | No | Stop when any call fails |
    | `use_parallel` | `boolean` | No | Whether to execute calls in parallel |
    | `disable_cache` | `boolean` | No | Whether to bypass the cache |

    <Expandable title="calls — Item fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `from` | `string` / `null` | No | Simulated caller’s EVM address |
      | `to` | `string` / `null` | No | Target EVM address |
      | `gas` | `string` / `null` | No | Gas limit as a hexadecimal quantity |
      | `gasPrice` | `string` / `null` | No | Gas price as a hexadecimal quantity |
      | `maxFeePerGas` | `string` / `null` | No | Maximum fee per gas as a hexadecimal quantity |
      | `maxPriorityFeePerGas` | `string` / `null` | No | Maximum priority fee per gas as a hexadecimal quantity |
      | `value` | `string` / `null` | No | Native token value sent with the call, as a hexadecimal quantity in the smallest unit |
      | `nonce` | `string` / `null` | No | Nonce as a hexadecimal quantity |
      | `data` | `string` / `null` | No | Compatibility alias for input; prefer input |
      | `input` | `string` / `null` | No | Hexadecimal call data |
      | `chainId` | `string` / `null` | No | EIP-155 chain ID as a hexadecimal quantity |
      | `maxFeePerBlobGas` | `string` / `null` | No | Maximum fee per blob gas as a hexadecimal quantity |
      | `accessList` | `object[]` / `null` | No | Declared addresses and storage slots |
      | `blobVersionedHashes` | `string[]` | No | Array of blob versioned hashes |
      | `blobs` | `string[]` | No | Blob data as an array of hexadecimal byte strings |
      | `commitments` | `string[]` | No | Blob KZG commitments as hexadecimal byte strings |
      | `proofs` | `string[]` | No | Blob KZG proofs as hexadecimal byte strings |

      <Expandable title="accessList — Item fields">
        | Field | Type | Required | Description |
        | - | - | - | - |
        | `address` | `string` | Yes | EVM address |
        | `storageKeys` | `string[]` | Yes | Storage slots, each a 32-byte hexadecimal value |
      </Expandable>
    </Expandable>

    <Expandable title="block_context — Fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `block_id` | `string` | Yes | Block hash, hexadecimal height, or latest |
      | `type` | `string` | Yes | Equals reads the specified block; Contains checks that the block is valid and canonical, then reads the latest state, otherwise returning an error; Values: `"Equals"`, `"Contains"` |
    </Expandable>

    <Expandable title="block_overrides — Fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `number` | `string` / `null` | No | Overridden block height as a hexadecimal quantity |
      | `difficulty` | `string` / `null` | No | Overridden difficulty as a hexadecimal quantity; ignored for post-merge calls |
      | `time` | `string` / `null` | No | Overridden block time as a hexadecimal Unix-seconds quantity |
      | `gasLimit` | `string` / `null` | No | Overridden block gas limit as a hexadecimal quantity |
      | `feeRecipient` | `string` / `null` | No | Overridden fee recipient address |
      | `prevRandao` | `string` / `null` | No | Overridden randomness as a 32-byte hexadecimal value |
      | `baseFeePerGas` | `string` / `null` | No | Overridden base fee as a hexadecimal quantity |
      | `blobBaseFee` | `string` / `null` | No | Overridden blob base fee as a hexadecimal quantity |
    </Expandable>

    <Expandable title="state_overrides — Value fields">
      | Field | Type | Required | Description |
      | - | - | - | - |
      | `balance` | `string` / `null` | No | Overridden native token balance as a hexadecimal quantity in the smallest unit |
      | `nonce` | `string` / `null` | No | Nonce as a hexadecimal quantity |
      | `code` | `string` / `null` | No | Overridden contract bytecode as hexadecimal bytes |
      | `movePrecompileToAddress` | `string` / `null` | No | Address to which the precompile is moved |
      | `state` | `object` | No | Replace storage entirely; keys and values are 32-byte hexadecimal values |
      | `stateDiff` | `object` | No | Override only specified slots; keys and values are 32-byte hexadecimal values |
    </Expandable>

    **Returns**

    | Field | Type | Description |
    | - | - | - |
    | `result` | `object` | Batch call results and execution details |

    <Expandable title="result — Fields">
      | Field | Type | Description |
      | - | - | - |
      | `results` | `object[]` | Results in call order |
      | `stats` | `object` | Execution details for this batch |

      <Expandable title="results — Item fields">
        | Field | Type | Description |
        | - | - | - |
        | `code` | `integer` | Per-call status: 0 for success, a negative value for an upstream call failure |
        | `err` | `string` | Call error message; empty on success |
        | `from_cache` | `boolean` | Whether the result came from cache |
        | `result` | `string` | ABI-encoded return data as hexadecimal bytes |
        | `gas_used` | `integer` | Gas used |
        | `time_cost` | `number` | Per-call duration reported by the upstream |
      </Expandable>

      <Expandable title="stats — Fields">
        | Field | Type | Description |
        | - | - | - |
        | `block_num` | `integer` | Block height used for execution |
        | `block_hash` | `string` | Block hash used for execution |
        | `block_time` | `integer` | Timestamp of the block used, in Unix seconds |
        | `success` | `boolean` | Overall batch success status |
        | `cache_enabled` | `boolean` | Whether caching was enabled |
      </Expandable>
    </Expandable>

    `stats.success` indicates the overall batch status. Within `results`, each item’s `code` is `0` on success or a negative value on upstream call failure.

    **Request**

    ```bash theme={null}
    curl https://api.chaintable.com/v1/leafage/1 \
      -H "AccessKey: $CHAINTABLE_ACCESS_KEY" \
      -H 'Content-Type: application/json' \
      --data '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "contractMultiCall",
      "params": [
        [
          {
            "to": "0xA0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
            "input": "0x18160ddd"
          }
        ],
        {
          "block_id": "latest",
          "type": "Equals"
        }
      ]
    }'
    ```

    **Result**

    ```json theme={null}
    {
      "code": 0,
      "message": "ok",
      "data": {
        "jsonrpc": "2.0",
        "id": 1,
        "result": {
          "results": [
            {
              "code": 0,
              "err": "",
              "from_cache": false,
              "result": "0x00000000000000000000000000000000000000000000000000000000000f4240",
              "gas_used": 2100,
              "time_cost": 0.003
            }
          ],
          "stats": {
            "block_num": 21000000,
            "block_hash": "0x1111111111111111111111111111111111111111111111111111111111111111",
            "block_time": 1788220800,
            "success": true,
            "cache_enabled": true
          }
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>

**Upstream error codes**

Upstream error codes are separate from the outer Chaintable `code`. They appear in `error.code` or an individual batch call’s `code`.

| Upstream code | Meaning |
| - | - |
| `-32700`, `-32600`, `-32601`, `-32602` | Invalid JSON, invalid request object, unsupported method, invalid parameters |
| `-32603` | Internal node error |
| `-39000`–`-39004` | Contract revert, out of gas, insufficient balance, nonce error, other EVM execution failure |
| `-39005` | State data read failure |
| `-39006`, `-39007` | Block not found, invalid block ID |
| `-41000` | Queried block height exceeds the limit |
| `-41001`, `-41004` | Too many requests, gateway rate limit |
| `-41002`, `-41003` | Gateway timeout, method not allowed |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.