> ## Documentation Index
> Fetch the complete documentation index at: https://docs.voicemark.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# GET /token/{id}/validate

> Validate a token server-side before authorising privileged actions.

Validates a verify token on your backend. Pass the full JWT string as a query parameter for authoritative decode and expiry check.

## Request

`GET /v1/token/{token_id}/validate?token={jwt}`

| Parameter | Location | Notes |
| - | - | - |
| `token_id` | Path | The `token_id` from the verify response |
| `token` | Query | The full JWT string from the verify response |

> [!WARNING]
>
> Always call this endpoint server-side. Never trust the `authorized` field from the verify response alone for high-value actions.

## Response

```json theme={null}
{ "valid": true, "expires_in": 44 }
```

| Field | Description |
| - | - |
| `valid` | Whether the token is valid and unexpired |
| `expires_in` | Seconds remaining until expiry |

## Example

```typescript theme={null}
// In your backend route handler
const tokenId = req.headers["x-voicemark-token-id"];
const tokenJwt = req.headers["x-voicemark-token"];

const check = await vm.token(tokenId, tokenJwt);
if (!check.valid) {
  return res.status(401).json({ error: "Voice token expired or invalid" });
}

// proceed with the authorised action
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.