Team members

Team accounts allow you to invite other users to access your account. Members can be assigned different roles, which control what they can do within the account.

The team member model

Not all endpoints return all account data - particularly around billing as that can require additinoal calls to third parties to verify. Below is a breakdown of fields you can expect to get back when interacting with accounts.

Properties

  • Name
    user_id
    Type
    uuid
    Description

    Unique identifier for a user.

  • Name
    account_role
    Type
    string
    Description

    The current user's role within the account. Typically member or owner.

  • Name
    is_primary_owner
    Type
    boolean
    Description

    Tells you if the current user is the primary owner of the account.

  • Name
    name
    Type
    string
    Description

    The name of the user

  • Name
    email
    Type
    string
    Description

    The email address of the user


POST/rpc/get_account_members

List all members

Returns a list of all members on a given account.

Required attributes

  • Name
    account_id
    Type
    uuid
    Description

    Unique UUID for the account you're trying to lookup

Optional attributes

  • Name
    results_limit
    Type
    integer
    Description

    Limit the number of results returned. Default is 50.

  • Name
    results_offset
    Type
    integer
    Description

    Offset the results returned. Default is 0.

Request

POST
/rpc/get_account_members
curl -G https://YOUR_SUPABASE/rest/v1/rpc/get_account_members \
-X POST \
-H "Authorization: Bearer SUPABASE_AUTH_TOKEN" \
-H "apikey: SUPABASE_ANON_KEY" \
-H "Content-Type: application/json"
-d '{"account_id": "uuid"}'

Response

[
    {
        "user_id": "uuid",
        "account_role": "member",
        "is_primary_owner": true,
        "name": "Frank Smith",
        "email": "test@test.com"
    },
    ...
]