Projects
Endpoints
POST /api/v1/projects— Create a new project with an initial API keyGET /api/v1/projects— List projects accessible to the authenticated API keyGET /api/v1/projects/{projectId}— Get project detailsPATCH /api/v1/projects/{projectId}— Update a projectDELETE /api/v1/projects/{projectId}— Delete a project and all associated data
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
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Min length: 1. Max length: 255 |
description | string | No | Max length: 1000 |
Response (201)
| Field | Type | Required | Description |
|---|---|---|---|
project | object | Yes | — |
api_key | object | Yes | — |
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)
| Field | Type | Required | Description |
|---|---|---|---|
projects | object[] | Yes | — |
Error Responses
| Status | Description |
|---|---|
401 | Unauthorized |
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
| Parameter | Type | Description |
|---|---|---|
projectId | string | — |
Response (200)
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Format: uuid |
name | string | Yes | — |
description | string,null | Yes | — |
created_at | string | Yes | — |
updated_at | string | Yes | — |
Error Responses
| Status | Description |
|---|---|
401 | Unauthorized |
403 | Forbidden |
404 | Project 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
| Parameter | Type | Description |
|---|---|---|
projectId | string | — |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | Min length: 1. Max length: 255 |
description | string,null | No | Max length: 1000 |
Response (200)
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Format: uuid |
name | string | Yes | — |
description | string,null | Yes | — |
created_at | string | Yes | — |
updated_at | string | Yes | — |
Error Responses
| Status | Description |
|---|---|
401 | Unauthorized |
403 | Forbidden |
404 | Project 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
| Parameter | Type | Description |
|---|---|---|
projectId | string | — |
Error Responses
| Status | Description |
|---|---|
401 | Unauthorized |
403 | Forbidden |
404 | Project not found |
Example
Request:
bash
curl -s \
-X DELETE \
"http://localhost:3000/api/v1/projects/$PROJECT_ID" \
-H "Authorization: Bearer $NEXGRAPH_KEY"