# Test a connection

`POST /v1/connections/{id}/test`

Checks the stored credentials with the destination and records the result.

Scope: `docs:write`.

## Request

```bash
curl -X POST "https://api.lydie.co/v1/connections/01JCQ3V5MZ8G4ZK2X7T9R6N1PB/test" \
  -H "Authorization: Bearer $LYDIE_TOKEN"
```

## Path parameters

- `id` (ULID, required)

## 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)
- `ok` (boolean, 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"
  },
  "ok": false,
  "warnings": [
    "string"
  ]
}
```

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