> ## 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.

# Update workspace

> Updates mutable workspace attributes for a partner-managed workspace. Partners can change the human-readable display_name and/or adjust the number of purchased seats (seats_purchased, 1-999). When the purchased seats are reduced below current utilization, the platform may automatically suspend users and their associated WhatsApp accounts to comply with the new limit. The response returns the updated workspace representation, including seat counters and, when applicable, details of suspended members so partners can reconcile the downgrade on their side. Standard partner ownership and billing eligibility checks apply before processing the update.



## OpenAPI

````yaml patch /workspaces/{workspace_id}
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}:
    patch:
      tags:
        - workspaces
      summary: Update workspace
      description: >-
        Updates mutable workspace attributes for a partner-managed workspace.
        Partners can change the human-readable display_name and/or adjust the
        number of purchased seats (seats_purchased, 1-999). When the purchased
        seats are reduced below current utilization, the platform may
        automatically suspend users and their associated WhatsApp accounts to
        comply with the new limit. The response returns the updated workspace
        representation, including seat counters and, when applicable, details of
        suspended members so partners can reconcile the downgrade on their side.
        Standard partner ownership and billing eligibility checks apply before
        processing the update.
      operationId: workspaceUpdate
      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: false
        description: Workspace update request payload
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PartnerAPIWorkspaceRequest'
      responses:
        '200':
          headers:
            X-TL-API-Version:
              schema:
                type: string
              description: Partner API version. Current version is v1
          description: Workspace updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerAPIWorkspaceResponse'
        '404':
          $ref: '#/components/responses/WorkspaceNotFound'
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:
    PartnerAPIWorkspaceRequest:
      type: object
      properties:
        display_name:
          type: string
          description: New workspace display name
          example: updated-workspace-name
          minLength: 1
          maxLength: 100
        seats_purchased:
          type: integer
          description: New number of workspace seats
          example: 5
          minimum: 1
          maximum: 999
      description: >-
        Partial update payload for a workspace. Allows partners to change the
        workspace display_name and/or the number of purchased seats. Fields are
        optional and only those provided are updated. Business rules around seat
        downgrades, including potential user suspensions, are enforced
        server-side.
    PartnerAPIWorkspaceResponse:
      type: object
      properties:
        workspace_id:
          type: string
          description: Unique identifier for the workspace
          example: ws_1234567890abcdef
        display_name:
          type: string
          description: Workspace display name
          example: my-first-workspace
        plan_id:
          type: integer
          description: Workspace plan type
          example: 1
        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
        updated_at:
          type: string
          format: date-time
          description: Timestamp of the last update
          example: '2024-01-01T12:00:00Z'
        owner_user_id:
          type: integer
          description: User ID of the workspace owner
          example: 42
        group_id:
          type: integer
          description: Group ID associated with the workspace
          example: 7
        created_at:
          type: string
          format: date-time
          description: Timestamp of workspace creation
          example: '2024-01-01T10:00:00Z'
        suspended_members:
          type: array
          description: array of suspended user IDs
          items:
            $ref: '#/components/schemas/SuspendedMember'
      required:
        - workspace_id
        - display_name
        - plan_id
        - seats_total
        - seats_available
      description: >-
        Representation of a partner-managed workspace returned after creation or
        update. It includes the stable workspace_id, display_name, linked
        plan_id, seat allocation and utilization, audit timestamps, the default
        group identifier, the automatically generated Owner user, and any
        suspended members that resulted from a seat downgrade.
    SuspendedMember:
      type: object
      description: Suspended users
      properties:
        user_id:
          type: integer
          description: ID of the suspended user
          example: 123
        whatsapp_account_id:
          type: integer
          description: ID of the WhatsApp account associated with the suspended user
          example: 1092930
        phone_numbers:
          type: array
          items:
            type: string
          description: List of phone numbers associated with the suspended user
          example:
            - '+1234567890'
      required:
        - user_id
    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:
    WorkspaceNotFound:
      description: Workspace not found
      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>.

````