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

# TypeScript Client Reference

> DevHelm TypeScript SDK client reference — all namespaces, methods, types, and response objects

Complete reference for the `@devhelm/sdk` TypeScript SDK.

## Client initialization

```typescript theme={null}
import { Devhelm } from "@devhelm/sdk";

const client = new Devhelm({
  token: process.env.DEVHELM_API_TOKEN!,
  baseUrl: "https://api.devhelm.io",
  orgId: "1",
  workspaceId: "1",
});
```

### Configuration options

| Property      | Type   | Required | Default                             | Description            |
| ------------- | ------ | -------- | ----------------------------------- | ---------------------- |
| `token`       | string | Yes      | —                                   | API token (Bearer)     |
| `baseUrl`     | string | —        | `https://api.devhelm.io`            | API base URL           |
| `orgId`       | string | —        | `DEVHELM_ORG_ID` env or `"1"`       | Organization ID header |
| `workspaceId` | string | —        | `DEVHELM_WORKSPACE_ID` env or `"1"` | Workspace ID header    |

## Resource namespaces

### client.monitors

| Method                   | Signature                                                                        | Returns                |
| ------------------------ | -------------------------------------------------------------------------------- | ---------------------- |
| `list()`                 | `() => Promise<MonitorDto[]>`                                                    | Auto-fetches all pages |
| `listPage(page, size)`   | `(number, number) => Promise<Page<MonitorDto>>`                                  | Single page            |
| `get(id)`                | `(string \| number) => Promise<MonitorDto>`                                      |                        |
| `create(body)`           | `(CreateMonitorRequest) => Promise<MonitorDto>`                                  |                        |
| `update(id, body)`       | `(string \| number, UpdateMonitorRequest) => Promise<MonitorDto>`                |                        |
| `delete(id)`             | `(string \| number) => Promise<void>`                                            |                        |
| `pause(id)`              | `(string \| number) => Promise<MonitorDto>`                                      |                        |
| `resume(id)`             | `(string \| number) => Promise<MonitorDto>`                                      |                        |
| `test(id)`               | `(string \| number) => Promise<MonitorTestResultDto>`                            |                        |
| `results(id, options?)`  | `(string \| number, { cursor?, limit? }) => Promise<CursorPage<CheckResultDto>>` | Cursor pagination      |
| `versions(id, options?)` | `(string \| number, { page?, size? }) => Promise<Page<MonitorVersionDto>>`       |                        |

### client.incidents

| Method                 | Signature                                                                   | Returns       |
| ---------------------- | --------------------------------------------------------------------------- | ------------- |
| `list()`               | `() => Promise<IncidentDto[]>`                                              |               |
| `listPage(page, size)` | `(number, number) => Promise<Page<IncidentDto>>`                            |               |
| `get(id)`              | `(string \| number) => Promise<IncidentDetailDto>`                          |               |
| `create(body)`         | `(CreateManualIncidentRequest) => Promise<IncidentDetailDto>`               |               |
| `resolve(id, body?)`   | `(string \| number, ResolveIncidentRequest?) => Promise<IncidentDetailDto>` | Body optional |

<Note>
  Incidents have no `delete` method — they are resolved, not deleted.
</Note>

### client.alertChannels

| Method                 | Signature                                                                   | Returns |
| ---------------------- | --------------------------------------------------------------------------- | ------- |
| `list()`               | `() => Promise<AlertChannelDto[]>`                                          |         |
| `listPage(page, size)` | `(number, number) => Promise<Page<AlertChannelDto>>`                        |         |
| `get(id)`              | `(string \| number) => Promise<AlertChannelDto>`                            |         |
| `create(body)`         | `(CreateAlertChannelRequest) => Promise<AlertChannelDto>`                   |         |
| `update(id, body)`     | `(string \| number, UpdateAlertChannelRequest) => Promise<AlertChannelDto>` |         |
| `delete(id)`           | `(string \| number) => Promise<void>`                                       |         |
| `test(id)`             | `(string \| number) => Promise<TestChannelResult>`                          |         |

### client.notificationPolicies

