API7 Docs

Get all labels of a resource type

GET /api/labels/{resource_type}

GET /api/labels/{resource_type}

Interactive request editor loads with JavaScript.

Authorization

X-API-KEY<token>

In: header

Path Parameters

resource_type*string

Resource type.

Value in

  • "gateway_group"
  • "consumer"
  • "consumer_credential"
  • "ssl"
  • "service"
  • "route"
  • "stream_route"
  • "role"
  • "permission_policy"
  • "published_service"
  • "secret"
  • "contact_point"
  • "alert_policy"
  • "certificate"
  • "api_product"
  • "sni"
  • "portal"
  • "dcr_provider"

Query Parameters

gateway_group_id?string

Gateway group ID.

Length1 <= length

Response Body

application/json

curl -X GET "$API_BASE_URL/api/labels/gateway_group"

Successfully retrieved all labels across resources.

{
  "value": {
    "k8s/namespace": [
      "api7-ingress-system",
      "default",
      "api7"
    ],
    "manager-by": [
      "api7-ingress-controller",
      "apisix-ingress-controller"
    ]
  }
}
Complete operation details and schema variants

GET /api/labels/{resource_type}

Get all labels of a resource type

List available key-value labels for the specified resource type. Use these labels to organize resources and apply label-based filtering in list queries.

Parameters

  • resource_type (path, string, required): Resource type.
  • gateway_group_id (query, string, optional): Gateway group ID.

Responses

  • 200: Successfully retrieved all labels across resources.
  • allOf variant 1
  • value (object, optional): The specific resource.
  • allOf variant 2
  • value (object, optional):
  • 400: Invalid arguments. Error details will be provided in the response.

cURL

curl -X GET '$API_BASE_URL/api/labels/{resource_type}'