Skip to content
Testnet only: a reference implementation, not a production service.Tokens and bank transfers here are simulated and have no value.

Api keys

4 operations under api-keys. Examples read $API and $KEY from your shell.

GET /v1/api-keys

Parameters

  • limit integer optional in query
  • starting_after string optional in query

Responses

200 Default Response

object

  • data array required

    Each item:

    • id string required
    • name string required
    • prefix string required
    • scopes array of string required
    • allowed_ips array of string required
    • created_at string required
    • revoked_at string required (nullable)
  • has_more boolean required

Errors are RFC 9457 problem documents (application/problem+json).

curl

curl -s \
  "$API/v1/api-keys" \
  -H "authorization: Bearer $KEY"
Copied

SDK

import { createScrClient } from "@scr/sdk";

// The client sends the API key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.GET("/v1/api-keys");
Copied

POST /v1/api-keys

Send an Idempotency-Key header on every POST so a retry never repeats the request.

Request body

application/json, required

object

  • name string required
  • scopes array of string required
  • allowed_ips array of string optional

Responses

201 Default Response

object

  • id string required
  • name string required
  • prefix string required
  • scopes array of string required
  • allowed_ips array of string required
  • created_at string required
  • revoked_at string required (nullable)
  • secret string required

Errors are RFC 9457 problem documents (application/problem+json).

curl

curl -s \
  -X POST \
  "$API/v1/api-keys" \
  -H "authorization: Bearer $KEY" \
  -H "idempotency-key: $(uuidgen)" \
  -H "content-type: application/json" \
  -d '{"name":"<name>","scopes":[]}'
Copied

SDK

import { createScrClient } from "@scr/sdk";

// The client sends the API key and an Idempotency-Key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.POST("/v1/api-keys", {
  body: {
    "name": "<name>",
    "scopes": []
  },
});
Copied

PATCH /v1/api-keys/{id}

Parameters

  • id string required in path

Request body

application/json, required

object

  • allowed_ips array of string required

Responses

200 Default Response

object

  • id string required
  • name string required
  • prefix string required
  • scopes array of string required
  • allowed_ips array of string required
  • created_at string required
  • revoked_at string required (nullable)

Errors are RFC 9457 problem documents (application/problem+json).

curl

curl -s \
  -X PATCH \
  "$API/v1/api-keys/$ID" \
  -H "authorization: Bearer $KEY" \
  -H "content-type: application/json" \
  -d '{"allowed_ips":[]}'
Copied

SDK

import { createScrClient } from "@scr/sdk";

// The client sends the API key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.PATCH("/v1/api-keys/{id}", {
  params: { path: { id: "<id>" } },
  body: {
    "allowed_ips": []
  },
});
Copied

POST /v1/api-keys/{id}/revoke

Send an Idempotency-Key header on every POST so a retry never repeats the request.

Parameters

  • id string required in path

Responses

200 Default Response

object

  • id string required
  • name string required
  • prefix string required
  • scopes array of string required
  • allowed_ips array of string required
  • created_at string required
  • revoked_at string required (nullable)

Errors are RFC 9457 problem documents (application/problem+json).

curl

curl -s \
  -X POST \
  "$API/v1/api-keys/$ID/revoke" \
  -H "authorization: Bearer $KEY" \
  -H "idempotency-key: $(uuidgen)"
Copied

SDK

import { createScrClient } from "@scr/sdk";

// The client sends the API key and an Idempotency-Key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.POST("/v1/api-keys/{id}/revoke", {
  params: { path: { id: "<id>" } },
});
Copied

Edit on GitHub