Get Services API
Use this API to retrieve a paginated list of services in your organization.
API Description
Method | Path |
---|---|
GET | /v1/services |
Headers | |
---|---|
Authorization | Bearer: [API key] |
Full Endpoint URL https://api.flightcontrol.dev/v1/services
Parameters
Query Parameters
skip
(number, optional, default: 0) - Number of services to skip (0-based)take
(number, optional, default: 25, max: 100) - Number of services to return (1-100)projectId
(string, optional) - Filter by specific project IDenvironmentId
(string, optional) - Filter by specific environment IDpreviewEnvironmentId
(string, optional) - Filter by preview environment IDtype
(string, optional) - Filter by service type (e.g.,web
,worker
,rds
, etc.)environmentType
(string, optional) - Filter by environment type:preview
for preview services,standard
for standard/production services
Request Examples
Basic Request
curl -X GET "https://api.flightcontrol.dev/v1/services" \
-H "Authorization: Bearer YOUR_API_KEY"
With Pagination
curl -X GET "https://api.flightcontrol.dev/v1/services?skip=50&take=50" \
-H "Authorization: Bearer YOUR_API_KEY"
With Filters
curl -X GET "https://api.flightcontrol.dev/v1/services?type=web&projectId=cm2jl7psl0000718o04s31mz9" \
-H "Authorization: Bearer YOUR_API_KEY"
Preview Services Only
curl -X GET "https://api.flightcontrol.dev/v1/services?environmentType=preview" \
-H "Authorization: Bearer YOUR_API_KEY"
Standard Services Only
curl -X GET "https://api.flightcontrol.dev/v1/services?environmentType=standard" \
-H "Authorization: Bearer YOUR_API_KEY"
Response Example
{
"count": 47,
"hasMore": true,
"hasPrevious": false,
"nextPage": 25,
"previousPage": null,
"pageCount": 2,
"pageSize": 25,
"services": [
{
"id": "cm2jl6r8p0000k08o5shg2z5a",
"name": "Web App",
"givenId": "web-app",
"type": "web",
"environmentId": "cm2jl6r8p0000k08o5shg2z5a",
"projectId": "cm2jl7psl0000718o04s31mz9",
"previewEnvironmentId": null
},
{
"id": "cm2jlakxl00008v8o7j021l31",
"name": "Database",
"givenId": "db",
"type": "rds",
"environmentId": null,
"projectId": "cm2jl7psl0000718o04s31mz9",
"previewEnvironmentId": null
}
]
}
Response Fields
Services Array
Each service object contains:
id
(string) - Unique identifier of the servicename
(string) - Display name of the servicegivenId
(string) - User-defined identifier for the servicetype
(string) - Service type (e.g.,web
,worker
,rds
,redis
, etc.)environmentId
(string | null) - Environment ID if this is a preview serviceprojectId
(string) - Project ID that contains this servicepreviewEnvironmentId
(string | null) - Preview environment ID if applicable
Pagination Fields
count
(number) - Total number of services matching the filtershasMore
(boolean) - Whether there are more services availablehasPrevious
(boolean) - Whether there are previous services availablenextPage
(number | null) - Next skip value for pagination, or null if no more servicespreviousPage
(number | null) - Previous skip value for pagination, or null if on first pagepageCount
(number) - Total number of pagespageSize
(number) - Number of services per page
Response Conditions
Success
Errors
Service Types
The API supports various service types including but not limited to:
web
- Web serviceweb-private
- Private web serviceworker
- Worker servicenetwork-server
- Network servernetwork-server-private
- Private network serverrds
- Relational database serviceredis
- Redis cache services3
- S3 Bucketscheduler
- Scheduled job servicefargate
- Fargate service
Additional service types may be supported depending on your Flightcontrol configuration.
Notes
- Services are ordered by creation date (newest first)
- Use
skip
andtake
for pagination (skip is 0-based, take is 1-100) - Maximum
take
value is 100 services per request nextPage
contains the skip value for the next page of resultspreviousPage
contains the skip value for the previous page of results, or null if on the first page