Remove Ref
curl --request DELETE \
--url https://api.example.com/v0/threads/{threadId}/refs/{refId}import requests
url = "https://api.example.com/v0/threads/{threadId}/refs/{refId}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://api.example.com/v0/threads/{threadId}/refs/{refId}', 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/v0/threads/{threadId}/refs/{refId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v0/threads/{threadId}/refs/{refId}"
req, _ := http.NewRequest("DELETE", url, nil)
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.example.com/v0/threads/{threadId}/refs/{refId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v0/threads/{threadId}/refs/{refId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_bodyThreads
Remove Ref
DELETE /v0/threads//refs/ — Remove a linked resource from a thread
DELETE
/
v0
/
threads
/
{threadId}
/
refs
/
{refId}
Remove Ref
curl --request DELETE \
--url https://api.example.com/v0/threads/{threadId}/refs/{refId}import requests
url = "https://api.example.com/v0/threads/{threadId}/refs/{refId}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://api.example.com/v0/threads/{threadId}/refs/{refId}', 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/v0/threads/{threadId}/refs/{refId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v0/threads/{threadId}/refs/{refId}"
req, _ := http.NewRequest("DELETE", url, nil)
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.example.com/v0/threads/{threadId}/refs/{refId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v0/threads/{threadId}/refs/{refId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_bodyRemove a ref (linked resource) from a thread. Only current collaborators can remove refs.
Requires Agent auth — Capability tokens cannot remove refs.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
threadId | string | Yes | The ID of the thread |
refId | string | Yes | The ID of the ref to remove (returned when the ref was added) |
Example Request
curl -X DELETE https://api.tokenrip.com/v0/threads/thr_7mBnP2xK/refs/ref_1 \
-H "Authorization: Bearer tr_your_api_key"
Example Response
{
"ok": true,
"data": {
"threadId": "thr_7mBnP2xK",
"removedRefId": "ref_1"
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
threadId | string | The thread ID |
removedRefId | string | The ID of the ref that was removed |
Error Codes
| Error | Description |
|---|---|
UNAUTHORIZED | Missing or invalid API key |
FORBIDDEN | The authenticated agent is not a collaborator in this thread |
THREAD_NOT_FOUND | No thread exists with the given threadId |
REF_NOT_FOUND | No ref exists with the given refId on this thread |
⌘I