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

# POST /admin/api/users



## OpenAPI

````yaml /generated/openapi.json post /admin/api/users
openapi: 3.1.0
info:
  description: >-
    Forwarding, management, portal and OAuth APIs generated from Rust types.
    Input and output schemas preserve their respective Serde contracts.
    Streaming events and WebSocket messages are documented alongside HTTP
    payloads.
  title: GPROXY HTTP API
  version: 4.2.1
servers: []
security:
  - bearer: []
  - anthropicKey: []
  - googleKey: []
  - queryKey: []
paths:
  /admin/api/users:
    post:
      tags:
        - Management
      summary: POST /admin/api/users
      parameters:
        - description: Administrative scope selected by the caller.
          in: header
          name: x-gproxy-admin-scope
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Input_UserWrite'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Output_UserDto'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Output_Envelope'
          description: Gateway error
      security:
        - consoleSession: []
        - bearer: []
        - anthropicKey: []
        - googleKey: []
components:
  schemas:
    Input_UserWrite:
      properties:
        enabled:
          default: null
          type:
            - boolean
            - 'null'
        id:
          default: null
          type:
            - string
            - 'null'
        name:
          type: string
        oauthClientAllowlist:
          default: null
          items:
            type: string
          type:
            - array
            - 'null'
        password:
          default: null
          description: >-
            Optional: a user created without one cannot sign in until a password
            is

            set, which is what an API-key-only account is.
          type:
            - string
            - 'null'
        role:
          default: null
          description: '`admin` or `user`; absent means `user`.'
          type:
            - string
            - 'null'
      required:
        - name
      type: object
    Output_UserDto:
      properties:
        createdAtMs:
          format: int64
          type: integer
        enabled:
          type: boolean
        hasPassword:
          description: >-
            Whether a console/portal password is set. `password_hash` itself has
            no

            field here and no accessor anywhere.
          type: boolean
        id:
          type: string
        name:
          type: string
        oauthClientAllowlist:
          description: >-
            None inherits the levels above; an empty list denies every client
            for

            this user.
          items:
            type: string
          type:
            - array
            - 'null'
        role:
          description: >-
            Instance-wide role, `admin` or `user`. Organization and team roles
            are

            memberships and are not this.
          type: string
      required:
        - id
        - name
        - role
        - enabled
        - hasPassword
        - oauthClientAllowlist
        - createdAtMs
      type: object
    Output_Envelope:
      properties:
        error:
          $ref: '#/components/schemas/Output_EnvelopeBody'
      required:
        - error
      type: object
    Output_EnvelopeBody:
      properties:
        code:
          type: string
        message:
          type: string
      required:
        - code
        - message
      type: object
  securitySchemes:
    bearer:
      scheme: bearer
      type: http
    anthropicKey:
      in: header
      name: x-api-key
      type: apiKey
    googleKey:
      in: header
      name: x-goog-api-key
      type: apiKey
    queryKey:
      in: query
      name: key
      type: apiKey
    consoleSession:
      in: cookie
      name: gproxy_session
      type: apiKey

````

## Related topics

- [POST /admin/api/users/batch](https://gproxy.leenhawk.com/api-reference/management/post-adminapiusersbatch.md)
- [POST /admin/api/users/{id}/password](https://gproxy.leenhawk.com/api-reference/management/post-adminapiusers-password.md)
- [GET /admin/api/users](https://gproxy.leenhawk.com/api-reference/management/get-adminapiusers.md)
- [DELETE /admin/api/users/{id}](https://gproxy.leenhawk.com/api-reference/management/delete-adminapiusers.md)
- [GET /admin/api/users/{id}](https://gproxy.leenhawk.com/api-reference/management/get-adminapiusers-1.md)


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