POST
v1.1.0stable

Update Token Expiry

Update the expiry timestamp of the current API token. Set expire_time to 0 to make it permanent.

POST/api/token/expire
Auth:API Key
Limit:60/minute

Request Parameters

All parameters can be passed via Query or Body

ParameterTypeRequiredDescription
token
stringRequired
Current API token
Example: your_api_token_here
expire_time
numberRequired
New expiry timestamp in Unix seconds or milliseconds. Use 0 for permanent
Example: 1772267945

Response

ParameterTypeRequiredDescription
code
numberRequired
Status code: 1=success, 0=failure
Example: 1
msg
stringRequired
Response message
Example: 设置已保存
data.username
stringRequired
Username
Example: testuser
data.expire_time
numberRequired
New expiry timestamp. 0 means permanent
Example: 1772267945
data.status
stringRequired
Status: permanent or valid
Example: valid
data.is_valid
booleanRequired
Whether the token is valid
Example: true
data.remaining_seconds
numberRequired
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
0
Token is required
Missing token parameter
0
Expiration time is required
Missing or invalid expire_time
0
Expiration 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: en
Supported Languages
zh, en, zh-TW, vi, ar

Accept-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.

POSThttps://testypro.iwai.cc/api/token/expireLocked to this site
stringRequired

Current API token

numberRequired

New expiry timestamp in Unix seconds or milliseconds. Use 0 for permanent