Verify a key for a given workspace
curl --request POST \
--url https://prod.oneloop.ai/api/v1/api-key/verify \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"key": "<string>",
"requestedScopes": [
{
"representation": "<string>",
"create": true,
"read": true,
"update": true,
"del": true,
"id": "<string>"
}
],
"route": "<string>",
"billing": {
"usage": "0",
"usageName": "<string>"
}
}
'import requests
url = "https://prod.oneloop.ai/api/v1/api-key/verify"
payload = {
"key": "<string>",
"requestedScopes": [
{
"representation": "<string>",
"create": True,
"read": True,
"update": True,
"del": True,
"id": "<string>"
}
],
"route": "<string>",
"billing": {
"usage": "0",
"usageName": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
key: '<string>',
requestedScopes: [
{
representation: '<string>',
create: true,
read: true,
update: true,
del: true,
id: '<string>'
}
],
route: '<string>',
billing: {usage: '0', usageName: '<string>'}
})
};
fetch('https://prod.oneloop.ai/api/v1/api-key/verify', 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://prod.oneloop.ai/api/v1/api-key/verify",
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([
'key' => '<string>',
'requestedScopes' => [
[
'representation' => '<string>',
'create' => true,
'read' => true,
'update' => true,
'del' => true,
'id' => '<string>'
]
],
'route' => '<string>',
'billing' => [
'usage' => '0',
'usageName' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://prod.oneloop.ai/api/v1/api-key/verify"
payload := strings.NewReader("{\n \"key\": \"<string>\",\n \"requestedScopes\": [\n {\n \"representation\": \"<string>\",\n \"create\": true,\n \"read\": true,\n \"update\": true,\n \"del\": true,\n \"id\": \"<string>\"\n }\n ],\n \"route\": \"<string>\",\n \"billing\": {\n \"usage\": \"0\",\n \"usageName\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://prod.oneloop.ai/api/v1/api-key/verify")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"key\": \"<string>\",\n \"requestedScopes\": [\n {\n \"representation\": \"<string>\",\n \"create\": true,\n \"read\": true,\n \"update\": true,\n \"del\": true,\n \"id\": \"<string>\"\n }\n ],\n \"route\": \"<string>\",\n \"billing\": {\n \"usage\": \"0\",\n \"usageName\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod.oneloop.ai/api/v1/api-key/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"key\": \"<string>\",\n \"requestedScopes\": [\n {\n \"representation\": \"<string>\",\n \"create\": true,\n \"read\": true,\n \"update\": true,\n \"del\": true,\n \"id\": \"<string>\"\n }\n ],\n \"route\": \"<string>\",\n \"billing\": {\n \"usage\": \"0\",\n \"usageName\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"apiKeyId": "<string>",
"expiresAt": 1,
"requestedScopes": [
{
"representation": "<string>",
"create": true,
"read": true,
"update": true,
"del": true,
"id": "<string>"
}
],
"billing": {
"id": "<string>",
"totalCredits": "<string>",
"usedCredits": "<string>",
"allowOverages": true,
"spendCap": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
},
"externalMeterId": "<string>",
"customerId": "<string>",
"scopes": [
{
"representation": "<string>",
"create": true,
"read": true,
"update": true,
"del": true,
"id": "<string>"
}
],
"rateLimit": {
"remaining": 123,
"resetAt": 123
},
"metadata": {}
}{
"error": {
"code": 1,
"message": "<string>"
}
}{
"error": {
"code": 1,
"message": "<string>"
}
}{
"error": {
"code": 1,
"message": "<string>"
}
}API Keys
Verify a key for a given workspace
POST
/
api
/
v1
/
api-key
/
verify
Verify a key for a given workspace
curl --request POST \
--url https://prod.oneloop.ai/api/v1/api-key/verify \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"key": "<string>",
"requestedScopes": [
{
"representation": "<string>",
"create": true,
"read": true,
"update": true,
"del": true,
"id": "<string>"
}
],
"route": "<string>",
"billing": {
"usage": "0",
"usageName": "<string>"
}
}
'import requests
url = "https://prod.oneloop.ai/api/v1/api-key/verify"
payload = {
"key": "<string>",
"requestedScopes": [
{
"representation": "<string>",
"create": True,
"read": True,
"update": True,
"del": True,
"id": "<string>"
}
],
"route": "<string>",
"billing": {
"usage": "0",
"usageName": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
key: '<string>',
requestedScopes: [
{
representation: '<string>',
create: true,
read: true,
update: true,
del: true,
id: '<string>'
}
],
route: '<string>',
billing: {usage: '0', usageName: '<string>'}
})
};
fetch('https://prod.oneloop.ai/api/v1/api-key/verify', 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://prod.oneloop.ai/api/v1/api-key/verify",
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([
'key' => '<string>',
'requestedScopes' => [
[
'representation' => '<string>',
'create' => true,
'read' => true,
'update' => true,
'del' => true,
'id' => '<string>'
]
],
'route' => '<string>',
'billing' => [
'usage' => '0',
'usageName' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://prod.oneloop.ai/api/v1/api-key/verify"
payload := strings.NewReader("{\n \"key\": \"<string>\",\n \"requestedScopes\": [\n {\n \"representation\": \"<string>\",\n \"create\": true,\n \"read\": true,\n \"update\": true,\n \"del\": true,\n \"id\": \"<string>\"\n }\n ],\n \"route\": \"<string>\",\n \"billing\": {\n \"usage\": \"0\",\n \"usageName\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://prod.oneloop.ai/api/v1/api-key/verify")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"key\": \"<string>\",\n \"requestedScopes\": [\n {\n \"representation\": \"<string>\",\n \"create\": true,\n \"read\": true,\n \"update\": true,\n \"del\": true,\n \"id\": \"<string>\"\n }\n ],\n \"route\": \"<string>\",\n \"billing\": {\n \"usage\": \"0\",\n \"usageName\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod.oneloop.ai/api/v1/api-key/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"key\": \"<string>\",\n \"requestedScopes\": [\n {\n \"representation\": \"<string>\",\n \"create\": true,\n \"read\": true,\n \"update\": true,\n \"del\": true,\n \"id\": \"<string>\"\n }\n ],\n \"route\": \"<string>\",\n \"billing\": {\n \"usage\": \"0\",\n \"usageName\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"apiKeyId": "<string>",
"expiresAt": 1,
"requestedScopes": [
{
"representation": "<string>",
"create": true,
"read": true,
"update": true,
"del": true,
"id": "<string>"
}
],
"billing": {
"id": "<string>",
"totalCredits": "<string>",
"usedCredits": "<string>",
"allowOverages": true,
"spendCap": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
},
"externalMeterId": "<string>",
"customerId": "<string>",
"scopes": [
{
"representation": "<string>",
"create": true,
"read": true,
"update": true,
"del": true,
"id": "<string>"
}
],
"rateLimit": {
"remaining": 123,
"resetAt": 123
},
"metadata": {}
}{
"error": {
"code": 1,
"message": "<string>"
}
}{
"error": {
"code": 1,
"message": "<string>"
}
}{
"error": {
"code": 1,
"message": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
The verification result
Required range:
x > 0Show child attributes
Show child attributes
Available options:
VALID, EXPIRED, DISABLED, DELETED, RATE_LIMITED, USAGE_LIMITED, INVALID_SCOPES, INVALID Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I