Rotate API key
curl --request POST \
--url https://arena-predictions.com/api/v1/api_keys/{id}/rotate \
--header 'Content-Type: application/json' \
--cookie sb-access-token= \
--data '
{
"graceSeconds": 0,
"expiresInDays": 183
}
'import requests
url = "https://arena-predictions.com/api/v1/api_keys/{id}/rotate"
payload = {
"graceSeconds": 0,
"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({graceSeconds: 0, expiresInDays: 183})
};
fetch('https://arena-predictions.com/api/v1/api_keys/{id}/rotate', 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>",
"replaced": {
"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
}
}{
"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
Rotate API key
Replace a key: a new key with the same label and scopes (its token shown once in this response), and the old key kept working for graceSeconds (0 to 86400; 0 revokes it at once). One transaction. A rotating key does not count toward the 10-key cap; a rotation counts toward the 20 keys a day.
POST
/
api_keys
/
{id}
/
rotate
Rotate API key
curl --request POST \
--url https://arena-predictions.com/api/v1/api_keys/{id}/rotate \
--header 'Content-Type: application/json' \
--cookie sb-access-token= \
--data '
{
"graceSeconds": 0,
"expiresInDays": 183
}
'import requests
url = "https://arena-predictions.com/api/v1/api_keys/{id}/rotate"
payload = {
"graceSeconds": 0,
"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({graceSeconds: 0, expiresInDays: 183})
};
fetch('https://arena-predictions.com/api/v1/api_keys/{id}/rotate', 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>",
"replaced": {
"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
}
}{
"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).
Path Parameters
Body
application/json