Skip to content
betterstack-alchemyUnofficial

Account.Team

Kind ResourceType id BetterStack.Account.TeamSource src/Account/Team.tsOffline only Tested against the offline mock only: creating teams and inviting people is not reversible from a test (test/Account/Team.test.ts).

A team in the organization. Everything created in any Better Stack product belongs to a team; a team’s id (t123) is the teamId every other resource takes.

Needs a global API token (organization-wide): a team-scoped token cannot list, create or delete teams.

Every setting updates in place; removing logoRemoteUrl removes the logo. name defaults to a generated unique name; an existing team with the same explicit name (ignoring case) is adopted with --adopt.

Retained by default. Deleting a team (DELETE /api/v3/teams/{id}) deletes everything in it for good, so alchemy destroy and removing the declaration leave the team in Better Stack and only forget it (Terraform’s deletion_protection, as a removal policy). Opt into deletion with RemovalPolicy.destroy().

A team with its own incident grouping

const team = yield* BetterStack.Account.Team("platform", {
name: "Platform team",
incidentGroupingPeriod: 600,
incidentGroupingMetadataScope: ["environment"],
});
yield* BetterStack.Errors.Application("api-errors", {
platform: "bun_errors",
teamId: team.id,
});

A throwaway team, deleted on destroy with everything in it

yield* BetterStack.Account.Team("preview", { name: "Preview team" }).pipe(
RemovalPolicy.destroy(),
);

incidentGroupingMetadataScope string[]

Metadata keys whose values must match for incidents to be grouped. New teams start with ["Origin"]. null groups the same way as ["Origin"].

incidentGroupingPeriod number

Seconds within which a new incident is grouped with an earlier one that's still open, for example 300 for 5 minutes. 0 never groups incidents. From 0 to 2147483647, and new teams start at 300.

logoRemoteUrl string

The URL the team's logo was fetched from. Accepts an image URL, and we fetch the logo from it. Remove the argument to remove the logo.

logoUrl string | null

The team's logo. Send the URL of a jpg, png, webp or gif image under 20 MB, and we fetch the logo from it. Responses return the URL of the stored logo. Send null to remove the logo.

name string

The team's name. Must be unique in the organization, ignoring letter case. Defaults to a unique name generated from the stack, stage and logical id.

notifyAboutAllIncidentsInAGroup boolean

Whether every incident in a group alerts, rather than only the first. New teams start at true.

onCallReminderEmail boolean

Send on-call reminders by e-mail. New teams start at true.

onCallReminderLeadTime number

Seconds before an on-call shift starts to remind the person, or 0 for no reminder. The other values are 3600, 21600, 43200, 86400, 172800 and 604800. New teams start at 86400.

onCallReminderPush boolean

Send on-call reminders as push notifications. New teams start at true.

onCallReminderSms boolean

Send on-call reminders by SMS. New teams start at false.

openedEmailsTrackingEnabled boolean

Whether the incident timeline records when a team member opens the e-mail about a new incident. New teams start at true.

organizationId string

The organization to create the team in, such as 123, when you sign in with OAuth. Required when you can access more than one organization. Get the ID from organization_id in List teams. Leave it out with a global API token, which creates the team in the token's own organization.

reportingEnabled boolean

Whether reporting is on, which unlocks the reports in Incidents. New teams start at false.

id string always set

The team's id.

createdAt string

When the team was created.

incidentGroupingMetadataScope string[] | null

Metadata keys whose values must match for incidents to be grouped. New teams start with ["Origin"]. null groups the same way as ["Origin"].

incidentGroupingPeriod number

Seconds within which a new incident is grouped with an earlier one that's still open, for example 300 for 5 minutes. 0 never groups incidents. From 0 to 2147483647, and new teams start at 300.

logoRemoteUrl string | null

The URL the team's logo was fetched from. Accepts an image URL, and we fetch the logo from it. Remove the argument to remove the logo.

logoUrl string | null

URL of the team's logo, or null when it has none.

name string

The team's name. Must be unique in the organization, ignoring letter case.

notifyAboutAllIncidentsInAGroup boolean

Whether every incident in a group alerts, rather than only the first. New teams start at true.

onCallReminderEmail boolean

Send on-call reminders by e-mail. New teams start at true.

onCallReminderLeadTime number

Seconds before an on-call shift starts to remind the person, or 0 for no reminder. The other values are 3600, 21600, 43200, 86400, 172800 and 604800. New teams start at 86400.

onCallReminderPush boolean

Send on-call reminders as push notifications. New teams start at true.

onCallReminderSms boolean

Send on-call reminders by SMS. New teams start at false.

openedEmailsTrackingEnabled boolean

Whether the incident timeline records when a team member opens the e-mail about a new incident. New teams start at true.

organizationId number

ID of the organization the team belongs to.

reportingEnabled boolean

Whether reporting is on, which unlocks the reports in Incidents. New teams start at false.

updatedAt string

When the team was last updated.

Team.lookup(props) reads an object this stack does not manage. It is never created, updated or deleted.

id string required

The team's id, such as t123.