4Z API

Batch update tokens

Endpoint: PUT https://4zapi.com/api/token/batch

Batch-update tokens. ids is an int array; only fields listed in update_fields are applied.

Parameters

  • New-Api-User (header, string, required): Current user ID; must match the authenticated identity

Request body (application/json)

  • ids (array<integer>, required): Token IDs to update
  • update_fields (array<string>, required): Field names to update
  • allow_ips (string): IP allowlist
  • expired_time (integer): Expiration time (Unix timestamp)
  • group (string): User group
  • mj_custom_proxy (string): Midjourney custom proxy
  • mj_image_mode (string): Midjourney image mode
  • model_limits (string): Model limit configuration
  • model_limits_enabled (boolean): Whether model limits are enabled
  • remain_quota (integer): Remaining quota
  • routing_priority (string): Routing priority
  • unlimited_quota (boolean): Whether quota is unlimited

Request example

{
  "expired_time": -1,
  "group": "default",
  "ids": [
    1,
    2
  ],
  "update_fields": [
    "group",
    "expired_time"
  ]
}