# OAuth | Signal House API Docs

> Connect a third-party application to a Signal House account with OAuth, without handling the user's password or API key.

Source: https://docs.signalhouse.io/oauth

---

## OAuth

# OAuth

Signal House is an OAuth 2.1 authorization server. An application can ask a user to connect their Signal House account by sending them through a hosted approval screen, and receive an access token without ever handling the user password or an API key.

The access token returned here is an ordinary Signal House bearer token. Once you hold one, every endpoint documented elsewhere in these docs is called as described, subject to the scope and the boundaries below, with `Authorization: Bearer <access_token>`.

**A protocol surface, not an SDK surface.** These six endpoints implement RFC 6749, RFC 7009, RFC 7591, RFC 7636 and RFC 8414, so they are consumed by a standards-compliant OAuth client rather than by a Signal House SDK method. Most clients need nothing beyond the discovery document below. They also do not use the `{ success, data }` envelope the rest of the API returns, because the RFCs define their own request and response bodies and a client library parses those.

## The flow

1. Read the discovery document to find the endpoints.
2. Register your application once, receiving a `client_id`.
3. Send the user to `/oauth/authorize` with a PKCE challenge.
4. The user signs in to Signal House and approves your application.
5. Signal House redirects back to your `redirect_uri` with a single-use code.
6. Exchange the code at `/oauth/token` for an access token and a refresh token.

**PKCE is mandatory** and only `S256` is accepted. There are no client secrets: every client is a public client, and an authorization request without a code challenge is rejected rather than allowed through unprotected.

## Discovery

Served at the root of the origin, as RFC 8414 requires. Both are unauthenticated, because a client reads them to learn how to authenticate at all.

### GET /.well-known/oauth-authorization-server

Authorization server metadata. Point your OAuth client at this URL and it can configure itself.

Response

```json
{
  "issuer": "https://v2.signalhouse.io",
  "authorization_endpoint": "https://v2.signalhouse.io/oauth/authorize",
  "token_endpoint": "https://v2.signalhouse.io/oauth/token",
  "registration_endpoint": "https://v2.signalhouse.io/oauth/register",
  "revocation_endpoint": "https://v2.signalhouse.io/oauth/revoke",
  "revocation_endpoint_auth_methods_supported": ["none"],
  "response_types_supported": ["code"],
  "grant_types_supported": ["authorization_code", "refresh_token"],
  "code_challenge_methods_supported": ["S256"],
  "token_endpoint_auth_methods_supported": ["none"],
  "scopes_supported": ["read", "messaging", "numbers", "registration", "billing", "account"],
  "authorization_response_iss_parameter_supported": true
}
```

### GET /.well-known/oauth-protected-resource

Protected resource metadata. Tells a client which authorization server guards this API.

Response

```json
{
  "resource": "https://v2.signalhouse.io",
  "authorization_servers": ["https://v2.signalhouse.io"],
  "bearer_methods_supported": ["header"],
  "scopes_supported": ["read", "messaging", "numbers", "registration", "billing", "account"]
}
```

### POST /oauth/register

Dynamic client registration (RFC 7591). Register your application once and keep the returned `client_id`. No authentication is required, and no client secret is issued.

#### Request Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `client_name` | String | Required | Display name shown on the consent screen. Maximum 200 characters. A name claiming to be Signal House is rejected. |
| `redirect_uris` | String\[\] | Required | One to ten absolute URIs. Each URI is checked on its own: HTTPS is required except on loopback, where http://localhost, http://127.0.0.1 and http://\[::1\] are accepted for desktop and CLI clients, and fragments and embedded credentials are not allowed. A URI that fails is dropped rather than failing the request, and the 201 lists only the URIs that were registered. |
| `grant_types` | String\[\] | Optional | Any of authorization\_code and refresh\_token. Defaults to both. |
| `response_types` | String\[\] | Optional | Only code is supported. |
| `token_endpoint_auth_method` | String | Optional | Only none is accepted. A client asking for a secret-based method is refused rather than silently downgraded. |
| `software_id` | String | Optional | Your own identifier for the application. Maximum 200 characters. |
| `scope` | String | Optional | Ignored at registration. Scope is granted per authorization: send it on /oauth/authorize. See Token scope below. |

Request

```
POST /oauth/register
Content-Type: application/json

{
  "client_name": "Acme Dispatch",
  "redirect_uris": ["https://acme.example.com/callback"]
}
```

#### Example Response201

Response

