Verify a Pi user access token
verify_userAuthenticate a Pi user by checking their access token against the Pi Platform API. Returns the token's owner, or a reason for invalid tokens, so you never trust a client-supplied uid alone.
Instructions
Check whether a Pi user access token is genuine and, if so, who it belongs to. Call this to authenticate someone who claims a Pi identity — never trust a client-supplied uid or username on its own; this is the only thing that proves it. Returns valid: false with a reason for a rejected token rather than failing. Sends the token to the Pi Platform API (https://api.minepi.com/v2/me) and nothing else; it is not stored or logged. Note the uid is app-specific — the same person has a different uid under a different Pi app.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| access_token | Yes | The user's Pi access token, obtained from Pi Browser authentication or Pi Sign-in OAuth. This is a credential — pass the token itself, not a uid. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | No | ||
| valid | Yes | ||
| app_id | No | ||
| reason | No | ||
| scopes | No | ||
| username | No | ||
| valid_until | No |