SecretsManagerRpc
SecretsManagerRpc exposes browser-facing RPC endpoints for listing, creating, updating, and deleting secrets through the SecretsManager feature. It is designed to return metadata only; secret values are not returned to the browser by the documented list endpoint. The class also provides a small helper endpoint for scope-filter UI options.
Endpoints
POST /api/rpc (Method: SecretsManagerRpc.getData)
Description: List all secrets, returning metadata only and excluding secret values, for the current subscription.
Request Body:
{ "method": "SecretsManagerRpc.getData", "params": { "scope": "subscription", "projectId": "string", "agentName": "string", "page": 1, "pageSize": 50 } }Parameters:
Name Type Required Description scopeStringNo Filters secrets by scope. Allowed values are subscription,project, andagent.projectIdStringNo Optional project identifier used when filtering project-scoped secrets. May be null.agentNameStringNo Optional agent name used when filtering agent-scoped secrets. May be null.pageNumberNo Page number for pagination. Defaults to 1. Must be a positive integer.pageSizeNumberNo Number of results per page. Defaults to 50. Must be a positive integer.Response:
{ "success": true, "data": "implementation-defined metadata list returned by the connector" }Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "SecretsManagerRpc.getData", "params": { "scope": "subscription", "page": 1, "pageSize": 50 } }'
POST /api/rpc (Method: SecretsManagerRpc.create)
Description: Create or update a secret. The value is encrypted server-side before storage.
Request Body:
{ "method": "SecretsManagerRpc.create", "params": { "scope": "subscription", "projectId": "string", "agentName": "string", "key": "string", "value": "string", "label": "string", "description": "string" } }Parameters:
Name Type Required Description scopeStringYes Secret scope. Allowed values are subscription,project, andagent.projectIdStringNo Optional project identifier. May be null.agentNameStringNo Optional agent name. May be null.keyStringYes Secret key name. Must be a non-empty string. valueStringYes Secret value. Must be a non-empty string. labelStringNo Optional display label. May be null.descriptionStringNo Optional description. May be null.Response:
{ "success": true, "data": "implementation-defined result returned by the connector" }Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "SecretsManagerRpc.create", "params": { "scope": "project", "projectId": "demo-project", "key": "API_KEY", "value": "secret-value", "label": "External API key", "description": "Used by the integration layer" } }'
POST /api/rpc (Method: SecretsManagerRpc.update)
Description: Update secret metadata such as
labelanddescription. Ifvalueis supplied, the method treats the request as a value rotation and delegates to the same create-or-update flow used bySecretsManagerRpc.create. Ifvalueis omitted, the method attempts a metadata-only update.Request Body:
{ "method": "SecretsManagerRpc.update", "params": { "_id": "string", "label": "string", "description": "string", "value": "string", "scope": "subscription", "projectId": "string", "agentName": "string", "key": "string" } }Parameters:
Name Type Required Description _idStringYes Secret identifier. labelStringNo Optional display label. May be null.descriptionStringNo Optional description. May be null.valueStringNo Optional secret value. When present, the method rotates the stored value by delegating to the create-or-update path. May be null.scopeStringNo Optional secret scope used when rotating a value. Allowed values are subscription,project, andagent.projectIdStringNo Optional project identifier used when rotating a value. May be null.agentNameStringNo Optional agent name used when rotating a value. May be null.keyStringNo Optional secret key used when rotating a value. Response:
{ "success": true, "data": "implementation-defined result returned by the connector, or a fallback object for metadata-only attempts" }Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "SecretsManagerRpc.update", "params": { "_id": "66f1d2...", "label": "Updated label", "description": "Updated description" } }'
POST /api/rpc (Method: SecretsManagerRpc.delete)
Description: Delete a secret by its
_id.Request Body:
{ "method": "SecretsManagerRpc.delete", "params": { "_id": "string" } }Parameters:
Name Type Required Description _idStringYes Secret identifier to delete. Response:
{ "success": true, "data": "implementation-defined result returned by the connector" }Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "SecretsManagerRpc.delete", "params": { "_id": "66f1d2..." } }'
POST /api/rpc (Method: SecretsManagerRpc.getScopeOptions)
Description: Returns scope options for filter dropdowns.
Request Body:
{ "method": "SecretsManagerRpc.getScopeOptions", "params": {} }Parameters:
Name Type Required Description No parameters This method does not accept any request parameters. Response:
{ "success": true, "data": [ { "value": "subscription", "label": "Subscription — shared across all agents" }, { "value": "project", "label": "Project — scoped to a specific project" }, { "value": "agent", "label": "Agent — private to a specific agent" } ] }Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "SecretsManagerRpc.getScopeOptions", "params": {} }'