ReferenceFlightcontrol APIServicesGet Services

Get Services API

Use this API to retrieve a paginated list of services in your organization.

API Description

MethodPath
GET/v1/services
Headers
AuthorizationBearer: [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 ID
  • environmentId (string, optional) - Filter by specific environment ID
  • previewEnvironmentId (string, optional) - Filter by preview environment ID
  • type (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 service
  • name (string) - Display name of the service
  • givenId (string) - User-defined identifier for the service
  • type (string) - Service type (e.g., web, worker, rds, redis, etc.)
  • environmentId (string | null) - Environment ID if this is a preview service
  • projectId (string) - Project ID that contains this service
  • previewEnvironmentId (string | null) - Preview environment ID if applicable

Pagination Fields

  • count (number) - Total number of services matching the filters
  • hasMore (boolean) - Whether there are more services available
  • hasPrevious (boolean) - Whether there are previous services available
  • nextPage (number | null) - Next skip value for pagination, or null if no more services
  • previousPage (number | null) - Previous skip value for pagination, or null if on first page
  • pageCount (number) - Total number of pages
  • pageSize (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 service
  • web-private - Private web service
  • worker - Worker service
  • network-server - Network server
  • network-server-private - Private network server
  • rds - Relational database service
  • redis - Redis cache service
  • s3 - S3 Bucket
  • scheduler - Scheduled job service
  • fargate - Fargate service

Additional service types may be supported depending on your Flightcontrol configuration.

Notes

  • Services are ordered by creation date (newest first)
  • Use skip and take 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 results
  • previousPage contains the skip value for the previous page of results, or null if on the first page