# Change a connection

`PATCH /v1/connections/{id}`

Renames a connection, changes its settings or replaces its credentials (checked with the destination first). Owners and admins only.

Scope: `docs:write`.

## Request

```bash
curl -X PATCH "https://api.lydie.co/v1/connections/01JCQ3V5MZ8G4ZK2X7T9R6N1PB" \
  -H "Authorization: Bearer $LYDIE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## Path parameters

- `id` (ULID, required)

## Body

- `name` (string, optional): (1–120 chars)
- `settings` (object, optional)
- `credentials` (object, optional)

## Response

- `connection` (Connection, required): A destination account. Credentials are never returned.
  - `id` (ULID, required)
  - `workspaceId` (string, required): (1–64 chars)
  - `connector` (string, required)
  - `name` (string, required)
  - `authMethod` (string, required): One of: `token`, `oauth2`, `generated`.
  - `settings` (object, required)
  - `credentialsHint` (string, required, nullable)
  - `account` (string, required, nullable): Who the credentials act as at the destination.
  - `status` (string, required): One of: `active`, `error`.
  - `lastError` (string, required, nullable)
  - `lastValidatedAt` (timestamp, required, nullable)
  - `createdBy` (string, required, nullable)
  - `updatedBy` (string, required, nullable)
  - `createdAt` (timestamp, required)
  - `updatedAt` (timestamp, required)
- `warnings` (string[], required)

```json
{
  "connection": {
    "id": "01JCQ3V5MZ8G4ZK2X7T9R6N1PB",
    "workspaceId": "01JCQ3TZ0WJ8K4M2X7T9R6N1PA",
    "connector": "string",
    "name": "Notes",
    "authMethod": "token",
    "settings": {},
    "credentialsHint": null,
    "account": null,
    "status": "active",
    "lastError": null,
    "lastValidatedAt": null,
    "createdBy": null,
    "updatedBy": null,
    "createdAt": "2026-11-12T09:30:00.000Z",
    "updatedAt": "2026-11-12T09:30:00.000Z"
  },
  "warnings": [
    "string"
  ]
}
```

Errors use the envelope described at https://developers.lydie.co/errors.md.
