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

# Invite member to organization

> Sends an invitation to the specified user to join the organization with the chosen role.




## OpenAPI

````yaml post /organizations/{org_id}/invites
openapi: 3.0.3
info:
  title: Diversion Core API
  description: >-
    Definition of the Core API used to access low-level functionality of
    Diversion
  version: 0.2.0
servers:
  - url: https://api.diversion.dev/v0
    description: Base endpoint
security: []
paths:
  /organizations/{org_id}/invites:
    parameters:
      - $ref: '#/components/parameters/OrgParam'
    post:
      tags:
        - Organization Management
      summary: Invite member to organization
      description: >
        Sends an invitation to the specified user to join the organization with
        the chosen role.
      operationId: src.handlersv2.organization.invite_member
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrganizationInviteRequest'
      responses:
        '201':
          description: Invitation sent successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '409':
          description: User is already a member
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
      security:
        - OAuth2:
            - coreapi/write
components:
  parameters:
    OrgParam:
      in: path
      name: org_id
      schema:
        type: string
      required: true
      description: An ID of an organization
  schemas:
    OrganizationInviteRequest:
      type: object
      properties:
        email:
          type: string
          format: email
        role:
          $ref: '#/components/schemas/AccessMode'
      required:
        - email
        - role
    Error:
      type: object
      properties:
        status:
          type: integer
          description: HTTP status code
        detail:
          type: string
        title:
          type: string
        type:
          type: string
      required:
        - status
        - detail
    AccessMode:
      type: string
      enum:
        - READ
        - WRITE
        - ADMIN
        - OWNER
    NewResourceId:
      type: object
      properties:
        id:
          type: string
          description: The id of the newly created resource
          example: example_id
        read_only:
          type: boolean
      required:
        - id
  responses:
    Created:
      description: Resource created
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NewResourceId'
    BadRequest:
      description: The request does not meet the required conditions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error:
      description: An error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    OAuth2:
      type: oauth2
      x-tokenInfoFunc: src.token_info.token_auth
      description: This API uses OAuth 2 with the implicit grant flow
      flows:
        implicit:
          authorizationUrl: https://auth.diversion.dev/oauth2/authorize
          scopes:
            coreapi/read: Operations with no possible side-effects
            coreapi/write: Modifying operations
            coreapi/admin: >-
              Organizational operations like adding a repo or changing repo
              properties

````