Skip to content

Repositories

Endpoints


POST /api/v1/repositories

Add a repository to the project

Authentication

Requires Bearer token. See Authentication.

Request Body

FieldTypeRequiredDescription
namestringNoMin length: 1. Max length: 255
source_type"git_url" | "zip_upload" | "local_path"Yes
urlstringYesMin length: 1. Max length: 2048
default_branchstringNoDefault: "main". Min length: 1. Max length: 255

Response (201)

FieldTypeRequiredDescription
idstringYesFormat: uuid
project_idstringYesFormat: uuid
namestring,nullYes
source_type"git_url" | "zip_upload" | "local_path"Yes
urlstringYes
default_branchstringYes
graph_namestring,nullYes
last_indexed_atstring,nullYes
created_atstringYes
updated_atstringYes

Error Responses

StatusDescription
401Unauthorized
403Forbidden
409Repository already exists in this project

Example

Request:

bash
curl -s \
  -X POST \
  "http://localhost:3000/api/v1/repositories" \
  -H "Authorization: Bearer $NEXGRAPH_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "my-project",
  "source_type": "git_url",
  "url": "https://github.com/expressjs/express.git",
  "default_branch": "main"
}'

Response:

json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "project_id": "550e8400-e29b-41d4-a716-446655440000",
  "name": null,
  "source_type": "git_url",
  "url": "https://github.com/expressjs/express.git",
  "default_branch": "main",
  "graph_name": null,
  "last_indexed_at": null,
  "created_at": "string",
  "updated_at": "string"
}

GET /api/v1/repositories

List repositories in the authenticated project

Authentication

Requires Bearer token. See Authentication.

Response (200)

FieldTypeRequiredDescription
repositoriesobject[]Yes

Error Responses

StatusDescription
401Unauthorized

Example

Request:

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

Response:

json
{
  "repositories": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "project_id": "550e8400-e29b-41d4-a716-446655440000",
      "name": null,
      "source_type": "git_url",
      "url": "https://github.com/expressjs/express.git",
      "default_branch": "main",
      "graph_name": null,
      "last_indexed_at": null,
      "created_at": "string",
      "updated_at": "string"
    }
  ]
}

GET /api/v1/repositories/{repoId}

Get repository details including indexing status

Authentication

Requires Bearer token. See Authentication.

Path Parameters

ParameterTypeDescription
repoIdstring

Response (200)

FieldTypeRequiredDescription
idstringYesFormat: uuid
project_idstringYesFormat: uuid
namestring,nullYes
source_type"git_url" | "zip_upload" | "local_path"Yes
urlstringYes
default_branchstringYes
graph_namestring,nullYes
last_indexed_atstring,nullYes
created_atstringYes
updated_atstringYes
indexing_statusobject,nullYes

Error Responses

StatusDescription
401Unauthorized
403Forbidden
404Repository not found

Example

Request:

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

Response:

json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "project_id": "550e8400-e29b-41d4-a716-446655440000",
  "name": null,
  "source_type": "git_url",
  "url": "https://github.com/expressjs/express.git",
  "default_branch": "main",
  "graph_name": null,
  "last_indexed_at": null,
  "created_at": "string",
  "updated_at": "string",
  "indexing_status": null
}

PATCH /api/v1/repositories/{repoId}

Update repository settings

Authentication

Requires Bearer token. See Authentication.

Path Parameters

ParameterTypeDescription
repoIdstring

Request Body

FieldTypeRequiredDescription
namestring,nullNoMin length: 1. Max length: 255
default_branchstringNoMin length: 1. Max length: 255

Response (200)

FieldTypeRequiredDescription
idstringYesFormat: uuid
project_idstringYesFormat: uuid
namestring,nullYes
source_type"git_url" | "zip_upload" | "local_path"Yes
urlstringYes
default_branchstringYes
graph_namestring,nullYes
last_indexed_atstring,nullYes
created_atstringYes
updated_atstringYes

Error Responses

StatusDescription
401Unauthorized
403Forbidden
404Repository not found

Example

Request:

bash
curl -s \
  -X PATCH \
  "http://localhost:3000/api/v1/repositories/$REPO_ID" \
  -H "Authorization: Bearer $NEXGRAPH_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": null,
  "default_branch": "main"
}'

Response:

json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "project_id": "550e8400-e29b-41d4-a716-446655440000",
  "name": null,
  "source_type": "git_url",
  "url": "https://github.com/expressjs/express.git",
  "default_branch": "main",
  "graph_name": null,
  "last_indexed_at": null,
  "created_at": "string",
  "updated_at": "string"
}

DELETE /api/v1/repositories/{repoId}

Delete a repository and its AGE graph

Authentication

Requires Bearer token. See Authentication.

Path Parameters

ParameterTypeDescription
repoIdstring

Error Responses

StatusDescription
401Unauthorized
403Forbidden
404Repository not found

Example

Request:

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

Released under the MIT License.