| Method                 | Signature                                                                               | Returns |
| ---------------------- | --------------------------------------------------------------------------------------- | ------- |
| `list()`               | `() => Promise<NotificationPolicyDto[]>`                                                |         |
| `listPage(page, size)` | `(number, number) => Promise<Page<NotificationPolicyDto>>`                              |         |
| `get(id)`              | `(string \| number) => Promise<NotificationPolicyDto>`                                  |         |
| `create(body)`         | `(CreateNotificationPolicyRequest) => Promise<NotificationPolicyDto>`                   |         |
| `update(id, body)`     | `(string \| number, UpdateNotificationPolicyRequest) => Promise<NotificationPolicyDto>` |         |
| `delete(id)`           | `(string \| number) => Promise<void>`                                                   |         |
| `test(id)`             | `(string \| number) => Promise<void>`                                                   |         |

### client.tags

| Method                 | Signature                                                 | Returns |
| ---------------------- | --------------------------------------------------------- | ------- |
| `list()`               | `() => Promise<TagDto[]>`                                 |         |
| `listPage(page, size)` | `(number, number) => Promise<Page<TagDto>>`               |         |
| `get(id)`              | `(string \| number) => Promise<TagDto>`                   |         |
| `create(body)`         | `(CreateTagRequest) => Promise<TagDto>`                   |         |
| `update(id, body)`     | `(string \| number, UpdateTagRequest) => Promise<TagDto>` |         |
| `delete(id)`           | `(string \| number) => Promise<void>`                     |         |

### client.environments

| Method                 | Signature                                                       | Returns |
| ---------------------- | --------------------------------------------------------------- | ------- |
| `list()`               | `() => Promise<EnvironmentDto[]>`                               |         |
| `listPage(page, size)` | `(number, number) => Promise<Page<EnvironmentDto>>`             |         |
| `get(slug)`            | `(string) => Promise<EnvironmentDto>`                           | By slug |
| `create(body)`         | `(CreateEnvironmentRequest) => Promise<EnvironmentDto>`         |         |
| `update(slug, body)`   | `(string, UpdateEnvironmentRequest) => Promise<EnvironmentDto>` |         |
| `delete(slug)`         | `(string) => Promise<void>`                                     |         |

### client.secrets

| Method                 | Signature                                             | Returns       |
| ---------------------- | ----------------------------------------------------- | ------------- |
| `list()`               | `() => Promise<SecretDto[]>`                          | Metadata only |
| `listPage(page, size)` | `(number, number) => Promise<Page<SecretDto>>`        |               |
| `create(body)`         | `(CreateSecretRequest) => Promise<SecretDto>`         |               |
| `update(key, body)`    | `(string, UpdateSecretRequest) => Promise<SecretDto>` |               |
| `delete(key)`          | `(string) => Promise<void>`                           |               |

### client.resourceGroups

| Method                            | Signature                                                                     | Returns |
| --------------------------------- | ----------------------------------------------------------------------------- | ------- |
| `list()`                          | `() => Promise<ResourceGroupDto[]>`                                           |         |
| `listPage(page, size)`            | `(number, number) => Promise<Page<ResourceGroupDto>>`                         |         |
| `get(id)`                         | `(string \| number) => Promise<ResourceGroupDto>`                             |         |
| `create(body)`                    | `(CreateResourceGroupRequest) => Promise<ResourceGroupDto>`                   |         |
| `update(id, body)`                | `(string \| number, UpdateResourceGroupRequest) => Promise<ResourceGroupDto>` |         |
| `delete(id)`                      | `(string \| number) => Promise<void>`                                         |         |
| `addMember(groupId, body)`        | `(string \| number, AddResourceGroupMemberRequest) => Promise<void>`          |         |
| `removeMember(groupId, memberId)` | `(string \| number, string \| number) => Promise<void>`                       |         |

### client.webhooks

| Method                 | Signature                                                                         | Returns |
| ---------------------- | --------------------------------------------------------------------------------- | ------- |
| `list()`               | `() => Promise<WebhookEndpointDto[]>`                                             |         |
| `listPage(page, size)` | `(number, number) => Promise<Page<WebhookEndpointDto>>`                           |         |
| `get(id)`              | `(string \| number) => Promise<WebhookEndpointDto>`                               |         |
| `create(body)`         | `(CreateWebhookEndpointRequest) => Promise<WebhookEndpointDto>`                   |         |
| `update(id, body)`     | `(string \| number, UpdateWebhookEndpointRequest) => Promise<WebhookEndpointDto>` |         |
| `delete(id)`           | `(string \| number) => Promise<void>`                                             |         |
| `test(id)`             | `(string \| number) => Promise<WebhookTestResult>`                                |         |

