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

# Invite corporate members

> Invite new users to join your corporate account by sending them email invitations (maximum 10 per request). Only corporate admins with appropriate permissions can use this endpoint. (Permitted scopes: **fax:all:edit**, **fax:member:edit**)

<Note>
  You can invite up to 10 users per request. If you need to invite more users, make multiple requests.
</Note>

<RequestExample>
  ```js NodeJS SDK theme={null}
  const axios = require('axios');
  const AccountsApiFp = require('@alohi/faxplus-api').AccountsApiFp;
  const Configuration = require('@alohi/faxplus-api').Configuration;

  const config = new Configuration({
      accessToken: accessToken,
      basePath: 'https://restapi.fax.plus/v3',
      // Header required only when using the OAuth2 token scheme
      baseOptions: {
          headers: {
            "x-fax-clientid": clientId,
          }
      }
  });

  async function inviteMembers() {
      const emails = ["user1@example.com", "user2@example.com"];
      const req = await AccountsApiFp(config).inviteMembers(emails);
      const resp = await req(axios);
  }

  inviteMembers()
  ```

  ```python Python SDK theme={null}
  from faxplus import ApiClient, AccountsApi
  from faxplus.configuration import Configuration

  conf = Configuration()
  conf.access_token = access_token
  # header_name and header_value required only when using the OAuth2 token scheme
  api_client = ApiClient(header_name='x-fax-clientid', header_value=client_id, configuration=conf)
  api = AccountsApi(api_client)

  emails = ["user1@example.com", "user2@example.com"]
  resp = api.invite_members(emails)
  ```

  ```java Java theme={null}
  /**
  * Example below uses Apache HTTP Client 4 with Fluent API
  **/

  String url = "https://restapi.fax.plus/v3/accounts/self/member-invitations";
  String jsonBody = "[\"user1@example.com\", \"user2@example.com\"]";

  String result = Request
      .Post(url)
       // The x-fax-clientid header is required only when using the OAuth2 token scheme
      .addHeader("x-fax-clientid", "YOUR_CLIENT_ID")
      .addHeader("Accept", "'application/json'")
      .addHeader("Content-Type", "'application/json'")
      .addHeader("Authorization", "'Bearer {access-token}'")
      .bodyString(jsonBody, ContentType.APPLICATION_JSON)
      .execute()
      .returnContent().asString();

  System.out.println(result.toString());
  ```

  ```go Go theme={null}
  package main

  import (
         "bytes"
         "net/http"
  )

  func main() {

      headers := map[string][]string{
          // The x-fax-clientid header is required only when using the OAuth2 token scheme
          "Accept": []string{"application/json"},
          "Content-Type": []string{"application/json"},
          "Authorization": []string{"Bearer {access-token}"},
          "x-fax-clientid": []string{"YOUR_CLIENT_ID"}
      }

      jsonBody := []byte(`["user1@example.com", "user2@example.com"]`)
      data := bytes.NewBuffer(jsonBody)
      req, err := http.NewRequest("POST", "https://restapi.fax.plus/v3/accounts/self/member-invitations", data)
      req.Header = headers

      client := &http.Client{}
      resp, err := client.Do(req)
      // ...
  }
  ```

  ```php PHP theme={null}
  <?php

  require 'vendor/autoload.php';

  $headers = array(
      'Accept' => 'application/json',
      'Content-Type' => 'application/json',
      'Authorization' => 'Bearer {access-token}',
      // The x-fax-clientid header is required only when using the OAuth2 token scheme
      'x-fax-clientid' => '{client ID}',
  );

  $client = new GuzzleHttp\Client();

  try {
      $response = $client->request('POST','https://restapi.fax.plus/v3/accounts/self/member-invitations', array(
          'headers' => $headers,
          'json' => ["user1@example.com", "user2@example.com"],
          )
      );
      print_r($response->getBody()->getContents());
   }
   catch (GuzzleHttp\Exception\BadResponseException $e) {
      // handle exception or api errors.
      print_r($e->getMessage());
   }

   // ...
  ```

  ```bash cURL theme={null}
  # You can also use wget
  curl -X POST https://restapi.fax.plus/v3/accounts/self/member-invitations \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer {access-token}' \
    # The x-fax-clientid header is required only when using the OAuth2 token scheme
    -H 'x-fax-clientid: "YOUR_CLIENT_ID"' \
    -d '["user1@example.com", "user2@example.com"]'
  ```
</RequestExample>


## OpenAPI

