GET/v1/tokens/verify

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.

Responses

StatusMeaningDescription
200OKVerification result. Valid API tokens include result.id; valid OAuth tokens omit it. May also return a canonical failure envelope with success: false at HTTP200.
400Bad RequestInvalid request
401UnauthorizedAuthorization header is missing
500Internal Server ErrorInternal Server Error

Response Schema

success:boolean
false
result:null
errors:object[]
messages:[any]

Request

GET
/v1/tokens/verify
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/v1/tokens/permissions

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, or require organization selection. Expired and invalid tokens return HTTP 200 with success: false.

Responses

StatusMeaningDescription
200OKAPI-token permissions or a failure envelope. May also return a canonical failure envelope with success: false at HTTP200.
400Bad RequestInvalid request
401UnauthorizedAuthorization header is missing
500Internal Server ErrorInternal Server Error

Response Schema

success:boolean
false
result:null
errors:object[]
messages:[any]

Request

GET
/v1/tokens/permissions
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": []
}

GET/v1/tokens

List all API tokens

Retrieve a paginated list of all API tokens for the organization

Requires API_TOKENS:READ.

Header parameters

X-OnlineOrNot-Organisation:stringoptional
Public organization ID to select from an OAuth grant. Required for grants authorizing multiple organizations. Omit for single-organization grants and API tokens.

Query parameters

page:integeroptional
Page number of paginated results, starting at 1.
Default: 1
per_page:integeroptional
Number of tokens per page, default 10. Pagination metadata is nested at result.result_info.
Default: 10
search:stringoptional
Search term to filter results.

Responses

StatusMeaningDescription
200OKReturns a list of API tokens
400Bad RequestInvalid request
401UnauthorizedMissing or invalid credentials
403ForbiddenInsufficient permissions
500Internal Server ErrorInternal Server Error

Response Schema

result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

GET
/v1/tokens
curl --request GET \
  --url https://api.onlineornot.com/v1/tokens \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'

Response

{
  "result": {
    "result": [
      {
        "project_id": "a1b2c3d4e5f6g7h8",
        "id": "a1b2c3d4",
        "name": "My API Token",
        "expiresAfter": "2025-12-31T23:59:59.000Z",
        "createdAt": "2024-01-15T10:30:00.000Z",
        "grants": [
          {
            "scope": "PROJECTS",
            "permission": "READ"
          }
        ]
      }
    ],
    "result_info": {
      "page": 0,
      "per_page": 0,
      "total_count": 0,
      "total_pages": 0
    }
  },
  "success": true,
  "errors": [],
  "messages": []
}

POST/v1/tokens

Create an API token

Create a new API token for the organization.

Your API token grants or OAuth access token scopes must permit each requested permission.

  • EDIT permits READ or EDIT for the same scope.
  • READ permits only READ for the same scope.
  • The API returns HTTP 403 if your token does not have a required permission.
  • This limit does not apply when you use session cookies. LOGS:EDIT and LOGS:SEND still require current ADMIN membership.
  • OAuth callers also require current ADMIN membership to issue LOGS:EDIT or LOGS:SEND.
  • LOGS:SEND can be combined with other explicitly granted permissions. Tokens with LOGS:SEND may specify project_id; omit it or use null for unassigned.
  • Project scope applies only to sending; other grants remain organisation-wide.
  • Issuing LOGS:SEND requires LOGS:EDIT or explicit LOGS:SEND delegation authority in addition to API_TOKENS:EDIT for bearer callers. LOGS:EDIT itself does not authorize sending logs.
  • Project scope is fixed at creation. Revoke and replace the token to change it. A sending credential with API_TOKENS:EDIT may delegate sending only to its own project unless it also holds organisation-wide LOGS:EDIT.
  • Logs grants are available to authorized callers in every organisation. Ingestion and search are not available yet.