### client.apiKeys

| Method                 | Signature                                                | Returns                   |
| ---------------------- | -------------------------------------------------------- | ------------------------- |
| `list()`               | `() => Promise<ApiKeyDto[]>`                             |                           |
| `listPage(page, size)` | `(number, number) => Promise<Page<ApiKeyDto>>`           |                           |
| `create(body)`         | `(CreateApiKeyRequest) => Promise<ApiKeyCreateResponse>` | Full key only at creation |
| `revoke(id)`           | `(string \| number) => Promise<void>`                    |                           |
| `delete(id)`           | `(string \| number) => Promise<void>`                    |                           |

### client.dependencies

| Method                                    | Signature                                                               | Returns                                            |
| ----------------------------------------- | ----------------------------------------------------------------------- | -------------------------------------------------- |
| `list()`                                  | `() => Promise<ServiceSubscriptionDto[]>`                               |                                                    |
| `listPage(page, size)`                    | `(number, number) => Promise<Page<ServiceSubscriptionDto>>`             |                                                    |
| `get(id)`                                 | `(string \| number) => Promise<ServiceSubscriptionDto>`                 |                                                    |
| `track(slug, options?)`                   | `(string, ServiceSubscribeRequest?) => Promise<ServiceSubscriptionDto>` | `options`: `componentId`, `alertSensitivity`       |
| `updateAlertSensitivity(id, sensitivity)` | `(string \| number, string) => Promise<ServiceSubscriptionDto>`         | `ALL`, `INCIDENTS_ONLY`, `MAJOR_ONLY`, `AWARENESS` |
| `delete(id)`                              | `(string \| number) => Promise<void>`                                   |                                                    |

### client.services

Read-only access to the third-party service status catalog (GitHub, Stripe, AWS, …).

| Method                                                   | Signature                                                                 |
| -------------------------------------------------------- | ------------------------------------------------------------------------- |
| `list(options?)`                                         | `(ServiceListFilters) => Promise<CursorPage<ServiceCatalogDto>>`          |
| `get(slugOrId, options?)`                                | `(string, { summary? }) => Promise<ServiceDetailDto>`                     |
| `liveStatus(slugOrId)`                                   | `(string) => Promise<ServiceLiveStatusDto>`                               |
| `categories()` / `summary()`                             | `Promise<CategoryDto[]>` / `Promise<GlobalStatusSummaryDto>`              |
| `components(slugOrId, options?)`                         | `(string, { groupId? }) => Promise<ServiceComponentDto[]>`                |
| `uptime(slugOrId, options?)`                             | `Promise<ServiceUptimeResponse>`                                          |
| `componentUptime(slugOrId, componentId, options?)`       | per-component uptime history                                              |
| `batchComponentUptime(slugOrId, options?)`               | `Promise<BatchComponentUptimeDto>`                                        |
| `day(slugOrId, date)`                                    | `(string, string) => Promise<ServiceDayDetailDto>`                        |
| `incidents(options?)` / `incident(slugOrId, incidentId)` | `Promise<Page<ServiceIncidentDto>>` / `Promise<ServiceIncidentDetailDto>` |
| `maintenances(slugOrId, options?)`                       | `Promise<ScheduledMaintenanceDto[]>`                                      |

### client.maintenanceWindows

| Method                              | Signature                                                       |
| ----------------------------------- | --------------------------------------------------------------- |
| `list(filters?)`                    | `(MaintenanceWindowFilters) => Promise<MaintenanceWindowDto[]>` |
| `listPage(...)`                     | `Promise<Page<MaintenanceWindowDto>>`                           |
| `get(id)`                           | `(string) => Promise<MaintenanceWindowDto>`                     |
| `create(body)` / `update(id, body)` | `Promise<MaintenanceWindowDto>`                                 |
| `cancel(id)`                        | `(string) => Promise<void>`                                     |

### client.deployLock

| Method            | Signature                                              | Returns     |
| ----------------- | ------------------------------------------------------ | ----------- |
| `acquire(body)`   | `(AcquireDeployLockRequest) => Promise<DeployLockDto>` | 409 if held |
| `current()`       | `() => Promise<DeployLockDto \| null>`                 |             |
| `release(lockId)` | `(string) => Promise<void>`                            |             |
| `forceRelease()`  | `() => Promise<void>`                                  |             |

