Skip to main content
POST
/
api
/
public
/
v2
/
tables
/
{table_id}
/
sheets
/
{sheet_id}
/
operations
Create Table Sheet Operation
curl --request POST \
  --url https://api.promptlayer.com/api/public/v2/tables/{table_id}/sheets/{sheet_id}/operations \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "operation": "recalculate",
  "column_ids": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "row_ids": [
    1
  ],
  "statuses": [],
  "confirmation_token": "<string>"
}
'
{
  "operation_id": "<string>",
  "execution_id": "<string>",
  "execution_ids": [
    "<string>"
  ],
  "cell_count": 123,
  "version": 123,
  "status_url": "<string>",
  "virtual_cell_count": 123,
  "cells": [
    {
      "id": "<string>",
      "sheet_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "column_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "row_index": 123,
      "execution_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "last_computed_version": 123,
      "display_value": "<string>",
      "input_hash": "<string>",
      "value": "<unknown>",
      "updated_at": "2023-11-07T05:31:56Z"
    }
  ]
}
Queue a recalculate operation for selected columns, rows, and cell statuses. By default, recalculation targets stale computed cells. Pass column_ids, row_ids, or statuses to narrow the operation. row_ids are zero-based row indices. statuses accepts STALE, QUEUED, DISPATCHED, RUNNING, COMPLETED, and FAILED; omit it to target stale cells, or pass an empty array to include all statuses. Text columns cannot be recalculated. If the operation affects many cells, the response may return requires_confirmation with a confirmation_token; pass that token in a follow-up request to proceed. If no matching cells need work, the endpoint can return success with cell_count: 0. Queued recalculations return version, the sheet version count used for the operation response. Computed cells report last_computed_version after they complete.

Authorizations

X-API-KEY
string
header
required

Headers

X-API-KEY
string
required

Your PromptLayer API key. The key's workspace scopes table resources for this request.

Path Parameters

table_id
string<uuid>
required

Table ID.

sheet_id
string<uuid>
required

Table sheet ID.

Body

application/json
operation
enum<string>
default:recalculate
Available options:
recalculate
column_ids
string<uuid>[] | null

Columns to recalculate. Text columns cannot be recalculated.

row_ids
integer[] | null

Zero-based row indices to recalculate. If omitted, matching cells across all rows are considered.

Required range: x >= 0
statuses
enum<string>[] | null

Cell statuses to include. Defaults to stale cells. Pass an empty array to include all statuses.

Available options:
STALE,
QUEUED,
DISPATCHED,
RUNNING,
COMPLETED,
FAILED
confirmation_token
string | null

Confirmation token returned when the operation exceeds the confirmation threshold.

Response

No operation was queued or confirmation is required.

success
enum<boolean>
required
Available options:
true
operation
enum<string>
required
Available options:
recalculate
operation_id
string
required
execution_id
string
required
execution_ids
string[]
required
cell_count
integer
required
version
integer
required
status_url
string
required
virtual_cell_count
integer
required
cells
TableCell · object[]
required