Services
This API endpoint offers developers a seamless way to access valuable information about services within the LinearB platform. By utilizing this endpoint, you can effortlessly retrieve the details of services and the specific repositories and paths configured for each service
Get services
Get a list of services that have been configured in the LinearB platform
HTTP request
GET https://public-api.linearb.io/api/v1/services
Query parameter
| Parameter name | Value | Description |
|---|---|---|
| repository_id | integer | Repository ID to filter by. Return only services where this repository is presented |
Responses
200 - Successful Response
{
"total": 0,
"items": [
{
"id": 0,
"name": "string",
"paths": [
{
"id": 0,
"name": "string",
"paths": [
"string"
]
}
]
}
]
}
400 - Bad Request
401 - Unauthorized
405 - Method Not Allowed
422 - Validation Error
500 - Internal Server Error
504 - Endpoint request timed out
Get service
Get a single service by its ID.
HTTP request
GET https://public-api.linearb.io/api/v1/services/{service_id}
Query parameter
| Parameter name | Value | Description |
|---|---|---|
| service_id (required) | integer | The service ID |
Responses
200 - Successful Response
{
"id": 0,
"name": "string",
"paths": [
{
"id": 0,
"name": "string",
"paths": [
"string"
]
}
]
}
400 - Bad Request
401 - Unauthorized
405 - Method Not Allowed
422 - Validation Error
500 - Internal Server Error
504 - Endpoint request timed out
Bulk create services
Create multiple services in a single request. This is useful when onboarding a set of services at once.
HTTP request
POSTĀ https://public-api.linearb.io/api/v1/services
Body parameters
| Parameter name | Value | Description |
|---|---|---|
| services | array of objects | List of services to create |
| name | string | Service name (display name) |
| repositories | array of objects | List of repositories to map to a service |
| url | string | Repository URL |
| paths | array of strings | List of directory paths in the repository that belong to this service |
Examples
{
"services": [
{
"name": "Payments",
"repositories": [
{
"url": "https://github.com/owner/my-repo.git",
"paths": [
"src/fe",
"lib/be"
]
}
]
}
]
}
Responses
200 - Successful Response
201 - Successful Response
{
"message": "string",
"summary": {
"total": 0,
"successful": 0,
"failed": 0
},
"errors": [
{
"name": "string",
"error": "string"
}
]
}
400 - Bad Request
401 - Unauthorized
403 - Forbidden
405 - Method Not Allowed
409 - Conflict
422 - Validation Error
500 - Internal Server Error
504 - Endpoint request timed out
Update service
Updates properties of a service based on the provided service ID.
HTTP request
PUTĀ https://public-api.linearb.io/api/v1/services/{service_id}
Body parameters
| Parameter name | Value | Description |
|---|---|---|
| name | string | Service name (display name) |
| repositories | array of objects | List of repositories to map to a service |
| url | string | Repository URL |
| paths | array of strings | List of directory paths in the repository that belong to this service |
Examples
{
"name": "Payments",
"repositories": [
{
"url": "https://github.com/owner/my-repo.git",
"paths": [
"src/fe",
"lib/be"
]
}
]
}
Responses
200 - Successful Response
{
"id": 0,
"name": "string",
"paths": [
{
"id": 0,
"name": "string",
"paths": [
"string"
]
}
]
}
400 - Bad Request
401 - Unauthorized
403 - Forbidden
405 - Method Not Allowed
409 - Conflict
422 - Validation Error
500 - Internal Server Error
504 - Endpoint request timed out
Delete service
Deletes a service identified by the provided service ID.
HTTP request
DELETE https://public-api.linearb.io/api/v1/services/{service_id}
Query parameter
| Parameter name | Value | Description |
|---|---|---|
| service_id (required) | integer | The service ID |
Responses
200 - Successful Response
204 - Successful Response
400 - Bad Request
401 - Unauthorized
403 - Forbidden
404 - Not Found
405 - Method Not Allowed
409 - Conflict
422 - Validation Error
500 - Internal Server Error
504 - Endpoint request timed out