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

# Invite or update a user

> Sends an invitation to a user to join the organization. If the user is already a member, updates their role to the specified value. If the user has a pending invite, returns the current status without changes. If the organization has reached its seat limit, returns status "error" with a descriptive error message.



## OpenAPI

````yaml https://api.factory.ai/api/v0/openapi.json post /api/v0/organization/users/invite
openapi: 3.0.1
info:
  title: Factory Public API
  description: >-
    Public API for Factory platform. Requires authentication via the
    `Authorization: Bearer` header.
  version: 0.1.0
servers:
  - url: https://api.factory.ai/
    description: Production
security:
  - BearerAuth: []
paths:
  /api/v0/organization/users/invite:
    post:
      tags:
        - Organization
      summary: Invite or update a user
      description: >-
        Sends an invitation to a user to join the organization. If the user is
        already a member, updates their role to the specified value. If the user
        has a pending invite, returns the current status without changes. If the
        organization has reached its seat limit, returns status "error" with a
        descriptive error message.
      operationId: inviteUser
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InviteUserRequestBody'
      responses:
        '200':
          description: Response for status 200
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InviteUser200ResponseBody'
        '400':
          description: Response for status 400
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InviteUser400ResponseBody'
        '401':
          description: Response for status 401
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InviteUser401ResponseBody'
        '403':
          description: Response for status 403
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InviteUser403ResponseBody'
        '409':
          description: Response for status 409
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InviteUser409ResponseBody'
        '500':
          description: Response for status 500
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InviteUser500ResponseBody'
components:
  schemas:
    InviteUserRequestBody:
      type: object
      properties:
        email:
          type: string
          format: email
          description: Email address to invite
        role:
          type: string
          enum:
            - user
            - manager
            - owner
          default: user
          description: Role to assign (defaults to user)
      required:
        - email
      additionalProperties: false
    InviteUser200ResponseBody:
      type: object
      properties:
        email:
          type: string
          format: email
          description: Invited email address
        role:
          type: string
          enum:
            - user
            - manager
            - owner
          description: Assigned role
        status:
          type: string
          enum:
            - invited
            - already_member
            - role_updated
            - already_invited
            - error
          description: Result of the invite operation
        error:
          type: string
          description: Error message if status is error
      required:
        - email
        - role
        - status
      additionalProperties: false
    InviteUser400ResponseBody:
      type: object
      properties:
        detail:
          type: string
          description: Human-readable error message
        status:
          type: number
          description: HTTP status code
        title:
          type: string
          description: HTTP status title
        metadata:
          type: object
          additionalProperties: {}
          description: Additional error metadata
      required:
        - detail
        - status
        - title
      additionalProperties: false
    InviteUser401ResponseBody:
      type: object
      properties:
        detail:
          type: string
          description: Human-readable error message
        status:
          type: number
          description: HTTP status code
        title:
          type: string
          description: HTTP status title
        metadata:
          type: object
          additionalProperties: {}
          description: Additional error metadata
      required:
        - detail
        - status
        - title
      additionalProperties: false
    InviteUser403ResponseBody:
      type: object
      properties:
        detail:
          type: string
          description: Human-readable error message
        status:
          type: number
          description: HTTP status code
        title:
          type: string
          description: HTTP status title
        metadata:
          type: object
          additionalProperties: {}
          description: Additional error metadata
      required:
        - detail
        - status
        - title
      additionalProperties: false
    InviteUser409ResponseBody:
      type: object
      properties:
        detail:
          type: string
          description: Human-readable error message
        status:
          type: number
          description: HTTP status code
        title:
          type: string
          description: HTTP status title
        metadata:
          type: object
          additionalProperties: {}
          description: Additional error metadata
      required:
        - detail
        - status
        - title
      additionalProperties: false
    InviteUser500ResponseBody:
      type: object
      properties:
        detail:
          type: string
          description: Human-readable error message
        status:
          type: number
          description: HTTP status code
        title:
          type: string
          description: HTTP status title
        metadata:
          type: object
          additionalProperties: {}
          description: Additional error metadata
      required:
        - detail
        - status
        - title
      additionalProperties: false
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Factory API key or JWT token for authentication

````