Repositories API
Repositories are linked to projects for analysis. Octokraft connects to repositories via the GitHub App installation or can add public repositories directly.
List Repositories
Returns all repositories linked to a project.
curl "https://app.octokraft.com/api/v1/projects/b3d7f1a2-4e5c-6d8a-9b0c-1e2f3a4b5c6d/repos" \
-H "Authorization: Bearer ok_live_a1b2c3d4e5f6..."
Response Fields
Field Type Description idstring Octokraft repository ID (UUID) github_idinteger GitHub repository ID installation_idinteger GitHub App installation ID ownerstring Repository owner (user or organization) namestring Repository name full_namestring Full repository name (owner/name) urlstring GitHub repository URL default_branchstring Default branch name analyzersarray Detected static analyzers for this repository privateboolean Whether the repository is private
Link Repository
Links one or more repositories to a project. Repositories must already be synced from a GitHub App installation.
Request (single)
Request (batch)
Response (201 Created)
curl -X POST "https://app.octokraft.com/api/v1/projects/b3d7f1a2-4e5c-6d8a-9b0c-1e2f3a4b5c6d/repos" \
-H "Authorization: Bearer ok_live_a1b2c3d4e5f6..." \
-H "Content-Type: application/json" \
-d '{
"repository_id": "f1a2b3c4-5678-9abc-def0-aabbccddeeff"
}'
Request Body
Field Type Required Description repository_idstring yes (if repository_ids not set) Single repository ID to link repository_idsarray of strings yes (if repository_id not set) Multiple repository IDs to link skip_onboardingboolean no If true, skip the automatic onboarding analysis. Defaults to false.
When repositories are linked, Octokraft automatically starts an onboarding workflow that clones the repository, detects analyzers, runs initial analysis, and generates architecture documentation. The onboarding_session_id can be used to track progress via the SSE event stream.
Add Public Repository
Adds a public GitHub repository to a project without requiring the GitHub App installation.
Request (by owner/name)
Request (by URL)
Response (201 Created)
curl -X POST "https://app.octokraft.com/api/v1/projects/b3d7f1a2-4e5c-6d8a-9b0c-1e2f3a4b5c6d/repos/add-public" \
-H "Authorization: Bearer ok_live_a1b2c3d4e5f6..." \
-H "Content-Type: application/json" \
-d '{
"owner": "BurntSushi",
"name": "ripgrep"
}'
Request Body
Field Type Required Description urlstring yes (if owner/name not set) GitHub repository URL ownerstring yes (if url not set) Repository owner namestring yes (if url not set) Repository name skip_onboardingboolean no If true, skip automatic onboarding. Defaults to false.
Unlink Repository
Removes a repository from a project. This does not delete analysis data.
curl -X DELETE "https://app.octokraft.com/api/v1/projects/b3d7f1a2-4e5c-6d8a-9b0c-1e2f3a4b5c6d/repos/f1a2b3c4-5678-9abc-def0-aabbccddeeff" \
-H "Authorization: Bearer ok_live_a1b2c3d4e5f6..."
Returns 204 No Content on success.
List Available Repositories
Returns repositories accessible via the GitHub App installation that are not yet linked to the project. Use this to present a selection UI when adding repositories.
curl "https://app.octokraft.com/api/v1/projects/b3d7f1a2-4e5c-6d8a-9b0c-1e2f3a4b5c6d/repos/available" \
-H "Authorization: Bearer ok_live_a1b2c3d4e5f6..."
Sync GitHub Installations
Syncs GitHub App installations and their repositories. Call this after installing or reconfiguring the GitHub App to update the available repositories.
curl -X POST "https://app.octokraft.com/api/v1/github/installations/sync" \
-H "Authorization: Bearer ok_live_a1b2c3d4e5f6..." \
-H "Content-Type: application/json" \
-d '{
"installation_ids": [42000001]
}'
Request Body
Field Type Required Description installation_idsarray of integers no Specific installation IDs to sync. If omitted, syncs all installations associated with the authenticated user.