```json
{
  "client_id": "sh-9tK2mQ7xR4vN1pL8sD3fWg",
  "client_name": "Acme Dispatch",
  "redirect_uris": ["https://acme.example.com/callback"],
  "grant_types": ["authorization_code", "refresh_token"],
  "response_types": ["code"],
  "token_endpoint_auth_method": "none"
}
```

Redirect URIs that are not valid are left out of registration, so compare the `redirect_uris` in the response with what you sent. The request fails with `400` `invalid_client_metadata` when none of them is usable; the other client metadata must still be valid. Registration is limited to 10 requests per hour per IP address. Exceeding it returns `429` with the error code `temporarily_unavailable`. Invalid metadata returns `400` with `invalid_client_metadata` and a description naming the fields at fault.

### GET /oauth/authorize

Start an authorization. This is a browser navigation, not a background request: send the user here and Signal House takes over until it redirects them back to you.

#### Query Parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `response_type` | String | Required | Must be code. |
| `client_id` | String | Required | The client\_id returned by registration. |
| `redirect_uri` | String | Required | Must exactly match one of the URIs you registered. It is compared as a whole string, not by prefix. |
| `code_challenge` | String | Required | Base64url SHA-256 digest of your code verifier, 43 to 128 characters. |
| `code_challenge_method` | String | Required | Must be S256. The plain method is not accepted. |
| `state` | String | Optional | Opaque value returned unchanged on the redirect. Use it for CSRF protection. Maximum 512 characters. |
| `scope` | String | Optional | Space-separated scopes to request. Maximum 500 characters. Omit it, or send none of the values listed under Token scope, to request full access. Unknown values are ignored. |

Browser navigation

```
GET https://v2.signalhouse.io/oauth/authorize
  ?response_type=code
  &client_id=sh-9tK2mQ7xR4vN1pL8sD3fWg
  &redirect_uri=https%3A%2F%2Facme.example.com%2Fcallback
  &code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM
  &code_challenge_method=S256
  &scope=read%20messaging
  &state=xyzABC123
```

After the user approves, the browser lands on your redirect URI carrying a single-use code:

Redirect on approval

```
https://acme.example.com/callback?state=xyzABC123&iss=https%3A%2F%2Fv2.signalhouse.io&code=Kd7Rq2...
```

If the user declines, the refusal comes back the same way:

Redirect on refusal

```
https://acme.example.com/callback?state=xyzABC123&iss=https%3A%2F%2Fv2.signalhouse.io&error=access_denied
```

Every redirect back to your client, success or error, carries `iss` (RFC 9207), equal to the `issuer` in the authorization server metadata. Before handling a success or an error, require it to match the issuer you started the request with exactly.

Once a user has approved your client at least once, a request that fails validation after the redirect URI has been verified is also reported on the redirect, with a description. Before that first approval it is a 400 JSON error instead:

Redirect on failure

```
https://acme.example.com/callback?error=invalid_request&error_description=code_challenge_method+must+be+S256&state=xyzABC123&iss=https%3A%2F%2Fv2.signalhouse.io
```

**An unknown client or an unregistered redirect URI is never redirected.** Those two failures are answered with a JSON error at this endpoint instead, because redirecting to a URI that has not been proven to be yours would make the endpoint an open redirect. If you are debugging a callback that never arrives, check the exact string match on your registered `redirect_uri` first.

### POST /oauth/token

Exchange an authorization code for tokens, or exchange a refresh token for a new pair. Accepts either `application/x-www-form-urlencoded` or JSON.

#### Authorization code grant

A code is valid for **60 seconds** and can be redeemed once. It is bound to the client and to the exact redirect URI it was issued for, so both must be sent again here.

Request

```
POST /oauth/token
Content-Type: application/x-www-form-urlencoded

grant_type=authorization_code
&code=Kd7Rq2...
&redirect_uri=https://acme.example.com/callback
&client_id=sh-9tK2mQ7xR4vN1pL8sD3fWg
&code_verifier=dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk
```

#### Refresh token grant

The user's role is read again on every refresh. If the user is no longer active, or now holds a Signal House staff role, the refresh fails with `invalid_grant` and every refresh token in that chain is revoked; the user has to connect again.

Request

```
POST /oauth/token
Content-Type: application/x-www-form-urlencoded

grant_type=refresh_token
&refresh_token=8Fq...
&client_id=sh-9tK2mQ7xR4vN1pL8sD3fWg
```

#### Example Response200

Response

```json
{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "expires_in": 43200,
  "refresh_token": "8Fq...",
  "scope": "read messaging"
}
```

`expires_in` reports the real lifetime of the issued token, so read it rather than assuming a fixed value. `scope` is the granted scope. A full-access grant lists all six scopes. A refresh keeps the original scope and cannot widen it.

