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

Oauth

1 operations under oauth. Examples read $API and $KEY from your shell.

POST /v1/oauth/token

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

Request body

application/json, required

object

  • grant_type string optional
  • client_assertion_type string optional
  • client_assertion string optional
  • scope string optional

Responses

200 Default Response

object

  • access_token string required
  • token_type string required one of Bearer
  • expires_in integer required
  • scope string required

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

curl

curl -s \
  -X POST \
  "$API/v1/oauth/token" \
  -H "authorization: Bearer $KEY" \
  -H "idempotency-key: $(uuidgen)" \
  -H "content-type: application/json" \
  -d '{}'
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/token", {
  body: {},
});
Copied

Edit on GitHub