Skip to main content
All requests use a single endpoint: POST /functions/v1/api with resource: "teams".

Access control

Access varies by action. Team owners and internal admins have full access to all actions. Team members have read-only access to get and members. Any authenticated user can create a team.
ActionAny userTeam memberTeam ownerAdmin
getNoYes (read-only)YesYes
createYesYes
updateNoNoYesYes
deleteNoNoYesYes
membersNoYesYesYes
inviteNoNoYesYes
invitationsNoNoYesYes
cancel-inviteNoNoYesYes
remove-memberNoNoYesYes
Only team owners and internal admins can manage invitations and remove members. Regular team members have read-only access to get and members actions only.

Team management workflow

1

Create a team

Use the create action to set up a new team. The authenticated user automatically becomes the team owner.
2

Invite members

Use the invite action to send invitations by email. Track pending invitations with the invitations action.
3

Members accept

Invited users accept the invitation to join the team. Their profile is updated with the team_id.
4

Manage the team

Use members to view the roster, remove-member to remove users, and cancel-invite to revoke pending invitations.

Get a team

Retrieves a specific team by ID with all team members.
resource
string
required
Must be "teams"
action
string
required
Must be "get"
id
string
required
The team ID.

Response

success
boolean
data
object
const response = await ApiService.invoke<{
  team: Team;
  members: TeamMember[];
}>({
  resource: "teams",
  action: "get",
  id: "123",
});

Create a team

Creates a new team. The authenticated user automatically becomes the team owner.
resource
string
required
Must be "teams"
action
string
required
Must be "create"
data
object
required

Response (status 201)

success
boolean
data
object
const response = await ApiService.invoke<{ team: Team }>(
  {
    resource: "teams",
    action: "create",
    data: {
      name: "Marketing Team",
      brand: "ACME Corp",
      branding: { color: "#FF0000" },
    },
  },
  201
);

Update a team

Updates team settings such as name, brand, and branding.
resource
string
required
Must be "teams"
action
string
required
Must be "update"
id
string
required
The team ID.
data
object
required

Response

success
boolean
data
object
const response = await ApiService.invoke<{ team: Team }>({
  resource: "teams",
  action: "update",
  id: "123",
  data: {
    name: "Updated Team Name",
  },
});

Delete a team

Permanently deletes a team and removes all members.
resource
string
required
Must be "teams"
action
string
required
Must be "delete"
id
string
required
The team ID.

Response

success
boolean
data
object
This permanently deletes the team and removes all member associations.
const response = await ApiService.invoke<{
  success: boolean;
  message: string;
}>({
  resource: "teams",
  action: "delete",
  id: "123",
});

List team members

Retrieves all members of a team.
resource
string
required
Must be "teams"
action
string
required
Must be "members"
id
string
required
The team ID.

Response

success
boolean
data
object
const response = await ApiService.invoke<{
  members: TeamMember[];
  count: number;
}>({
  resource: "teams",
  action: "members",
  id: "123",
});

Invite a member

Sends a team invitation to an email address.
resource
string
required
Must be "teams"
action
string
required
Must be "invite"
id
string
required
The team ID.
data
object
required

Response (status 201)

success
boolean
data
object
const response = await ApiService.invoke<{ invitation: TeamInvitation }>(
  {
    resource: "teams",
    action: "invite",
    id: "123",
    data: {
      email: "user@example.com",
    },
  },
  201
);

List pending invitations

Retrieves all pending invitations for a team.
resource
string
required
Must be "teams"
action
string
required
Must be "invitations"
id
string
required
The team ID.

Response

success
boolean
data
object
const response = await ApiService.invoke<{
  invitations: TeamInvitation[];
  count: number;
}>({
  resource: "teams",
  action: "invitations",
  id: "123",
});

Cancel an invitation

Cancels a pending team invitation.
resource
string
required
Must be "teams"
action
string
required
Must be "cancel-invite"
id
string
required
The invitation UUID.
data
object
required

Response

success
boolean
data
object
const response = await ApiService.invoke<{ success: boolean }>({
  resource: "teams",
  action: "cancel-invite",
  id: "invitation-uuid",
  data: {
    teamId: 123,
  },
});

Remove a member

Removes a member from a team.
resource
string
required
Must be "teams"
action
string
required
Must be "remove-member"
id
string
required
The team ID.
data
object
required

Response

success
boolean
data
object
const response = await ApiService.invoke<{ success: boolean }>({
  resource: "teams",
  action: "remove-member",
  id: "123",
  data: {
    memberId: "user-uuid",
  },
});

Error responses

StatusCodeDescription
400VALIDATION_ERRORMissing or invalid required parameters
401UNAUTHORIZEDNo valid authentication token
403FORBIDDENUser lacks permission for the operation
404NOT_FOUNDTeam or resource not found
500INTERNAL_ERRORServer error during processing