Skip to main content
POST
/
api
/
public
/
v2
/
tables
/
{table_id}
/
sheets
/
{sheet_id}
/
columns
Create Column
curl --request POST \
  --url https://api.promptlayer.com/api/public/v2/tables/{table_id}/sheets/{sheet_id}/columns \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "title": "<string>",
  "config": {},
  "dependencies": [
    {
      "column_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "reference_type": "value",
      "config_key": "<string>",
      "config_meta": {}
    }
  ]
}
'
{
  "success": true,
  "column": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "sheet_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "workspace_id": 123,
    "title": "<string>",
    "config": {},
    "position_rank": 123,
    "is_output_column": true
  },
  "cells": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "sheet_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "column_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "row_index": 123,
      "display_value": "<string>",
      "value": "<unknown>",
      "error": "<string>",
      "input_hash": "<string>",
      "updated_at": "2023-11-07T05:31:56Z",
      "request_metrics": {
        "request_count": 123,
        "request_ids": [
          123
        ],
        "latency_ms": 123,
        "price": 123,
        "input_tokens": 123,
        "output_tokens": 123,
        "trace_ids": [
          "<string>"
        ]
      }
    }
  ],
  "version": 123
}
Add a new column to a sheet. For non-text columns, cells for all existing rows are created with stale status and queued for computation. Use dependencies to declare which other columns this column’s config references. PromptLayer enforces a DAG (no cycles allowed) and uses the dependency graph to propagate staleness when upstream cells change.

Authorizations

X-API-KEY
string
header
required

Path Parameters

table_id
string<uuid>
required
sheet_id
string<uuid>
required

Body

application/json
title
string
required
type
enum<string>
required
Available options:
text,
prompt_template,
llm,
code,
score,
comparison,
composition
config
object

Type-specific column configuration.

dependencies
object[] | null

Column dependency edges for non-text columns.

Response

Column created

success
boolean
column
object

A column within a Table sheet.

cells
object[]
version
integer