Invitations
4 operations under invitations. Examples read $API and $KEY from your shell.
GET /v1/invitations
Responses
200 Default Response
object
dataarray requiredEach item:
idstring requiredemailstring requiredrolestring requiredcreated_atstring requiredexpires_atstring requiredaccepted_atstring required (nullable)revoked_atstring required (nullable)
has_moreboolean required
Errors are RFC 9457 problem documents (application/problem+json).
curl
curl -s \
"$API/v1/invitations" \
-H "authorization: Bearer $KEY"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");POST /v1/invitations
Send an Idempotency-Key header on every POST so a retry never repeats the request.
Request body
application/json, required
object
emailstring requiredrolestring required one ofadmin,operator,viewer,approver,developer
Responses
201 Default Response
object
idstring requiredemailstring requiredrolestring requiredcreated_atstring requiredexpires_atstring requiredaccepted_atstring required (nullable)revoked_atstring required (nullable)invitation_urlstring 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"}'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"
},
});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
tokenstring required
Responses
201 Default Response
object
user_idstring requiredorg_idstring requiredenrolment_tokenstring 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>"}'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>"
},
});POST /v1/invitations/{id}/revoke
Send an Idempotency-Key header on every POST so a retry never repeats the request.
Parameters
idstring required in path
Responses
200 Default Response
object
idstring requiredemailstring requiredrolestring requiredcreated_atstring requiredexpires_atstring requiredaccepted_atstring required (nullable)revoked_atstring 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)"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>" } },
});