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

# Create users in workspace

> Bulk-creates placeholder agent users in a partner-managed workspace. Each request specifies a count of users to create. For every user the platform: assigns the agent role and activated status, creates a non-login, system-managed email `<user_id>-<workspace-id>@partners.timelines.ai`, assigns the user to the workspace's Default group, consumes one seat from the workspace.
 The operation is all-or-nothing: if there are not enough available seats to satisfy count, the request fails with a seats_full error and no users are created. On success the response returns updated seat counters and the list of created users, including their identifiers and metadata needed for downstream QR-link generation.



## OpenAPI

````yaml post /workspaces/{workspace_id}/users
openapi: 3.0.3
info:
  title: Partner API
  version: 1.0.1
  description: >-
    Partner-facing HTTP API used by approved integrators to provision and manage
    TimelinesAI workspaces, users and WhatsApp connections on behalf of their
    customers. All endpoints are versioned under /partner/api/v1 and secured
    with JWT bearer authentication. Obtaining a workspace Public API token,
    together with the capabilities of the Public API such as webhook
    subscriptions, enables partners to build complex integrations for their
    customers.
servers:
  - url: /partner/api/v1
    description: Partner API root URL
security:
  - bearerAuth: []
tags:
  - name: workspaces
  - name: users
  - name: whatsappAccounts
  - name: qr
  - name: publicAPI
paths:
  /workspaces/{workspace_id}/users:
    post:
      tags:
        - workspaces
        - users
      summary: Create users in workspace
      description: >-
        Bulk-creates placeholder agent users in a partner-managed workspace.
        Each request specifies a count of users to create. For every user the
        platform: assigns the agent role and activated status, creates a
        non-login, system-managed email
        `<user_id>-<workspace-id>@partners.timelines.ai`, assigns the user to
        the workspace's Default group, consumes one seat from the workspace.
         The operation is all-or-nothing: if there are not enough available seats to satisfy count, the request fails with a seats_full error and no users are created. On success the response returns updated seat counters and the list of created users, including their identifiers and metadata needed for downstream QR-link generation.
      operationId: workspaceCreateUsers
      parameters:
        - $ref: '#/components/parameters/X-TL-Partner-Id'
        - name: workspace_id
          in: path
          required: true
          description: The unique identifier for the workspace.
          schema:
            type: string
      requestBody:
        required: true
        description: User creation request payload
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PartnerAPIUserRequest'
      responses:
        '201':
          headers:
            X-TL-API-Version:
              schema:
                type: string
              description: Partner API version. Current version is v1
          description: Users created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerAPIUsersResponse'
        '409':
          $ref: '#/components/responses/SeatsFull'
components:
  parameters:
    X-TL-Partner-Id:
      name: X-TL-Partner-Id
      in: header
      description: The unique identifier for the partner.
      required: true
      schema:
        type: string
  schemas:
    PartnerAPIUserRequest:
      type: object
      properties:
        count:
          type: integer
          description: Number of users to create
          example: 3
          minimum: 1
          maximum: 99
      required:
        - count
      description: >-
        Request payload for bulk-creating placeholder agent users in a
        workspace. The count field specifies how many users to provision in a
        single all-or-nothing operation, subject to available seats in the
        workspace.
    PartnerAPIUsersResponse:
      type: object
      properties:
        workspace_id:
          type: string
          description: Unique identifier for the workspace
          example: my-first-workspace
        seats_total:
          type: integer
          description: Total number of seats in the workspace
          example: 3
        seats_available:
          type: integer
          description: Number of available seats in the workspace
          example: 2
        users:
          type: array
          items:
            $ref: '#/components/schemas/PartnerAPIUser'
      required:
        - workspace_id
        - seats_total
        - seats_available
        - users
      description: >-
        Response payload for bulk user creation. Contains the workspace_id,
        updated seat counters (seats_total and seats_available), and the list of
        created users with their identifiers and metadata. This response is
        typically consumed to track which agents were provisioned for QR-link
        generation.
    PartnerAPIUser:
      type: object
      properties:
        user_id:
          type: integer
          description: Unique identifier for the user
          example: 42
        display_name:
          type: string
          description: Display name of the user
          example: John Doe
        role:
          type: string
          description: Role of the user in the workspace
          example: owner
        email:
          type: string
          description: Email address of the user
          example: admin@timelines.ai
        status:
          type: string
          description: Status of the user
          example: active
        created_at:
          type: string
          format: date-time
          description: Timestamp of user creation
          example: '2024-01-01T10:00:00Z'
      required:
        - user_id
        - display_name
        - email
        - status
        - created_at
      description: >-
        User entry returned as part of a workspace summary or bulk user creation
        response. Captures the user identifier, display name, email, role within
        the workspace and current status, together with the creation timestamp.
        Partner-created placeholders follow the partners.timelines.ai email
        pattern and typically have agent role and activated status.
    PartnerAPIError:
      type: object
      properties:
        error:
          type: string
          description: Machine-readable error code
        status:
          type: integer
          description: HTTP status code
        description:
          type: string
          description: Human-readable error description
      required:
        - error
        - status
      description: >-
        Standard error envelope used by Partner API endpoints. The error field
        contains a machine-readable error code such as partner_not_found,
        partner_not_active, invalid_signature, timestamp_out_of_range,
        workspace_not_found, workspace_not_owned_by_partner or
        workspace_billing_managed. The status field repeats the HTTP status
        code, and description may contain a human-readable explanation suitable
        for logs and troubleshooting.
  responses:
    SeatsFull:
      description: Seats are full
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PartnerAPIError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT bearer authentication. The token payload must include partner_id,
        nbf (not-before) and exp (expiry) claims. All Partner API requests must
        be authenticated with Authorization: Bearer <token>.

````