# API: Organization

| Method | Path | What it does | Scope |
|---|---|---|---|
| GET | `/v1/invitations` | List pending invitations (owner) | `members:write` |
| POST | `/v1/invitations` | Invite someone by email (owner, web only) (web app only) | `members:write` |
| DELETE | `/v1/invitations/:id` | Cancel a pending invitation (owner, web only) (web app only) | `members:write` |
| POST | `/v1/invitations/:id/resend` | Resend a pending invitation (owner, web only) (web app only) | `members:write` |
| GET | `/v1/members` | List members and their roles | `members:read` |
| DELETE | `/v1/members/:id` | Remove a member and revoke their API keys and app connections (owner) | `members:write` |
| PATCH | `/v1/members/:id` | Change a member's role (owner) | `members:write` |
| DELETE | `/v1/organization` | Schedule the organization's deletion: it's suspended at once and, unless an owner undoes it within 30 days, purged with all its data, including audit history (owner, web only, the exact name to confirm) (web app only) | `security:write` |
| GET | `/v1/organization` | Get the active organization | `settings:read` |
| PATCH | `/v1/organization` | Rename the organization (owner) | `security:write` |
| GET | `/v1/organization/deletion` | Whether the organization is scheduled for deletion, and when it will be purged (answers while it's suspended) (web app only) | — |
| POST | `/v1/organization/deletion/cancel` | Undo the organization's scheduled deletion before its window ends (owner, web only) (web app only) | `security:write` |
| GET | `/v1/organization/exports` | Your exports of this organization (owner; each holds what its requester could read, so it's theirs alone) | `security:write` |
| POST | `/v1/organization/exports` | Export everything this organization holds (every table, as gzipped JSON lines, secrets left out); ready to download for 7 days (owner) (web app only) | `security:write` |

## Examples

### GET /v1/invitations

List pending invitations (owner)

```bash
curl -s "https://api.ferryseal.com/v1/invitations" \
  -H "Authorization: Bearer $FT_API_KEY"
```

```js
const res = await fetch(`https://api.ferryseal.com/v1/invitations`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.FT_API_KEY}` },
});
const data = await res.json();
```

### GET /v1/members

List members and their roles

```bash
curl -s "https://api.ferryseal.com/v1/members" \
  -H "Authorization: Bearer $FT_API_KEY"
```

```js
const res = await fetch(`https://api.ferryseal.com/v1/members`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.FT_API_KEY}` },
});
const data = await res.json();
```

### DELETE /v1/members/$ID

Remove a member and revoke their API keys and app connections (owner)

```bash
curl -s -X DELETE "https://api.ferryseal.com/v1/members/$ID" \
  -H "Authorization: Bearer $FT_API_KEY"
```

```js
const res = await fetch(`https://api.ferryseal.com/v1/members/${id}`, {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.FT_API_KEY}` },
});
const data = await res.json();
```

### PATCH /v1/members/$ID

Change a member's role (owner)

```bash
curl -s -X PATCH "https://api.ferryseal.com/v1/members/$ID" \
  -H "Authorization: Bearer $FT_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.ferryseal.com/v1/members/${id}`, {
  method: "PATCH",
  headers: { authorization: `Bearer ${process.env.FT_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### GET /v1/organization

Get the active organization

```bash
curl -s "https://api.ferryseal.com/v1/organization" \
  -H "Authorization: Bearer $FT_API_KEY"
```

```js
const res = await fetch(`https://api.ferryseal.com/v1/organization`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.FT_API_KEY}` },
});
const data = await res.json();
```

### PATCH /v1/organization

Rename the organization (owner)

```bash
curl -s -X PATCH "https://api.ferryseal.com/v1/organization" \
  -H "Authorization: Bearer $FT_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.ferryseal.com/v1/organization`, {
  method: "PATCH",
  headers: { authorization: `Bearer ${process.env.FT_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### GET /v1/organization/exports

Your exports of this organization (owner; each holds what its requester could read, so it's theirs alone)

```bash
curl -s "https://api.ferryseal.com/v1/organization/exports" \
  -H "Authorization: Bearer $FT_API_KEY"
```

```js
const res = await fetch(`https://api.ferryseal.com/v1/organization/exports`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.FT_API_KEY}` },
});
const data = await res.json();
```

Request and response schemas: [https://www.ferryseal.com/openapi.json](https://www.ferryseal.com/openapi.json). All resources: [API reference](https://www.ferryseal.com/docs/api).
