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

# Create Invitation

> Create an invitation link for the given workspace.

The plaintext ``token`` is returned exactly once in the response.
The caller delivers it however they want (link, email, Slack).



## OpenAPI

````yaml /api-reference/openapi.json post /v1/workspaces/{workspace_id}/invitations
openapi: 3.1.0
info:
  description: >-
    Modular and extensible framework for building AI agents. This API requires
    JWT Bearer token authentication for most endpoints. Include your JWT token
    in the Authorization header. Public endpoints include /, /health, /docs,
    /redoc, and /openapi.json.
  title: AgentArea API
  version: 0.1.0
servers: []
security:
  - bearer: []
paths:
  /v1/workspaces/{workspace_id}/invitations:
    post:
      tags:
        - v1
        - protected
        - workspace-invitations
      summary: Create Invitation
      description: |-
        Create an invitation link for the given workspace.

        The plaintext ``token`` is returned exactly once in the response.
        The caller delivers it however they want (link, email, Slack).
      operationId: create_invitation_v1_workspaces__workspace_id__invitations_post
      parameters:
        - in: path
          name: workspace_id
          required: true
          schema:
            title: Workspace Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateInvitationBody'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvitationCreatedResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    CreateInvitationBody:
      properties:
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        expires_in_days:
          anyOf:
            - type: integer
            - type: 'null'
          title: Expires In Days
      title: CreateInvitationBody
      type: object
    InvitationCreatedResponse:
      description: Same as InvitationResponse plus the plaintext token, returned ONCE.
      properties:
        accepted_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Accepted At
        accepted_by_user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Accepted By User Id
        created_at:
          title: Created At
          type: string
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        expires_at:
          title: Expires At
          type: string
        id:
          format: uuid
          title: Id
          type: string
        invited_by:
          title: Invited By
          type: string
        status:
          title: Status
          type: string
        token:
          title: Token
          type: string
        workspace_id:
          title: Workspace Id
          type: string
      required:
        - id
        - workspace_id
        - email
        - invited_by
        - status
        - expires_at
        - accepted_at
        - accepted_by_user_id
        - created_at
        - token
      title: InvitationCreatedResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    bearer:
      bearerFormat: JWT
      description: JWT Bearer token for authentication
      scheme: bearer
      type: http
    HTTPBearer:
      scheme: bearer
      type: http

````