Reference/API/Views
GET
/v1/view

List views

List out all views. The views are sorted by creation date, with the most recently-created views coming first

Authorization

Authorization
Required
Bearer <token>

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.

In: header


Query Parameters

limitinteger

Limit the number of objects to return

Minimum: 0

starting_afterstring

Pagination cursor id.

For example, if the final item in the last page you fetched had an id of foo, pass starting_after=foo to fetch the next page. Note: you may only pass one of starting_after and ending_before

Format: "uuid"

ending_beforestring

Pagination cursor id.

For example, if the initial item in the last page you fetched had an id of foo, pass ending_before=foo to fetch the previous page. Note: you may only pass one of starting_after and ending_before

Format: "uuid"

idsAny properties in string, array<string>

Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times

view_namestring

Name of the view to search for

view_typestring

Type of table that the view corresponds to.

Value in: "projects" | "logs" | "experiments" | "datasets" | "prompts" | "playgrounds" | "experiment" | "dataset" | null

object_type
Required
string

The object type that the ACL applies to

Value in: "organization" | "project" | "experiment" | "dataset" | "prompt" | "prompt_session" | "group" | "role" | "org_member" | "project_log" | "org_project" | null

object_id
Required
string

The id of the object the ACL applies to

Format: "uuid"
Status codeDescription
200Returns a list of view objects
400The request was unacceptable, often due to missing a required parameter
401No valid API key provided
403The API key doesn’t have permissions to perform the request
429Too many requests hit the API too quickly. We recommend an exponential backoff of your requests
500Something went wrong on Braintrust's end. (These are rare.)
curl -X GET "https://api.braintrust.dev/v1/view?limit=0&starting_after=497f6eca-6276-4993-bfeb-53cbbbba6f08&ending_before=497f6eca-6276-4993-bfeb-53cbbbba6f08&ids=497f6eca-6276-4993-bfeb-53cbbbba6f08&view_name=string&view_type=projects&object_type=organization&object_id=497f6eca-6276-4993-bfeb-53cbbbba6f08"

{
  "objects": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "object_type": "organization",
      "object_id": "463a83d0-a816-4902-abba-2486e0c0a0bb",
      "view_type": "projects",
      "name": "string",
      "created": "2019-08-24T14:15:22Z",
      "view_data": {
        "search": {
          "filter": [
            null
          ],
          "tag": [
            null
          ],
          "match": [
            null
          ],
          "sort": [
            null
          ]
        }
      },
      "options": {
        "columnVisibility": {
          "property1": true,
          "property2": true
        },
        "columnOrder": [
          "string"
        ],
        "columnSizing": {
          "property1": 0,
          "property2": 0
        }
      },
      "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
      "deleted_at": "2019-08-24T14:15:22Z"
    }
  ]
}

POST
/v1/view

Create view

Create a new view. If there is an existing view with the same name as the one specified in the request, will return the existing view unmodified

Authorization

Authorization
Required
Bearer <token>

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.

In: header


Request Body (Optional)

Any desired information about the new view object

object_type
Required
string

The object type that the ACL applies to

Value in: "organization" | "project" | "experiment" | "dataset" | "prompt" | "prompt_session" | "group" | "role" | "org_member" | "project_log" | "org_project" | null

object_id
Required
string

The id of the object the view applies to

Format: "uuid"

view_type
Required
string

Type of table that the view corresponds to.

Value in: "projects" | "logs" | "experiments" | "datasets" | "prompts" | "playgrounds" | "experiment" | "dataset" | null

name
Required
string

Name of the view

view_dataobject | null

The view definition

optionsobject | null

Options for the view in the app

user_idstring | null

Identifies the user who created the view

Format: "uuid"

deleted_atstring | null

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

Format: "date-time"
Status codeDescription
200Returns the new view object
400The request was unacceptable, often due to missing a required parameter
401No valid API key provided
403The API key doesn’t have permissions to perform the request
429Too many requests hit the API too quickly. We recommend an exponential backoff of your requests
500Something went wrong on Braintrust's end. (These are rare.)
curl -X POST "https://api.braintrust.dev/v1/view" \
  -d '{
  "object_type": "organization",
  "object_id": "463a83d0-a816-4902-abba-2486e0c0a0bb",
  "view_type": "projects",
  "name": "string",
  "view_data": {
    "search": {
      "filter": [
        null
      ],
      "tag": [
        null
      ],
      "match": [
        null
      ],
      "sort": [
        null
      ]
    }
  },
  "options": {
    "columnVisibility": {
      "property1": true,
      "property2": true
    },
    "columnOrder": [
      "string"
    ],
    "columnSizing": {
      "property1": 0,
      "property2": 0
    }
  },
  "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
  "deleted_at": "2019-08-24T14:15:22Z"
}'

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "object_type": "organization",
  "object_id": "463a83d0-a816-4902-abba-2486e0c0a0bb",
  "view_type": "projects",
  "name": "string",
  "created": "2019-08-24T14:15:22Z",
  "view_data": {
    "search": {
      "filter": [
        null
      ],
      "tag": [
        null
      ],
      "match": [
        null
      ],
      "sort": [
        null
      ]
    }
  },
  "options": {
    "columnVisibility": {
      "property1": true,
      "property2": true
    },
    "columnOrder": [
      "string"
    ],
    "columnSizing": {
      "property1": 0,
      "property2": 0
    }
  },
  "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
  "deleted_at": "2019-08-24T14:15:22Z"
}

