---
metadata:
  - name: generator
    content: Diplodoc Platform v5.57.3
alternate:
  - https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/invite.md
  - https://sourcecraft.dev/portal/docs/ru/sourcecraft/operations/invite.md
  - href: en/sourcecraft/operations/invite.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://sourcecraft.dev/portal/docs/en/llms.txt

<!-- source: en/_includes/sourcecraft/security-invite.md -->
# Sending and accepting an invitation to a SourceCraft organization

## Sending an invitation {#send-invite}

{% note warning %}

You need at least the [Organization admin](https://sourcecraft.dev/portal/docs/en/sourcecraft/security/index.md#organization-manager-admin) role to send an invitation to an organization.

{% endnote %}

You can invite a user with a [Yandex account](https://id.yandex.com) to a SourceCraft [organization](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/index.md#org).

{% note tip %}

<!-- source: en/_includes/sourcecraft/federations-note.md -->
To authorize corporate accounts in SourceCraft using single sign-on (SSO), you can use Yandex Cloud [SAML-compatiable identity federations](https://yandex.cloud/en/docs/organization/concepts/add-federation).
<!-- endsource: en/_includes/sourcecraft/federations-note.md -->

{% endnote %}

1. Open the SourceCraft [home page](https://sourcecraft.dev).
1. On the ![image](../../_assets/console-icons/house.svg) **Home** tab, navigate to ![image](../../_assets/console-icons/briefcase.svg) **Organizations**.
1. Select the organization you want to invite a user to.
1. On the organization page, under ![image](../../_assets/console-icons/person-nut-hex.svg) **People**, go to the ![image](../../_assets/console-icons/person.svg) **Members & roles** section.
1. In the top-right corner, click **New member**.
1. In the window that opens, select the invitation principle:

    {% list tabs group=invite-type %}

    - Login {#login}

      1. In the **Users to invite** field, start typing the public name, e.g., `John Smith`, or nickname, e.g., `ivanov-2000`, and select one of the suggested options. You can add multiple users.
      1. Optionally, assign a [role](https://sourcecraft.dev/portal/docs/en/sourcecraft/security/index.md#roles-list) to the users you invite:
         1. Click ![image](../../_assets/console-icons/plus.svg) **Add role**.
         1. Select the [role](https://sourcecraft.dev/portal/docs/en/sourcecraft/security/index.md#roles-list) you need from the **Role** drop-down list.
      1. In the **Invite Expires In** drop-down list, select how long the invitation to the organization will remain valid.
      1. Click **Invite to organization**.

      <!-- source: en/_includes/sourcecraft/user-gets-mail-invite.md -->
      The user will receive an email invitation to join your organization. They can do so using the link in the email. 

      {% note info %}

      Registered users will also see the invitation on the SourceCraft [home page](https://sourcecraft.dev).

      {% endnote %}
      <!-- endsource: en/_includes/sourcecraft/user-gets-mail-invite.md -->

    - E-mail {#e-mail}

      1. In the **People to invite** field, enter the user's email address and click **Add email**. You can add multiple emails.
      1. Optionally, assign a [role](https://sourcecraft.dev/portal/docs/en/sourcecraft/security/index.md#roles-list) to the users you are inviting:
         1. Click ![image](../../_assets/console-icons/plus.svg) **Add role**.
         1. Select the [role](https://sourcecraft.dev/portal/docs/en/sourcecraft/security/index.md#roles-list) you need from the **Role** drop-down list.
      1. In the **Invite Expires In** drop-down list, select how long the invitation to the organization will remain valid.
      1. Click **Invite to organization**.

      <!-- source: en/_includes/sourcecraft/user-gets-mail-invite.md -->
      The user will receive an email invitation to join your organization. They can do so using the link in the email. 

      {% note info %}

      Registered users will also see the invitation on the SourceCraft [home page](https://sourcecraft.dev).

      {% endnote %}
      <!-- endsource: en/_includes/sourcecraft/user-gets-mail-invite.md -->

    - Link {#link}

      <!-- source: en/_includes/sourcecraft/link-invite-intro.md -->
      You can generate unique _invitation links_ for ad-hoc users. Each link has its own expiration date and can only be used once. 

      This is useful if you do not know the logins or emails of your users or want to automate role assignment and repository access management.

      A user accepts the invitation by clicking the link and gets access to your organization and its repositories.
      <!-- endsource: en/_includes/sourcecraft/link-invite-intro.md -->
      
      To generate invitation links:
      1. Optionally, assign a [role](https://sourcecraft.dev/portal/docs/en/sourcecraft/security/index.md#roles-list) to the user you are inviting:
         1. Click ![image](../../_assets/console-icons/plus.svg) **Add role**.
         1. Select the [role](https://sourcecraft.dev/portal/docs/en/sourcecraft/security/index.md#roles-list) you need from the **Role** drop-down list.
      1. In the **Invite Expires In** drop-down list, select how long the link will remain valid.
      1. In the **Quantity** field, specify the number of unique invitation links.
      1. In the **Prefix** field, specify a prefix for the invitation links, e.g., `team-sourcecraft`.
      1. Click **Invite to organization**. 
      1. In the window that opens, copy the links to the clipboard or download them as a file, then close the window.

          {% note warning %}

          After closing the window, the links you generated will no longer be available. However, you can create new ones.

          {% endnote %}

      1. Send the invitation links to the users.

    - Multi-use link {#multi-link}

      You can generate a single _multi-use link_ that allows one or more users to join the organization. You can create a multi-use link either for specific users or for anyone with the link.

      <!-- source: en/_includes/sourcecraft/multi-link-sa.md -->
      Multi-invite links are managed via a Yandex Identity and Access Management [service account](https://yandex.cloud/en/docs/iam/concepts/users/service-accounts) with the `organization-manager.passportUserAdmin` [role](https://yandex.cloud/en/docs/iam/roles-reference#organization-manager-passportUserAdmin). You can select an existing service account or create a new one.
      <!-- endsource: en/_includes/sourcecraft/multi-link-sa.md -->

      To generate a multi-use link:
      1. In the **Invite Expires In** drop-down list, select how long the multi-use link will remain valid.
      1. Optionally, in the **Invitee limit** field, specify the maximum number of users who can accept this multi-use link. For an unlimited number of users, leave this field empty.
      1. Optionally, in the **Unique invite link name** field, enter a unique name for the multi-use link. Leave this field empty to generate a name automatically.
      1. Optionally, assign a [role](https://sourcecraft.dev/portal/docs/en/sourcecraft/security/index.md#roles-list) to the users you are inviting:
         1. Click ![image](../../_assets/console-icons/plus.svg) **Add role**.
         1. Select the role you need from the **Role** drop-down list.
      1. Under **Can accept**, select an invitation limit:
          * **Everyone**: Any user can accept the invitation.
          * **Specific users**: Only specific users can accept the invitation:
            * **SourceCraft users** (optional): Start typing the public name, e.g., `John Smith`, or nickname, e.g., `jsmith-2000`, and select one of the suggested options. You can add multiple users.
            * **Yandex logins** (optional): Enter a user login and click **Add login**. You can add multiple users.
      1. Under **Service account**, select one of the following options:
          * **Auto**: Yandex Cloud will automatically create a new service account with the `organization-manager.passportUserAdmin` [role](https://yandex.cloud/en/docs/iam/roles-reference#organization-manager-passportUserAdmin).
          * **Choose existing**: Select a Yandex Identity and Access Management [service account](https://yandex.cloud/en/docs/iam/concepts/users/service-accounts) to use for creating invites.
      1. Click **Invite to organization**.
      1. In the window that opens, copy the multi-use link to the clipboard, then close the window.

          {% note warning %}

          After you close the window, the multi-use link you generated will no longer be available. However, you can create a new one.

          {% endnote %}

      1. Send your multi-use link to the users.

    {% endlist %}

## Accepting an invitation {#accept-invite}

{% list tabs %}

- Registered user

  1. Perform these actions depending on the invitation method:
      * **Email from SourceCraft**: Open it and click **Open invitation**.
      * **Link**: Follow the link.
  1. To view info about the organization you have been invited to, click **View organization** on the page that opens.
  1. To accept the invitation, click **Join organization**.

- New user

  1. Perform these actions depending on the invitation method:
      * **Email from SourceCraft**: Open it and click **Accept invitation**.
      * **Link**: Follow the link.
  1. On the page that opens, click **Accept**.
  1. Log in with your [Yandex ID](https://id.yandex.com/).

      If you do not have a Yandex ID yet, [sign up](https://yandex.com/support/id/en/authorization/registration.html).

      If using your social network profile to log in to Yandex, [create a username and password](https://passport.yandex.com/passport?mode=postregistration&create_login=1).
  1. Select an account to join the organization with and confirm your selection.
  1. [Complete](https://sourcecraft.dev/portal/docs/en/sourcecraft/security/registration.md) your registration.

{% endlist %}

## Working with invitations via the API {#api}

You can use the [SourceCraft REST API](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/api-start.md) to automate your invitation management routine.

For example, you can integrate the process of issuing invitations into your website or access management system.

For more information, see [Organization | Invites](https://api.sourcecraft.tech/docs/index.html#tag/Organization-or-Invites).

{% note warning %}

You can authenticate in the SourceCraft API to work with invitations only using an [IAM token](https://yandex.cloud/en/docs/iam/concepts/authorization/iam-token) from Yandex Identity and Access Management. For more information, see [Getting an IAM token](https://yandex.cloud/en/docs/iam/operations/iam-token/create).

{% endnote %}

### Creating an invitation to an organization via the API {#api-create-invite}

```bash
export IAM_TOKEN=<IAM_token>
curl \
  --request POST \
  --url "https://api.sourcecraft.tech/orgs/<organization_slug>/invites" \
  --header "Authorization: Bearer $IAM_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
    "invitees": [
      {
        "email": "<user_email>"
      },
      {
        "slug": "<user_1_slug>"
      },
      {
        "alias": "<text_record_for identification>"
      },
      {
        "slug": "<user_2_slug>"
      }
    ],
    "ttl_in_days": 1
  }' | jq
```

Where:
* `invitees`: List of invited users and the principle of issuing an invitation to a user:
  * To invite specific users, use one of the following parameters:
    * `email`: User's email. You can invite either users already registered in SourceCraft or new users.
    * `slug`: User slug in SourceCraft. Only for registered SourceCraft users.
  * To invite an ad-hoc user, use the `alias` parameter for an invitation via a one-time link. It contains a text record to identify the invitation, e.g., `my-first-invite`.
* `ttl_in_days`: Invitation validity period in days.

Result:

```json
{
  "operation_id": "cq9gajzloslj********",
  "status_url": "/operations/create-invites/id:cq9gajzloslj********",
  "status": "scheduled",
  "created_at": "2026-01-23T07:42:03.062925Z",
  "modified_at": "2026-01-23T07:42:03.062925Z"
}
```

The operation is executed asynchronously. Save its ID (`operation_id`) to get information about its progress status.

For more information, see [Organization | Invites](https://api.sourcecraft.tech/docs/index.html#tag/Organization-or-Invites).

### Getting information about an operation of creating an invitation via the API {#api-get-invite}

```bash
export IAM_TOKEN=<personal_access_token>
curl \
  --request GET \
  --url "https://api.sourcecraft.tech/operations/create-invites/id:<operation_ID>" \
  --header "Authorization: Bearer $IAM_TOKEN" \
  --header "Content-Type: application/json"
```

Result:

```json
{
  "operation_id": "cq9gajzloslj********",
  "status_url": "operations/create-invites/id:cq9gajzloslj********",
  "status": "success",
  "created_at": "2026-01-23T07:42:03.062925Z",
  "modified_at": "2026-01-23T07:42:09.612256Z",
  "response": {
    "invites": [
      {
        "id": "bpf65vedallc********",
        "email": "<user_email>",
        "alias": "",
        "invite_link": "",
        "status": "pending",
        "subject": {
          "type": "invitee",
          "id": "ajeth710l8gi********"
        },
        "created_at": "1970-01-01T00:00:00Z",
        "expires_at": "1970-01-01T00:00:00Z"
      },
      {
        "id": "bpf4q13jhnod********",
        "email": "",
        "alias": "",
        "invite_link": "",
        "invitee": {
          "id": "01971bf5-6751-7eea-a07f-2e29********",
          "slug": "<user_1_slug>"
        },
        "status": "pending",
        "subject": {
          "type": "invitee",
          "id": "ajehmssc34ob********"
        },
        "created_at": "1970-01-01T00:00:00Z",
        "expires_at": "1970-01-01T00:00:00Z"
      },
      {
        "id": "bpfrvnq2qd81********",
        "email": "",
        "alias": "<text_record_for identification>",
        "invite_link": "https://sourcecraft.dev/me/accept-invite/9emq5q98ym4cJU********",
        "status": "pending",
        "subject": {
          "type": "invitee",
          "id": "ajebuh02o909********"
        },
        "created_at": "2026-02-05T07:34:20.736642Z",
        "expires_at": "2026-02-06T07:34:20.673905Z"
      }
    ],
    "errors": [
      {
        "invitee": {
          "email": "",
          "slug": "<user_2_slug>",
          "alias": ""
        },
        "error_code": "InviteeHasAlreadyJoined",
        "message": "Invited user is already a member"
      }
     ]
  }
}
```

Where:
* `status`: Invitation status.
* `invite_link`: One-time invitation link for an ad-hoc user. Available only with the `alias` invitation type.

  {% note warning %}

  The invitation link is displayed only once. You cannot retrieve it later. However, you can create a new one.

  {% endnote %}

* `errors`: Errors that occur when creating an invitation, e.g., if the user is already a member of the organization.

For more information, see [Get invitation creation operation status (By Operation ID)](https://api.sourcecraft.tech/docs/index.html#tag/Organization-or-Operation/operation/GetOrganizationInvitesOperationByID).

### Listing active invitations using the API {#api-list-invites}

The invitation is active if the user has not accepted it yet.

```bash
export IAM_TOKEN=<personal_access_token>
curl \
  --request GET \
  --url "https://api.sourcecraft.tech/orgs/<organization_slug>/invites" \
  --header "Authorization: Bearer $IAM_TOKEN" \
  --header "Content-Type: application/json"
```

Result:

```json
{
  "invites": [
    {
      "id": "bpf65vedallc********",
      "email": "<user_email>",
      "alias": "",
      "invite_link": "",
      "status": "pending",
      "subject": {
        "type": "invitee",
        "id": "ajeth710l8gi********"
      },
      "created_at": "2026-01-23T07:42:06.938436Z",
      "expires_at": "2026-01-24T07:42:06.847107Z"
    }
  ],
  "next_page_token": ""
}
```

For more information, see [List Organization Invitations](https://api.sourcecraft.tech/docs/index.html#tag/Organization-or-Invites/operation/ListOrganizationInvites).
<!-- endsource: en/_includes/sourcecraft/security-invite.md -->

#### Useful links {#see-also}

* [Access management in SourceCraft](https://sourcecraft.dev/portal/docs/en/sourcecraft/security/index.md)
* [Assigning a role to a user](https://sourcecraft.dev/portal/docs/en/sourcecraft/security/bind.md)
