> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scrubbe.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Business and IMS Configuration Endpoints Reference

> Manage your Scrubbe workspace — accept invites, configure team members and roles, and set up IMS notification preferences and escalation rules.

The business API lets you manage your Scrubbe workspace: onboarding new team members via invite links, configuring workspace settings, and setting up the Incident Management System (IMS) with notification preferences, SLA rules, and escalation policies. Business endpoints live under `/api/v1/business`; IMS configuration endpoints live under `/api/v1/ims`.

***

## Business endpoints

### POST /business/decode-invite

**Public.** Decode an invite token to retrieve metadata (invitee email, assigned role, workspace name) before the user accepts. Use this to pre-fill a registration or acceptance form.

<ParamField body="token" type="string" required>
  The invite token from the invitation email or link.
</ParamField>

```json theme={null}
{
  "success": true,
  "message": "Invite decoded.",
  "data": {
    "email": "teammate@example.com",
    "role": "ENGINEER",
    "businessName": "Acme Corp",
    "expiresAt": "2025-06-15T00:00:00Z"
  }
}
```

***

### POST /business/accept-invite

**Public.** Accept a workspace invitation. If the invitee already has a Scrubbe account, this links the invite to their existing account; otherwise, a new account is created.

<ParamField body="token" type="string" required>
  The invite token from the invitation email.
</ParamField>

<ParamField body="password" type="string">
  Required if creating a new account during acceptance.
</ParamField>

<ParamField body="firstName" type="string">
  Required for new account creation.
</ParamField>

<ParamField body="lastName" type="string">
  Required for new account creation.
</ParamField>

***

### PUT /business/setup

**Protected.** Complete initial workspace configuration after registration. Requires `Authorization: Bearer <accessToken>`.

<ParamField body="businessName" type="string" required>
  The display name for the workspace.
</ParamField>

<ParamField body="industry" type="string">
  The industry or sector for the workspace.
</ParamField>

<ParamField body="size" type="string">
  Team size range. Example: `"11-50"`.
</ParamField>

<ParamField body="timezone" type="string">
  IANA timezone string for the workspace. Example: `"America/New_York"`.
</ParamField>

***

### GET /business/get\_members

**Protected.** Retrieve all members of the authenticated user's workspace.

```json theme={null}
{
  "success": true,
  "message": "Members retrieved.",
  "data": [
    {
      "id": "usr_01HX...",
      "email": "teammate@example.com",
      "firstName": "Sam",
      "lastName": "Rivera",
      "role": "ENGINEER",
      "level": "Senior",
      "accessPermissions": ["incidents", "postmortems"],
      "status": "ACTIVE"
    }
  ]
}
```

***

### POST /business/send-invite

**Protected.** Send a workspace invitation to a new team member. The invitee receives an email with a link containing the invite token.

<ParamField body="email" type="string" required>
  Email address of the person to invite.
</ParamField>

<ParamField body="role" type="string" required>
  Role to assign. One of: `ADMIN`, `ENGINEER`, `VIEWER`.
</ParamField>

<ParamField body="accessPermissions" type="string[]" required>
  Features the invitee will have access to. Example: `["incidents", "postmortems"]`.
</ParamField>

<ParamField body="level" type="string">
  Seniority or team level. Example: `"Senior"`.
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url "https://your-api-domain.com/api/v1/business/send-invite" \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer $ACCESS_TOKEN" \
    --data '{
      "email": "teammate@example.com",
      "role": "ENGINEER",
      "accessPermissions": ["incidents", "postmortems"],
      "level": "Senior"
    }'
  ```

  ```javascript Node.js theme={null}
  await fetch('https://your-api-domain.com/api/v1/business/send-invite', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': `Bearer ${accessToken}`
    },
    body: JSON.stringify({
      email: 'teammate@example.com',
      role: 'ENGINEER',
      accessPermissions: ['incidents', 'postmortems'],
      level: 'Senior'
    })
  });
  ```
</CodeGroup>

```json theme={null}
{
  "success": true,
  "message": "Invitation sent successfully.",
  "data": {
    "inviteId": "inv_01HX...",
    "email": "teammate@example.com",
    "expiresAt": "2025-06-15T00:00:00Z"
  }
}
```

<Note>
  Invitations expire after 7 days. You can re-send an invite to the same email address after the previous one expires or if it was never accepted.
</Note>

***

## IMS configuration endpoints

The Incident Management System (IMS) controls notification routing, SLA enforcement, escalation behaviour, and timezone settings for your workspace. All IMS endpoints require `Authorization: Bearer <accessToken>` and live under `/api/v1/ims`.

***

### POST /ims/setup

Perform the initial IMS configuration for the workspace. Called once during onboarding.

<ParamField body="alertEmail" type="string" required>
  Email address that receives incident alert notifications.
</ParamField>

<ParamField body="slackChannel" type="string">
  Slack channel name or ID for incident notifications. Example: `"#incidents"`.
</ParamField>

<ParamField body="slaEnabled" type="boolean" default="false">
  Whether SLA tracking and breach alerts are active.
</ParamField>

<ParamField body="autoEscalate" type="boolean" default="false">
  Automatically escalate incidents that breach SLA thresholds.
</ParamField>

<ParamField body="notifyOnCreate" type="boolean" default="true">
  Send notifications when a new incident is created.
</ParamField>

<ParamField body="notifyOnResolve" type="boolean" default="true">
  Send notifications when an incident is resolved.
</ParamField>

<ParamField body="timezone" type="string" required>
  IANA timezone string for SLA calculations and scheduled reports. Example: `"Europe/London"`.
</ParamField>

***

### GET /ims/config

Retrieve the current IMS configuration for the workspace.

```json theme={null}
{
  "success": true,
  "message": "IMS configuration retrieved.",
  "data": {
    "alertEmail": "oncall@example.com",
    "slackChannel": "#incidents",
    "slaEnabled": true,
    "autoEscalate": false,
    "notifyOnCreate": true,
    "notifyOnResolve": true,
    "timezone": "America/New_York"
  }
}
```

***

### PUT /ims/config

Update one or more IMS configuration fields. Only the fields you include are modified.

<ParamField body="alertEmail" type="string">
  Updated alert email address.
</ParamField>

<ParamField body="slackChannel" type="string">
  Updated Slack channel.
</ParamField>

<ParamField body="slaEnabled" type="boolean">
  Enable or disable SLA tracking.
</ParamField>

<ParamField body="autoEscalate" type="boolean">
  Enable or disable automatic escalation.
</ParamField>

<ParamField body="notifyOnCreate" type="boolean">
  Toggle creation notifications.
</ParamField>

<ParamField body="notifyOnResolve" type="boolean">
  Toggle resolution notifications.
</ParamField>

<ParamField body="timezone" type="string">
  Updated IANA timezone string.
</ParamField>

<Tip>
  All SLA calculations and scheduled digest emails use the `timezone` value from your IMS config. Update this if your team moves to a different region.
</Tip>
