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

Invitations

4 operations under invitations. Examples read $API and $KEY from your shell.

GET /v1/invitations

Responses

200 Default Response

object

  • data array required

    Each item:

    • id string required
    • email string required
    • role string required
    • created_at string required
    • expires_at string required
    • accepted_at string required (nullable)
    • revoked_at string required (nullable)
  • has_more boolean required

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

curl

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

POST /v1/invitations

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

Request body

application/json, required

object

  • email string required
  • role string required one of admin, operator, viewer, approver, developer

Responses

201 Default Response

object

  • id string required
  • email string required
  • role string required
  • created_at string required
  • expires_at string required
  • accepted_at string required (nullable)
  • revoked_at string required (nullable)
  • invitation_url string optional

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

curl

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

POST /v1/invitations/accept

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

Request body

application/json, required

object

  • token string required

Responses

201 Default Response

object

  • user_id string required
  • org_id string required
  • enrolment_token string required

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

curl

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

POST /v1/invitations/{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
  • email string required
  • role string required
  • created_at string required
  • expires_at string required
  • accepted_at string required (nullable)
  • revoked_at string required (nullable)

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

curl

curl -s \
  -X POST \
  "$API/v1/invitations/$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/invitations/{id}/revoke", {
  params: { path: { id: "<id>" } },
});
Copied

Edit on GitHub