POST
v1.1.0stable

Renew Device Membership

Batch update device membership expiry with flexible matching and renewal modes.

POST/api/device/membership/renew
Auth:API Key
Limit:30/minute

Request Parameters

All parameters can be passed via Query or Body

ParameterTypeRequiredDescription
token
stringRequired
User API token
Example: your_api_token_here
mode
stringOptional
Renew mode: extend, set, or permanent. Defaults to set when expire_time is provided, otherwise extend
extendsetpermanent
Example: extend
base
stringOptional
Extend base: auto, current, or now
autocurrentnow
Example: auto
days
numberOptional
Days to add in extend mode
Example: 30
seconds
numberOptional
Seconds to add in extend mode. Higher priority than days
Example: 2592000
duration
stringOptional
Duration expression: 30d, 12h, 60m, or 3600s
Example: 30d
expire_time
numberOptional
New expiry timestamp for set mode, seconds or milliseconds. 0 means permanent
Example: 1772267945
kid
stringOptional
Single device KID
Example: KID001
udid
stringOptional
Single device UDID
Example: 00008030-001234567890002E
kids
arrayOptional
Device KID array. Comma/space/newline separated strings are also supported
Example: KID001,KID002
udids
arrayOptional
Device UDID array. If one UDID has multiple certificates, match=all updates all by default. Comma/space/newline separated strings are also supported
Example: 00008030-001234567890002E
items
arrayOptional
Advanced batch items. Each item can include kid or udid and override mode/base/days/seconds/duration/expire_time
Example: [{"kid":"KID001","mode":"extend","days":30},{"udid":"00008030-001234567890002E","mode":"permanent"}]
match
stringOptional
Multiple match handling: all, first, or error. Default all
allfirsterror
Example: all
continue_on_error
booleanOptional
Whether to continue after an item fails. Default true
Example: true

Response

ParameterTypeRequiredDescription
code
numberRequired
Status code: 1=request processed
Example: 1
data.total
numberRequired
Number of requested device items
Example: 2
data.success
numberRequired
Successful renewal count
Example: 2
data.failed
numberRequired
Failed renewal count
Example: 0
data.results[].kid
stringRequired
Device KID
Example: KID001
data.results[].old_expire_time
numberRequired
Previous membership expiry timestamp. 0 means permanent
Example: 1769675945
data.results[].new_expire_time
numberRequired
New membership expiry timestamp. 0 means permanent
Example: 1772267945
data.results[].new_expire_at
stringRequired
Formatted new expiry time
Example: 2026-02-28 15:04:05
Response Example
{
"code":1,
"msg":"Device membership renewal processed",
"time":1769675945,
"data":
{
"total":2,
"processed_results":2,
"success":2,
"failed":0,
"continue_on_error":true,
"match":"all",
"results":
[
{
"index":0,
"kid":"KID001",
"udid":"00008030-001234567890002E",
"success":true,
"code":1,
"msg":"续期成功",
"old_expire_time":1769675945,
"new_expire_time":1772267945,
"old_expire_at":"2026-01-29 15:04:05",
"new_expire_at":"2026-02-28 15:04:05",
"changed":true,
"matched_count":1
}
,
{
"index":1,
"kid":"KID002",
"udid":"00008030-009876543210002E",
"success":true,
"code":1,
"msg":"续期成功",
"old_expire_time":0,
"new_expire_time":0,
"old_expire_at":"permanent",
"new_expire_at":"permanent",
"changed":false,
"matched_count":1
}
]
}
,
"ip":"192.168.1.100",
"ysucc":"Ysucc"
}

Batch extend 30 days by KID

Use comma-separated kids with extend mode

Batch extend 30 days by KID
{
"token":"your_api_token_here",
"kids":"KID001,KID002",
"mode":"extend",
"days":30
}

Batch extend by UDID

For scenarios where only UDIDs are available. Multiple certificates under one UDID are updated by default

Batch extend by UDID
{
"token":"your_api_token_here",
"udids":"00008030-001234567890002E,00008030-009876543210002E",
"mode":"extend",
"duration":"60d"
}

Set explicit expiry time

Use mode=set to set an explicit membership expiry timestamp

Set explicit expiry time
{
"token":"your_api_token_here",
"kid":"KID001",
"mode":"set",
"expire_time":1772267945
}

Set permanent

Use mode=permanent to make membership permanent

Set permanent
{
"token":"your_api_token_here",
"kid":"KID001",
"mode":"permanent"
}

Per-device strategy

Each item can override global renewal options

Per-device strategy
{
"token":"your_api_token_here",
"items":
[
{
"kid":"KID001",
"mode":"extend",
"days":30
}
,
{
"kid":"KID002",
"mode":"set",
"expire_time":1772267945
}
,
{
"udid":"00008030-001234567890002E",
"mode":"permanent"
}
]
}

Only update latest match for a UDID

With match=first, only the latest matched certificate under the same UDID is updated

Only update latest match for a UDID
{
"token":"your_api_token_here",
"udid":"00008030-001234567890002E",
"mode":"extend",
"days":30,
"match":"first"
}

Error Codes

Error Codes4 defined
12
Token is required
Missing token parameter
20
Please provide at least one device
Missing kid, kids, udid, udids, or items
21
Invalid mode, valid values: extend/set/permanent
Invalid renewal mode

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/device/membership/renew" \
  -H "X-Lang: en" \
  -H "Content-Type: application/json" \
  -d '{
    "token": "your_api_token_here",
    "mode": "extend",
    "base": "auto",
    "days": 30,
    "seconds": 2592000,
    "duration": "30d",
    "expire_time": 1772267945,
    "kid": "KID001",
    "udid": "00008030-001234567890002E",
    "kids": "KID001,KID002",
    "udids": "00008030-001234567890002E",
    "items": "[{\"kid\":\"KID001\",\"mode\":\"extend\",\"days\":30},{\"udid\":\"00008030-001234567890002E\",\"mode\":\"permanent\"}]",
    "match": "all",
    "continue_on_error": true
  }'

Notes

  • This API only updates the device membership/certificate download expiry. It does not re-sign or charge balance
  • 0 means permanent. In extend mode, permanent devices remain permanent by default; use base=now to force a finite expiry
  • When a UDID matches multiple certificates, match=all updates all by default. Use first or error to change behavior
  • Both JSON and form requests are supported. Form items may be a JSON array string

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/device/membership/renewLocked to this site
stringRequired

User API token

string

Renew mode: extend, set, or permanent. Defaults to set when expire_time is provided, otherwise extend

string

Extend base: auto, current, or now

number

Days to add in extend mode

number

Seconds to add in extend mode. Higher priority than days

string

Duration expression: 30d, 12h, 60m, or 3600s

number

New expiry timestamp for set mode, seconds or milliseconds. 0 means permanent

string

Single device KID

string

Single device UDID

array

Device KID array. Comma/space/newline separated strings are also supported

array

Device UDID array. If one UDID has multiple certificates, match=all updates all by default. Comma/space/newline separated strings are also supported

array

Advanced batch items. Each item can include kid or udid and override mode/base/days/seconds/duration/expire_time

string

Multiple match handling: all, first, or error. Default all

boolean

Whether to continue after an item fails. Default true