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

Oauth clients

5 operations under oauth-clients. Examples read $API and $KEY from your shell.

GET /v1/oauth-clients

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
    • scopes array of string required
    • jwks object required
      • keys array required

        Each item:

        • kid string required
        • kty string required
        • crv string required
        • alg string required
        • x string required
        • y string optional
    • token_endpoint_auth_method string required one of private_key_jwt
    • 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/oauth-clients" \
  -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/oauth-clients");
Copied

POST /v1/oauth-clients

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
  • jwks object required
    • keys array of object required
  • allowed_ips array of string optional

Responses

201 Default Response

object

  • id string required
  • name string required
  • scopes array of string required
  • jwks object required
    • keys array required

      Each item:

      • kid string required
      • kty string required
      • crv string required
      • alg string required
      • x string required
      • y string optional
  • token_endpoint_auth_method string required one of private_key_jwt
  • 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/oauth-clients" \
  -H "authorization: Bearer $KEY" \
  -H "idempotency-key: $(uuidgen)" \
  -H "content-type: application/json" \
  -d '{"name":"<name>","scopes":[],"jwks":{"keys":[]}}'
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/oauth-clients", {
  body: {
    "name": "<name>",
    "scopes": [],
    "jwks": {
      "keys": []
    }
  },
});
Copied

GET /v1/oauth-clients/{id}

Parameters

  • id string required in path

Responses

200 Default Response

object

  • id string required
  • name string required
  • scopes array of string required
  • jwks object required
    • keys array required

      Each item:

      • kid string required
      • kty string required
      • crv string required
      • alg string required
      • x string required
      • y string optional
  • token_endpoint_auth_method string required one of private_key_jwt
  • 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 \
  "$API/v1/oauth-clients/$ID" \
  -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/oauth-clients/{id}", {
  params: { path: { id: "<id>" } },
});
Copied

PATCH /v1/oauth-clients/{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
  • scopes array of string required
  • jwks object required
    • keys array required

      Each item:

      • kid string required
      • kty string required
      • crv string required
      • alg string required
      • x string required
      • y string optional
  • token_endpoint_auth_method string required one of private_key_jwt
  • 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/oauth-clients/$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/oauth-clients/{id}", {
  params: { path: { id: "<id>" } },
  body: {
    "allowed_ips": []
  },
});
Copied

POST /v1/oauth-clients/{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
  • scopes array of string required
  • jwks object required
    • keys array required

      Each item:

      • kid string required
      • kty string required
      • crv string required
      • alg string required
      • x string required
      • y string optional
  • token_endpoint_auth_method string required one of private_key_jwt
  • 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/oauth-clients/$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/oauth-clients/{id}/revoke", {
  params: { path: { id: "<id>" } },
});
Copied

Edit on GitHub