Create org API key
curl --request POST \
--url https://api.omnara.com/v1/orgs/{orgID}/api-keys \
--header 'Content-Type: application/json' \
--header 'X-Omnara-Csrf: <api-key>' \
--cookie __Host-omnara_session= \
--data '
{
"name": "<string>"
}
'import requests
url = "https://api.omnara.com/v1/orgs/{orgID}/api-keys"
payload = { "name": "<string>" }
headers = {
"cookie": "__Host-omnara_session=",
"X-Omnara-Csrf": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
cookie: '__Host-omnara_session=',
'X-Omnara-Csrf': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({name: '<string>'})
};
fetch('https://api.omnara.com/v1/orgs/{orgID}/api-keys', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>'
]),
CURLOPT_COOKIE => "__Host-omnara_session=",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.omnara.com/v1/orgs/{orgID}/api-keys"
payload := strings.NewReader("{\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "__Host-omnara_session=")
req.Header.Add("X-Omnara-Csrf", "<api-key>")
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.post("https://api.omnara.com/v1/orgs/{orgID}/api-keys")
.header("cookie", "__Host-omnara_session=")
.header("X-Omnara-Csrf", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.omnara.com/v1/orgs/{orgID}/api-keys")
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>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"token": "<string>",
"api_key": {
"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": "invalid_request"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "internal_error"
}Users and API Keys
Create org API key
Mints an org API key. The plaintext token is returned once and never stored.
POST
/
orgs
/
{orgID}
/
api-keys
Create org API key
curl --request POST \
--url https://api.omnara.com/v1/orgs/{orgID}/api-keys \
--header 'Content-Type: application/json' \
--header 'X-Omnara-Csrf: <api-key>' \
--cookie __Host-omnara_session= \
--data '
{
"name": "<string>"
}
'import requests
url = "https://api.omnara.com/v1/orgs/{orgID}/api-keys"
payload = { "name": "<string>" }
headers = {
"cookie": "__Host-omnara_session=",
"X-Omnara-Csrf": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
cookie: '__Host-omnara_session=',
'X-Omnara-Csrf': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({name: '<string>'})
};
fetch('https://api.omnara.com/v1/orgs/{orgID}/api-keys', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>'
]),
CURLOPT_COOKIE => "__Host-omnara_session=",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.omnara.com/v1/orgs/{orgID}/api-keys"
payload := strings.NewReader("{\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "__Host-omnara_session=")
req.Header.Add("X-Omnara-Csrf", "<api-key>")
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.post("https://api.omnara.com/v1/orgs/{orgID}/api-keys")
.header("cookie", "__Host-omnara_session=")
.header("X-Omnara-Csrf", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.omnara.com/v1/orgs/{orgID}/api-keys")
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>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"token": "<string>",
"api_key": {
"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": "invalid_request"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "internal_error"
}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}$Body
application/json
Human-readable name. Spaces and punctuation are allowed; leading or trailing whitespace and invisible or control characters are not.
Required string length:
1 - 64The key's org role. Org API keys can never hold the owner role.
Available options:
admin, member ⌘I