> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.rydhm.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.rydhm.ai/_mcp/server.

# Your connection to this workspace

GET https://api.rydhm.ai/v1/oauth/connection

With the key Connect with Rydhm gave your app: which workspace, what it allowed, and the numbers its sales calls go out from ("Connected to AIX Staging · calls go out from (628) 212-6768"). When `salesCalls.ready` is false, send people to `salesCalls.setupUrl`.

Only the key Connect with Rydhm gave your app (Authorization: Bearer rydhm_live_…). Any other key: 403 not_a_connected_app.

Reference: https://docs.rydhm.ai/api-reference/connect/connection

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Response

### 200

OK

- `id` (string, required) — A UUID.
- `app` (OAuthConnectionApp, required)
- `workspace` (OAuthConnectionWorkspace, required)
- `scopes` (list of string, required)
- `connectedAt` (datetime, required)
- `salesCalls` (OAuthConnectionSalesCalls, required)

## Errors

### 401 Unauthorized Error

The key is missing, not valid or revoked: the workspace disconnected your app (connect again).

- `statusCode` (integer, required)
- `message` (string, required)
- `error` (string, optional) — A stable code such as insufficient_scope, expert_not_allowed, rate_limited, plan_limit, payment_required.
- `code` (string, optional) — The stable code on the refusals that carry it here instead of in `error`: stale_edit (409 on an expert save).
- `requestId` (string, optional) — The X-Request-Id of the call, to quote to support.
- `upgradeHint` (ErrorUpgradeHint, optional) — On 402 payment_required and 403 plan_limit: what fixes it.
- `requiredScopes` (list of string, optional) — On 403 insufficient_scope: what the route needs.
- `missingScopes` (list of string, optional)
- `retryAfterSeconds` (integer, optional) — On 429: how long to wait.
- `retryAt` (datetime, optional, nullable)
- `timeZone` (string, optional, nullable)
- `localTime` (string, optional, nullable)
- `state` (string, optional, nullable)
- `exceptionsAllowed` (boolean, optional) — On 400 outside_calling_hours: whether `callingHoursException` may be sent.

### 403 Forbidden Error

The key was not issued by Connect with Rydhm (not_a_connected_app).

- `statusCode` (integer, required)
- `message` (string, required)
- `error` (string, optional) — A stable code such as insufficient_scope, expert_not_allowed, rate_limited, plan_limit, payment_required.
- `code` (string, optional) — The stable code on the refusals that carry it here instead of in `error`: stale_edit (409 on an expert save).
- `requestId` (string, optional) — The X-Request-Id of the call, to quote to support.
- `upgradeHint` (ErrorUpgradeHint, optional) — On 402 payment_required and 403 plan_limit: what fixes it.
- `requiredScopes` (list of string, optional) — On 403 insufficient_scope: what the route needs.
- `missingScopes` (list of string, optional)
- `retryAfterSeconds` (integer, optional) — On 429: how long to wait.
- `retryAt` (datetime, optional, nullable)
- `timeZone` (string, optional, nullable)
- `localTime` (string, optional, nullable)
- `state` (string, optional, nullable)
- `exceptionsAllowed` (boolean, optional) — On 400 outside_calling_hours: whether `callingHoursException` may be sent.

### 429 Too Many Requests Error

Rate limited; wait Retry-After seconds.

- `statusCode` (integer, required)
- `message` (string, required)
- `error` (string, optional) — A stable code such as insufficient_scope, expert_not_allowed, rate_limited, plan_limit, payment_required.
- `code` (string, optional) — The stable code on the refusals that carry it here instead of in `error`: stale_edit (409 on an expert save).
- `requestId` (string, optional) — The X-Request-Id of the call, to quote to support.
- `upgradeHint` (ErrorUpgradeHint, optional) — On 402 payment_required and 403 plan_limit: what fixes it.
- `requiredScopes` (list of string, optional) — On 403 insufficient_scope: what the route needs.
- `missingScopes` (list of string, optional)
- `retryAfterSeconds` (integer, optional) — On 429: how long to wait.
- `retryAt` (datetime, optional, nullable)
- `timeZone` (string, optional, nullable)
- `localTime` (string, optional, nullable)
- `state` (string, optional, nullable)
- `exceptionsAllowed` (boolean, optional) — On 400 outside_calling_hours: whether `callingHoursException` may be sent.

## Types

### OAuthConnectionApp

- `id` (string, required) — A UUID.
- `name` (string, required)

### OAuthConnectionWorkspace

- `id` (string, required) — A UUID.
- `name` (string, required)

### OAuthConnectionSalesCalls

- `ready` (boolean, required) — A number is ready: a call without `from` goes out.
- `numbers` (list of OAuthConnectionSalesCallsNumbersItems, required)
- `setupUrl` (string, required) — Where the workspace chooses its numbers for sales calls (show it when `ready` is false).

### ErrorUpgradeHint

On 402 payment_required and 403 plan_limit: what fixes it.

- `action` (enum, optional)
  - Allowed values: `top_up`, `upgrade`, `contact`
- `planCode` (string, optional) — The smallest plan that allows it, when action is upgrade.
- `href` (string, optional) — Where to go in the app.

### OAuthConnectionSalesCallsNumbersItems

- `e164` (string, required)
- `display` (string, required)
- `label` (string, required, nullable)

## Examples

**Response**

```json
{
  "id": "string",
  "app": {
    "id": "string",
    "name": "string"
  },
  "workspace": {
    "id": "string",
    "name": "string"
  },
  "scopes": [
    "string"
  ],
  "connectedAt": "2024-01-15T09:30:00Z",
  "salesCalls": {
    "ready": true,
    "numbers": [
      {
        "e164": "string",
        "display": "string",
        "label": "string"
      }
    ],
    "setupUrl": "string"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.rydhm.ai/v1/oauth/connection"

headers = {"Authorization": "Bearer <apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.rydhm.ai/v1/oauth/connection';
const options = {method: 'GET', headers: {Authorization: 'Bearer <apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```