app.tempomusic.staff.createInviteCode

Generate a batch of single-use PDS invite codes (TEM-502). Requires the caller to have the `superAdmin` role. Each call requests `quantity` codes from the PDS (`com.atproto.server.createInviteCode` with `useCount=1`), writes one `inviteCodeCreated` audit row per successfully-created code (payload = SHA-256 hash of the suffix + `use_count`, never the plain code), and returns the suffix-only codes. When the PDS returns a transient failure mid-batch the handler stops iterating and returns the successfully-generated codes together with the requested count (partial-batch surfacing — the client decides whether to retry the missing count).

Details · procedure
Kindprocedure
Authoritystaff.tempomusic.app
Indexed

Procedure

procedure · POST

Input

application/json

quantity

requiredinteger

Number of invite codes to generate in this batch. Hard-capped at 25 to keep the audit-log write batch bounded and the partial-failure surface predictable.

  • minimum: 1
  • maximum: 25

Output

application/json

codes

requiredarray

The successfully-generated invite codes as suffix-only strings (the env prefix stored under `APPVIEW_PDS_INVITE_CODE_PREFIX` has been stripped).

itemsstring
  • maxLength: 128

created

requiredinteger

Number of codes actually generated (equal to `codes.length`). Present redundantly to make the partial-batch semantic obvious to clients that only inspect scalars.

  • minimum: 0

requested

requiredinteger

The `quantity` originally requested. `created < requested` signals a partial batch — the client may retry with `quantity = requested - created`.

  • minimum: 1

Errors

Forbidden

The caller is not a super-admin.

InvalidRequest

`quantity` outside the 1..25 range.

PdsUnavailable

The PDS returned a transient failure on the FIRST call and zero codes were generated. Partial failures on subsequent calls surface via `created < requested` on a 200 OK response, NOT this error.

Similar lexicons

semantic match

Lexicons whose schemas describe something close to this one. Check them before publishing a new one that overlaps.

  • List PDS invite codes on-demand via the PDS (`com.atproto.admin.getInviteCodes`). No local mirror — the source of truth is the PDS. Requires the caller to have the `superAdmin` role. Codes are returned as suffix-only strings (the env prefix stored under `APPVIEW_PDS_INVITE_CODE_PREFIX` has been stripped). Optional `createdBy` filter narrows the listing to codes emitted by a specific staff DID (applied server-side by the AppView — the admin endpoint has no such parameter); when omitted every code

  • Disable one or more PDS invite codes (TEM-502). Requires the caller to have the `superAdmin` role. Codes are provided as suffix-only strings; the handler re-prepends the env prefix stored under `APPVIEW_PDS_INVITE_CODE_PREFIX` before calling `com.atproto.admin.disableInviteCodes`. On success, writes one `inviteCodeDisabled` audit row per code (payload = SHA-256 hash of the suffix, never the plain code).

  • Create invite codes.

  • Create an invite code.