PUT
/v1/view

Create or replace view

Create or replace view. If there is an existing view with the same name as the one specified in the request, will replace the existing view with the provided fields

Authorization

Authorization
Required
Bearer <token>

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.

In: header


Request Body (Optional)

Any desired information about the new view object

object_type
Required
string

The object type that the ACL applies to

Value in: "organization" | "project" | "experiment" | "dataset" | "prompt" | "prompt_session" | "group" | "role" | "org_member" | "project_log" | "org_project" | null

object_id
Required
string

The id of the object the view applies to

Format: "uuid"

view_type
Required
string

Type of table that the view corresponds to.

Value in: "projects" | "logs" | "experiments" | "datasets" | "prompts" | "playgrounds" | "experiment" | "dataset" | null

name
Required
string

Name of the view

view_dataobject | null

The view definition

optionsobject | null

Options for the view in the app

user_idstring | null

Identifies the user who created the view

Format: "uuid"

deleted_atstring | null

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

Format: "date-time"
Status codeDescription
200Returns the new view object
400The request was unacceptable, often due to missing a required parameter
401No valid API key provided
403The API key doesn’t have permissions to perform the request
429Too many requests hit the API too quickly. We recommend an exponential backoff of your requests
500Something went wrong on Braintrust's end. (These are rare.)
curl -X PUT "https://api.braintrust.dev/v1/view" \
  -d '{
  "object_type": "organization",
  "object_id": "463a83d0-a816-4902-abba-2486e0c0a0bb",
  "view_type": "projects",
  "name": "string",
  "view_data": {
    "search": {
      "filter": [
        null
      ],
      "tag": [
        null
      ],
      "match": [
        null
      ],
      "sort": [
        null
      ]
    }
  },
  "options": {
    "columnVisibility": {
      "property1": true,
      "property2": true
    },
    "columnOrder": [
      "string"
    ],
    "columnSizing": {
      "property1": 0,
      "property2": 0
    }
  },
  "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
  "deleted_at": "2019-08-24T14:15:22Z"
}'

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "object_type": "organization",
  "object_id": "463a83d0-a816-4902-abba-2486e0c0a0bb",
  "view_type": "projects",
  "name": "string",
  "created": "2019-08-24T14:15:22Z",
  "view_data": {
    "search": {
      "filter": [
        null
      ],
      "tag": [
        null
      ],
      "match": [
        null
      ],
      "sort": [
        null
      ]
    }
  },
  "options": {
    "columnVisibility": {
      "property1": true,
      "property2": true
    },
    "columnOrder": [
      "string"
    ],
    "columnSizing": {
      "property1": 0,
      "property2": 0
    }
  },
  "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
  "deleted_at": "2019-08-24T14:15:22Z"
}

GET
/v1/view/{view_id}

Get view

Get a view object by its id

Authorization

Authorization
Required
Bearer <token>

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.

In: header


Path Parameters

view_id
Required
string

View id

Format: "uuid"

Query Parameters

object_type
Required
string

The object type that the ACL applies to

Value in: "organization" | "project" | "experiment" | "dataset" | "prompt" | "prompt_session" | "group" | "role" | "org_member" | "project_log" | "org_project" | null

object_id
Required
string

The id of the object the ACL applies to

Format: "uuid"
Status codeDescription
200Returns the view object
400The request was unacceptable, often due to missing a required parameter
401No valid API key provided
403The API key doesn’t have permissions to perform the request
429Too many requests hit the API too quickly. We recommend an exponential backoff of your requests
500Something went wrong on Braintrust's end. (These are rare.)
curl -X GET "https://api.braintrust.dev/v1/view/497f6eca-6276-4993-bfeb-53cbbbba6f08?object_type=organization&object_id=497f6eca-6276-4993-bfeb-53cbbbba6f08"

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "object_type": "organization",
  "object_id": "463a83d0-a816-4902-abba-2486e0c0a0bb",
  "view_type": "projects",
  "name": "string",
  "created": "2019-08-24T14:15:22Z",
  "view_data": {
    "search": {
      "filter": [
        null
      ],
      "tag": [
        null
      ],
      "match": [
        null
      ],
      "sort": [
        null
      ]
    }
  },
  "options": {
    "columnVisibility": {
      "property1": true,
      "property2": true
    },
    "columnOrder": [
      "string"
    ],
    "columnSizing": {
      "property1": 0,
      "property2": 0
    }
  },
  "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
  "deleted_at": "2019-08-24T14:15:22Z"
}

