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

# Create an account for a human

> Creates a Memex account for a human during an agent-assisted signup flow. This endpoint requires the `x-agent-service-token` service header.



## OpenAPI

````yaml /api-reference/openapi.json post /agent-create-user
openapi: 3.1.0
info:
  title: Memex REST API
  description: Memex REST API endpoints.
  version: '2026-03-10'
servers:
  - url: https://memex.garden/api
    description: Public edge router
  - url: https://rubctkzqxcdgkbbcprnu.supabase.co/functions/v1
    description: Direct Supabase Edge Functions
security:
  - bearerAuth: []
paths:
  /agent-create-user:
    post:
      summary: Create an account for a human
      description: >-
        Creates a Memex account for a human during an agent-assisted signup
        flow. This endpoint requires the `x-agent-service-token` service header.
      operationId: agentCreateUser
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentCreateUserRequest'
            examples:
              default:
                summary: Create a user account
                value:
                  targetUserEmail: person@example.com
                  targetUserName: Person Example
      responses:
        '200':
          description: Created account and API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentCreateUserResponse'
        '401':
          description: Missing or invalid agent service token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '409':
          description: A user already exists for the requested email address
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentCreateUserConflictError'
        '500':
          description: Unexpected server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
      security:
        - agentServiceToken: []
components:
  schemas:
    AgentCreateUserRequest:
      type: object
      required:
        - targetUserEmail
      properties:
        targetUserEmail:
          type: string
          format: email
        targetUserName:
          type: string
        targetUserPicture:
          type: string
          format: uri
      additionalProperties: false
    AgentCreateUserResponse:
      type: object
      required:
        - userId
        - userEmail
        - isNewUser
        - apiKey
        - recoveryHint
      properties:
        userId:
          type: string
        userEmail:
          type: string
          format: email
        isNewUser:
          type: boolean
          const: true
        apiKey:
          type: string
        recoveryHint:
          type: string
      additionalProperties: false
    UnauthorizedError:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          example: Unauthorized
      additionalProperties: true
    AgentCreateUserConflictError:
      type: object
      required:
        - error
        - message
        - userEmail
        - recoveryHint
      properties:
        error:
          type: string
          const: USER_ALREADY_EXISTS
        message:
          type: string
        userEmail:
          type: string
          format: email
        recoveryHint:
          type: string
      additionalProperties: false
    InternalServerError:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
          example: Internal server error
        message:
          type: string
      additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    agentServiceToken:
      type: apiKey
      in: header
      name: x-agent-service-token

````

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