curl --request POST \
--url https://aquila.attaxr.com/api/auth/api-key/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"configId": "<string>",
"name": "<string>",
"expiresIn": 123,
"prefix": "<string>",
"remaining": 123,
"metadata": "<unknown>",
"refillAmount": 123,
"refillInterval": 123,
"rateLimitTimeWindow": 123,
"rateLimitMax": 123,
"rateLimitEnabled": true,
"permissions": {},
"userId": "<string>",
"organizationId": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
configId: '<string>',
name: '<string>',
expiresIn: 123,
prefix: '<string>',
remaining: 123,
metadata: '<unknown>',
refillAmount: 123,
refillInterval: 123,
rateLimitTimeWindow: 123,
rateLimitMax: 123,
rateLimitEnabled: true,
permissions: {},
userId: '<string>',
organizationId: '<string>'
})
};
fetch('https://aquila.attaxr.com/api/auth/api-key/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://aquila.attaxr.com/api/auth/api-key/create"
payload = {
"configId": "<string>",
"name": "<string>",
"expiresIn": 123,
"prefix": "<string>",
"remaining": 123,
"metadata": "<unknown>",
"refillAmount": 123,
"refillInterval": 123,
"rateLimitTimeWindow": 123,
"rateLimitMax": 123,
"rateLimitEnabled": True,
"permissions": {},
"userId": "<string>",
"organizationId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"key": "<string>",
"enabled": true,
"referenceId": "<string>",
"rateLimitEnabled": true,
"requestCount": 123,
"name": "<string>",
"prefix": "<string>",
"start": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"lastRefillAt": "2023-11-07T05:31:56Z",
"lastRequest": "2023-11-07T05:31:56Z",
"metadata": {},
"rateLimitMax": 123,
"rateLimitTimeWindow": 123,
"remaining": 123,
"refillAmount": 123,
"refillInterval": 123,
"permissions": {}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Create a new API key for a user
Create a new API key for a user
curl --request POST \
--url https://aquila.attaxr.com/api/auth/api-key/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"configId": "<string>",
"name": "<string>",
"expiresIn": 123,
"prefix": "<string>",
"remaining": 123,
"metadata": "<unknown>",
"refillAmount": 123,
"refillInterval": 123,
"rateLimitTimeWindow": 123,
"rateLimitMax": 123,
"rateLimitEnabled": true,
"permissions": {},
"userId": "<string>",
"organizationId": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
configId: '<string>',
name: '<string>',
expiresIn: 123,
prefix: '<string>',
remaining: 123,
metadata: '<unknown>',
refillAmount: 123,
refillInterval: 123,
rateLimitTimeWindow: 123,
rateLimitMax: 123,
rateLimitEnabled: true,
permissions: {},
userId: '<string>',
organizationId: '<string>'
})
};
fetch('https://aquila.attaxr.com/api/auth/api-key/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://aquila.attaxr.com/api/auth/api-key/create"
payload = {
"configId": "<string>",
"name": "<string>",
"expiresIn": 123,
"prefix": "<string>",
"remaining": 123,
"metadata": "<unknown>",
"refillAmount": 123,
"refillInterval": 123,
"rateLimitTimeWindow": 123,
"rateLimitMax": 123,
"rateLimitEnabled": True,
"permissions": {},
"userId": "<string>",
"organizationId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"key": "<string>",
"enabled": true,
"referenceId": "<string>",
"rateLimitEnabled": true,
"requestCount": 123,
"name": "<string>",
"prefix": "<string>",
"start": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"lastRefillAt": "2023-11-07T05:31:56Z",
"lastRequest": "2023-11-07T05:31:56Z",
"metadata": {},
"rateLimitMax": 123,
"rateLimitTimeWindow": 123,
"remaining": 123,
"refillAmount": 123,
"refillInterval": 123,
"permissions": {}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
Personal API key sent as a bearer token.
Body
The configuration ID to use for the API key. If not provided, the default configuration will be used.
Name of the Api Key
Expiration time of the Api Key in seconds
Prefix of the Api Key
Remaining number of requests. Server side only
Amount to refill the remaining count of the Api Key. server-only. Eg: 100
Interval to refill the Api Key in milliseconds. server-only. Eg: 1000
The duration in milliseconds where each request is counted. Once the maxRequests is reached, the request will be rejected until the timeWindow has passed, at which point the timeWindow will be reset. server-only. Eg: 1000
Maximum amount of requests allowed within a window. Once the maxRequests is reached, the request will be rejected until the timeWindow has passed, at which point the timeWindow will be reset. server-only. Eg: 100
Whether the key has rate limiting enabled. server-only. Eg: true
Permissions of the Api Key.
Show child attributes
Show child attributes
User Id of the user that the Api Key belongs to. server-only. Eg: "user-id"
Organization Id of the organization that the Api Key belongs to. Eg: 'org-id'
Response
API key created successfully
Unique identifier of the API key
Creation timestamp
Last update timestamp
The full API key (only returned on creation)
Whether the key is enabled
ID of the reference owning the key
Whether rate limiting is enabled
Current request count in window
Name of the API key
Prefix of the API key
Starting characters of the key (if configured)
Expiration timestamp
Last refill timestamp
Last request timestamp
Metadata associated with the key
Maximum requests in time window
Rate limit time window in milliseconds
Remaining requests
Amount to refill
Refill interval in milliseconds
Permissions associated with the key
Show child attributes
Show child attributes

