Skip to main content
POST
/
api
/
v1
/
tokens
/
attenuate
Attenuate token
curl --request POST \
  --url https://devs.adaptyvbio.com/api/v1/tokens/attenuate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "attenuation": {
    "allowed_actions": [
      "<string>"
    ],
    "allowed_org_ids": [
      "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    ],
    "allowed_resources": [
      "<string>"
    ],
    "expires_at": "2023-11-07T05:31:56Z",
    "non_destructive": true,
    "read_only": true
  },
  "name": "<string>",
  "token": "<string>",
  "attenuated_parent_token_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'
import requests

url = "https://devs.adaptyvbio.com/api/v1/tokens/attenuate"

payload = {
"attenuation": {
"allowed_actions": ["<string>"],
"allowed_org_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"allowed_resources": ["<string>"],
"expires_at": "2023-11-07T05:31:56Z",
"non_destructive": True,
"read_only": True
},
"name": "<string>",
"token": "<string>",
"attenuated_parent_token_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
attenuation: {
allowed_actions: ['<string>'],
allowed_org_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
allowed_resources: ['<string>'],
expires_at: '2023-11-07T05:31:56Z',
non_destructive: true,
read_only: true
},
name: '<string>',
token: '<string>',
attenuated_parent_token_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};

fetch('https://devs.adaptyvbio.com/api/v1/tokens/attenuate', 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://devs.adaptyvbio.com/api/v1/tokens/attenuate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'attenuation' => [
'allowed_actions' => [
'<string>'
],
'allowed_org_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'allowed_resources' => [
'<string>'
],
'expires_at' => '2023-11-07T05:31:56Z',
'non_destructive' => true,
'read_only' => true
],
'name' => '<string>',
'token' => '<string>',
'attenuated_parent_token_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://devs.adaptyvbio.com/api/v1/tokens/attenuate"

payload := strings.NewReader("{\n \"attenuation\": {\n \"allowed_actions\": [\n \"<string>\"\n ],\n \"allowed_org_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"allowed_resources\": [\n \"<string>\"\n ],\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"non_destructive\": true,\n \"read_only\": true\n },\n \"name\": \"<string>\",\n \"token\": \"<string>\",\n \"attenuated_parent_token_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")

req, _ := http.NewRequest("POST", 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.post("https://devs.adaptyvbio.com/api/v1/tokens/attenuate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"attenuation\": {\n \"allowed_actions\": [\n \"<string>\"\n ],\n \"allowed_org_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"allowed_resources\": [\n \"<string>\"\n ],\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"non_destructive\": true,\n \"read_only\": true\n },\n \"name\": \"<string>\",\n \"token\": \"<string>\",\n \"attenuated_parent_token_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://devs.adaptyvbio.com/api/v1/tokens/attenuate")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"attenuation\": {\n \"allowed_actions\": [\n \"<string>\"\n ],\n \"allowed_org_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"allowed_resources\": [\n \"<string>\"\n ],\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"non_destructive\": true,\n \"read_only\": true\n },\n \"name\": \"<string>\",\n \"token\": \"<string>\",\n \"attenuated_parent_token_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "token": "<string>"
}
{
"error": "experiment not found",
"request_id": "req_019462a4-b1c2-7def-8901-23456789abcd"
}
{
"error": "experiment not found",
"request_id": "req_019462a4-b1c2-7def-8901-23456789abcd"
}
{
"error": "experiment not found",
"request_id": "req_019462a4-b1c2-7def-8901-23456789abcd"
}

Authorizations

Authorization
string
header
required

Biscuit-based bearer token. Obtain tokens from the Adaptyv Portal or via the /tokens endpoint. Tokens encode organization membership and role-based capabilities; the API verifies the token's cryptographic signature and authorization claims before processing requests. Use /tokens/attenuate to create restricted tokens for delegation.

Body

application/json

Request to attenuate (restrict) an existing token.

Attenuation is a Biscuit cryptographic feature that adds restriction blocks without needing the private signing key. Any authenticated user can attenuate their tokens to create limited-scope versions for delegation.

attenuation
object
required

Restrictions to apply to the token.

name
string
required

Human-readable label for this attenuated token.

Names are not unique — they are purely for display purposes.

token
string
required

Existing token string (format: abs0_{slug}{biscuit_base64}) to attenuate.

attenuated_parent_token_id
string<uuid> | null

If attenuating an already-attenuated token (chained attenuation), provide the id of the parent attenuated token record. Omit when attenuating a root token directly.

Response

Token attenuated and persisted

Response after attenuating a token.

id
string
required

Database ID of the attenuated token record (for revocation/management).

token
string
required

The attenuated token string. Format: abs0_{slug}{biscuit_base64}.