Revoke an org API key
curl --request POST \
--url https://api.omnara.com/v1/orgs/{orgID}/api-keys/{keyID}/revoke \
--header 'X-Omnara-Csrf: <api-key>' \
--cookie __Host-omnara_session=import requests
url = "https://api.omnara.com/v1/orgs/{orgID}/api-keys/{keyID}/revoke"
headers = {
"cookie": "__Host-omnara_session=",
"X-Omnara-Csrf": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: '__Host-omnara_session=', 'X-Omnara-Csrf': '<api-key>'}
};
fetch('https://api.omnara.com/v1/orgs/{orgID}/api-keys/{keyID}/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.omnara.com/v1/orgs/{orgID}/api-keys/{keyID}/revoke",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_COOKIE => "__Host-omnara_session=",
CURLOPT_HTTPHEADER => [
"X-Omnara-Csrf: <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.omnara.com/v1/orgs/{orgID}/api-keys/{keyID}/revoke"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("cookie", "__Host-omnara_session=")
req.Header.Add("X-Omnara-Csrf", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.omnara.com/v1/orgs/{orgID}/api-keys/{keyID}/revoke")
.header("cookie", "__Host-omnara_session=")
.header("X-Omnara-Csrf", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.omnara.com/v1/orgs/{orgID}/api-keys/{keyID}/revoke")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = '__Host-omnara_session='
request["X-Omnara-Csrf"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"org_id": "<string>",
"name": "<string>",
"token_id": "<string>",
"org_role": "<string>",
"created_by_user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Users and API Keys
Revoke an org API key
Terminally revokes the key and removes its org and project roles. Idempotent.
POST
/
orgs
/
{orgID}
/
api-keys
/
{keyID}
/
revoke
Revoke an org API key
curl --request POST \
--url https://api.omnara.com/v1/orgs/{orgID}/api-keys/{keyID}/revoke \
--header 'X-Omnara-Csrf: <api-key>' \
--cookie __Host-omnara_session=import requests
url = "https://api.omnara.com/v1/orgs/{orgID}/api-keys/{keyID}/revoke"
headers = {
"cookie": "__Host-omnara_session=",
"X-Omnara-Csrf": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: '__Host-omnara_session=', 'X-Omnara-Csrf': '<api-key>'}
};
fetch('https://api.omnara.com/v1/orgs/{orgID}/api-keys/{keyID}/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.omnara.com/v1/orgs/{orgID}/api-keys/{keyID}/revoke",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_COOKIE => "__Host-omnara_session=",
CURLOPT_HTTPHEADER => [
"X-Omnara-Csrf: <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.omnara.com/v1/orgs/{orgID}/api-keys/{keyID}/revoke"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("cookie", "__Host-omnara_session=")
req.Header.Add("X-Omnara-Csrf", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.omnara.com/v1/orgs/{orgID}/api-keys/{keyID}/revoke")
.header("cookie", "__Host-omnara_session=")
.header("X-Omnara-Csrf", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.omnara.com/v1/orgs/{orgID}/api-keys/{keyID}/revoke")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = '__Host-omnara_session='
request["X-Omnara-Csrf"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"org_id": "<string>",
"name": "<string>",
"token_id": "<string>",
"org_role": "<string>",
"created_by_user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Authorizations
Browser session cookie. HTTPS deployments use __Host-omnara_session; local HTTP development uses omnara_session.
CSRF token header required for browser-session mutations. The value must match the session's CSRF cookie.
Path Parameters
Pattern:
^org_[a-z2-7]{26}$Pattern:
^oak_[a-z2-7]{26}$Response
The revoked org API key.
Pattern:
^oak_[a-z2-7]{26}$Pattern:
^org_[a-z2-7]{26}$Human-readable name. Spaces and punctuation are allowed; leading or trailing whitespace and invisible or control characters are not.
Required string length:
1 - 64Stable non-secret display identifier. It is not embedded in the bearer token.
The key's org role (admin or member). Empty for revoked keys.
Pattern:
^usr_[a-z2-7]{26}$