**Every refresh returns a new refresh token, and retires the one you sent.** Store the new value before you use it. Presenting a refresh token that has already been rotated is treated as a stolen credential and revokes the entire chain, which disconnects the user and forces them to approve your application again. The one exception is a retry within 30 seconds of a successful refresh, which is answered with the same tokens so an ordinary dropped response does not cost the user their connection.

A grant type other than the two above returns `unsupported_grant_type`. Every failure to redeem a code or a refresh token returns the same `invalid_grant`, whether it expired, was already used, or belongs to another client. Recovery is identical in all three cases: start a new authorization.

### POST /oauth/revoke

Token revocation (RFC 7009). Surrender a refresh token when your application no longer needs access. Revoking one token in a chain revokes the whole chain.

Request

```
POST /oauth/revoke
Content-Type: application/x-www-form-urlencoded

token=8Fq...
&client_id=sh-9tK2mQ7xR4vN1pL8sD3fWg
```

Returns `200` with an empty body for any token, including one that was never issued, so this endpoint cannot be used to test whether a token is real. Omitting `token` or `client_id` returns `400`.

### GET /oauth/consent-request

Read a pending authorization so the signed-in user can decide on it. Signal House's own approval screen calls this with the signed-in user's session token; your OAuth client does not call it. It uses normal bearer authentication, and refuses an OAuth connector token with `403`. A setup-only session (its group requires two-factor authentication and the user hasn't turned it on) is also refused with `403`: the user turns it on and signs in again first.

Request

```
GET /oauth/consent-request?request_id=q3Zt8LwN0bVxR2kYp5HcJm7aEuD9fGsT
Authorization: Bearer <session token>
```

Response (restricted grant)

```json
{
  "clientName": "Acme CRM",
  "verified": false,
  "redirectUri": "https://acme.example.com/callback",
  "redirectHost": "acme.example.com",
  "scopes": ["read", "messaging"]
}
```

`scopes` lists the scopes the user is being asked to grant, from the values under Token scope. An empty array, `"scopes": []`, means a full-access grant: the token will reach everything a connector can reach under the user's role, so show that rather than an empty list. The routes that refuse every connector token, such as this one, stay refused. `verified` is true only for an application Signal House has verified. A missing, expired or already-completed `request_id` returns `400 invalid_request`.

### POST /oauth/consent

Record the signed-in user's decision on a pending authorization. Signal House's own approval screen calls this with the user's session token after showing `/oauth/consent-request`; your OAuth client does not call it. It uses normal bearer authentication, and refuses an OAuth connector token or a setup-only two-factor session with `403`, the same as `/oauth/consent-request`. An approval from a Signal House staff account is also refused with `403` ("Signal House staff accounts can't connect AI assistants."), and no code is issued.

Request

```
POST /oauth/consent
Authorization: Bearer <session token>
Content-Type: application/json

{
  "request_id": "q3Zt8LwN0bVxR2kYp5HcJm7aEuD9fGsT",
  "approved": true
}
```

Response

```json
{
  "redirectTo": "https://acme.example.com/callback?state=xyz&iss=https%3A%2F%2Fv2.signalhouse.io&code=..."
}
```

Both fields are required, and `approved` must be a boolean. The response is JSON, not a redirect: the caller sends the browser to `redirectTo` itself. On approval it carries the authorization `code`, and `state` when the client sent one, and always `iss`. On refusal it carries `error=access_denied` instead. A request can be completed only once: a missing, expired or already-completed `request_id` returns `400 invalid_request`.

### GET /oauth/connections

List the applications the signed-in user currently has connected, for the connections screen in Signal House settings. It uses normal bearer authentication, and refuses an OAuth connector token or a setup-only two-factor session with `403`, the same as `/oauth/consent-request`.

Request

```
GET /oauth/connections
Authorization: Bearer <session token>
```

Response

```json
{
  "connections": [
    {
      "clientId": "sh-9tK2mQ7xR4vN1pL8sD3fWg",
      "clientName": "Acme CRM",
      "verified": false,
      "authorizedAt": "2026-11-02T15:04:11.000Z",
      "expiresAt": "2026-12-02T15:04:11.000Z"
    }
  ]
}
```

There is one entry per application with an unexpired, unrevoked grant, and an empty array when there are none. A grant cut off by a password reset can still be listed until it next tries to refresh or expires. `authorizedAt` is when tokens were first issued for the earliest of the listed grants, not when its token last rotated. Reconnecting after a disconnect starts it again. `expiresAt` is when its latest grant expires. `clientName` is `"Unknown application"` if the application's registration no longer exists.

### POST /oauth/connections/revoke

Disconnect an application from the signed-in user's account. Every grant the user gave that application is revoked, so its refresh tokens stop working at once. It uses normal bearer authentication, and refuses an OAuth connector token or a setup-only two-factor session with `403`, the same as `/oauth/consent-request`.

Request

```
POST /oauth/connections/revoke
Authorization: Bearer <session token>
Content-Type: application/json

{
  "client_id": "sh-9tK2mQ7xR4vN1pL8sD3fWg"
}
```

Response

```json
{
  "revokedCount": 1
}
```

`revokedCount` is the number of refresh-token records newly revoked, so one connection can count more than once. It is `0` when nothing was left to revoke, which is not an error. A missing `client_id` returns `400 invalid_request`.

## Token lifetimes

| Credential | Lifetime | Notes |
| --- | --- | --- |
| Authorization code | 60 seconds | Single use, bound to the client and redirect URI. |
| Pending approval | 10 minutes | How long a consent screen stays valid before the user must start again. |
| Access token | See `expires_in` | An ordinary Signal House bearer token. Cannot be revoked individually before it expires. |
| Refresh chain | 30 days | Absolute. Rotation issues a new token but never extends the deadline, so a connection is re-approved on a predictable cadence. |

A user can disconnect your application at any time from Settings, and a password reset or a security logout on the account invalidates every refresh chain. Both take effect at your next refresh rather than mid-token, so an access token already in flight keeps working until it expires. Handle a `400 invalid_grant` on refresh by sending the user through authorization again, not by retrying.

## Token scope

Request scopes on `/oauth/authorize` as a space-separated list. The user sees them on the approval screen, and every call made with the resulting access token is checked against them. A call outside the granted scope is refused with `403`. Scope never widens a token past the connecting user's own role.

| Scope | Allows |
| --- | --- |
| `read` | Any GET request. |
| `messaging` | Any request under /message, /shortlink, /template, /rcs (except /rcs/agent) and /landing. Reads under /agent/drafts and /agent/conversations are included. Opt-out records under /dnc and every AI Agents write are not available to connected applications. |
| `numbers` | Any request under /number. Setting a number's callback URLs, which receive its incoming messages, also needs `messaging`. |
| `registration` | Any request under /brand, /campaign, /registration, /rcs/agent, /verify and /compliance. |
| `billing` | GET and HEAD requests under /billing and /subscription. Connected applications cannot add funds, change payment methods, fees or subscriptions. Listing payment methods for a wallet that has no payment processor customer yet creates one, as it does for any caller. |
| `account` | Any request under every other path, such as /group, /subgroup, /webhook and /notification. Creating a webhook subscribed to message events, or changing the URL or events of one that is, also needs `messaging`. |

**No scope means full access.** An authorization that requests none of these values, including one that sends only values this API does not recognise, is a full-access grant: the token can reach everything a connector can reach under the connecting user's role (see the boundaries below), and the token response lists all six scopes. Requesting all six is equivalent. Scope names are case-sensitive. Ask only for the access your application genuinely needs.

The main boundaries are these. First, a token obtained through OAuth is refused on the routes that mint credentials, change a password, or terminate sessions, so a connected application cannot escalate itself into a permanent credential or lock the user out of their own account. Those operations require an interactive login. Second, any write under `/billing`, `/subscription` or `/agent` returns 403, so a connected application cannot add funds, change payment methods or fees, change a subscription, or change how AI Agents send. Reads under those paths are still allowed.

## Errors

Errors follow RFC 6749 rather than the standard Signal House error envelope.

Error body

```json
{
  "error": "invalid_grant",
  "error_description": "The grant is invalid or has expired."
}
```

| Code | Status | Meaning |
| --- | --- | --- |
| `invalid_request` | 400 | A parameter is missing or malformed. |
| `invalid_client_metadata` | 400 | Registration metadata was rejected. The description names the fields. |
| `invalid_grant` | 400 | The code or refresh token is expired, already used, or not yours. |
| `unsupported_grant_type` | 400 | Only authorization\_code and refresh\_token are supported. |
| `unsupported_response_type` | 302 | response\_type was not code. Your client is misconfigured. |
| `invalid_scope` | 302 | The requested scope was rejected. |
| `access_denied` | 302 | The user declined. Delivered on the redirect, not as a response body. |
| `invalid_client` | 401 | Client authentication failed. |
| `temporarily_unavailable` | 429 | Registration rate limit reached. Back off and retry. |
| `server_error` | 500 | The request could not be completed. |
