Verify a token
Check whether an API token or OAuth access token is valid. Send the token in the Authorization header as Bearer <token>. Session cookies are not accepted, and no organization needs to be selected. Check success in the response body: invalid tokens return HTTP 200 with success: false. A missing Authorization header returns HTTP 401.
Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer 123
Responses
| Status | Meaning | Description |
|---|---|---|
| 200 | OK | Verification result. Valid API tokens include result.id; valid OAuth tokens omit it. May also return a canonical failure envelope with success: false at HTTP200. |
| 400 | Bad Request | Invalid request |
| 401 | Unauthorized | Authorization header is missing |
| 500 | Internal Server Error | Internal Server Error |
Response Schema
Request
curl --request GET \
--url https://api.onlineornot.com/v1/tokens/verify \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}'
Response
{
"result": {
"id": "a1b2c3d4",
"status": "active"
},
"success": true,
"errors": [],
"messages": []
}
Get token permissions
List the permissions granted to an API token. Send the token in the Authorization header as Bearer <token>. This endpoint does not support OAuth scopes or session cookies, check token expiration, or require organization selection. If no grants match, it returns HTTP 200 with success: false.
Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer 123
Responses
| Status | Meaning | Description |
|---|---|---|
| 200 | OK | API-token permissions or a failure envelope. May also return a canonical failure envelope with success: false at HTTP200. |
| 400 | Bad Request | Invalid request |
| 401 | Unauthorized | Authorization header is missing |
| 500 | Internal Server Error | Internal Server Error |
Response Schema
Request
curl --request GET \
--url https://api.onlineornot.com/v1/tokens/permissions \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}'
Response
{
"result": {
"permissions": ["uptime_checks (read)"]
},
"success": true,
"errors": [],
"messages": []
}
List all API tokens
Retrieve a paginated list of all API tokens for the organization
Requires API_TOKENS:READ; EDIT also grants READ. Session cookies are accepted only when no bearer credential is supplied.
Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer 123
Header parameters
Query parameters
Responses
| Status | Meaning | Description |
|---|---|---|
| 200 | OK | Returns a list of API tokens |
| 400 | Bad Request | Invalid request |
| 401 | Unauthorized | Missing or invalid credentials |
| 403 | Forbidden | Insufficient permissions |
| 500 | Internal Server Error | Internal Server Error |
Response Schema
Request
curl --request GET \
--url https://api.onlineornot.com/v1/tokens \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}' \
--header 'X-OnlineOrNot-Organisation: string'
Response
{
"result": {
"result": [
{
"id": "a1b2c3d4",
"name": "My API Token",
"expiresAfter": "2025-12-31T23:59:59.000Z",
"createdAt": "2024-01-15T10:30:00.000Z",
"grants": [
{
"scope": "UPTIME_CHECKS",
"permission": "READ"
}
]
}
],
"result_info": {
"page": 0,
"per_page": 0,
"total_count": 0,
"total_pages": 0
}
},
"success": true,
"errors": [],
"messages": []
}
Create an API token
Create a new API token for the organization
Requires API_TOKENS:EDIT; EDIT also grants READ. Session cookies are accepted only when no bearer credential is supplied.
Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer 123
Header parameters
Body parameters
Responses
| Status | Meaning | Description |
|---|---|---|
| 201 | Created | Create a new API token |
| 400 | Bad Request | Invalid request |
| 401 | Unauthorized | Missing or invalid credentials |
| 403 | Forbidden | Insufficient permissions |
| 500 | Internal Server Error | Internal Server Error |
Response Schema
Request
curl --request POST \
--url https://api.onlineornot.com/v1/tokens \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}' \
--header 'Content-Type: application/json' \
--header 'X-OnlineOrNot-Organisation: string' \
--data '{"name":"My API Token","grants":[{"scope":"UPTIME_CHECKS","permission":"READ"}]}'
Response
{
"result": {
"id": "a1b2c3d4",
"name": "My API Token",
"expiresAfter": "2025-12-31T23:59:59.000Z",
"createdAt": "2024-01-15T10:30:00.000Z",
"token": "abc123def456ghi789jkl012mno345pqrs678tuv"
},
"success": true,
"errors": [],
"messages": []
}
Retrieve an API token
Look up detailed information about a specific API token
Requires API_TOKENS:READ; EDIT also grants READ. Session cookies are accepted only when no bearer credential is supplied.
Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer 123
Header parameters
Path parameters
Responses
| Status | Meaning | Description |
|---|---|---|
| 200 | OK | Retrieve the specified API token |
| 400 | Bad Request | Invalid request |
| 401 | Unauthorized | Missing or invalid credentials |
| 403 | Forbidden | Insufficient permissions |
| 404 | Not Found | Token not found |
| 500 | Internal Server Error | Internal Server Error |
Response Schema
Request
curl --request GET \
--url https://api.onlineornot.com/v1/tokens/a1b2c3d4 \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}' \
--header 'X-OnlineOrNot-Organisation: string'
Response
{
"result": {
"id": "a1b2c3d4",
"name": "My API Token",
"expiresAfter": "2025-12-31T23:59:59.000Z",
"createdAt": "2024-01-15T10:30:00.000Z",
"grants": [
{
"scope": "UPTIME_CHECKS",
"permission": "READ"
}
]
},
"success": true,
"errors": [],
"messages": []
}
Delete an API token
Permanently delete an API token
Requires API_TOKENS:EDIT; EDIT also grants READ. Session cookies are accepted only when no bearer credential is supplied.
Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer 123
Header parameters
Path parameters
Responses
| Status | Meaning | Description |
|---|---|---|
| 200 | OK | Delete the specified API token |
| 400 | Bad Request | Invalid request |
| 401 | Unauthorized | Missing or invalid credentials |
| 403 | Forbidden | Insufficient permissions |
| 404 | Not Found | Token not found |
| 500 | Internal Server Error | Internal Server Error |
Response Schema
Request
curl --request DELETE \
--url https://api.onlineornot.com/v1/tokens/a1b2c3d4 \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}' \
--header 'X-OnlineOrNot-Organisation: string'
Response
{
"result": {
"deleted": true
},
"success": true,
"errors": [],
"messages": []
}