Account.TeamMember
A member of a team, or a pending invitation to join it, with the member’s role (or the role the invitation gives).
Creating one e-mails an invitation; the person joins once they accept
it (someone already in another team of the organization joins at once).
A member is identified by email: changing email or teamId replaces
it (the old membership is removed). role or roleId change in place
through the change-role endpoint; with only role, its id is looked up in
the organization’s roles. With neither, an invitation gets the responder
role. An existing member with the same e-mail is adopted with --adopt
(the API’s create would otherwise answer the existing member unchanged).
Destroying the resource removes the person from the team (or withdraws the invitation).
Inviting a team member
Section titled “Inviting a team member”A team lead
yield* BetterStack.Account.TeamMember("ada", { email: "ada@example.com", role: "team_lead",});Into a custom role, by id
yield* BetterStack.Account.TeamMember("grace", { email: "grace@example.com", roleId: "206",});Looking up a member
Section titled “Looking up a member”By e-mail
const existing = BetterStack.Account.TeamMember.lookup({ email: "ada@example.com" });email string required
E-mail address. Required to invite, and can't be changed afterward.
organizationId string
The organization to use, such as 123. Required when you sign in with OAuth and can access more than one organization. Get the ID from organization_id in List teams.
role "admin" | "billing_admin" | "team_lead" | "responder" | "member" | "custom" | string
The member's built-in role in this team. A user can have a different role in each team. null on an invitation to a custom role. With neither role nor role_id, an invitation gets the responder role. - admin: Can access every feature in every team, including billing, organization settings and API tokens. The API never assigns it. - billing_admin: Can manage subscriptions, invoices and payment settings for the whole organization, without access to operational features. - team_lead: Can access monitors, incidents, on-call, status pages, telemetry and AI SRE, invite team members and change their roles. - responder: Can access monitors, incidents, on-call, status pages, telemetry and AI SRE, and invite team members. - member: Can access sources, Live tail, dashboards, error tracking, session replays and AI SRE, without monitors, incidents or on-call. - custom: The member has a custom role. Assign one with role_id instead.
roleId string
ID of the member's role, or of the role an invitation gives, custom roles included. Get the IDs via List roles. When role is also given, both must name the same role.
teamId string
Team that owns the resource, such as t123. Defaults to the credentials' team (BETTERSTACK_TEAM_ID, or the profile's team). Changing it replaces the resource.
Attributes
Section titled “Attributes”email string always set
The member's e-mail address, which identifies it.
id string always set
The team_member's id.
createdAt string | null
When the user account was created. Absent on a pending invitation.
firstName string | null
The member's first name, or null when they haven't set one. Absent on a pending invitation.
invitedAt string | null
When the invitation was created. Present only on a pending invitation.
lastName string | null
The member's last name, or null when they haven't set one. Absent on a pending invitation.
message string
What happened, in a sentence, either Invitation sent, or User is already a member of the team when the address already belongs to a member.
mobileAppPlatforms string[]
The platforms the member's mobile apps receive push notifications on, ios and android, or empty when none. Absent on a pending invitation.
phoneNumbers unknown[]
The member's phone numbers. Always empty on the accounts observed, so the item shape is unverified.
role "admin" | "billing_admin" | "team_lead" | "responder" | "member" | "custom" | null
The member's built-in role in this team. A user can have a different role in each team. null on an invitation to a custom role. With neither role nor role_id, an invitation gets the responder role. - admin: Can access every feature in every team, including billing, organization settings and API tokens. The API never assigns it. - billing_admin: Can manage subscriptions, invoices and payment settings for the whole organization, without access to operational features. - team_lead: Can access monitors, incidents, on-call, status pages, telemetry and AI SRE, invite team members and change their roles. - responder: Can access monitors, incidents, on-call, status pages, telemetry and AI SRE, and invite team members. - member: Can access sources, Live tail, dashboards, error tracking, session replays and AI SRE, without monitors, incidents or on-call. - custom: The member has a custom role. Assign one with role_id instead.
roleId string | null
ID of the member's role, or of the role an invitation gives, custom roles included. Get the IDs via List roles. When role is also given, both must name the same role.
teamId string
Team the membership is in, such as t123. Defaults to the provider's team_id. Set it to create this object in another team. Changing it replaces the resource, because an object can't move to another team.
Lookup
Section titled “Lookup”TeamMember.lookup(props) reads an object this stack does not manage. It is never created, updated or deleted.
email string required
The member's e-mail address.
teamId string
Team the membership is in, such as t123. Defaults to the credentials' team.