surrealctl invite manages organisation invitations: the ones that have been sent and not yet accepted. Once someone accepts, they become a member and move into team.
surrealctl invite <COMMAND> [OPTIONS]surrealctl invites <COMMAND> [OPTIONS]team invite and invite create are the same command reached two ways — the same arguments, the same validators and the same messages — because sending an invitation is both how a team gains a member and how an invitation comes to exist. Use whichever reads better in the script you are writing.
surrealctl invite list
List an organisation's pending invitations.
surrealctl invite list [OPTIONS]This command takes no positional argument. The organisation comes from --org and the precedence chain.
Accepts the list presentation flags and nothing else. Column ids are email, role and status, with code and organization_id under --wide.
surrealctl invite listEMAIL ROLE STATUS
dee@acme.example member pending
eli@acme.example admin pendingsurrealctl invite list --wideAn organisation with no pending invitations is a success: exit 0, and an empty array under --json.
surrealctl invite create
Invite someone to an organisation.
surrealctl invite create [OPTIONS] --role <ROLE> <EMAIL>surrealctl invite create dee@acme.example --role memberwhile IFS=, read -r email role; do
surrealctl invite create "$email" --role "$role"
done < new-joiners.csvRefusals, exit 2, before any request. The address validator asks only for an @ with something either side and no internal whitespace; the API is the authority on deliverability:
`dee.acme.example` is not an email address: it has no `@`.Only an empty --role is refused locally, because the role vocabulary is per organisation:
A role cannot be empty. Run `surrealctl org roles` to see the ones this organization defines.A role the API rejects as invalid is annotated with a pointer to org roles.
surrealctl invite delete
Withdraw an invitation.
surrealctl invite delete [OPTIONS] <INVITE>surrealctl invite delete dee@acme.examplesurrealctl invite delete 7f3a91c4 --forceRefusals. The confirmation names the address the invitation was sent to. Declining exits 0. In a non-interactive session without --force or --yes, it exits 2 having sent nothing.
Withdrawing an invitation someone has already accepted is not how you remove them — use team remove for that.
Related pages
teamcommands — members who have already joinedorg roles— the roles an invitation can grantOverview — the rest of the reference
SurrealDB CLI — for working with the data inside an instance