• Start
Sign In

surrealctl

/

Commands

invite

Reference for surrealctl invite — listing an organisation's pending invitations, sending one, and withdrawing one.

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.

Usage
surrealctl invite <COMMAND> [OPTIONS]surrealctl invites <COMMAND> [OPTIONS]
VerbPurposeAlias
listList an organisation's pending invitationsls
createInvite someone to an organisation
deleteWithdraw an invitationrm

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.

List an organisation's pending invitations.

Usage
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 list
Output
EMAIL                ROLE    STATUS
dee@acme.example     member  pending
eli@acme.example     admin   pending
Include the codes, which withdrawals also accept
surrealctl invite list --wide

An organisation with no pending invitations is a success: exit 0, and an empty array under --json.

Invite someone to an organisation.

Usage
surrealctl invite create [OPTIONS] --role <ROLE> <EMAIL>

Arguments

NameDescription
<EMAIL>
required
The email address to invite.

Options

NameDescription
--role<ROLE>
required
The role to grant. Run surrealctl org roles for the ones this organisation defines.
surrealctl invite create dee@acme.example --role member
Invite a whole list, reading roles from a file
while IFS=, read -r email role; do
    surrealctl invite create "$email" --role "$role"
done < new-joiners.csv

Refusals, 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.

Withdraw an invitation.

Usage
surrealctl invite delete [OPTIONS] <INVITE>

Arguments

NameDescription
<INVITE>
required
The invitation, by email address or code.

Options

NameDescription
--force
Withdraw without confirming.
By address
surrealctl invite delete dee@acme.example
By code, without a prompt
surrealctl invite delete 7f3a91c4 --force

Refusals. 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.

Was this page helpful?