Skip to main content
POST
/
v1
/
view
Create view
curl --request POST \
  --url https://api.braintrust.dev/v1/view \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "object_type": "organization",
  "object_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "view_type": "projects",
  "name": "<string>",
  "view_data": {
    "search": {
      "filter": [
        "<any>"
      ],
      "tag": [
        "<any>"
      ],
      "match": [
        "<any>"
      ],
      "sort": [
        "<any>"
      ]
    },
    "custom_charts": "<any>"
  },
  "options": {
    "viewType": "monitor",
    "options": {
      "spanType": "range",
      "rangeValue": "<string>",
      "frameStart": "<string>",
      "frameEnd": "<string>",
      "tzUTC": true,
      "chartVisibility": {},
      "projectId": "<string>",
      "type": "project",
      "groupBy": "<string>"
    }
  },
  "user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "deleted_at": "2023-11-07T05:31:56Z"
}'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "object_type": "organization",
  "object_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "view_type": "projects",
  "name": "<string>",
  "created": "2023-11-07T05:31:56Z",
  "view_data": {
    "search": {
      "filter": [
        "<any>"
      ],
      "tag": [
        "<any>"
      ],
      "match": [
        "<any>"
      ],
      "sort": [
        "<any>"
      ]
    },
    "custom_charts": "<any>"
  },
  "options": {
    "viewType": "monitor",
    "options": {
      "spanType": "range",
      "rangeValue": "<string>",
      "frameStart": "<string>",
      "frameEnd": "<string>",
      "tzUTC": true,
      "chartVisibility": {},
      "projectId": "<string>",
      "type": "project",
      "groupBy": "<string>"
    }
  },
  "user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "deleted_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Most Braintrust endpoints are authenticated by providing your API key as a header Authorization: Bearer [api_key] to your HTTP request. You can create an API key in the Braintrust organization settings page.

Body

application/json

Any desired information about the new view object

object_type
enum<string>
required

The object type that the ACL applies to

Available options:
organization,
project,
experiment,
dataset,
prompt,
prompt_session,
group,
role,
org_member,
project_log,
org_project
object_id
string<uuid>
required

The id of the object the view applies to

view_type
enum<string>
required

Type of object that the view corresponds to.

Available options:
projects,
experiments,
experiment,
playgrounds,
playground,
datasets,
dataset,
prompts,
tools,
scorers,
logs,
agents,
monitor,
for_review
name
string
required

Name of the view

view_data
object | null

The view definition

options
object | null

Options for the view in the app

  • MonitorViewOptions
  • TableViewOptions
user_id
string<uuid> | null

Identifies the user who created the view

deleted_at
string<date-time> | null

Date of role deletion, or null if the role is still active

Response

Returns the new view object

id
string<uuid>
required

Unique identifier for the view

object_type
enum<string>
required

The object type that the ACL applies to

Available options:
organization,
project,
experiment,
dataset,
prompt,
prompt_session,
group,
role,
org_member,
project_log,
org_project
object_id
string<uuid>
required

The id of the object the view applies to

view_type
enum<string>
required

Type of object that the view corresponds to.

Available options:
projects,
experiments,
experiment,
playgrounds,
playground,
datasets,
dataset,
prompts,
tools,
scorers,
logs,
agents,
monitor,
for_review
name
string
required

Name of the view

created
string<date-time> | null

Date of view creation

view_data
object | null

The view definition

options
object | null

Options for the view in the app

  • MonitorViewOptions
  • TableViewOptions
user_id
string<uuid> | null

Identifies the user who created the view

deleted_at
string<date-time> | null

Date of role deletion, or null if the role is still active