Team API

Manage member access

Use the Team API to keep a member's Lettermint access in sync with your own provisioning workflow.

Code
Role = what a member can do Project access = where project permissions apply

The API replaces both parts atomically in one request.

Create an assignment token

Create a Team API token with read:members and write:members to list members, invite or remove them, and change their roles and project access. Add write:roles to manage custom roles.

A token with write:members can grant any active non-Owner role and any project scope in the team. Store it in a secrets manager, restrict it by IP where possible, and use a dedicated token for this integration.

Find roles and members

Call listTeamRoles to list the team's reusable roles. Call listTeamMembers to list members and their current assignments. Method names use the normal naming convention for each SDK, such as team.members.updateAssignment in Node.js, team.members.update_assignment in Python and Team.Members.UpdateAssignment in Go.

The Owner role is included for display. Team API tokens cannot assign or remove Owner; Owners manage those assignments in the dashboard.

The top-level member id is the user ID used in member and assignment URLs. Member responses include name, email, role: { id, name }, project_access, and joined_at. Selected project access is returned as project_access.projects, where each project contains its id and name. An all scope includes every current and future project and returns an empty projects list.

Assign selected projects

selected applies the role's project permissions only to the listed projects. Replace the example IDs with IDs returned by listTeamRoles and listTeamMembers.

import { Lettermint } from "lettermint"; const lettermint = new Lettermint({ teamToken: process.env.LETTERMINT_TEAM_TOKEN!, }); const member = await lettermint.team.members.updateAssignment("user-id", { role_id: "role-id", project_access: { scope: "selected", project_ids: ["project-a-id", "project-b-id"], }, });

A successful request returns the complete member assignment.

Assign all projects

Use "scope": "all" to include every current and future project. Do not include project_ids:

JSONCode
{ "role_id": "role-id", "project_access": { "scope": "all" } }

Selected access does not include future projects automatically. Send an empty project_ids array for a team-only role such as Billing:

JSONCode
{ "role_id": "BILLING_ROLE_ID", "project_access": { "scope": "selected", "project_ids": [] } }

Owner assignments return owner_protected. Manage Owners from Manage team > Members.

Invite and remove members

An invite uses the same role_id and project_access body as an assignment. Lettermint emails the invite, and the assignment applies when the person accepts.

TerminalcURL
curl -X POST "https://api.lettermint.co/v1/team/invites" \ -H "Accept: application/json" \ -H "Authorization: Bearer $LETTERMINT_TEAM_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "email": "new.member@example.com", "role_id": "role-id", "project_access": { "scope": "all" } }'
  • Inviting needs a free seat on your plan.
  • Updating an invite's email sends a new invite email.
  • Revoke an invite with DELETE /v1/team/invites/{inviteId}. Remove a member with DELETE /v1/team/members/{userId}.
  • Team API tokens cannot remove Owners. These requests return owner_protected.

Manage custom roles

Custom roles are available on the Pro plan. Send the role's complete permission list; an update replaces it for every member and invite with that role.

TerminalcURL
curl -X POST "https://api.lettermint.co/v1/team/roles" \ -H "Accept: application/json" \ -H "Authorization: Bearer $LETTERMINT_TEAM_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Support", "permissions": ["members:read", "projects:read", "messages:read"] }'
  • Built-in roles cannot be changed or deleted. Duplicate one to start from its permissions.
  • To delete a role that is still assigned, pass replacement_role_id. Lettermint moves its members and invites to that role.
  • GET /v1/team/roles lists reusable roles and permission keys.
  • GET, PUT, DELETE /v1/team/roles/{roleId}, POST /v1/team/roles and POST /v1/team/roles/{roleId}/duplicate manage custom roles.
  • GET /v1/team/members lists complete assignments. Add filter[project_id] to list the members who can access one project.
  • GET /v1/team/members/{userId} returns one assignment.
  • PUT /v1/team/members/{userId}/assignment replaces one assignment.
  • DELETE /v1/team/members/{userId} removes a member.
  • GET, POST /v1/team/invites and GET, PUT, DELETE /v1/team/invites/{inviteId} manage pending invites.

See the Team API reference for complete schemas and response details.