### client.status

| Method       | Signature                             | Returns |
| ------------ | ------------------------------------- | ------- |
| `overview()` | `() => Promise<DashboardOverviewDto>` |         |

### client.statusPages

The largest namespace; root operations plus five sub-namespaces.

| Method                    | Signature                                                               |
| ------------------------- | ----------------------------------------------------------------------- |
| `list()`                  | `() => Promise<StatusPageDto[]>`                                        |
| `get(id)`                 | `(string \| number) => Promise<StatusPageDto>`                          |
| `create(body)`            | `(CreateStatusPageRequest) => Promise<StatusPageDto>`                   |
| `update(id, body)`        | `(string \| number, UpdateStatusPageRequest) => Promise<StatusPageDto>` |
| `delete(id)`              | `(string \| number) => Promise<void>`                                   |
| `reorderLayout(id, body)` | `(string \| number, ReorderPageLayoutRequest) => Promise<void>`         |

Sub-namespaces (each takes `pageId` as the first arg):

```typescript theme={null}
client.statusPages.components.list(pageId)
client.statusPages.components.create(pageId, body)
client.statusPages.components.update(pageId, componentId, body)
client.statusPages.components.delete(pageId, componentId)
client.statusPages.components.reorder(pageId, body)

client.statusPages.groups.list(pageId)
client.statusPages.groups.create(pageId, body)
client.statusPages.groups.update(pageId, groupId, body)
client.statusPages.groups.delete(pageId, groupId)

client.statusPages.incidents.list(pageId, options?)
client.statusPages.incidents.get(pageId, incidentId)
client.statusPages.incidents.create(pageId, body)
client.statusPages.incidents.update(pageId, incidentId, body)
client.statusPages.incidents.postUpdate(pageId, incidentId, body)
client.statusPages.incidents.publish(pageId, incidentId, body?)
client.statusPages.incidents.dismiss(pageId, incidentId)
client.statusPages.incidents.delete(pageId, incidentId)

client.statusPages.subscribers.list(pageId)
client.statusPages.subscribers.add(pageId, body)
client.statusPages.subscribers.remove(pageId, subscriberId)

client.statusPages.domains.list(pageId)
client.statusPages.domains.add(pageId, body)
client.statusPages.domains.verify(pageId, domainId)
client.statusPages.domains.remove(pageId, domainId)
```

### client.forensics

Read-only audit trail for the detection engine. See [Incident Forensics](/incidents/forensics) for the conceptual overview.

| Method                                 | Signature                                                                            | Returns                                                     |
| -------------------------------------- | ------------------------------------------------------------------------------------ | ----------------------------------------------------------- |
| `incidentTimeline(id)`                 | `(string \| number) => Promise<IncidentTimelineDto>`                                 | State transitions, triggering evals, active policy snapshot |
| `checkTrace(checkId)`                  | `(string) => Promise<CheckTraceDto>`                                                 | Everything recorded for a single check execution            |
| `policySnapshot(hashHex)`              | `(string) => Promise<PolicySnapshotDto>`                                             | Fetch policy snapshot by SHA-256 hash                       |
| `monitorRuleEvaluations(id, filters?)` | `(string \| number, RuleEvaluationFilters) => Promise<Page<RuleEvaluationDto>>`      | Paginated rule evaluations                                  |
| `monitorTransitions(id, filters?)`     | `(string \| number, TransitionFilters) => Promise<Page<IncidentStateTransitionDto>>` | Paginated state transitions                                 |

`RuleEvaluationFilters` accepts `ruleType`, `region`, `onlyMatched`, `from`, `to`, `page`, and `size`. `TransitionFilters` accepts `from`, `to`, `page`, and `size`.

## Exported types

All DTO and request types are re-exported from the package root:

```typescript theme={null}
import type {
  MonitorDto,
  CreateMonitorRequest,
  IncidentDto,
  AlertChannelDto,
  Page,
  CursorPage,
} from "@devhelm/sdk";
```

Types are generated from the OpenAPI specification, so they always match the current API.

## Next steps

<CardGroup cols={2}>
  <Card title="Error handling" icon="triangle-exclamation" href="/sdk/typescript/error-handling">
    Catch and handle SDK errors.
  </Card>

  <Card title="Pagination" icon="list" href="/sdk/typescript/pagination">
    Iterate through paginated results.
  </Card>
</CardGroup>
