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

# Invite Member

This invites a new member to your platform, when they are created they will have the status of `invited`, if their email already has an associated Onsi account their status will go straight to `active`.

#### Relevant Error Codes

If there are any issues with the member add, the API will return a `400` status code with the following error codes:

* [MemberAlreadyInvited](/api-reference/error-handling#memberalreadyinvited) a member with this email is currently active or invited.
* [InvalidAddMemberPayload](/api-reference/error-handling#invalidaddmemberpayload) for any other add member payload issues.


## OpenAPI

````yaml POST /v1/members
openapi: 3.0.2
info:
  title: BMO Partner API
  version: v1
servers:
  - url: https://api.onsi.com
    description: Production
  - url: https://api.onsi.dev
    description: Sandbox
security:
  - apiKey: []
paths:
  /v1/members:
    post:
      tags:
        - members
      operationId: inviteMember
      parameters:
        - name: x-idempotency-key
          in: header
          description: Unique key to ensure idempotency of the request
          schema:
            type: string
      requestBody:
        description: Body
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  example: jane-smith@onsi.com
                  description: A unique email address for the member
                  type: string
                  format: email
                  pattern: >-
                    ^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$
                firstName:
                  example: John
                  type: string
                lastName:
                  example: Smith
                  type: string
                phone:
                  example: '+447123456789'
                  description: An optional phone number for the member
                  type: string
                workerId:
                  example: ID_123
                  description: >-
                    Unique ID provided by API consumer, must be unique across
                    all members (active, invited and inactive)
                  type: string
                tier:
                  example: Gold
                  description: Tier name for the member
                  type: string
                accountDetails:
                  anyOf:
                    - anyOf:
                        - title: BankAccountUK
                          example:
                            accountHolder: John Smith
                            sortCode: '123456'
                            accountNumber: '12345678'
                          description: A UK bank account
                          type: object
                          properties:
                            accountHolder:
                              type: string
                            sortCode:
                              type: string
                            accountNumber:
                              type: string
                          required:
                            - accountHolder
                            - sortCode
                            - accountNumber
                          additionalProperties: false
                        - title: BankAccountEU
                          example:
                            accountHolder: John Smith
                            iban: GB29NWBK60161331926819
                          description: A EU bank account
                          type: object
                          properties:
                            accountHolder:
                              type: string
                            iban:
                              type: string
                          required:
                            - accountHolder
                            - iban
                          additionalProperties: false
                      nullable: true
                enablePayroll:
                  type: boolean
                dob:
                  example: '1990-01-01'
                  description: Date of birth of the member, must later than 1900
                  type: string
                  pattern: ^\d{4}-\d{2}-\d{2}$
                gender:
                  anyOf:
                    - description: Gender of the member
                      type: string
                      enum:
                        - Female
                        - Male
                        - NonBinary
                      nullable: true
              required:
                - email
                - firstName
                - lastName
                - tier
              additionalProperties: false
      responses:
        '201':
          description: A member on the platform.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Member'
components:
  schemas:
    Member:
      title: Member
      description: A member on the platform.
      type: object
      properties:
        email:
          type: string
          format: email
          pattern: >-
            ^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$
        memberId:
          example: mem_q5sdae3se6eg9m9dcvug
          description: Onsi's ID of the member
          type: string
        firstName:
          example: John
          type: string
        lastName:
          example: Smith
          type: string
        phone:
          example: '+447123456789'
          anyOf:
            - type: string
              nullable: true
        tier:
          example: Gold
          description: Tier name for the member
          type: string
        workerId:
          anyOf:
            - example: ID_123
              description: >-
                Unique ID provided by API consumer, must be unique across all
                members (active, invited and inactive)
              type: string
              nullable: true
        status:
          description: The status of the member.
          type: string
          enum:
            - active
            - invited
            - inactive
        accountDetails:
          anyOf:
            - anyOf:
                - $ref: '#/components/schemas/BankAccountUK'
                - $ref: '#/components/schemas/BankAccountEU'
              nullable: true
        enablePayroll:
          example: true
          type: boolean
        gender:
          anyOf:
            - description: Gender of the member
              type: string
              enum:
                - Female
                - Male
                - NonBinary
              nullable: true
        dob:
          example: '1990-01-01'
          description: Date of birth of the member, must later than 1900
          anyOf:
            - description: Date in ISO8601 `YYYY-MM-DD` format
              type: string
              pattern: ^\d{4}-\d{2}-\d{2}$
              nullable: true
      required:
        - email
        - memberId
        - firstName
        - lastName
        - phone
        - tier
        - workerId
        - status
        - accountDetails
        - enablePayroll
        - dob
      additionalProperties: false
    BankAccountUK:
      title: BankAccountUK
      example:
        accountHolder: John Smith
        sortCode: '123456'
        accountNumber: '12345678'
      description: A UK bank account
      type: object
      properties:
        accountHolder:
          type: string
        sortCode:
          type: string
        accountNumber:
          type: string
      required:
        - accountHolder
        - sortCode
        - accountNumber
      additionalProperties: false
    BankAccountEU:
      title: BankAccountEU
      example:
        accountHolder: John Smith
        iban: GB29NWBK60161331926819
      description: A EU bank account
      type: object
      properties:
        accountHolder:
          type: string
        iban:
          type: string
      required:
        - accountHolder
        - iban
      additionalProperties: false
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````