GET
v1.0.0stableQuery Token Expiry
Retrieve the expiry time and validity status of an API token
GET
/api/token/expireAuth:API Key
Limit:120/minute
Request Parameters
All parameters can be passed via Query or Body
| Parameter | Type | Required | Description |
|---|---|---|---|
token | string | Required | User API token Example: your_api_token_here |
Response
| Parameter | Type | Required | Description |
|---|---|---|---|
code | number | Required | Status code: 1=success, 0=failure Example: 1 |
msg | string | Required | Response message Example: 查询成功 |
time | number | Required | Server timestamp (Unix seconds) Example: 1769675945 |
data | object | Required | Response payload |
data.username | string | Required | Username Example: testuser |
data.expire_time | number | Required | Expiry timestamp (Unix seconds). 0 means permanent Example: 1769675945 |
data.status | string | Required | Status: permanent, valid, or expired Example: valid |
data.status_text | string | Required | Status text Example: 有效 |
data.is_valid | boolean | Required | Whether the token is valid Example: true |
data.remaining_seconds | number | Required | Remaining seconds (-1 means permanent) Example: 2592000 |
data.remaining_days | number | Required | Remaining days (-1 means permanent) Example: 30 |
data.expire_time_formatted | string | Required | Formatted expiry time (not returned if permanent) Example: 2026-02-28 15:04:05 |
ysucc | string | Required | Success flag, returns "Ysucc" on success Example: Ysucc |
Response Example
{}
"code":1,
"msg":"Query successful",
"time":1769675945,
"data":
{}
,"username":"testuser",
"expire_time":1772267945,
"status":"valid",
"status_text":"有效",
"is_valid":true,
"remaining_seconds":2592000,
"remaining_days":30,
"expire_time_formatted":"2026-02-28 15:04:05"
"ysucc":"Ysucc"
Permanent Token
Returns permanent when the token has no expiry set
Permanent Token
{}
"code":1,
"msg":"Query successful",
"time":1769675945,
"data":
{}
,"username":"testuser",
"expire_time":0,
"status":"permanent",
"status_text":"永久有效",
"is_valid":true,
"remaining_seconds":-1,
"remaining_days":-1
"ysucc":"Ysucc"
Expired Token
Token has exceeded its expiry time
Expired Token
{}
"code":1,
"msg":"Query successful",
"time":1769675945,
"data":
{}
,"username":"testuser",
"expire_time":1769000000,
"status":"expired",
"status_text":"已过期",
"is_valid":false,
"expired_seconds":675945,
"expired_days":7,
"expire_time_formatted":"2026-01-21 12:26:40"
"ysucc":"Ysucc"
Error Codes
Error Codes3 defined
0Token is required
Token parameter is missing
0Invalid token
Invalid token or has been replaced
0Only GET requests are supported
Used non-GET method
Response Language
Customize the API response language with the X-Lang header. The code examples below automatically use your current site language.
Recommended Header
X-Lang: enSupported Languages
zh, en, zh-TW, vi, arAccept-Language is also supported; X-Lang takes priority. Unsupported languages fall back to English.
Code Examples
curl -X GET "https://testypro.iwai.cc,https://cer.xyul.cn,https://cer.iwai.cc/api/token/expire?token=your_api_token_here" \
-H "X-Lang: en"Notes
- expire_time of 0 means the token is permanent
- remaining_seconds/remaining_days of -1 means permanent
- Expired tokens can still query expiry, but is_valid is false
- Replaced tokens cannot be queried, will return invalid token error
Try it in Console
Fill in the parameters below and send a request to test. Requests only go to this site's API; the URL is locked and cannot be changed, and your current login cookie is included.
GET
https://testypro.iwai.cc/api/token/expire?token=your_api_token_hereLocked to this sitestringRequired
User API token