Create Api Key
curl --request POST \
--url https://{tenant_id}.api.useago.com/api/v1/api-keys \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"scopes": [
"<string>"
],
"description": "",
"allowed_cidrs": [
"<string>"
],
"expires_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://{tenant_id}.api.useago.com/api/v1/api-keys"
payload = {
"name": "<string>",
"scopes": ["<string>"],
"description": "",
"allowed_cidrs": ["<string>"],
"expires_at": "2023-11-07T05:31:56Z"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
scopes: ['<string>'],
description: '',
allowed_cidrs: ['<string>'],
expires_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://{tenant_id}.api.useago.com/api/v1/api-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"key_prefix": "<string>",
"scopes": [
"<string>"
],
"allowed_cidrs": [
"<string>"
],
"is_active": true,
"expires_at": "2023-11-07T05:31:56Z",
"rotated_at": "2023-11-07T05:31:56Z",
"locked_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"key": "<string>",
"object": "api_key"
}API keys
Create Api Key
Create a key with at most your key’s scopes, IP allowlist and lifetime. The secret is returned only once.
POST
/
api
/
v1
/
api-keys
Create Api Key
curl --request POST \
--url https://{tenant_id}.api.useago.com/api/v1/api-keys \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"scopes": [
"<string>"
],
"description": "",
"allowed_cidrs": [
"<string>"
],
"expires_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://{tenant_id}.api.useago.com/api/v1/api-keys"
payload = {
"name": "<string>",
"scopes": ["<string>"],
"description": "",
"allowed_cidrs": ["<string>"],
"expires_at": "2023-11-07T05:31:56Z"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
scopes: ['<string>'],
description: '',
allowed_cidrs: ['<string>'],
expires_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://{tenant_id}.api.useago.com/api/v1/api-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"key_prefix": "<string>",
"scopes": [
"<string>"
],
"allowed_cidrs": [
"<string>"
],
"is_active": true,
"expires_at": "2023-11-07T05:31:56Z",
"rotated_at": "2023-11-07T05:31:56Z",
"locked_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"key": "<string>",
"object": "api_key"
}Body
application/json
Response
201 - application/json
Created
