POST
v1.1.0stable

Update Token

Generate a new API token and invalidate the old token immediately.

POST/api/token/update
Auth:API Key
Limit:30/minute

Request Parameters

All parameters can be passed via Query or Body

ParameterTypeRequiredDescription
token
stringRequired
Current API token. It becomes invalid immediately after success
Example: your_api_token_here

Response

ParameterTypeRequiredDescription
code
numberRequired
Status code: 1=success, 0=failure
Example: 1
msg
stringRequired
Response message
Example: 刷新成功
data.username
stringRequired
Username
Example: testuser
data.token
stringRequired
New API token
Example: new_api_token_here
data.expire_time
numberRequired
Expiry timestamp inherited by the new token. 0 means permanent
Example: 1772267945
data.old_token_invalidated
booleanRequired
Whether the old token has been invalidated
Example: true
Response Example
{
"code":1,
"msg":"Refreshed successfully",
"time":1769675945,
"data":
{
"username":"testuser",
"token":"new_api_token_here",
"expire_time":1772267945,
"old_token_invalidated":true
}
,
"ysucc":"Ysucc"
}

Error Codes

Error Codes3 defined
0
Token is required
Missing token parameter
0
Invalid token
Token is invalid, replaced, or the account status is unavailable
0
Token expired
Expired tokens cannot update tokens

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/update" \
  -H "X-Lang: en" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "token=your_api_token_here"

Notes

  • After success, the old token is invalidated immediately and future requests must use the new token
  • The new token inherits the previous token expiry setting
  • Old token cache is cleared after success to prevent cache hits

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/updateLocked to this site
stringRequired

Current API token. It becomes invalid immediately after success