Node.js
import { Rewrite } from '@rewritetoday/sdk';
const rewrite = new Rewrite(process.env.REWRITE_API_KEY!);
const { data, error, cursor } = await rewrite.apiKeys.list({
limit: 20,
});
if (error) throw error;{
"ok": true,
"data": [
{
"id": "748395130237498990",
"name": "primary",
"prefix": "rw_d5f3ce",
"scopes": [
"message:write",
"message:read",
"project:logs:read"
],
"description": "Main server key used by production messaging flows.",
"lastUsedAt": "2026-03-20T14:22:39.914Z",
"createdAt": "2026-03-20T14:22:31.562Z"
}
],
"cursor": {
"persist": false
}
}API Keys
List API keys
List API keys created for the current project. Results are paginated with a top-level cursor.
GET
/
api-keys
Node.js
import { Rewrite } from '@rewritetoday/sdk';
const rewrite = new Rewrite(process.env.REWRITE_API_KEY!);
const { data, error, cursor } = await rewrite.apiKeys.list({
limit: 20,
});
if (error) throw error;{
"ok": true,
"data": [
{
"id": "748395130237498990",
"name": "primary",
"prefix": "rw_d5f3ce",
"scopes": [
"message:write",
"message:read",
"project:logs:read"
],
"description": "Main server key used by production messaging flows.",
"lastUsedAt": "2026-03-20T14:22:39.914Z",
"createdAt": "2026-03-20T14:22:31.562Z"
}
],
"cursor": {
"persist": false
}
}Authorizations
Send your API key as Authorization: Bearer rw_....
Required scope: project:api_keys:read.
Query Parameters
Cursor for forward pagination. Send exactly one of after or before when paginating.
Example:
"748395130237498412"
Cursor for backward pagination. Send exactly one of after or before when paginating.
Example:
"748395130237498412"
Page size. Backend cursor schemas validate this between 2 and the route-specific maximum.
Required range:
2 <= x <= 100