Datasets

REST API methods for interacting with Phoenix datasets

List datasets

get
Query parameters
cursorany ofOptional

Cursor for pagination

nameany ofOptional

An optional dataset name to filter by

limitintegerOptional

The max number of datasets to return at a time.

Default: 10
Responses
application/json
objectOptional
get
GET /v1/datasets HTTP/1.1
Host: 
Accept: */*
{
  "data": [
    {
      "id": "text",
      "name": "text",
      "description": "text",
      "metadata": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "created_at": "2025-04-19T17:44:31.817Z",
      "updated_at": "2025-04-19T17:44:31.817Z"
    }
  ],
  "next_cursor": "text"
}

Get dataset by ID

get
Path parameters
idstringRequired

The ID of the dataset

Responses
application/json
objectOptional
get
GET /v1/datasets/{id} HTTP/1.1
Host: 
Accept: */*
{
  "data": {
    "id": "text",
    "name": "text",
    "description": "text",
    "metadata": {
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "created_at": "2025-04-19T17:44:31.817Z",
    "updated_at": "2025-04-19T17:44:31.817Z",
    "example_count": 1
  }
}

Delete dataset by ID

delete
Path parameters
idstringRequired

The ID of the dataset to delete.

Responses
delete
DELETE /v1/datasets/{id} HTTP/1.1
Host: 
Accept: */*

No content

List dataset versions

get
Path parameters
idstringRequired

The ID of the dataset

Query parameters
cursorany ofOptional

Cursor for pagination

limitintegerOptional

The max number of dataset versions to return at a time

Default: 10
Responses
application/json
objectOptional
get
GET /v1/datasets/{id}/versions HTTP/1.1
Host: 
Accept: */*
{
  "data": [
    {
      "version_id": "text",
      "description": "text",
      "metadata": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "created_at": "2025-04-19T17:44:31.817Z"
    }
  ],
  "next_cursor": "text"
}

Upload dataset from JSON, CSV, or PyArrow

post
Query parameters
syncbooleanOptional

If true, fulfill request synchronously and return JSON containing dataset_id.

Default: false
Body
actionstring · enumOptionalAvailable options:
namestringRequired
descriptionstringOptional
inputsobject[]Required
outputsobject[]Optional
metadataobject[]Optional
Responses
application/json
any ofOptional
post
POST /v1/datasets/upload HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 99

{
  "action": "create",
  "name": "text",
  "description": "text",
  "inputs": [
    {}
  ],
  "outputs": [
    {}
  ],
  "metadata": [
    {}
  ]
}
{
  "data": {
    "dataset_id": "text"
  }
}

Get examples from a dataset

get
Path parameters
idstringRequired

The ID of the dataset

Query parameters
version_idany ofOptional

The ID of the dataset version (if omitted, returns data from the latest version)

Responses
application/json
objectOptional
get
GET /v1/datasets/{id}/examples HTTP/1.1
Host: 
Accept: */*
{
  "data": {
    "dataset_id": "text",
    "version_id": "text",
    "examples": [
      {
        "id": "text",
        "input": {
          "ANY_ADDITIONAL_PROPERTY": "anything"
        },
        "output": {
          "ANY_ADDITIONAL_PROPERTY": "anything"
        },
        "metadata": {
          "ANY_ADDITIONAL_PROPERTY": "anything"
        },
        "updated_at": "2025-04-19T17:44:31.817Z"
      }
    ]
  }
}

Download dataset examples as CSV file

get
Path parameters
idstringRequired

The ID of the dataset

Query parameters
version_idany ofOptional

The ID of the dataset version (if omitted, returns data from the latest version)

Responses
text/csv
stringOptional
get
GET /v1/datasets/{id}/csv HTTP/1.1
Host: 
Accept: */*
text

Download dataset examples as OpenAI fine-tuning JSONL file

get
Path parameters
idstringRequired

The ID of the dataset

Query parameters
version_idany ofOptional

The ID of the dataset version (if omitted, returns data from the latest version)

Responses
text/plain
stringOptional
get
GET /v1/datasets/{id}/jsonl/openai_ft HTTP/1.1
Host: 
Accept: */*
text

Download dataset examples as OpenAI evals JSONL file

get
Path parameters
idstringRequired

The ID of the dataset

Query parameters
version_idany ofOptional

The ID of the dataset version (if omitted, returns data from the latest version)

Responses
text/plain
stringOptional
get
GET /v1/datasets/{id}/jsonl/openai_evals HTTP/1.1
Host: 
Accept: */*
text

Last updated

Was this helpful?