# app.tempomusic.staff.listInviteCodes

> Published by [lexicons.tempomusic.fan](https://lexicon.garden/identity/did:plc:pxsuqmultto34oks44m2lgxm)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:pxsuqmultto34oks44m2lgxm/app.tempomusic.staff.listInviteCodes)
- [Documentation](https://lexicon.garden/lexicon/did:plc:pxsuqmultto34oks44m2lgxm/app.tempomusic.staff.listInviteCodes/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:pxsuqmultto34oks44m2lgxm/app.tempomusic.staff.listInviteCodes/examples)

## Definitions

### `app.tempomusic.staff.listInviteCodes`

**Type**: `query`

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 is returned.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `createdBy` | `string` (did) | No | Optional DID filter. When set, only codes generated by that staff account are returned. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `codes` | `array` | Yes |  |

#### Errors

- **Forbidden**: The caller is not a super-admin.
- **PdsUnavailable**: The PDS returned a transient failure — the query never lands locally, retry.

## Raw Schema

```json
{
  "id": "app.tempomusic.staff.listInviteCodes",
  "defs": {
    "main": {
      "type": "query",
      "errors": [
        {
          "name": "Forbidden",
          "description": "The caller is not a super-admin."
        },
        {
          "name": "PdsUnavailable",
          "description": "The PDS returned a transient failure — the query never lands locally, retry."
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "codes"
          ],
          "properties": {
            "codes": {
              "type": "array",
              "items": {
                "ref": "app.tempomusic.staff.defs#inviteCodeView",
                "type": "ref"
              }
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "properties": {
          "createdBy": {
            "type": "string",
            "format": "did",
            "description": "Optional DID filter. When set, only codes generated by that staff account are returned."
          }
        }
      },
      "description": "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 is returned."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
