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

# Invite Client

> Invites a client user to the workspace. Sends an invitation email with a magic link. Agency plan required.

<Note>
  **Agency Plan Required** - This endpoint is only available for teams on the Agency plan.
</Note>

## Endpoint

```
POST https://api.kakiyo.com/v1/workspaces/:workspaceId/invite
```

## Path Parameters

| Parameter     | Type   | Required | Description      |
| ------------- | ------ | -------- | ---------------- |
| `workspaceId` | string | Yes      | The workspace ID |

## Request Body

| Field         | Type   | Required | Description                              |
| ------------- | ------ | -------- | ---------------------------------------- |
| `email`       | string | Yes      | Email address of the client to invite    |
| `roles`       | array  | No       | Roles to assign (default: `["member"]`)  |
| `redirectUrl` | string | No       | Custom redirect URL after authentication |

## Response

```json theme={null}
{
  "membershipId": "69724d91001234567890",
  "userId": "69724d91009876543210",
  "email": "john@acmecorp.com",
  "portalUrl": "https://youragency.kakiyo.agency",
  "emailSent": true
}
```

## Example Request

```bash theme={null}
curl -X POST "https://api.kakiyo.com/v1/workspaces/69724d900007cfde1d88/invite" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email": "john@acmecorp.com"}'
```

An invitation email with a magic link is sent to the client. The email is sent from your custom domain if configured, otherwise from `noreply@kakiyo.com`.


## OpenAPI

````yaml POST /workspaces/{id}/invite
openapi: 3.1.0
info:
  title: Kakiyo API
  description: API for automating LinkedIn outreach campaigns with AI-powered conversations
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.kakiyo.com/v1
security:
  - bearerAuth: []
paths:
  /workspaces/{id}/invite:
    post:
      tags:
        - Workspaces
      summary: Invite Client
      description: >-
        Invites a client user to the workspace. Sends an invitation email with a
        magic link. Agency plan required.
      operationId: inviteClient
      parameters:
        - name: id
          in: path
          required: true
          description: Workspace ID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
              properties:
                email:
                  type: string
                  format: email
                  description: Email address of the client to invite
                  example: client@example.com
                roles:
                  type: array
                  items:
                    type: string
                  default:
                    - member
                  description: Roles to assign to the client
                  example:
                    - member
                redirectUrl:
                  type: string
                  description: Custom redirect URL after authentication
                  example: https://portal.youragency.com
      responses:
        '201':
          description: Client invited successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  membershipId:
                    type: string
                    example: membership_abc123
                  userId:
                    type: string
                    example: user_xyz789
                  email:
                    type: string
                    example: client@example.com
                  portalUrl:
                    type: string
                    example: https://youragency.kakiyo.agency
                  emailSent:
                    type: boolean
                    example: true
        '400':
          description: Invalid email address
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Workspace not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Client already a member
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          example: validation_error
        message:
          type: string
          example: The request parameters failed validation
        details:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
                example: name
              message:
                type: string
                example: The name field is required
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````