Example requirements:

  • Read permissions: API_TOKENS:EDIT and UPTIME_CHECKS:READ (or UPTIME_CHECKS:EDIT).
  • Multiple permissions: API_TOKENS:EDIT, UPTIME_CHECKS:EDIT, and STATUS_PAGES:EDIT.

Requires API_TOKENS:EDIT.

Header parameters

X-OnlineOrNot-Organisation:stringoptional
Public organization ID to select from an OAuth grant. Required for grants authorizing multiple organizations. Omit for single-organization grants and API tokens.

Body parameters

name:string
Token name
grants:[anyOf]
Permissions explicitly granted to this token.
*anonymous*:objectoptional
*anonymous*:objectoptional
expiresAt:string,null(date-time)optional
Custom expiration date. Omit for 365 days from now, or use null for no expiration.
project_id:string | nulloptional
Project receiving logs. Omit or use null for unassigned. Requires LOGS:SEND and applies only to sending; other grants remain organisation-wide. Scope cannot be changed after issuance.

Responses

StatusMeaningDescription
201CreatedCreate a new API token
400Bad RequestInvalid request
401UnauthorizedMissing or invalid credentials
403ForbiddenYour token does not have API_TOKENS:EDIT or a requested permission
404Not FoundProject not found in this organisation
500Internal Server ErrorInternal Server Error
503Service UnavailableLog credential storage is unavailable

Response Schema

result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

POST
/v1/tokens
curl --request POST \
  --url https://api.onlineornot.com/v1/tokens \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}' \
  --header 'Content-Type: application/json' \
  --data '{"name":"My API Token","grants":[{"scope":"UPTIME_CHECKS","permission":"READ"}]}'

Response

{
  "result": {
    "project_id": "a1b2c3d4e5f6g7h8",
    "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": []
}

GET/v1/tokens/{token_id}

Retrieve an API token

Look up detailed information about a specific API token

Requires API_TOKENS:READ.

Header parameters

X-OnlineOrNot-Organisation:stringoptional
Public organization ID to select from an OAuth grant. Required for grants authorizing multiple organizations. Omit for single-organization grants and API tokens.

Path parameters

token_id:string
The token ID

Responses

StatusMeaningDescription
200OKRetrieve the specified API token
400Bad RequestInvalid request
401UnauthorizedMissing or invalid credentials
403ForbiddenInsufficient permissions
404Not FoundToken not found
500Internal Server ErrorInternal Server Error

Response Schema

result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

GET
/v1/tokens/{token_id}
curl --request GET \
  --url https://api.onlineornot.com/v1/tokens/a1b2c3d4 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'

Response

{
  "result": {
    "project_id": "a1b2c3d4e5f6g7h8",
    "id": "a1b2c3d4",
    "name": "My API Token",
    "expiresAfter": "2025-12-31T23:59:59.000Z",
    "createdAt": "2024-01-15T10:30:00.000Z",
    "grants": [
      {
        "scope": "PROJECTS",
        "permission": "READ"
      }
    ]
  },
  "success": true,
  "errors": [],
  "messages": []
}

DELETE/v1/tokens/{token_id}

Delete an API token

Permanently delete an API token

Requires API_TOKENS:EDIT.

Header parameters

X-OnlineOrNot-Organisation:stringoptional
Public organization ID to select from an OAuth grant. Required for grants authorizing multiple organizations. Omit for single-organization grants and API tokens.

Path parameters

token_id:string
The token ID

Responses

StatusMeaningDescription
200OKDelete the specified API token
400Bad RequestInvalid request
401UnauthorizedMissing or invalid credentials
403ForbiddenInsufficient permissions
404Not FoundToken not found
500Internal Server ErrorInternal Server Error

Response Schema

result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

DELETE
/v1/tokens/{token_id}
curl --request DELETE \
  --url https://api.onlineornot.com/v1/tokens/a1b2c3d4 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'

Response

{
  "result": {
    "deleted": true
  },
  "success": true,
  "errors": [],
  "messages": []
}

Was this page helpful?