API7 Docs

Get a Secret

GET /apisix/admin/secrets/{secret_type}/{id}

GET /apisix/admin/secrets/{secret_type}/{id}

Interactive request editor loads with JavaScript.

Authorization

X-API-KEY<token>

Admin API key configured in config.yaml under deployment.admin.admin_key. You can also pass the key as a query parameter api_key or cookie x_api_key.

In: header

Path Parameters

secret_type*string

Type of secret manager (e.g., vault, aws).

Value in

  • "vault"
  • "aws"
  • "gcp"
id*string

Unique identifier of the resource. Can be a string (alphanumeric, -, _, .) or a positive integer.

Response Body

application/json

application/json

application/json

curl -X GET "http://127.0.0.1:9180/apisix/admin/secrets/vault/my-resource-1"

Successful response.

{
  "createdIndex": 179,
  "key": "/apisix/secrets/vault/1",
  "value": {
    "token": "343effad",
    "id": "vault/1",
    "uri": "https://localhost/vault",
    "prefix": "/apisix/kv",
    "update_time": 1684395392,
    "create_time": 1684395392
  },
  "modifiedIndex": 179
}
Complete operation details and schema variants

GET /apisix/admin/secrets/{secret_type}/{id}

Get a Secret

Retrieve a specific secret manager configuration.

Parameters

  • secret_type (path, string, required): Type of secret manager (e.g., vault, aws).
  • id (path, string, required): Unique identifier of the resource. Can be a string (alphanumeric, -, _, .) or a positive integer.

Responses

  • 200: Successful response.
  • value (object, optional): Secret values.
  • value.id (string, optional): Unique identifier for the secret configuration, including the secret manager type and ID.
  • value.prefix (string, optional): Path prefix for the secret engine or storage location.
  • value.token (string, optional): Authentication token or credential for accessing the secret manager.
  • value.create_time (integer, optional): Creation time of the secret.
  • value.update_time (integer, optional): Update time of the secret.
  • value.uri (string, optional): Endpoint URI of the secret manager service.
  • key (string, optional): Unique key identifier for this secret in the data store.
  • modifiedIndex (integer, optional): The index number representing the most recent update to the object. It starts with the same value as createdIndex and increases by 1 each time the resource is modified.
  • createdIndex (integer, optional): The index number representing when the object was first created. It indicates the creation order of the resource.
  • 401: Unauthorized — The API key is missing, invalid, or lacks permission.
  • error_msg (string, required): Authentication error message.
  • description (string, optional): Detailed reason for the authentication failure.
  • 404: Not Found — The specified resource does not exist.
  • error_msg (string, required): Error message indicating the resource was not found.

cURL

curl -X GET 'http://127.0.0.1:9180/apisix/admin/secrets/{secret_type}/{id}'