Skip to main content
DELETE
/
v1
/
view
/
{view_id}
Delete view
curl --request DELETE \
  --url https://api.braintrust.dev/v1/view/{view_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "object_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'
import requests

url = "https://api.braintrust.dev/v1/view/{view_id}"

payload = { "object_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.delete(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'DELETE',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({object_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};

fetch('https://api.braintrust.dev/v1/view/{view_id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.braintrust.dev/v1/view/{view_id}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_POSTFIELDS => json_encode([
    'object_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.braintrust.dev/v1/view/{view_id}"

	payload := strings.NewReader("{\n  \"object_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")

	req, _ := http.NewRequest("DELETE", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.delete("https://api.braintrust.dev/v1/view/{view_id}")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"object_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.braintrust.dev/v1/view/{view_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"object_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "object_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "created": "2023-11-07T05:31:56Z",
  "view_data": {
    "search": {
      "filter": [
        null
      ],
      "tag": [
        null
      ],
      "match": [
        null
      ],
      "sort": [
        null
      ]
    },
    "custom_charts": null
  },
  "options": {
    "viewType": "monitor",
    "options": {
      "rangeValue": "<string>",
      "frameStart": "<string>",
      "frameEnd": "<string>",
      "tzUTC": true,
      "chartVisibility": {},
      "projectId": "<string>",
      "groupBy": "<string>"
    },
    "freezeColumns": true
  },
  "user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "deleted_at": "2023-11-07T05:31:56Z"
}
"<string>"
"<string>"
"<string>"
"<string>"
"<string>"

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.

Path Parameters

view_id
string<uuid>
required

View id

Body

application/json

Additional parameters for the delete operation

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,
org_audit_logs
object_id
string<uuid>
required

The id of the object the view applies to

Response

Returns the deleted 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,
org_audit_logs
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,
parameters,
tools,
scorers,
classifiers,
logs,
monitor,
for_review_project_log,
for_review_experiments,
for_review_datasets,
null
name
string
required

Name of the view

created
string<date-time> | null

Date of view creation

view_data
object | null

The view definition

options
MonitorViewOptions · object

Options for the view in the app

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