# Connectors

Connections to outside services, whether each still works, and what agents may use.

Scopes for this area: `connectors:read`, `connectors:write` and `connectors:admin`.

47 operations.

## connection

| Method | Route | What it does | Level | Command |
| --- | --- | --- | --- | --- |
| GET | `/workspace/connections` | The accounts the workspace has connected. | read | `rivier connectors connection list` |
| POST | `/workspace/connections` | Connect an account; the credential is sealed on arrival. | write | `rivier connectors connection create` |
| DELETE | `/workspace/connections/{id}` | Disconnect an account. | write | `rivier connectors connection delete` |
| POST | `/workspace/connections/{id}/check` | Test a connection. | write | `rivier connectors connection check` |
| GET | `/connectors/connections` | The connections to outside accounts. | read | `rivier connectors connection list all` |
| POST | `/connectors/connections` | Connect an account. | write | `rivier connectors connection connect` |
| POST | `/connectors/connections/sealed` | Connect with an already-sealed credential. | write | `rivier connectors connection seal` |
| POST | `/connectors/connections/{id}/rename` | Rename a connection. | write | `rivier connectors connection rename` |
| POST | `/connectors/connections/{id}/rotate` | Replace a connection's credential. | write | `rivier connectors connection rotate` |
| POST | `/connectors/connections/{id}/disable` | Switch a connection off. | write | `rivier connectors connection disable` |
| POST | `/connectors/connections/{id}/enable` | Switch a connection on. | write | `rivier connectors connection enable` |
| DELETE | `/connectors/connections/{id}` | Disconnect an account. | write | `rivier connectors connection remove` |
| POST | `/connectors/connections/{id}/transport` | Choose how a connection reaches the provider. | write | `rivier connectors connection transport` |
| POST | `/connectors/connections/{id}/settings` | Change a connection's non-secret settings. | write | `rivier connectors connection settings` |
| GET | `/connectors/connections/{id}/health` | Whether a connection still works. | read | `rivier connectors connection health` |
| GET | `/connectors/connections/{id}/reconcile` | Compare what we hold with the provider. | read | `rivier connectors connection reconcile` |
| POST | `/connectors/connections/{id}/sync` | Pull the provider's inventory now. | write | `rivier connectors connection sync` |

## grant

| Method | Route | What it does | Level | Command |
| --- | --- | --- | --- | --- |
| GET | `/workspace/grants` | How much each service may do on its own. | read | `rivier connectors grant list` |
| PATCH | `/workspace/grants/{service}` | Change a service's autonomy. | admin | `rivier connectors grant update` |

## connector

| Method | Route | What it does | Level | Command |
| --- | --- | --- | --- | --- |
| GET | `/connectors` | The connectors this deployment carries and what each can do. | read | `rivier connectors connector list` |

## tool

| Method | Route | What it does | Level | Command |
| --- | --- | --- | --- | --- |
| GET | `/connectors/tools` | Every connector tool with its input, effect and approval default. | read | `rivier connectors tool list` |
| POST | `/connectors/call/{connector}/{tool}` | Call one connector tool (dry run by default for changes). | write | `rivier connectors tool call` |

## seal

| Method | Route | What it does | Level | Command |
| --- | --- | --- | --- | --- |
| POST | `/connectors/admin/seal` | Seal a secret for the vault. | write | `rivier connectors seal create` |

## oauth

| Method | Route | What it does | Level | Command |
| --- | --- | --- | --- | --- |
| POST | `/connectors/oauth/start` | Begin connecting an account by sign-in. | write | `rivier connectors oauth start` |

## inventory

| Method | Route | What it does | Level | Command |
| --- | --- | --- | --- | --- |
| GET | `/connectors/inventory` | Everything connected, in one list. | read | `rivier connectors inventory list` |
| POST | `/connectors/inventory/changes/{id}/apply` | Apply a proposed change. | write | `rivier connectors inventory apply` |
| POST | `/connectors/inventory/changes/{id}/reject` | Reject a proposed change. | write | `rivier connectors inventory reject` |
| PUT | `/connectors/inventory/{connectionId}/{itemId}` | Change an inventory item. | write | `rivier connectors inventory set` |

## brand

| Method | Route | What it does | Level | Command |
| --- | --- | --- | --- | --- |
| GET | `/connectors/brands` | The brands. | read | `rivier connectors brand list` |
| POST | `/connectors/brands` | Add a brand. | write | `rivier connectors brand create` |
| GET | `/connectors/brands/{slug}` | One brand. | read | `rivier connectors brand get` |
| PATCH | `/connectors/brands/{slug}` | Change a brand. | write | `rivier connectors brand update` |
| DELETE | `/connectors/brands/{slug}` | Delete a brand. | write | `rivier connectors brand delete` |

## settings

| Method | Route | What it does | Level | Command |
| --- | --- | --- | --- | --- |
| GET | `/connectors/settings` | Connector policy for the project. | read | `rivier connectors settings get` |
| PATCH | `/connectors/settings` | Change connector policy. | write | `rivier connectors settings update` |

## kill

| Method | Route | What it does | Level | Command |
| --- | --- | --- | --- | --- |
| POST | `/connectors/kill` | Stop all outward actions at once. | write | `rivier connectors kill set` |

## agent

| Method | Route | What it does | Level | Command |
| --- | --- | --- | --- | --- |
| GET | `/connectors/agents` | What each agent may do through connectors. | read | `rivier connectors agent list` |
| PUT | `/connectors/agents/{id}` | Set what an agent may do. | write | `rivier connectors agent set` |
| DELETE | `/connectors/agents/{id}` | Remove an agent's permissions. | write | `rivier connectors agent remove` |

## approval

| Method | Route | What it does | Level | Command |
| --- | --- | --- | --- | --- |
| GET | `/connectors/approvals` | Actions waiting for a person's yes. | read | `rivier connectors approval list` |
| GET | `/connectors/portfolio/approvals` | Waiting approvals across the organisation's projects. | read | `rivier connectors approval portfolio` |
| POST | `/connectors/approvals/{id}/approve` | Approve a waiting action. | write | `rivier connectors approval approve` |
| POST | `/connectors/approvals/{id}/decline` | Decline a waiting action. | write | `rivier connectors approval decline` |

## audit

| Method | Route | What it does | Level | Command |
| --- | --- | --- | --- | --- |
| GET | `/connectors/audit` | What was done through connectors. | read | `rivier connectors audit list` |
| GET | `/connectors/portfolio/audit` | The audit across the organisation's projects. | read | `rivier connectors audit portfolio` |

## alert

| Method | Route | What it does | Level | Command |
| --- | --- | --- | --- | --- |
| GET | `/connectors/alerts` | Connections that need attention. | read | `rivier connectors alert list` |

## media

| Method | Route | What it does | Level | Command |
| --- | --- | --- | --- | --- |
| POST | `/connectors/media` | Host a media file so a network can fetch it. | write | `rivier connectors media upload` |
