Skip to content

Projects

Endpoints


POST /api/v1/projects

Create a new project with an initial API key

No Authentication

This endpoint does not require an API key.

Request Body

FieldTypeRequiredDescription
namestringYesMin length: 1. Max length: 255
descriptionstringNoMax length: 1000

Response (201)

FieldTypeRequiredDescription
projectobjectYes
api_keyobjectYes

Example

Request:

bash
curl -s \
  -X POST \
  "http://localhost:3000/api/v1/projects" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "my-project",
  "description": "A code intelligence project"
}'

Response:

json
{
  "project": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "my-project",
    "description": null,
    "created_at": "string",
    "updated_at": "string"
  },
  "api_key": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "key": "string",
    "key_prefix": "string",
    "permissions": [
      "read"
    ],
    "expires_at": null,
    "created_at": "string"
  }
}

GET /api/v1/projects

List projects accessible to the authenticated API key

Authentication

Requires Bearer token. See Authentication.

Response (200)

FieldTypeRequiredDescription
projectsobject[]Yes

Error Responses

StatusDescription
401Unauthorized

Example

Request:

bash
curl -s \
  "http://localhost:3000/api/v1/projects" \
  -H "Authorization: Bearer $NEXGRAPH_KEY"

Response:

json
{
  "projects": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "my-project",
      "description": null,
      "created_at": "string",
      "updated_at": "string"
    }
  ]
}

GET /api/v1/projects/{projectId}

Get project details

Authentication

Requires Bearer token. See Authentication.

Path Parameters

ParameterTypeDescription
projectIdstring

Response (200)

FieldTypeRequiredDescription
idstringYesFormat: uuid
namestringYes
descriptionstring,nullYes
created_atstringYes
updated_atstringYes

Error Responses

StatusDescription
401Unauthorized
403Forbidden
404Project not found

Example

Request:

bash
curl -s \
  "http://localhost:3000/api/v1/projects/$PROJECT_ID" \
  -H "Authorization: Bearer $NEXGRAPH_KEY"

Response:

json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "my-project",
  "description": null,
  "created_at": "string",
  "updated_at": "string"
}

PATCH /api/v1/projects/{projectId}

Update a project

Authentication

Requires Bearer token. See Authentication.

Path Parameters

ParameterTypeDescription
projectIdstring

Request Body

FieldTypeRequiredDescription
namestringNoMin length: 1. Max length: 255
descriptionstring,nullNoMax length: 1000

Response (200)

FieldTypeRequiredDescription
idstringYesFormat: uuid
namestringYes
descriptionstring,nullYes
created_atstringYes
updated_atstringYes

Error Responses

StatusDescription
401Unauthorized
403Forbidden
404Project not found

Example

Request:

bash
curl -s \
  -X PATCH \
  "http://localhost:3000/api/v1/projects/$PROJECT_ID" \
  -H "Authorization: Bearer $NEXGRAPH_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "my-project",
  "description": null
}'

Response:

json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "my-project",
  "description": null,
  "created_at": "string",
  "updated_at": "string"
}

DELETE /api/v1/projects/{projectId}

Delete a project and all associated data

Authentication

Requires Bearer token. See Authentication.

Path Parameters

ParameterTypeDescription
projectIdstring

Error Responses

StatusDescription
401Unauthorized
403Forbidden
404Project not found

Example

Request:

bash
curl -s \
  -X DELETE \
  "http://localhost:3000/api/v1/projects/$PROJECT_ID" \
  -H "Authorization: Bearer $NEXGRAPH_KEY"

Released under the MIT License.