# Integrations

6 endpoints.

## Identify the workspace behind the API key

```http
GET https://orbitwrite.com/api/v1/me
```

Returns the organization the API key is scoped to — or, for an OAuth access token (`orbitwrite login`), the workspace the person signed in to. Used by integrations (e.g. Zapier) to test the connection and label it.

**Authentication:** bearer token.

### Responses

#### 200

The key's organization

- `organization` (object, required)
  - `id` (string, required)
  - `name` (string | null, required)
  - `slug` (string | null, required)

#### 401

Not signed in

- `error` (string, required)
- `issues` (any[], optional)

## Subscribe to an event (REST Hook)

```http
POST https://orbitwrite.com/api/v1/hooks
```

Registers a target URL to receive a given event for this workspace. Idempotent: re-subscribing the same (event, URL) returns the existing subscription.

**Authentication:** bearer token.

### Request body (`application/json`)

- `event` (string, required, one of `post_published`, `post_failed`, `approval_requested`, `approval_decided`, `account_needs_reconnect`) — The Orbitwrite activity a Zap subscribes to.
- `targetUrl` (string, required) — The URL to POST the event payload to (Zapier catch hook).

### Responses

#### 200

The created (or existing) subscription id

- `id` (string, required)

#### 400

Invalid request

- `error` (string, required)
- `issues` (any[], optional)

#### 401

Not signed in

- `error` (string, required)
- `issues` (any[], optional)

#### 403

Not a member of the organization

- `error` (string, required)
- `issues` (any[], optional)

## Unsubscribe from an event (REST Hook)

```http
DELETE https://orbitwrite.com/api/v1/hooks/{id}
```

Removes a subscription. Called by Zapier when a Zap is turned off.

**Authentication:** bearer token.

### Path parameters

- `id` (string, required)

### Responses

#### 200

Subscription removed (or already absent)

- `ok` (boolean, required, one of `true`)

#### 401

Not signed in

- `error` (string, required)
- `issues` (any[], optional)

#### 403

Not a member of the organization

- `error` (string, required)
- `issues` (any[], optional)

#### 404

Subscription not found

- `error` (string, required)
- `issues` (any[], optional)

## List recent events of a type (trigger sample data)

```http
GET https://orbitwrite.com/api/v1/events/recent
```

Returns recent posts in the workspace shaped as the given trigger's payload, so a Zap's 'test trigger' step has realistic data. May be empty for a new workspace.

**Authentication:** bearer token.

### Query parameters

- `event` (string, required) — The Orbitwrite activity a Zap subscribes to.
- `limit` (integer, optional)

### Responses

#### 200

Recent event samples, newest first

- `events` (object[], required)

#### 401

Not signed in

- `error` (string, required)
- `issues` (any[], optional)

#### 403

Not a member of the organization

- `error` (string, required)
- `issues` (any[], optional)

## TikTok Content Posting webhook

```http
POST https://orbitwrite.com/api/v1/integrations/tiktok/webhook
```

Receives TikTok's `post.publish.*` events. Authenticated by TikTok's own `TikTok-Signature` header rather than by a session or key. Registered as the app's callback URL in the TikTok developer portal.

### Responses

#### 200

Event acknowledged

- `ok` (boolean, required)

#### 401

Signature missing or invalid

- `error` (string, required)

## Resend delivery webhook

```http
POST https://orbitwrite.com/api/v1/webhooks/resend
```

Receives Resend's `email.*` delivery events and records them against the sent message. Authenticated by Resend's Svix signature (`svix-id`, `svix-timestamp`, `svix-signature`) rather than by a session or key. Registered in the Resend dashboard.

### Responses

#### 200

Event acknowledged

- `ok` (boolean, required)

#### 400

Signature headers missing, or the signature does not verify

- `error` (string, required)

#### 501

No webhook secret is configured on this deployment

- `error` (string, required)
