Connect
Generated HTTP reference for the 1 operation the published OpenAPI document describes under connect.
1 min read
Connect
This page is generated from the published OpenAPI document. It is complete with respect to that document and says nothing about surfaces the document does not describe yet. See what is generated here for what that means.
Base URL: https://api.codespar.dev
Every operation below requires a Bearer token. See Authentication.
POST /v1/connect/start
POST
https://api.codespar.dev/v1/connect/startDeprecated
Begin the Connect Link OAuth flow for a provider
Request body
| Field | Type | Required | Description |
|---|---|---|---|
redirect_uri | string (uri) | yes | — |
scopes | string | no | — |
server_id | string | yes | — |
user_id | string | yes | — |
Responses
| Status | Body | Description |
|---|---|---|
200 | object | OK |
400 | object | The body did not match the schema. |
404 | object | The provider has no OAuth configuration in the catalog. |
500 | object | The platform's OAuth client credential is not seeded for this provider. A configuration defect on our side. |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
authorize_url | string (uri) | yes | Send the user here. Carries the client id, our callback as its redirect_uri, the state token, response_type=code and the resolved scopes. |
expires_at | string (date-time) | yes | Ten minutes after the call. A callback arriving later is refused. |
link_token | string | yes | Single-use state token, also embedded in authorize_url. |
Example request
curl -X POST https://api.codespar.dev/v1/connect/start \
-H "Authorization: Bearer $CODESPAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"server_id": "srv_0000000000000000",
"user_id": "user_0000000000000000",
"redirect_uri": "https://example.com/hook",
"scopes": "string"
}'const res = await fetch("https://api.codespar.dev/v1/connect/start", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CODESPAR_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"server_id": "srv_0000000000000000",
"user_id": "user_0000000000000000",
"redirect_uri": "https://example.com/hook",
"scopes": "string"
}),
});
const data = await res.json();const auth = await session.authorize(serverId, { redirectUri, scopes });Example response 200
{
"link_token": "string",
"authorize_url": "https://example.com/hook",
"expires_at": "2026-01-15T12:00:00.000Z"
}