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

# Invite someone to the workspace

> Email an invitation to join the workspace as a Creator (`member`) or Collaborator, optionally into teams. Admins and guests can't be invited through the API. Requires the Invite members scope. Returns 400 when the person is already a member or already has a pending invitation (so a retried call never sends a second email), when the workspace restricts email domains and this one isn't allowed, or when `teams` is set but team settings are off; 403 when the workspace has no free seats.



## OpenAPI

````yaml /api-reference/workspace-api.json post /workspaceapi/invites
openapi: 3.1.0
info:
  title: Abundly Workspace API
  description: >-
    Workspace-level and per-agent data and administration. GET endpoints need a
    workspace API key (wk_) with the Workspace read API scope; POST, PUT, PATCH
    and DELETE endpoints need the Workspace write API scope, except sending and
    revoking invitations (POST and DELETE /workspaceapi/invites), which need the
    Invite members scope instead. The write endpoints mirror the Workspace
    Manager capability. Most are batch operations: ids travel in the JSON body,
    each id gets its own result, and per-id failures still return HTTP 200. The
    team endpoints (create, rename, members) act on a single team or membership
    and answer with standard status codes instead.


    Restricted and personal agents (`isPrivate`) are listed by
    /workspaceapi/agents but return 403 on every per-agent GET except
    promotion-requests, so enumerate from
    /workspaceapi/agents?includeOverview=true rather than iterating agent ids.
    Write endpoints can target restricted and personal agents.
  version: 1.0.0
servers:
  - url: https://service.abundly.ai
    description: Shared platform
  - url: https://{tenant}.service.abundly.ai
    description: Dedicated deployment
    variables:
      tenant:
        default: your-tenant
security:
  - workspaceApiKey: []
paths:
  /workspaceapi/invites:
    post:
      summary: Invite someone to the workspace
      description: >-
        Email an invitation to join the workspace as a Creator (`member`) or
        Collaborator, optionally into teams. Admins and guests can't be invited
        through the API. Requires the Invite members scope. Returns 400 when the
        person is already a member or already has a pending invitation (so a
        retried call never sends a second email), when the workspace restricts
        email domains and this one isn't allowed, or when `teams` is set but
        team settings are off; 403 when the workspace has no free seats.
      operationId: post-invites
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  description: Email address to invite.
                  type: string
                  format: email
                  pattern: >-
                    ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                role:
                  description: >-
                    Workspace role on joining. "member" is shown as Creator in
                    the product.
                  type: string
                  enum:
                    - member
                    - collaborator
                teams:
                  description: Teams the invitee joins on accepting.
                  type: array
                  items:
                    type: object
                    properties:
                      teamId:
                        description: Team id.
                        type: string
                      role:
                        description: Team role.
                        type: string
                        enum:
                          - admin
                          - member
                          - guest
                    required:
                      - teamId
                      - role
                expiresInDays:
                  description: Days until the invitation expires. Defaults to 7.
                  type: integer
                  minimum: 1
                  maximum: 90
              required:
                - email
                - role
      responses:
        '201':
          description: Invitation created and emailed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  type:
                    type: string
                  email:
                    type: string
                  customerId:
                    type: string
                  customerName:
                    type: string
                  customerRole:
                    description: The role the invitee gets on accepting.
                    type: string
                  status:
                    description: '"pending" or "expired" — only those two are listed.'
                    type: string
                  createdAt:
                    description: ISO 8601 timestamp.
                    type: string
                  expiresAt:
                    description: ISO 8601 timestamp.
                    type: string
                  isExpired:
                    type: boolean
                  invitedByUserName:
                    type: string
                  displayName:
                    type: string
                  groups:
                    type: array
                    items:
                      type: object
                      properties:
                        groupId:
                          type: string
                        role:
                          type: string
                      required:
                        - groupId
                        - role
                      additionalProperties: {}
                  agentAccess:
                    description: >-
                      Set on guest invitations created from an agent's access
                      page.
                    type: object
                    properties:
                      agentId:
                        type: string
                      level:
                        type: string
                    required:
                      - agentId
                      - level
                    additionalProperties: {}
                required:
                  - id
                  - type
                  - email
                  - customerId
                  - status
                  - createdAt
                  - expiresAt
                additionalProperties: {}
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
components:
  responses:
    Error:
      description: >-
        Error. Every failure on this API returns JSON with a single `error`
        field.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                description: >-
                  Human-readable message. Every error on this API uses this
                  shape.
                type: string
            required:
              - error
            additionalProperties: false
  securitySchemes:
    workspaceApiKey:
      type: http
      scheme: bearer
      description: >-
        Workspace API key (wk_). GET endpoints require the Workspace read API
        scope, POST, PUT, PATCH and DELETE endpoints the Workspace write API
        scope, and sending or revoking invitations (POST and DELETE
        /workspaceapi/invites) the Invite members scope. A key stops working
        when it expires or is disabled.

````

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