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

# Create Client Workspace

> Create a client workspace with a credit rule and seat cap, and invite people to it.

Requires `client_workspaces:manage`. Requires the master of an active personal (agency) workspace. A key created in a client workspace, or by a non-master, cannot use the client workspace endpoints. If the personal workspace becomes inactive, its keys lose client workspace access.

## Idempotency-Key is required

Send an `Idempotency-Key` header. A retry with the same key returns the same workspace instead of creating a second one. A request without the header is rejected with `400`.

## Request body

* `creditMode`: `NONE`, `MONTHLY` (with `monthlyLimit`) or `FIXED` (with `startingBudget`).
* `seatCap`: the most LinkedIn senders the workspace can connect; `null` or omitted means no cap.
* `invitations`: optional people to invite as `ADMIN` or `MEMBER`.

A plan that cannot create workspaces returns `403`. The body rejects unknown properties with `400`, so a typo in a field name fails instead of being ignored.

The workspace is created first, then the invitations are sent. An invitation that fails does not undo the create: it is listed in `failedInvitations`, and you can retry it with [Invite to Client Workspace](https://docs.sendler.ai/api-reference/endpoint/post-client-workspace-invitation.md).


## OpenAPI

````yaml POST /v1/client-workspaces
openapi: 3.0.0
info:
  title: Sendler External API
  description: >

    # Sendler External API v1


    Public API for integrating with Sendler programmatically.


    ## Authentication


    Requests authenticate with a workspace API key in the `X-API-Key` header:


    ```

    X-API-Key: sp_live_your_api_key_here

    ```


    `Authorization: Bearer sp_live_...` (or `sp_test_...`) is also accepted.
    Prefer one header; `X-API-Key` takes precedence. Clerk OAuth tokens for MCP
    connection URLs are not public REST API keys.


    A key only reaches what its scopes and creator's current workspace
    permissions allow. Each operation lists the scopes it needs in
    `x-sp-scopes`. Use `GET /v1/me` to inspect the effective permissions and
    subscription state.


    ## Rate Limits


    - **Per API Key**: 300 requests/minute

    - **Per Workspace**: 50,000 requests/day


    Responses that reach the rate limiter include these headers; early
    authentication failures may not:

    - `X-RateLimit-Limit`: Max requests per minute

    - `X-RateLimit-Remaining`: Remaining requests in current window

    - `X-RateLimit-Reset`: Epoch timestamp when limit resets


    ## LinkedIn Sender Limits


    When using messaging endpoints, these headers show account limits:

    - `X-LinkedIn-Messages-Remaining`: Messages left today

    - `X-LinkedIn-Connections-Remaining`: Connection requests left today

    - `X-LinkedIn-Quota-Reset-At`: When daily limits reset


    ## Retries


    Send an `Idempotency-Key` header on POST and PATCH requests. A retry with
    the same key within 24 hours returns the first result (with
    `Idempotent-Replayed: true`) instead of acting twice. The same key with a
    different request answers 422 `IDEMPOTENCY_KEY_REUSED`; a retry while the
    first request still runs answers 409 `IDEMPOTENCY_IN_PROGRESS`.


    Once execution is attempted, its response (including errors) is retained. If
    a process stops or result storage fails after the attempt, the durable
    record blocks another execution for the replay window and returns 409
    `IDEMPOTENCY_IN_PROGRESS` or `IDEMPOTENCY_REPLAY_UNAVAILABLE`. Check the
    operation's status before using a new key: an uncertain outcome may already
    have acted. Requests refused before execution is claimed, such as
    authentication or rate-limit refusals, can be retried with the same key.


    ## Webhooks


    Configure webhooks in the app to receive real-time events:

    - `lead.tag.updated`

    - `lead.updated`

    - `message.sent`

    - `reply.received`

    - `connection_request.sent`

    - `connection_request.accepted`

    - `campaign.started`

    - `campaign.paused`

    - `campaign.resumed`

    - `campaign.finished`


    ## Error Codes


    Errors return a JSON body. Use the machine-readable `code` when supplied;
    validation messages can be arrays, and some legacy errors omit `code`. A
    typical error is:

    ```json

    {
      "statusCode": 400,
      "error": "Bad Request",
      "code": "SPECIFIC_ERROR_CODE",
      "message": "Human-readable description"
    }

    ```
  version: '1.0'
  contact:
    name: Sendler Support
    url: https://sendler.ai
    email: support@sendler.ai
servers:
  - url: https://api.sendler.ai
security: []
tags: []
paths:
  /v1/client-workspaces:
    post:
      tags:
        - External API - Client workspaces
      summary: Create a client workspace
      description: >-
        Creates the workspace with its credit rule and seat cap, then sends the
        invitations. Invitations that fail are listed in failedInvitations. An
        Idempotency-Key is required: a retry with the same key creates one
        workspace.
      operationId: clientWorkspaces.create
      parameters:
        - name: idempotency-key
          required: true
          in: header
          description: 'Required: a retry with the same key creates once.'
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateClientWorkspaceRequestDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientWorkspaceCreatedResponseDto'
        '400':
          description: Invalid body (VALIDATION_ERROR)
        '403':
          description: Your plan cannot create workspaces
        '404':
          description: >-
            This key isn't the agency owner's personal-workspace key, or the
            feature is off.
      security:
        - api-key: []
components:
  schemas:
    CreateClientWorkspaceRequestDto:
      type: object
      properties:
        name:
          type: string
          example: Acme Corp
          maxLength: 80
        note:
          type: string
          example: Retainer client
          maxLength: 200
        creditMode:
          type: string
          enum:
            - NONE
            - MONTHLY
            - FIXED
          description: >-
            Without it, startingBudget means FIXED, monthlyLimit MONTHLY,
            neither NONE.
        monthlyLimit:
          type: number
          example: 500
          minimum: 0
          description: 'MONTHLY: credits per cycle (required).'
        startingBudget:
          type: number
          example: 1000
          minimum: 0
          description: 'FIXED: the budget it starts with.'
        seatCap:
          type: number
          nullable: true
          minimum: 0
          example: 3
          description: LinkedIn seat cap; null or absent = no cap.
        invitations:
          maxItems: 20
          description: >-
            Sent after the workspace is created; failures are listed in
            failedInvitations.
          type: array
          items:
            $ref: '#/components/schemas/InviteToClientWorkspaceDto'
      required:
        - name
    ClientWorkspaceCreatedResponseDto:
      type: object
      properties:
        id:
          type: string
          example: cmb1x2y3z0000abcd
        name:
          type: string
          example: Acme Corp
        note:
          type: string
          nullable: true
          example: Retainer client
        creditMode:
          type: string
          enum:
            - NONE
            - MONTHLY
            - FIXED
          description: >-
            NONE: draws on the pool freely. MONTHLY: an allowance that resets
            with your plan. FIXED: a budget that only grows by top-ups or limit
            changes.
        limit:
          type: number
          nullable: true
          example: 500
          description: >-
            Monthly allowance (MONTHLY) or budget granted so far (FIXED); null
            for NONE.
        used:
          type: number
          example: 120
          description: >-
            Credits spent this cycle (MONTHLY, NONE) or since the budget began
            (FIXED).
        remaining:
          type: number
          nullable: true
          example: 380
          description: max(0, limit - used); null for NONE.
        exhaustedAt:
          type: string
          nullable: true
          example: null
          description: When the workspace ran out of credits; null while it has some.
        seatCap:
          type: number
          nullable: true
          example: 3
          description: LinkedIn seat cap; null = no cap.
        seatsUsed:
          type: number
          example: 1
          description: Connected LinkedIn senders.
        members:
          type: number
          example: 2
          description: Active members, not counting you.
        invited:
          type: number
          example: 1
          description: Pending, unexpired invitations.
        failedInvitations:
          example: []
          description: >-
            Emails whose invitation could not be created (the workspace still
            was).
          type: array
          items:
            type: string
      required:
        - id
        - name
        - note
        - creditMode
        - limit
        - used
        - remaining
        - exhaustedAt
        - seatCap
        - seatsUsed
        - members
        - invited
        - failedInvitations
    InviteToClientWorkspaceDto:
      type: object
      properties:
        email:
          type: string
          example: ann@example.com
        role:
          type: string
          enum:
            - ADMIN
            - MEMBER
        permissions:
          example:
            - ALLOW_UNIBOX
          description: >-
            MEMBER only: the workspace permissions to grant
            (ALLOW_CONNECT_LINKEDIN_ACCOUNT, ALLOW_LEAD_FINDER,
            ALLOW_LEAD_EXTRACTION, ALLOW_CREATE_CAMPAIGN, ALLOW_UPDATE_CAMPAIGN,
            ALLOW_UNIBOX, ALLOW_MANAGE_MEMBERS, ALLOW_MANAGE_SETTINGS,
            ALLOW_VIEW_PERSONAL_MESSAGES). An ADMIN gets all of them.
          type: array
          items:
            type: string
      required:
        - email
        - role
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'API key for authentication (prefix: sp_live_ or sp_test_)'

````

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