Skip to main content

Projects API

Projects are the top-level organizational unit in Octokraft. Each project contains repositories, health assessments, PR analyses, and team members.

List Projects

Returns all projects the authenticated user belongs to.
curl "https://app.octokraft.com/api/v1/projects" \
  -H "Authorization: Bearer ok_live_a1b2c3d4e5f6..."

Get Project

Returns a single project by ID.
curl "https://app.octokraft.com/api/v1/projects/b3d7f1a2-4e5c-6d8a-9b0c-1e2f3a4b5c6d" \
  -H "Authorization: Bearer ok_live_a1b2c3d4e5f6..."

Create Project

Creates a new project and adds the authenticated user as owner.
curl -X POST "https://app.octokraft.com/api/v1/projects" \
  -H "Authorization: Bearer ok_live_a1b2c3d4e5f6..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My New Project",
    "key": "my-new-project",
    "description": "A project for analyzing our backend services"
  }'

Request Body

FieldTypeRequiredDescription
namestringyesProject display name
keystringyesURL-safe project key (unique)
descriptionstringnoProject description

Update Project

Updates a project’s name, description, or settings. Only provided fields are updated.
curl -X PATCH "https://app.octokraft.com/api/v1/projects/b3d7f1a2-4e5c-6d8a-9b0c-1e2f3a4b5c6d" \
  -H "Authorization: Bearer ok_live_a1b2c3d4e5f6..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Octokraft Platform",
    "description": "Updated description"
  }'

Request Body

FieldTypeRequiredDescription
namestringnoNew project name
descriptionstringnoNew project description
settingsobjectnoProject settings (JSON object)

Delete Project

Deletes a project. The authenticated user must be a project owner.
curl -X DELETE "https://app.octokraft.com/api/v1/projects/d4e5f6a7-8901-2345-6789-abcdef012345" \
  -H "Authorization: Bearer ok_live_a1b2c3d4e5f6..."
Returns 204 No Content on success.

List Members

Returns all members of a project.
curl "https://app.octokraft.com/api/v1/projects/b3d7f1a2-4e5c-6d8a-9b0c-1e2f3a4b5c6d/members" \
  -H "Authorization: Bearer ok_live_a1b2c3d4e5f6..."

Invite Member

Sends an invitation to join a project. The invited user receives access once they accept.
curl -X POST "https://app.octokraft.com/api/v1/projects/b3d7f1a2-4e5c-6d8a-9b0c-1e2f3a4b5c6d/invitations" \
  -H "Authorization: Bearer ok_live_a1b2c3d4e5f6..." \
  -H "Content-Type: application/json" \
  -d '{
    "email": "teammate@example.com",
    "role": "member"
  }'

Request Body

FieldTypeRequiredDescription
emailstringyesEmail address to invite
rolestringnoRole to assign: owner or member (defaults to member)

Update Member Role

Changes a member’s role in a project. The authenticated user must be a project owner.
curl -X PATCH "https://app.octokraft.com/api/v1/projects/b3d7f1a2-4e5c-6d8a-9b0c-1e2f3a4b5c6d/members/a0b1c2d3-4567-89ab-cdef-000000000002" \
  -H "Authorization: Bearer ok_live_a1b2c3d4e5f6..." \
  -H "Content-Type: application/json" \
  -d '{
    "role": "owner"
  }'

Request Body

FieldTypeRequiredDescription
rolestringyesNew role: owner or member

Remove Member

Removes a user from a project. Returns 409 Conflict if attempting to remove the last owner.
curl -X DELETE "https://app.octokraft.com/api/v1/projects/b3d7f1a2-4e5c-6d8a-9b0c-1e2f3a4b5c6d/members/a0b1c2d3-4567-89ab-cdef-000000000002" \
  -H "Authorization: Bearer ok_live_a1b2c3d4e5f6..."
Returns 204 No Content on success.