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

# Invite an organization member

> Sends a WorkOS invitation to join the active organization. Requires an AuthKit session and the **admin** role.



## OpenAPI

````yaml https://api.twinbay.ai/openapi.json post /organizations/current/invitations
openapi: 3.1.0
info:
  title: Twinbay
  description: Backend API
  version: 0.1.0
servers:
  - url: https://api.twinbay.ai
    description: Production
security: []
tags:
  - name: healthchecks
    description: Healthcheck endpoints
  - name: users
    description: >-
      The current user. Sign-up and sign-in happen in WorkOS AuthKit, which
      issues the access tokens this API accepts.
  - name: organizations
    description: >-
      Organizations the caller belongs to. Every authenticated request acts
      inside exactly one organization — the one its access token names — so
      these routes address it as `current`.
  - name: billing
    description: >-
      The active organization's plan, its limits, and what the current period
      has cost so far.
  - name: api-keys
    description: >-
      Long-lived credentials for callers that cannot hold an AuthKit session —
      agents, SDKs, CI. A key is accepted wherever an access token is, and acts
      with the role its creator holds when the request arrives.
  - name: environments
    description: >-
      Create and edit isolated provider environments. Each environment contains
      behavioural twins from the `twins` package.
  - name: twins
    description: Manage provisioned twins by their IDs.
  - name: catalog
    description: Browse the digital twins available for new environments.
  - name: scenarios
    description: Reusable starting setups of provider twins and optional seeds.
  - name: seeds
    description: >-
      Starting states for a twin. Describe the data you want in your own words,
      and a worker expands it into rows once; pass the seed's id when you create
      an environment to start a twin holding it.
  - name: tests
    description: >-
      Outcomes described in natural language, compiled once into request
      matchers, and evaluated deterministically against the traffic an attempt
      was served.
paths:
  /organizations/current/invitations:
    post:
      tags:
        - organizations
      summary: Invite an organization member
      description: >-
        Sends a WorkOS invitation to join the active organization. Requires an
        AuthKit session and the **admin** role.
      operationId: invite_current_organization_member
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateInvitationRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvitationResponse'
        '401':
          description: The credential is missing, malformed, expired, or not trusted
        '403':
          description: The caller is not an admin or used an API key
        '409':
          description: The email is already a member or has a pending invitation
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '502':
          description: WorkOS could not create the invitation
      security:
        - Access token: []
components:
  schemas:
    CreateInvitationRequest:
      properties:
        email:
          type: string
          format: email
          title: Email
        role:
          $ref: '#/components/schemas/OrganizationRole'
      additionalProperties: false
      type: object
      required:
        - email
        - role
      title: CreateInvitationRequest
    InvitationResponse:
      properties:
        id:
          type: string
          title: Id
          description: WorkOS invitation id
        email:
          type: string
          format: email
          title: Email
        role:
          $ref: '#/components/schemas/OrganizationRole'
        state:
          type: string
          const: pending
          title: State
        created_at:
          type: string
          format: date-time
          title: Created At
        expires_at:
          type: string
          format: date-time
          title: Expires At
      type: object
      required:
        - id
        - email
        - role
        - state
        - created_at
        - expires_at
      title: InvitationResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    OrganizationRole:
      type: string
      enum:
        - admin
        - member
      title: OrganizationRole
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    Access token:
      type: http
      description: Access token issued by WorkOS AuthKit.
      scheme: bearer

````

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