---
title: "Exercise an mcp_oauth grant and report whether it still works [write]"
method: POST
path: "/vaults/{id}/secrets/{secretId}/validate"
tags: ["vaults"]
---

# Exercise an mcp_oauth grant and report whether it still works \[write\]

`POST /vaults/{id}/secrets/{secretId}/validate`

## Request

- Base URL: `https://api.agentsky.dev/v1`
- URL: `https://api.agentsky.dev/v1/vaults/{id}/secrets/{secretId}/validate`
- Auth: HTTP bearer

## Path parameters

- `id` string, required
- `secretId` string, required

## Response `200`

OK

- VaultSecretValidation: valid = the grant was exercised and the token renewed · invalid = the grant is dead, re-supply it · unknown = the endpoint was unreachable, retry.
  - `result` 'valid' | 'invalid' | 'unknown', required
  - `detail` string
  - `secret` VaultSecret, required: Metadata only — the secret value is never returned after it is written. `secret_name` is set for environment_variable secrets, `mcp_server_url` for the two MCP kinds.
    - `type` 'vault_secret', required
    - `id` string, required: vsec_…
    - `display_name` string, required
    - `auth_type` 'static_bearer' | 'mcp_oauth' | 'environment_variable', required
    - `mcp_server_url` string
    - `secret_name` string: The environment variable the pod sees
    - `allowed_hosts` string[]: Environment-variable destination metadata. An empty list disables credential injection. Omit this field on update to keep the current sites; send [] to clear them.
    - `status` string, required
    - `expires_at` string, date-time
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required

## Other responses

- `default`: Error — { error: { code, message } }

## Changes

- **2026-11-02** `e5e8f0229a99`: 2 info
  - added the optional property `error/request_id` to the response with the `default` status
  - added the optional property `secret/allowed_hosts` to the response with the `200` status

[Operation history](https://skmtc.dev/agentsky/apis/agentsky-developer-api/changes/vaults/:id/secrets/:secretId/validate/post.md)

---

[API](https://skmtc.dev/agentsky/apis/agentsky-developer-api.md) - [All operations](https://skmtc.dev/agentsky/apis/agentsky-developer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agentsky/apis/agentsky-developer-api/revisions/0d435187cd55?raw)
