1KEY Developers
API reference

Organization

Base URL https://api.1keyplatform.dev/v1. Every endpoint below is generated from the OpenAPI contract, which you can download as openapi.yaml.

Log in to send these requests to your organization from this page.

Organization

Your organization, its API keys, their usage and request log, and your email alerts.

GET /api-keys

List API keys

Needs the api_keys:read scope.

The organization's API keys. Never their secrets.

Parameters

Name In Type Description
status optional query "active" | "revoked"

Responses

200 All keys.

Errors

401 unauthenticated Missing, malformed, revoked or unknown API key.
403 insufficient_scope The key lacks the scope this operation needs.
POST /api-keys

Create an API key

Needs the api_keys:write scope.

A key with at most the calling key's scopes, acting as the calling key's creator. It stops working when the calling key is revoked. token is in this response only: store it now.

Body

name string, up to 100 characters · required
scopes array of string · required

Responses

201 The key, with its token.

Errors

400 invalid_request The request is malformed or a field is invalid.
401 unauthenticated Missing, malformed, revoked or unknown API key.
403 insufficient_scope The key lacks the scope this operation needs.
GET /requests/stream

Stream the request log

Needs the api_keys:read scope.

Server-Sent Events of each request as it is logged, with GET /requests's filters. Each message's id is the entry's id and its event is request. Starts after Last-Event-ID, or with the next request without it. A : keepalive comment arrives every 30 seconds. The server ends the stream after 15 minutes; reconnect with Last-Event-ID.

Parameters

Name In Type Description
api_key_id optional query string
status optional query "2xx" | "4xx" | "5xx"
request_id optional query string
Last-Event-ID optional header string

Responses

200 A request stream.
200 · example
id: 48213
event: request
data: {"id":"48213","at":"2026-10-03T14:03:11.143000Z","method":"GET","path":"/v1/hubs","query":null,"status":200,"duration_ms":38,"api_key_id":"5f0c…","api_key_name":"production","request_id":"req_01J…","request_body":null,"response_body":"{\"data\":[]}"}

Errors

400 invalid_request The request is malformed or a field is invalid.
401 unauthenticated Missing, malformed, revoked or unknown API key.
403 insufficient_scope The key lacks the scope this operation needs.
404 not_found No such resource, or it is not your organization's.
429 Too many requests. Retry after the Retry-After header.
DELETE /api-keys/{api_key_id}

Revoke an API key

Needs the api_keys:write scope.

Owners and admins revoke any key; members their own. The key, and every key created with it or with those keys, stops working at once.

Parameters

Name In Type Description
api_key_id required path string

Responses

200 The revoked key. · returns a ApiKey

Errors

401 unauthenticated Missing, malformed, revoked or unknown API key.
403 insufficient_scope The key lacks the scope this operation needs.
404 not_found No such resource, or it is not your organization's.
GET /alert-rules

Your email alerts

Needs the hubs:read scope.

The alert rules of the person the key acts as (in the portal, the signed-in person), and whether each emails them. Rules apply to every site but test sites.

Responses

200 Every rule.

Errors

401 unauthenticated Missing, malformed, revoked or unknown API key.
403 insufficient_scope The key lacks the scope this operation needs.
GET /requests

The request log

Needs the api_keys:read scope.

Requests made with your organization's keys in the last 30 minutes, newest first. Setup codes, tokens and passwords are removed from bodies, email addresses masked and IP and MAC addresses hidden. Owners and admins read every key's requests; members those made with their own keys.

Parameters

Name In Type Description
api_key_id optional query string
status optional query "2xx" | "4xx" | "5xx"
request_id optional query string The request_id of an answer or error.
limit optional query integer, 1–100, default 50
before optional query string An entry's id; the page holds older entries.

Responses

200 Logged requests.

Errors

400 invalid_request The request is malformed or a field is invalid.
401 unauthenticated Missing, malformed, revoked or unknown API key.
403 insufficient_scope The key lacks the scope this operation needs.
404 not_found No such resource, or it is not your organization's.
GET /usage

API key usage

Needs the api_keys:read scope.

Requests per key per hour or per UTC day, oldest first. Kept 30 days. Owners and admins read every key's usage; members their own keys'.

Parameters

Name In Type Description
api_key_id optional query string
granularity optional query "hour" | "day" hour (default) or day: counts per UTC day.
since optional query string From this time; by day, from the start of its UTC day. Default 24 hours ago, or by day the last 14 days.
format optional query "json" | "csv" json (default) or csv: the same rows as CSV, a header line first (hour or day, api_key_id, api_key_name, requests, errors, rate_limited). Names are quoted, and one starting with =, +, -, @, a tab or a carriage return gets a leading ' so spreadsheets don't run it.

Responses

200 The counts.

Errors

400 invalid_request The request is malformed or a field is invalid.
401 unauthenticated Missing, malformed, revoked or unknown API key.
403 insufficient_scope The key lacks the scope this operation needs.
404 not_found No such resource, or it is not your organization's.
GET /organization

Get your organization

The organization the API key belongs to, and the role it acts with. The one read that needs no scope.

Responses

200 The organization. · returns a Organization

Errors

401 unauthenticated Missing, malformed, revoked or unknown API key.
PATCH /organization

Rename your organization

Needs the organization:write scope.

Body

name string, up to 100 characters · required

Responses

200 The organization. · returns a Organization

Errors

400 invalid_request The request is malformed or a field is invalid.
401 unauthenticated Missing, malformed, revoked or unknown API key.
403 insufficient_scope The key lacks the scope this operation needs.
POST /api-keys/{api_key_id}/rotate

Rotate an API key

Needs the api_keys:write scope.

A new key with the old key's name, scopes, creator and parent, and rotated_from_id set to the old key. The old key stops working after grace_seconds: at once by default, revoking the keys it created with it; otherwise at its revoke_at, and the keys it created stop working then too. A key rotates itself; otherwise owners and admins rotate any key, members their own. The organization's owners and admins are emailed. token is in this response only: store it now.

Parameters

Name In Type Description
api_key_id required path string

Body

grace_seconds integer, 0–86400, default 0 · optional How long the old key keeps working.

Responses

201 The new key, with its token.

Errors

400 invalid_request The request is malformed or a field is invalid.
401 unauthenticated Missing, malformed, revoked or unknown API key.
403 insufficient_scope: the key lacks api_keys:write. forbidden: a member's request for a key they didn't create.
404 not_found No such resource, or it is not your organization's.
409 conflict: the key, or a key above it, is revoked or past its revoke_at.
PUT /alert-rules/{rule}

Turn an email alert on or off

Needs the hubs:write scope.

For the person the key acts as only.

Parameters

Name In Type Description
rule required path "site_offline" | "crash_loop" | "cellular_plan"

Body

enabled boolean · required

Responses

200 The rule. · returns a AlertRule

Errors

400 invalid_request The request is malformed or a field is invalid.
401 unauthenticated Missing, malformed, revoked or unknown API key.
403 insufficient_scope The key lacks the scope this operation needs.
404 not_found No such resource, or it is not your organization's.