curl --request POST \
--url https://api.promptlayer.com/api/public/v2/tables \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"title": "Regression suite"
}
'{
"success": true,
"table": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspace_id": 123,
"title": "<string>",
"folder_id": 123,
"sheet_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"sheet_row_counts": {}
},
"message": "<string>",
"default_sheet": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"table_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspace_id": 123,
"title": "<string>",
"index": 123,
"row_count": 123,
"version_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Tables
Create Table
Create a new Table. By default, an empty Sheet 1 with a Column A text column and one empty row is created. Pass create_default_sheet: false to create a table without a default sheet. Requests are scoped to the workspace associated with the API key; table, sheet, column, cell, operation, and version IDs must belong to that workspace.
POST
/
api
/
public
/
v2
/
tables
curl --request POST \
--url https://api.promptlayer.com/api/public/v2/tables \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"title": "Regression suite"
}
'{
"success": true,
"table": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspace_id": 123,
"title": "<string>",
"folder_id": 123,
"sheet_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"sheet_row_counts": {}
},
"message": "<string>",
"default_sheet": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"table_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspace_id": 123,
"title": "<string>",
"index": 123,
"row_count": 123,
"version_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create a new Table. By default, an empty
Sheet 1 with a Column A text column and one empty row is created automatically.
Pass create_default_sheet: false to create a table without a default sheet. The response omits default_sheet and table.sheet_count is 0. Add sheets later with Create Sheet.
The table is created in the workspace associated with your API key.
Tables are versioned, multi-sheet tables that can run LLM, code, and comparison columns to generate or evaluate data at scale.Body
application/json
Response
Table created. When create_default_sheet is true (default), the response includes default_sheet and table.sheet_count is 1. When create_default_sheet is false, default_sheet is omitted and table.sheet_count is 0.
Was this page helpful?

