Skip to main content
API reference

Connect

Generated HTTP reference for the 1 operation the published OpenAPI document describes under connect.

1 min read
View MarkdownEdit on GitHub

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

Begin the Connect Link OAuth flow for a provider

Request body

FieldTypeRequiredDescription
redirect_uristring (uri)yes
scopesstringno
server_idstringyes
user_idstringyes

Responses

StatusBodyDescription
200objectOK
400objectThe body did not match the schema.
404objectThe provider has no OAuth configuration in the catalog.
500objectThe platform's OAuth client credential is not seeded for this provider. A configuration defect on our side.

Response 200

FieldTypeRequiredDescription
authorize_urlstring (uri)yesSend the user here. Carries the client id, our callback as its redirect_uri, the state token, response_type=code and the resolved scopes.
expires_atstring (date-time)yesTen minutes after the call. A callback arriving later is refused.
link_tokenstringyesSingle-use state token, also embedded in authorize_url.

Example response

{
  "link_token": "string",
  "authorize_url": "https://example.com/hook",
  "expires_at": "2026-01-15T12:00:00.000Z"
}

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"
     }'
Connect | CodeSpar