Create API key
curl --request POST \
--url https://arena-predictions.com/api/v1/api_keys \
--header 'Content-Type: application/json' \
--cookie sb-access-token= \
--data '
{
"label": "<string>",
"scopes": [],
"expiresInDays": 183
}
'import requests
url = "https://arena-predictions.com/api/v1/api_keys"
payload = {
"label": "<string>",
"scopes": [],
"expiresInDays": 183
}
headers = {
"cookie": "sb-access-token=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'sb-access-token=', 'Content-Type': 'application/json'},
body: JSON.stringify({label: '<string>', scopes: [], expiresInDays: 183})
};
fetch('https://arena-predictions.com/api/v1/api_keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"key": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"tokenPrefix": "<string>",
"scopes": [
"records:read"
],
"status": "active",
"createdAt": "2023-11-07T05:31:56Z",
"lastUsedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"revokedAt": "2023-11-07T05:31:56Z",
"createdVia": "web",
"rotatedFrom": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rotatedAt": "2023-11-07T05:31:56Z",
"requestsThisMonth": 1
},
"token": "<string>",
"warning": "<string>"
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"retryAfterSeconds": 2
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"retryAfterSeconds": 2
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"retryAfterSeconds": 2
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"retryAfterSeconds": 2
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"retryAfterSeconds": 2
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"retryAfterSeconds": 2
}
}API keys
Create API key
Mint a key. The plaintext token is returned once, in this response, and never again. Not idempotent: every call mints a new key. At most 20 keys (created or rotated) per account in any 24 hours.
POST
/
api_keys
Create API key
curl --request POST \
--url https://arena-predictions.com/api/v1/api_keys \
--header 'Content-Type: application/json' \
--cookie sb-access-token= \
--data '
{
"label": "<string>",
"scopes": [],
"expiresInDays": 183
}
'import requests
url = "https://arena-predictions.com/api/v1/api_keys"
payload = {
"label": "<string>",
"scopes": [],
"expiresInDays": 183
}
headers = {
"cookie": "sb-access-token=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'sb-access-token=', 'Content-Type': 'application/json'},
body: JSON.stringify({label: '<string>', scopes: [], expiresInDays: 183})
};
fetch('https://arena-predictions.com/api/v1/api_keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"key": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"tokenPrefix": "<string>",
"scopes": [
"records:read"
],
"status": "active",
"createdAt": "2023-11-07T05:31:56Z",
"lastUsedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"revokedAt": "2023-11-07T05:31:56Z",
"createdVia": "web",
"rotatedFrom": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rotatedAt": "2023-11-07T05:31:56Z",
"requestsThisMonth": 1
},
"token": "<string>",
"warning": "<string>"
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"retryAfterSeconds": 2
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"retryAfterSeconds": 2
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"retryAfterSeconds": 2
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"retryAfterSeconds": 2
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"retryAfterSeconds": 2
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"retryAfterSeconds": 2
}
}Authorizations
sessionsessionBearer
The signed-in browser session (Google or Apple). Used only for key management, same-origin JSON requests only. An API key presented here is refused (401 session_required).
Body
application/json
Trimmed; an empty label becomes "Untitled key".
Maximum string length:
64Defaults to records:read, portfolio:read and markets:read. trade:write is reserved and refused (403 scope_not_available).
Minimum array length:
1Available options:
records:read, portfolio:read, markets:read, trade:write Omit for a key that never expires.
Required range:
1 <= x <= 365