Revoke Sub-API Key
curl --request DELETE \
--url https://api.io.solutions/v1/api-keys/sub-keys/{key_id} \
--header 'Authorization: Bearer <token>' \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.io.solutions/v1/api-keys/sub-keys/{key_id}"
headers = {
"x-api-key": "<x-api-key>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'x-api-key': '<x-api-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.io.solutions/v1/api-keys/sub-keys/{key_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.io.solutions/v1/api-keys/sub-keys/{key_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>",
"x-api-key: <x-api-key>"
],
]);
$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.io.solutions/v1/api-keys/sub-keys/{key_id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
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.io.solutions/v1/api-keys/sub-keys/{key_id}")
.header("x-api-key", "<x-api-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.io.solutions/v1/api-keys/sub-keys/{key_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<x-api-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "succeeded"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Sub-API Keys
Revoke Sub-API Key
Immediately revokes a sub-API key. All subsequent requests using the revoked key receive 401 Unauthorized.
DELETE
/
v1
/
api-keys
/
sub-keys
/
{key_id}
Revoke Sub-API Key
curl --request DELETE \
--url https://api.io.solutions/v1/api-keys/sub-keys/{key_id} \
--header 'Authorization: Bearer <token>' \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.io.solutions/v1/api-keys/sub-keys/{key_id}"
headers = {
"x-api-key": "<x-api-key>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'x-api-key': '<x-api-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.io.solutions/v1/api-keys/sub-keys/{key_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.io.solutions/v1/api-keys/sub-keys/{key_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>",
"x-api-key: <x-api-key>"
],
]);
$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.io.solutions/v1/api-keys/sub-keys/{key_id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
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.io.solutions/v1/api-keys/sub-keys/{key_id}")
.header("x-api-key", "<x-api-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.io.solutions/v1/api-keys/sub-keys/{key_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<x-api-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "succeeded"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Revocation is permanent and immediate. Once revoked, the key cannot be restored. Issue a new sub-key if access needs to be reinstated.
Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Headers
Admin API key that owns the sub-key. Admin API key (io.net Intelligence)
Path Parameters
UUID of the sub-key to revoke.
Response
Sub-key revoked successfully
Example:
"succeeded"
Was this page helpful?
⌘I