Attach packs to a chat workspace or thread
curl --request PUT \
--url https://api.example.com/api/registry/context/bindings/{target_type}/{target_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"packs": [
{
"artifact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": "<string>",
"token_budget": 101
}
]
}
'import requests
url = "https://api.example.com/api/registry/context/bindings/{target_type}/{target_id}"
payload = { "packs": [
{
"artifact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": "<string>",
"token_budget": 101
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
packs: [
{
artifact_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
version: '<string>',
token_budget: 101
}
]
})
};
fetch('https://api.example.com/api/registry/context/bindings/{target_type}/{target_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.example.com/api/registry/context/bindings/{target_type}/{target_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'packs' => [
[
'artifact_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'version' => '<string>',
'token_budget' => 101
]
]
]),
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.example.com/api/registry/context/bindings/{target_type}/{target_id}"
payload := strings.NewReader("{\n \"packs\": [\n {\n \"artifact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"version\": \"<string>\",\n \"token_budget\": 101\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.example.com/api/registry/context/bindings/{target_type}/{target_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"packs\": [\n {\n \"artifact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"version\": \"<string>\",\n \"token_budget\": 101\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/registry/context/bindings/{target_type}/{target_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"packs\": [\n {\n \"artifact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"version\": \"<string>\",\n \"token_budget\": 101\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"target_type": "workspace",
"target_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"packs": [
{}
],
"can_edit": false
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}Context packs
Attach packs to a chat workspace or thread
Replace the list. Workspaces (and threads in them) take Global packs only; a personal thread may also take your own. Workspace owners set a workspace’s; whoever can manage a thread sets the thread’s.
PUT
/
api
/
registry
/
context
/
bindings
/
{target_type}
/
{target_id}
Attach packs to a chat workspace or thread
curl --request PUT \
--url https://api.example.com/api/registry/context/bindings/{target_type}/{target_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"packs": [
{
"artifact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": "<string>",
"token_budget": 101
}
]
}
'import requests
url = "https://api.example.com/api/registry/context/bindings/{target_type}/{target_id}"
payload = { "packs": [
{
"artifact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": "<string>",
"token_budget": 101
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
packs: [
{
artifact_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
version: '<string>',
token_budget: 101
}
]
})
};
fetch('https://api.example.com/api/registry/context/bindings/{target_type}/{target_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.example.com/api/registry/context/bindings/{target_type}/{target_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'packs' => [
[
'artifact_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'version' => '<string>',
'token_budget' => 101
]
]
]),
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.example.com/api/registry/context/bindings/{target_type}/{target_id}"
payload := strings.NewReader("{\n \"packs\": [\n {\n \"artifact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"version\": \"<string>\",\n \"token_budget\": 101\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.example.com/api/registry/context/bindings/{target_type}/{target_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"packs\": [\n {\n \"artifact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"version\": \"<string>\",\n \"token_budget\": 101\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/registry/context/bindings/{target_type}/{target_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"packs\": [\n {\n \"artifact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"version\": \"<string>\",\n \"token_budget\": 101\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"target_type": "workspace",
"target_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"packs": [
{}
],
"can_edit": false
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}Authorizations
OAuth2AuthorizationCodeBearerAPIKeyHeader
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
workspace or thread.
Available options:
workspace, thread The workspace's or thread's ID.
Body
application/json
The packs to attach to a chat workspace or thread (replaces the list).
Maximum array length:
10Show child attributes
Show child attributes
Was this page helpful?

