POST
v1.1.0stableUpdate Token Expiry
Update the expiry timestamp of the current API token. Set expire_time to 0 to make it permanent.
POST
/api/token/expireAuth:API Key
Limit:60/minute
Request Parameters
All parameters can be passed via Query or Body
| Parameter | Type | Required | Description |
|---|---|---|---|
token | string | Required | Current API token Example: your_api_token_here |
expire_time | number | Required | New expiry timestamp in Unix seconds or milliseconds. Use 0 for permanent Example: 1772267945 |
Response
| Parameter | Type | Required | Description |
|---|---|---|---|
code | number | Required | Status code: 1=success, 0=failure Example: 1 |
msg | string | Required | Response message Example: 设置已保存 |
data.username | string | Required | Username Example: testuser |
data.expire_time | number | Required | New expiry timestamp. 0 means permanent Example: 1772267945 |
data.status | string | Required | Status: permanent or valid Example: valid |
data.is_valid | boolean | Required | Whether the token is valid Example: true |
data.remaining_seconds | number | Required | Remaining seconds, -1 when permanent Example: 2592000 |
Response Example
{}
"code":1,
"msg":"Settings saved",
"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"
Error Codes
Error Codes3 defined
0Token is required
Missing token parameter
0Expiration time is required
Missing or invalid expire_time
0Expiration time must be in the future
expire_time is not 0 and is earlier than current time
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 POST "https://testypro.iwai.cc,https://cer.xyul.cn,https://cer.iwai.cc/api/token/expire" \
-H "X-Lang: en" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "token=your_api_token_here&expire_time=1772267945"Notes
- The current token must be valid. Expired tokens cannot update expiry
- expire_time supports seconds or milliseconds. Use 0 to make the token permanent
- Token cache is cleared after update so the new expiry takes effect immediately
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.
POST
https://testypro.iwai.cc/api/token/expireLocked to this sitestringRequired
Current API token
numberRequired
New expiry timestamp in Unix seconds or milliseconds. Use 0 for permanent