> ## Documentation Index
> Fetch the complete documentation index at: https://docs.y.uno/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Test in the sandbox first: base URL https://api-sandbox.y.uno (Test Mode in the Dashboard). Production is https://api.y.uno (Live Mode).
> Every API request needs the public-api-key and private-secret-key headers. Get them in the Dashboard at https://dashboard.y.uno/developers (Developers > Credentials); sandbox and production keys are different.
> Send an X-Idempotency-Key (a UUID) when creating payments, refunds and cancels, so retries do not create duplicates.
> Start with the Quickstart (https://docs.y.uno/docs/quickstart.md) and the agent guide (https://docs.y.uno/agents.md). To search these docs from a coding agent, connect the docs MCP server at https://docs.y.uno/mcp.

# 创建用户

> 在已认证组织内创建新用户



## OpenAPI

````yaml openapi/zh-hans/organizations/create-user.json POST /organizations/users
openapi: 3.1.0
info:
  title: Users API - Create
  version: 1.0.0
servers:
  - url: https://api-sandbox.y.uno/v1
    description: Sandbox
  - url: https://api.y.uno/v1
    description: Production (US)
security:
  - sec0: []
    sec1: []
paths:
  /organizations/users:
    post:
      summary: 创建用户
      description: >-
        创建新用户。以此方式创建的用户没有 Dashboard 访问权限，只能通过 [Authenticate Whitelabel
        User](/zh-hans/reference/organizations/authenticate-whitelabel-user) API
        进行验证。创建用户时必须至少分配一项权限：account_permissions、account_group_permissions，或两者皆有。
      operationId: create-user
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
                - first_name
                - last_name
              properties:
                email:
                  type: string
                  format: email
                  description: 用户电子邮箱地址。
                first_name:
                  type: string
                  description: 名。
                last_name:
                  type: string
                  description: 姓。
                account_permissions:
                  type: array
                  description: 直接分配的账户权限。
                  items:
                    type: object
                    required:
                      - account_id
                      - role_id
                    properties:
                      account_id:
                        type: string
                        format: uuid
                        description: 账户 UUID（必须属于该组织）。
                      role_id:
                        type: string
                        description: 角色 ID（非管理员、非员工、组织范围内）。
                account_group_permissions:
                  type: array
                  description: 账户组权限分配。
                  items:
                    type: object
                    required:
                      - account_group_id
                      - role_id
                    properties:
                      account_group_id:
                        type: string
                        format: uuid
                        description: 账户组 UUID（必须属于该组织）。
                      role_id:
                        type: string
                        description: 角色 ID（非管理员、非员工、组织范围内）。
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  email:
                    type: string
                  first_name:
                    type: string
                  last_name:
                    type: string
                  account_permissions:
                    type: array
                    items:
                      type: object
                      properties:
                        account_id:
                          type: string
                          format: uuid
                        role_id:
                          type: string
                  account_group_permissions:
                    type: array
                    items:
                      type: object
                      properties:
                        account_group_id:
                          type: string
                          format: uuid
                        role_id:
                          type: string
                  created_at:
                    type: string
                    format: date-time
                  updated_at:
                    type: string
                    format: date-time
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: PUBLIC-API-KEY
      x-default: <Your PUBLIC-API-KEY>
    sec1:
      type: apiKey
      in: header
      name: PRIVATE-SECRET-KEY
      x-default: <Your PRIVATE-SECRET-KEY>

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.