Skip to content
Local APIPlatform accounts

Create an account ​

Version overview
POST
/api/v1/accounts

Create a preset or custom account using an existing account platform ID, and return full account details on success. The account platform must match type.

Request parameters

Authorization Bearer Token

Include your API Key as a Bearer token in the Authorization request header.

Authorization: Bearer <api-key>

Body parameters

requiredapplication/jsonAccountCreateRequest
Fields
stringrequired
Account platform type: preset means a system preset platform; custom means a user-defined platform.
Enum
stringrequired
Account platform ID; must match type
minLength: 1
string | null
Account display name; null clears the value
maxLength: 255
string | null
Login username; null clears the value
maxLength: 255
string | null
Login password; null clears the value
maxLength: 255
string | null
Two-step verification secret; null clears the value
maxLength: 255
string | null
Account notes; null clears the value
maxLength: 5000
Example

Generated from the schema; not a live response.

{
  "type": "preset",
  "platform_id": "string"
}

Request code examples

JavaScript / TypeScript: Node.js 18+ with fetch; PHP: cURL extension; Go: 1.16+; Java: JDK 11+. Replace the token and example parameter values before running.

curl -X POST -H 'Authorization: Bearer <TOKEN>' -H 'Content-Type: application/json' -d '{
  "type": "preset",
  "platform_id": "string"
}' 'http://local.zhongyibrowser.com:39025/api/v1/accounts'

Responses

Success: code = 0. Failure: code > 0. Select a status to view its fields and example. Expand objects to inspect nested fields. Optional fields may be omitted.

Details of the created account

Body

application/jsonAccountDetailSuccessResponse
Fields
numberrequired
Business status code; always 0 on success
Enum
stringrequired
Business status message; always success on success
Enum
objectrequired
Endpoint business data

Additional fields are not allowed.

Example

Generated from the schema; not a live response.

{
  "code": 0,
  "message": "success",
  "data": {
    "id": "account_01JABCDEF1234567890",
    "type": "preset",
    "name": "string",
    "username": "string",
    "password": "string",
    "twofa_key": "string",
    "remark": "string",
    "owner": "string",
    "editable": true,
    "platform": {
      "id": "string",
      "website": "string",
      "icon_url": "string",
      "platform_code": "string",
      "platform_name": "string",
      "category_code": "string",
      "category_name": "string",
      "region_code": "string",
      "region_name": "string"
    },
    "browser_count": 0,
    "created_at": "2024-01-15T09:30:00Z",
    "updated_at": "2024-01-15T09:30:00Z",
    "browser_ids": [
      "env_01JABCDEF1234567890"
    ]
  }
}

View all business error codes and HTTP statuses

ZYBrowser Local API documentation