Replace a single nested field of a secret
PATCH /apisix/admin/secrets/{secret_type}/{id}/{sub_path}
PATCH /apisix/admin/secrets/{secret_type}/{id}/{sub_path}Interactive request editor loads with JavaScript.
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 manager backend.
Value in
- "vault"
- "aws"
- "gcp"
Resource identifier.
Slash-separated nested key path within the resource document.
Query Parameters
Time-to-live in seconds. The resource is automatically removed when it expires.
1 <= valueRequest Body
application/json
Response Body
application/json
application/json
curl -X PATCH "http://127.0.0.1:9180/apisix/admin/secrets/gcp/r1/auth_config?ttl=3600" \ -H "Content-Type: application/json" \ -d '{ "client_email": "apisix@example.iam.gserviceaccount.com", "private_key": "example-private-key", "project_id": "example-project" }'Sub-field replaced.
**Unauthorized** — The API key is missing, invalid, or lacks permission.
{
"error_msg": "failed to check token",
"description": "missing apikey"
}{
"error_msg": "failed to check token",
"description": "wrong apikey"
}{
"error_msg": "failed to check token",
"description": "invalid method for role viewer"
}**Not Found** — The specified resource does not exist.
{
"error_msg": "Key not found"
}Complete operation details and schema variants
PATCH /apisix/admin/secrets/{secret_type}/{id}/{sub_path}
Replace a single nested field of a secret
Replaces the value at sub_path within the secret document with the request body. The body is any valid JSON value, not necessarily an object. The updated complete resource must pass validation.
Parameters
secret_type(path, string, required): Secret manager backend.id(path, object, required): Resource identifier.sub_path(path, string, required): Slash-separated nested key path within the resource document.ttl(query, integer, optional): Time-to-live in seconds. The resource is automatically removed when it expires.
Request body
Content type: application/json
Responses
200: Sub-field replaced.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 PATCH 'http://127.0.0.1:9180/apisix/admin/secrets/{secret_type}/{id}/{sub_path}'