DocsAF OAuth#

GitHub OAuth flow with repository access

Start DocsAF GitHub OAuth flow#

GET/docsaf/oauth/start

Initiates GitHub OAuth flow with repository access scopes. Redirects user to GitHub authorization page with repo and webhook permissions.

Optional repo_url parameter can pre-fill the repository for project creation.

Authentication required: bearerAuth

Parameters#

NameTypeLocationRequiredDescription
repo_urlstringqueryNoOptional GitHub repository URL to pre-fill

Code Examples#

curl -X GET "https://searchaf.antfly.io/api/v1/docsaf/oauth/start?repo_url=https://github.com/antflydb/colony" \\
    -H "Authorization: Bearer YOUR_API_KEY"

Responses#

{
  "redirect_url": "string"
}

Handle GitHub OAuth callback#

GET/docsaf/oauth/callback

Processes GitHub OAuth callback after user authorizes. Stores the access token temporarily in user_docsaf_tokens table. Redirects to frontend with success status.

Parameters#

NameTypeLocationRequiredDescription
codestringqueryYesAuthorization code from GitHub
statestringqueryYesState parameter for CSRF protection

Code Examples#

curl -X GET "https://searchaf.antfly.io/api/v1/docsaf/oauth/callback?code=value&state=value" \\
    -H "Authorization: Bearer YOUR_API_KEY"

Responses#

{
  "success": true
}