API Reference
Auto-generated
Connections
API reference for connections endpoints.
Auto-generated
This page was generated from the OpenAPI spec. Run
make generate-docs to refresh after spec changes.GET /api/v1/connections
GET
/api/v1/connectionsList active OAuth2 connections
Request Example
Bash
curl -X GET https://api.alterlab.io/api/v1/connections \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
JSON
{
"connections": []
}GET /api/v1/connections/callback/{provider}
GET
/api/v1/connections/callback/{provider}Handle OAuth2 authorization callback
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| provider | string | Required | provider |
| code | string | Required | Authorization code from provider |
| state | string | Required | State token echoed from initiation |
Request Example
Bash
curl -X GET 'https://api.alterlab.io/api/v1/connections/callback/<provider>?code=<code>&state=<state>' \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json"Response Example
JSON
{
"id": "example",
"provider": "example",
"display_name": "example",
"scopes": [],
"connected_at": "example",
"updated_at": "example"
}POST /api/v1/connections/connect/{provider}
POST
/api/v1/connections/connect/{provider}Initiate OAuth2 PKCE flow for a provider
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| provider | string | Required | provider |
| scopes | string | Optional | Space-separated scope override |
Request Example
Bash
curl -X POST https://api.alterlab.io/api/v1/connections/connect/<provider> \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
JSON
{
"authorization_url": "example",
"state": "example",
"provider": "example"
}DELETE /api/v1/connections/{connection_id}
DELETE
/api/v1/connections/{connection_id}Disconnect an OAuth2 provider
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| connection_id | string | Required | connection_id |
Request Example
Bash
curl -X DELETE https://api.alterlab.io/api/v1/connections/<connection_id> \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
JSON
{
"disconnected": true,
"provider": "example"
}POST /api/v1/connections/{connection_id}/refresh
POST
/api/v1/connections/{connection_id}/refreshOn-demand refresh of an OAuth2 access token
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| connection_id | string | Required | connection_id |
Request Example
Bash
curl -X POST https://api.alterlab.io/api/v1/connections/<connection_id>/refresh \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
JSON
{
"id": "example",
"provider": "example",
"display_name": "example",
"scopes": [],
"connected_at": "example",
"updated_at": "example"
}