````yaml post /accounts/self/member-invitations
openapi: 3.0.1
info:
  title: Fax.Plus REST API
  description: >-
    This is the Fax.Plus API v3 developed for third party developers and
    organizations. In order to have a better coding experience with this API,
    let's quickly go through some points:<br /><br /> - This API assumes
    **/accounts** as an entry point with the base url of
    **https://restapi.fax.plus/v3**. <br /><br /> - This API treats all date and
    times sent to it in requests as **UTC**. Also, all dates and times returned
    in responses are in **UTC**<br /><br /> - Once you have an access_token, you
    can easily send a request to the resource server with the base url of
    **https://restapi.fax.plus/v3** to access your permitted resources. As an
    example to get the user's profile info you would send a request to
    **https://restapi.fax.plus/v3/accounts/self** when **Authorization** header
    is set to **Bearer YOUR_ACCESS_TOKEN** and custom header of
    **x-fax-clientid** is set to YOUR_CLIENT_ID
  version: 3.4.0
  contact:
    name: Fax.Plus
    email: info@fax.plus
    url: https://github.com/alohi
servers:
  - url: https://restapi.fax.plus/v3
  - url: /v3
security: []
paths:
  /accounts/self/member-invitations:
    post:
      tags:
        - Accounts
      summary: Invite corporate members
      description: >-
        Invite new users to join your corporate account by sending them email
        invitations (maximum 10 per request). Only corporate admins with
        appropriate permissions can use this endpoint. (Permitted scopes:
        **fax:all:edit**, **fax:member:edit**)
      operationId: inviteMembers
      requestBody:
        description: List of email addresses to invite
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvitationEmails'
            examples:
              single:
                summary: Invite a single user
                value:
                  - newuser@example.com
              multiple:
                summary: Invite multiple users
                value:
                  - user1@example.com
                  - user2@example.com
                  - user3@example.com
      responses:
        '200':
          description: Invitations sent successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Invitations sent successfully
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '409':
          description: One or more emails are already registered
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: user_exists
                  description:
                    type: string
                    example: One or more emails are already registered
                  existing_emails:
                    type: array
                    items:
                      type: string
                    example:
                      - existing@example.com
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - oauth2:
            - all
        - personal_access_token:
            - fax:all:edit
            - fax:member:edit
      x-code-samples:
        - lang: Python
          source: |-
            import faxplus
            from faxplus.rest import ApiException

            # Configure API client
            configuration = faxplus.Configuration(
                access_token='YOUR_ACCESS_TOKEN'
            )

            with faxplus.ApiClient(configuration) as api_client:
                api_client.default_headers['x-fax-clientid'] = 'YOUR_CLIENT_ID'
                api_instance = faxplus.AccountsApi(api_client)
                
                emails = ["user1@example.com", "user2@example.com"]
                
                try:
                    response = api_instance.invite_members(emails)
                    print("Invitations sent successfully")
                except ApiException as e:
                    print(f"Exception: {e}")
        - lang: cURL
          source: >-
            curl -X POST
            'https://restapi.fax.plus/v3/accounts/self/member-invitations' \
              -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
              -H 'x-fax-clientid: YOUR_CLIENT_ID' \
              -H 'Content-Type: application/json' \
              -d '["user1@example.com", "user2@example.com"]'
components:
  schemas:
    InvitationEmails:
      type: array
      items:
        type: string
        format: email
        description: Email address of the user to invite or resend invitation to
        example: user@example.com
      minItems: 1
      maxItems: 10
      description: List of email addresses for invitations (maximum 10 per request)
    Error:
      properties:
        description:
          type: string
        error:
          type: string
      additionalProperties: false
  responses:
    Error:
      description: Error object in case there's a problem with given data
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: invalid_user_id
            description: Invalid user id given
    UnauthorizedError:
      description: Error object in case there's a problem with the authorization
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: unauthorized
            description: >-
              The access token provided is expired, revoked, malformed, or
              invalid for other reasons.
    ForbiddenError:
      description: Error object in case the user is not allowed to access this resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: forbidden
            description: You are not allowed to access this resource.
    ServerError:
      description: Error object in case there's a server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: internal_server_error
            description: An unexpected error happened, please contact support
  securitySchemes:
    oauth2:
      type: oauth2
      description: OAuth2 Authorization Grant
      flows:
        authorizationCode:
          authorizationUrl: >-
            https://accounts.fax.plus/login?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=http://localhost&scope=all
          tokenUrl: https://accounts.fax.plus/token
          refreshUrl: >-
            https://accounts.fax.plus/token?grant_type=refresh_token&refresh_token=YOUR_REFRESH_TOKEN
          scopes:
            all: >-
              for now when a user grants permission, all grants will be
              permitted
    personal_access_token:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Personal Access Token (PAT) is a Bearer token used for secure API calls.
        For direct API calls, the PAT is used in the Authorization header as
        'Bearer {PAT}'. For MCP usage, configure your PAT in your MCP client
        settings (e.g., in your IDE's MCP server configuration) - authentication
        will be handled automatically.

````