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

# Invite new user

> Invite a user to the account.

User will receive an email.
The new user will receive an invitation email with a link to create an account password,
the existing user will be notified about the invitation to the account.



## OpenAPI

````yaml /api-reference/services_documented/iam_api.yaml post /iam/clients/invite_user
openapi: 3.1.0
info:
  title: Gcore OpenAPI – IAM API
  description: >-
    This OpenAPI is an aggregated OpenAPI specification that unifies all Gcore
    products into a single file. It covers Cloud, CDN, DNS, WAAP, DDoS
    Protection, Object Storage, Streaming, and FastEdge services.
  version: '2026-05-07T20:33:46.548242+00:00'
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: Account
    description: >-
      Account management operations including authentication, password
      management, and account details.
    x-displayName: Account
  - name: API Tokens
    description: >-
      Use permanent API tokens for regular automated requests to services.

      You can either set its validity period when creating it or issue a token
      for an unlimited time.

      Please address the API documentation of the specific product in order to
      check if it supports API tokens.


      Newer endpoints under `/v2/…` issue tokens using `_` (underscore) as the
      separator

      (for example `42_a1b2c3d4e5f6...`) and are the recommended way to create
      new tokens.

      Legacy endpoints that issue `$`-separated tokens are marked deprecated and
      will be removed

      on **2026-07-17**; tokens that were already issued keep authenticating.


      Provide your APIKey in the Authorization header.


      Example: ```curl -H "Authorization: APIKey 42_a1b2c3d4e5f6..."
      https://api.gcore.com/iam/users/me```


      Please note: When authorizing via SAML SSO, our system does not have any

      information about permissions given to the user by the identity provider.

      Even if the provider revokes the user's access rights, their tokens remain
      active.

      Therefore, if necessary, the token will need to be deleted manually.
    x-displayName: API Tokens
  - name: Users
    x-displayName: Users
paths:
  /iam/clients/invite_user:
    post:
      tags:
        - Users
      summary: Invite new user
      description: >-
        Invite a user to the account.


        User will receive an email.

        The new user will receive an invitation email with a link to create an
        account password,

        the existing user will be notified about the invitation to the account.
      operationId: iamInviteUser
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InviteUserRequest'
      responses:
        '200':
          $ref: '#/components/responses/InviteUserResponse'
        '400':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InviteUserError'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from gcore import Gcore

            client = Gcore(
                api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
            )
            user_invited = client.iam.users.invite(
                client_id=0,
                email="dev@stainless.com",
                user_role={},
            )
            print(user_invited.user_id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/G-Core/gcore-go\"\n\t\"github.com/G-Core/gcore-go/iam\"\n\t\"github.com/G-Core/gcore-go/option\"\n)\n\nfunc main() {\n\tclient := gcore.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tuserInvited, err := client.Iam.Users.Invite(context.TODO(), iam.UserInviteParams{\n\t\tClientID: 0,\n\t\tEmail:    \"dev@stainless.com\",\n\t\tUserRole: iam.UserGroupParam{},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", userInvited.UserID)\n}\n"
components:
  schemas:
    InviteUserRequest:
      type: object
      properties:
        email:
          type: string
          format: email
          description: User email.
        user_role:
          $ref: '#/components/schemas/Group'
        client_id:
          type: integer
          description: ID of account.
        lang:
          $ref: '#/components/schemas/Language'
        name:
          type: string
          description: User name.
      required:
        - email
        - user_role
        - client_id
    InviteUserError:
      oneOf:
        - allOf:
            - $ref: '#/components/schemas/ValidationError'
            - example:
                errors:
                  email:
                    - This field is required
        - title: User has already been invited
          description: >-
            The specified user has already been invited to the specified
            account.
          type: array
          items:
            type: string
            enum:
              - User {user ID} has already been invited to client {account ID}
        - title: User cannot be added
          description: The specified user cannot be added to the specified account.
          type: array
          items:
            type: string
            enum:
              - This user cannot be added to this client.
    Group:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: >-
            Group's ID: Possible values are:   


            - 1 - Administrators* 2 - Users* 5 - Engineers* 3009 - Purge and
            Prefetch only (API+Web)* 3022 - Purge and Prefetch only (API)
        name:
          type: string
          example: Administrators
          description: Group's name.
          enum:
            - Users
            - Administrators
            - Engineers
            - Purge and Prefetch only (API)
            - Purge and Prefetch only (API+Web)
    Language:
      type: string
      description: |-
        User's language.

        Defines language of the control panel and email messages.
      enum:
        - de
        - en
        - ru
        - zh
        - az
    InviteUserResponseSchema:
      type: object
      required:
        - status
        - user_id
      properties:
        status:
          type: string
          description: Status of the invitation.
        user_id:
          type: integer
          description: Invited user ID.
    ValidationError:
      title: Validation error
      type: object
      properties:
        errors:
          type: object
          description: This object contains error descriptions per field from your request.
          additionalProperties:
            type: array
            description: Error list for specific field.
            items:
              type: string
              description: Error description
  responses:
    '401':
      description: >-
        Authentication credentials were not provided or given token not valid
        for any token type.
    '403':
      description: You do not have permission to perform this action.
    InviteUserResponse:
      description: OK.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InviteUserResponseSchema'
          example:
            status: sent
            user_id: 19449
  securitySchemes:
    APIKey:
      description: >-
        API key for authentication. Make sure to include the word `apikey`,
        followed by a single space and then your token.

        Example: `apikey 1234$abcdef`
      type: apiKey
      in: header
      name: Authorization

````