Revoke an API token
curl --request DELETE \
--url https://api.swap.shield.fi/api-tokens/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.swap.shield.fi/api-tokens/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.swap.shield.fi/api-tokens/{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.swap.shield.fi/api-tokens/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.swap.shield.fi/api-tokens/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.swap.shield.fi/api-tokens/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.swap.shield.fi/api-tokens/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revoked": true
}
}{
"error": "<string>",
"ref": "<string>"
}{
"error": "<string>",
"ref": "<string>"
}{
"error": "<string>",
"ref": "<string>"
}{
"error": "<string>",
"ref": "<string>"
}{
"error": "<string>",
"ref": "<string>"
}Revoke an API token
Revoke one API token owned by the authenticated wallet.
DELETE
/
api-tokens
/
{id}
Revoke an API token
curl --request DELETE \
--url https://api.swap.shield.fi/api-tokens/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.swap.shield.fi/api-tokens/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.swap.shield.fi/api-tokens/{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.swap.shield.fi/api-tokens/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.swap.shield.fi/api-tokens/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.swap.shield.fi/api-tokens/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.swap.shield.fi/api-tokens/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revoked": true
}
}{
"error": "<string>",
"ref": "<string>"
}{
"error": "<string>",
"ref": "<string>"
}{
"error": "<string>",
"ref": "<string>"
}{
"error": "<string>",
"ref": "<string>"
}{
"error": "<string>",
"ref": "<string>"
}Authorizations
Session JWT (browsers receive it as an httpOnly cookie from POST /auth/verify; 15 min, silently renewed via POST /auth/refresh), or a long-lived API token (ss_…) minted at POST /api-tokens. API tokens work on data and trading endpoints and can request WebSocket tickets; token management and admin endpoints accept session JWTs only.
Path Parameters
Token id
Response
API token revoked
Show child attributes
Show child attributes
⌘I