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

# Invite a user to a project by email

> Invite someone to a project by email, whatever their organization status.

Unlike ``POST /{project_id}/members``, the invitee need not already belong to
the organization: an unregistered email is invited, and a non-member is granted
``Member``. An existing member keeps the organization role they already hold.

Requires ``role:assign``, not merely ``project:manage_members`` — minting an
organization membership is an org-level grant however project-shaped the
request looks.

Returns
-------
AddUserByEmailResult
    The invitee's user id, and ``invite_sent`` — ``False`` when the address
    already belonged to a registered account, so no email was dispatched.



## OpenAPI

````yaml https://api.ionworks.com/openapi.json post /projects/{project_id}/invites
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.ionworks.com
    description: Production
security: []
paths:
  /projects/{project_id}/invites:
    post:
      summary: Invite a user to a project by email
      description: >-
        Invite someone to a project by email, whatever their organization
        status.


        Unlike ``POST /{project_id}/members``, the invitee need not already
        belong to

        the organization: an unregistered email is invited, and a non-member is
        granted

        ``Member``. An existing member keeps the organization role they already
        hold.


        Requires ``role:assign``, not merely ``project:manage_members`` —
        minting an

        organization membership is an org-level grant however project-shaped the

        request looks.


        Returns

        -------

        AddUserByEmailResult
            The invitee's user id, and ``invite_sent`` — ``False`` when the address
            already belonged to a registered account, so no email was dispatched.
      operationId: invite_project_member_projects__project_id__invites_post
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            title: Project Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InviteProjectMemberBody'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddUserByEmailResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    InviteProjectMemberBody:
      properties:
        email:
          type: string
          title: Email
          description: Email address of the person to invite.
        project_role_id:
          type: string
          title: Project Role Id
          description: ID of the project role to assign.
      type: object
      required:
        - email
        - project_role_id
      title: InviteProjectMemberBody
    AddUserByEmailResult:
      properties:
        user_id:
          type: string
          title: User Id
          description: ID of the (invited or pre-existing) user that was added.
        invite_sent:
          type: boolean
          title: Invite Sent
          description: >-
            True when the email was not registered yet and an invitation email
            was dispatched. False when the email already belonged to a
            registered user, in which case the existing account was linked and
            no email was sent.
      type: object
      required:
        - user_id
        - invite_sent
      title: AddUserByEmailResult
      description: |-
        Result of adding a user to an organization by email.

        Returned by the service and used verbatim as the route's response model.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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

````