PATCH
/v1/view/{view_id}

Partially update view

Partially update a view object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.

Authorization

Authorization
Required
Bearer <token>

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.

In: header


Request Body (Optional)

Fields to update

object_type
Required
string

The object type that the ACL applies to

Value in: "organization" | "project" | "experiment" | "dataset" | "prompt" | "prompt_session" | "group" | "role" | "org_member" | "project_log" | "org_project" | null

object_id
Required
string

The id of the object the view applies to

Format: "uuid"

view_typestring | null

Type of table that the view corresponds to.

Value in: "projects" | "logs" | "experiments" | "datasets" | "prompts" | "playgrounds" | "experiment" | "dataset" | null

namestring | null

Name of the view

view_dataobject | null

The view definition

optionsobject | null

Options for the view in the app

user_idstring | null

Identifies the user who created the view

Format: "uuid"

Path Parameters

view_id
Required
string

View id

Format: "uuid"
Status codeDescription
200Returns the view object
400The request was unacceptable, often due to missing a required parameter
401No valid API key provided
403The API key doesn’t have permissions to perform the request
429Too many requests hit the API too quickly. We recommend an exponential backoff of your requests
500Something went wrong on Braintrust's end. (These are rare.)
curl -X PATCH "https://api.braintrust.dev/v1/view/497f6eca-6276-4993-bfeb-53cbbbba6f08" \
  -d '{
  "object_type": "organization",
  "object_id": "463a83d0-a816-4902-abba-2486e0c0a0bb",
  "view_type": "projects",
  "name": "string",
  "view_data": {
    "search": {
      "filter": [
        null
      ],
      "tag": [
        null
      ],
      "match": [
        null
      ],
      "sort": [
        null
      ]
    }
  },
  "options": {
    "columnVisibility": {
      "property1": true,
      "property2": true
    },
    "columnOrder": [
      "string"
    ],
    "columnSizing": {
      "property1": 0,
      "property2": 0
    }
  },
  "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"
}'

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "object_type": "organization",
  "object_id": "463a83d0-a816-4902-abba-2486e0c0a0bb",
  "view_type": "projects",
  "name": "string",
  "created": "2019-08-24T14:15:22Z",
  "view_data": {
    "search": {
      "filter": [
        null
      ],
      "tag": [
        null
      ],
      "match": [
        null
      ],
      "sort": [
        null
      ]
    }
  },
  "options": {
    "columnVisibility": {
      "property1": true,
      "property2": true
    },
    "columnOrder": [
      "string"
    ],
    "columnSizing": {
      "property1": 0,
      "property2": 0
    }
  },
  "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
  "deleted_at": "2019-08-24T14:15:22Z"
}

DELETE
/v1/view/{view_id}

Delete view

Delete a view object by its id

Authorization

Authorization
Required
Bearer <token>

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.

In: header


Request Body (Optional)

Additional parameters for the delete operation

object_type
Required
string

The object type that the ACL applies to

Value in: "organization" | "project" | "experiment" | "dataset" | "prompt" | "prompt_session" | "group" | "role" | "org_member" | "project_log" | "org_project" | null

object_id
Required
string

The id of the object the view applies to

Format: "uuid"

Path Parameters

view_id
Required
string

View id

Format: "uuid"
Status codeDescription
200Returns the deleted view object
400The request was unacceptable, often due to missing a required parameter
401No valid API key provided
403The API key doesn’t have permissions to perform the request
429Too many requests hit the API too quickly. We recommend an exponential backoff of your requests
500Something went wrong on Braintrust's end. (These are rare.)
curl -X DELETE "https://api.braintrust.dev/v1/view/497f6eca-6276-4993-bfeb-53cbbbba6f08" \
  -d '{
  "object_type": "organization",
  "object_id": "463a83d0-a816-4902-abba-2486e0c0a0bb"
}'

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "object_type": "organization",
  "object_id": "463a83d0-a816-4902-abba-2486e0c0a0bb",
  "view_type": "projects",
  "name": "string",
  "created": "2019-08-24T14:15:22Z",
  "view_data": {
    "search": {
      "filter": [
        null
      ],
      "tag": [
        null
      ],
      "match": [
        null
      ],
      "sort": [
        null
      ]
    }
  },
  "options": {
    "columnVisibility": {
      "property1": true,
      "property2": true
    },
    "columnOrder": [
      "string"
    ],
    "columnSizing": {
      "property1": 0,
      "property2": 0
    }
  },
  "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
  "deleted_at": "2019-08-24T14:15:22Z"
}