Skip to main content
PUT
/
v1
/
api-keys
/
{uuid}
/
revoke
Revoke API Key
curl --request PUT \
  --url https://api.dispersed.com/v1/api-keys/{uuid}/revoke \
  --header 'Content-Type: application/json' \
  --data '{}'
import requests

url = "https://api.dispersed.com/v1/api-keys/{uuid}/revoke"

payload = {}
headers = {"Content-Type": "application/json"}

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

print(response.text)
const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({})
};

fetch('https://api.dispersed.com/v1/api-keys/{uuid}/revoke', 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.dispersed.com/v1/api-keys/{uuid}/revoke",
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([

]),
CURLOPT_HTTPHEADER => [
"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.dispersed.com/v1/api-keys/{uuid}/revoke"

payload := strings.NewReader("{}")

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

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.dispersed.com/v1/api-keys/{uuid}/revoke")
.header("Content-Type", "application/json")
.body("{}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.dispersed.com/v1/api-keys/{uuid}/revoke")

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

request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
{
  "created_at": "2023-11-07T05:31:56Z",
  "is_revoked": true,
  "name": "<string>",
  "object": "api_key",
  "permissions": [
    "<string>"
  ],
  "public_key": "<string>",
  "updated_at": "2023-11-07T05:31:56Z",
  "_id": "<string>",
  "account": "<string>",
  "account_uuid": "<string>",
  "allowed_ips": [
    "127.0.0.1",
    "192.168.1.1/24"
  ],
  "deleted_at": "2023-11-07T05:31:56Z",
  "expires_at": "2023-11-07T05:31:56Z",
  "last_used_at": "2023-11-07T05:31:56Z",
  "uuid": "<string>"
}
{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"timestamp": "<string>",
"details": []
}
}
{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"timestamp": "<string>",
"details": []
}
}
{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"timestamp": "<string>",
"details": []
}
}
{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"timestamp": "<string>",
"details": []
}
}

Path Parameters

uuid
string<uuid>
required

Body

application/json

The body is of type object.

Response

API key revoked successfully

created_at
string<date-time> | null
required
is_revoked
boolean
required
name
string
required
object
enum<string>
required
Available options:
api_key
permissions
string[]
required
public_key
string
required
updated_at
string<date-time> | null
required
_id
string | null
account
string | null
account_uuid
string | null
allowed_ips
string[]

OPTIONAL: List of allowed IP addresses or CIDR ranges. If no IPs are provided, the API key can be used from any IP address.

Example:
["127.0.0.1", "192.168.1.1/24"]
deleted_at
string<date-time> | null
expires_at
string<date-time> | null
last_used_at
string<date-time> | null
uuid
string | null