POST
v1.1.0stableUpdate Token
Generate a new API token and invalidate the old token immediately.
POST
/api/token/updateAuth:API Key
Limit:30/minute
Request Parameters
All parameters can be passed via Query or Body
| Parameter | Type | Required | Description |
|---|---|---|---|
token | string | Required | Current API token. It becomes invalid immediately after success 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: 刷新成功 |
data.username | string | Required | Username Example: testuser |
data.token | string | Required | New API token Example: new_api_token_here |
data.expire_time | number | Required | Expiry timestamp inherited by the new token. 0 means permanent Example: 1772267945 |
data.old_token_invalidated | boolean | Required | 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
0Token is required
Missing token parameter
0Invalid token
Token is invalid, replaced, or the account status is unavailable
0Token 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: 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/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.
POST
https://testypro.iwai.cc/api/token/updateLocked to this sitestringRequired
Current API token. It becomes invalid immediately after success