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

Auth

13 operations under auth. Examples read $API and $KEY from your shell.

GET /v1/auth/session

Responses

200 Default Response

object

  • session_id string required
  • user_id string required
  • org_id string required
  • role string required one of owner, admin, operator, viewer, approver, developer, issuer_operator
  • idle_expires_at string required
  • expires_at string required
  • step_up_expires_at string required (nullable)

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

curl

curl -s \
  "$API/v1/auth/session" \
  -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/auth/session");
Copied

POST /v1/auth/session/extend

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

Responses

200 Default Response

object

  • session_id string required
  • user_id string required
  • org_id string required
  • role string required one of owner, admin, operator, viewer, approver, developer, issuer_operator
  • idle_expires_at string required
  • expires_at string required
  • step_up_expires_at string required (nullable)

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

curl

curl -s \
  -X POST \
  "$API/v1/auth/session/extend" \
  -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/auth/session/extend");
Copied

POST /v1/auth/logout

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

Responses

204 Default Response

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

curl

curl -s \
  -X POST \
  "$API/v1/auth/logout" \
  -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/auth/logout");
Copied

POST /v1/auth/step-up/totp

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

Request body

application/json, required

object

  • code string required

Responses

200 Default Response

object

  • step_up_expires_at string required

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

curl

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

POST /v1/auth/step-up/webauthn/options

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

Request body

application/json, required

object

Responses

200 Default Response

object

  • challenge_id string required
  • options object required

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

curl

curl -s \
  -X POST \
  "$API/v1/auth/step-up/webauthn/options" \
  -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/auth/step-up/webauthn/options", {
  body: {},
});
Copied

POST /v1/auth/step-up/webauthn/verify

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

Request body

application/json, required

object

  • challenge_id string required
  • response object required
    • id string required
    • rawId string required
    • type string required one of public-key
    • response object required

Responses

200 Default Response

object

  • step_up_expires_at string required

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

curl

curl -s \
  -X POST \
  "$API/v1/auth/step-up/webauthn/verify" \
  -H "authorization: Bearer $KEY" \
  -H "idempotency-key: $(uuidgen)" \
  -H "content-type: application/json" \
  -d '{"challenge_id":"<challenge_id>","response":{"id":"<id>","rawId":"<rawId>","type":"public-key","response":{}}}'
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/auth/step-up/webauthn/verify", {
  body: {
    "challenge_id": "<challenge_id>",
    "response": {
      "id": "<id>",
      "rawId": "<rawId>",
      "type": "public-key",
      "response": {}
    }
  },
});
Copied

POST /v1/auth/totp/login

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

Request body

application/json, required

object

  • email string required
  • code string required

Responses

200 Default Response

object

  • user_id string required
  • org_id string required

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

curl

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

POST /v1/auth/totp/enrol

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

Request body

application/json, required

object

  • enrolment_token string required

Responses

200 Default Response

object

  • secret string required
  • otpauth_uri string required

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

curl

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

POST /v1/auth/totp/confirm

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

Request body

application/json, required

object

  • enrolment_token string required
  • code string required

Responses

200 Default Response

object

  • user_id string required
  • org_id string required

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

curl

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

POST /v1/auth/webauthn/login/options

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

Request body

application/json, required

object

Responses

200 Default Response

object

  • challenge_id string required
  • options object required

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

curl

curl -s \
  -X POST \
  "$API/v1/auth/webauthn/login/options" \
  -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/auth/webauthn/login/options", {
  body: {},
});
Copied

POST /v1/auth/webauthn/login/verify

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

Request body

application/json, required

object

  • challenge_id string required
  • response object required
    • id string required
    • rawId string required
    • type string required one of public-key
    • response object required

Responses

200 Default Response

object

  • user_id string required
  • org_id string required

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

curl

curl -s \
  -X POST \
  "$API/v1/auth/webauthn/login/verify" \
  -H "authorization: Bearer $KEY" \
  -H "idempotency-key: $(uuidgen)" \
  -H "content-type: application/json" \
  -d '{"challenge_id":"<challenge_id>","response":{"id":"<id>","rawId":"<rawId>","type":"public-key","response":{}}}'
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/auth/webauthn/login/verify", {
  body: {
    "challenge_id": "<challenge_id>",
    "response": {
      "id": "<id>",
      "rawId": "<rawId>",
      "type": "public-key",
      "response": {}
    }
  },
});
Copied

POST /v1/auth/webauthn/register/options

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

Request body

application/json, required

object

  • enrolment_token string optional

Responses

200 Default Response

object

  • challenge_id string required
  • options object required

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

curl

curl -s \
  -X POST \
  "$API/v1/auth/webauthn/register/options" \
  -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/auth/webauthn/register/options", {
  body: {},
});
Copied

POST /v1/auth/webauthn/register/verify

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

Request body

application/json, required

object

  • challenge_id string required
  • response object required
    • id string required
    • rawId string required
    • type string required one of public-key
    • response object required
  • enrolment_token string optional

Responses

201 Default Response

object

  • credential_id string required

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

curl

curl -s \
  -X POST \
  "$API/v1/auth/webauthn/register/verify" \
  -H "authorization: Bearer $KEY" \
  -H "idempotency-key: $(uuidgen)" \
  -H "content-type: application/json" \
  -d '{"challenge_id":"<challenge_id>","response":{"id":"<id>","rawId":"<rawId>","type":"public-key","response":{}}}'
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/auth/webauthn/register/verify", {
  body: {
    "challenge_id": "<challenge_id>",
    "response": {
      "id": "<id>",
      "rawId": "<rawId>",
      "type": "public-key",
      "response": {}
    }
  },
});
Copied

Edit on GitHub