Repositories API
Access repository information. List repositories, branches, and merge requests through the REST API.
Endpoints
| Method | Path | Scope | Description |
|---|---|---|---|
GET | /repositories | repos:read | List repositories |
GET | /repositories/:id | repos:read | Get repository details |
GET | /repositories/:id/branches | repos:read | List branches |
GET | /repositories/:id/merge-requests | repos:read | List merge requests |
Endpoint Details
GET /repositories
Retrieve a list of all repositories connected to the organization.
Response Example
{
"repositories": [
{
"id": 1,
"name": "agentsmesh",
"full_name": "org/agentsmesh",
"provider": "gitlab",
"url": "https://gitlab.com/org/agentsmesh",
"default_branch": "main",
"created_at": "2025-01-01T00:00:00Z"
}
]
}GET /repositories/:id
Retrieve detailed information about a specific repository.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | integer | Required | The numeric ID of the repository |
Response Example
{
"repository": {
"id": 1,
"name": "agentsmesh",
"full_name": "org/agentsmesh",
"provider": "gitlab",
"url": "https://gitlab.com/org/agentsmesh",
"default_branch": "main",
"created_at": "2025-01-01T00:00:00Z"
}
}GET /repositories/:id/branches
Retrieve a list of branches for a specific repository. Requires an access token.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | integer | Required | The numeric ID of the repository |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| access_token | string | Required | Git provider access token for authentication |
Response Example
{
"branches": [
"main",
"develop",
"feature/auth",
"fix/login-bug"
]
}GET /repositories/:id/merge-requests
Retrieve merge requests (or pull requests) for a specific repository.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | integer | Required | The numeric ID of the repository |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| branch | string | Optional | Filter by source branch name |
| state | string | Optional | Filter by state: opened, merged, closed, or all |
Response Example
{
"merge_requests": [
{
"id": 101,
"title": "Add JWT authentication",
"state": "opened",
"source_branch": "feature/auth",
"target_branch": "main",
"author": "john.doe",
"url": "https://gitlab.com/org/repo/-/merge_requests/101",
"created_at": "2025-01-14T09:00:00Z"
}
]
}