Get a service on a gateway group
GET /apisix/admin/services/{service_id}
GET /apisix/admin/services/{service_id}Interactive request editor loads with JavaScript.
In: header
Path Parameters
The unique identifier of the service.
^[a-zA-Z0-9-_.]+$1 <= length <= 256Query Parameters
Gateway group ID. Optional when using the gateway group admin key to authenticate.
1 <= lengthIf true, include publish information in the response, such as apisix_route_id, route_version_id, and service_version_id. The additional information is only useful for the Dashboard and not for API users.
falseResponse Body
application/json
application/json
curl -X GET "$API_BASE_URL/apisix/admin/services/bd58fce2-b6cc-4d2d-a53c-6ce11b19c101?gateway_group_id=86fb9981-d9d2-4555-9df8-91ae92129335"Successfully retrieved the service.
{
"value": {
"name": "us-west-rsc",
"labels": {
"version": "v2",
"env": "prod"
},
"desc": "Object description.",
"type": "http",
"id": "bd58fce2-b6cc-4d2d-a53c-6ce11b19c101",
"last_published": 1742288230,
"published_gateway_groups_count": 0,
"created_at": 1742288232,
"updated_at": 1742288235
}
}Bad Request — The request was malformed or contained invalid parameters. Check the error_msg field for details.
{
"value": {},
"error_msg": "error message"
}Complete operation details and schema variants
GET /apisix/admin/services/{service_id}
Get a service on a gateway group
Get one service through an APISIX Admin API compatible endpoint under /apisix/admin/. The response keeps APISIX field conventions for migration and interoperability scenarios.
Required IAM Permission: Action gateway:GetPublishedService, Resource arn:api7:gateway:gatewaygroup/%s/service/%s
Parameters
service_id(path, string, required): The unique identifier of the service.gateway_group_id(query, string, required): Gateway group ID. Optional when using the gateway group admin key to authenticate.with_publish_info(query, boolean, optional): If true, include publish information in the response, such asapisix_route_id,route_version_id, andservice_version_id. The additional information is only useful for the Dashboard and not for API users.
Responses
200: Successfully retrieved the service.- allOf variant 1
value(object, optional): The specific resource.- allOf variant 2
value(object, optional): The service with management fields.- allOf variant 1
- allOf variant 1
value.name(string, optional): The object name.value.labels(object, optional): Key-value pairs of labels.value.desc(string, optional): The object description.value.type(string, optional): Type of service.httpcorresponds to L7 service andstreamcorresponds to L4 service.- allOf variant 2
value.id(string, optional): The object ID.value.last_published(integer, optional): The object timestamp.value.published_gateway_groups_count(integer, optional):value.created_at(integer, optional): The object created timestamp.value.updated_at(integer, optional): The object updated timestamp.400: Bad Request — The request was malformed or contained invalid parameters. Check the error_msg field for details.value(object, optional): The specific resource.error_msg(string, optional): The error message.
cURL
curl -X GET '$API_BASE_URL/apisix/admin/services/{service_id}'