---
metadata:
  - name: generator
    content: Diplodoc Platform v5.70.2
alternate:
  - https://sourcecraft.dev/portal/docs/en/api-ref/Invites-or-MultiLinks/CreateMultiLink.md
  - https://sourcecraft.dev/portal/docs/en/api-ref/Invites-or-MultiLinks/CreateMultiLink.md
  - https://sourcecraft.dev/portal/docs/ru/api-ref/Invites-or-MultiLinks/CreateMultiLink.md
  - href: https://sourcecraft.dev/portal/docs/en/api-ref/Invites-or-MultiLinks/CreateMultiLink.md
    type: text/markdown
    title: Markdown version
  - href: https://sourcecraft.dev/portal/docs/en/llms.txt?revision=r22161526
    rel: describedby
---
> **Documentation Index:** Fetch the complete configuration index at https://sourcecraft.dev/portal/docs/en/llms.txt?revision=r22161526

<div class="openapi">

# Create Multi-Link

<!-- markdownlint-disable-file -->

Creates a multi-link asynchronously. Poll operation status at the returned status_url.

## Request

<div class="openapi__requests">

<div class="openapi__request__wrapper" style="--method: var(--dc-openapi-methods-post);margin-bottom: 12px">

<div class="openapi__request">

POST {.openapi__method}
```text translate=no
https://api.sourcecraft.tech/orgs/{org_slug}/invite-multilinks
```

</div>

</div>

</div>

### Path parameters

#|
|| **Name** | **Description** ||
||

_org_slug_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
|#{.json-schema-properties}

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "slug": "example",
  "ttl_in_days": 0,
  "invitee_count": 0,
  "org_role": "viewer",
  "repo": {
    "repo_id": "example",
    "repo_slug": "example",
    "repo_role": null
  },
  "restricted_to": [
    {
      "email": "example",
      "user_id": "example"
    }
  ],
  "team_id": "example"
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_invitee_count_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: integer

Maximum number of invitees who can accept the invitation. Unset means unlimited.
{.table-cell}
||
||

_org_role_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [RepoRole](#entity-RepoRole)

_Enum:_{.json-schema-reset .json-schema-value} `viewer`, `contributor`, `developer`, `maintainer`, `admin`
{.table-cell}
||
||

_repo_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [RepoAssignment](#entity-RepoAssignment)

RepoAssignment specifies a repository and the role granted to a multi-link invitee.

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "repo_id": "example",
  "repo_slug": "example",
  "repo_role": "viewer"
}
```

{% endcut %}
{.table-cell}
||
||

_restricted_to_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [MultiLinkInvitee](#entity-MultiLinkInvitee)[]

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  {
    "email": "example",
    "user_id": "example"
  }
]
```

{% endcut %}
{.table-cell}
||
||

_slug_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_team_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

IAM group ID of the team users join upon acceptance. Obtain it from
GET /orgs/{org_slug}/teams. Must belong to this organization. The caller
must have permission to manage the team's members.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_ttl_in_days_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: integer

Time-to-live in days. If unset, the link never expires.
{.table-cell}
||
|#{.json-schema-properties}

</div>

<div class="openapi-entity">

### RepoRole {#entity-RepoRole}

**Type**: string

_Enum:_{.json-schema-reset .json-schema-value} `viewer`, `contributor`, `developer`, `maintainer`, `admin`

</div>

<div class="openapi-entity">

### RepoAssignment {#entity-RepoAssignment}

RepoAssignment specifies a repository and the role granted to a multi-link invitee.

#|
|| **Name** | **Description** ||
||

_repo_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_repo_role_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [RepoRole](#entity-RepoRole)

_Enum:_{.json-schema-reset .json-schema-value} `viewer`, `contributor`, `developer`, `maintainer`, `admin`
{.table-cell}
||
||

_repo_slug_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "repo_id": "example",
  "repo_slug": "example",
  "repo_role": "viewer"
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### MultiLinkInvitee {#entity-MultiLinkInvitee}

MultiLinkInvitee identifies a user allowed to accept a restricted multi-link.
Exactly one of the fields must be specified.

#|
|| **Name** | **Description** ||
||

_email_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_user_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "email": "example",
  "user_id": "example"
}
```

{% endcut %}

</div>

## Responses

<div class="openapi__response__code__202">

## 202 Accepted

A successful response.

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "operation_id": "example",
  "status_url": "example",
  "status": "scheduled",
  "created_at": "2025-01-01T00:00:00Z",
  "modified_at": "2025-01-01T00:00:00Z",
  "response": {
    "id": "example",
    "org_id": "example",
    "org_slug": "example",
    "slug": "example",
    "url": "example",
    "ttl_in_days": 0,
    "expires_at": "2025-01-01T00:00:00Z",
    "created_at": "2025-01-01T00:00:00Z",
    "updated_at": "2025-01-01T00:00:00Z",
    "accepted_count": 0,
    "invitee_count": 0,
    "org_role": "viewer",
    "repo": {
      "repo_id": "example",
      "repo_slug": "example",
      "repo_role": null
    },
    "team_id": "example",
    "restricted_to_count": 0
  },
  "error": {
    "error_code": "example",
    "message": "example",
    "details": {}
  }
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_created_at_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;date-time&gt;

_Example:_{.json-schema-reset .json-schema-example} `2025-01-01T00:00:00Z`
{.table-cell}
||
||

_error_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [OperationError](#entity-OperationError)

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "error_code": "example",
  "message": "example",
  "details": {}
}
```

{% endcut %}
{.table-cell}
||
||

_modified_at_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;date-time&gt;

_Example:_{.json-schema-reset .json-schema-example} `2025-01-01T00:00:00Z`
{.table-cell}
||
||

_operation_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_response_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [MultiLink](#entity-MultiLink)

MultiLink represents a reusable invitation link that can be accepted by
multiple users. The link can be scoped to an organization and, optionally,
to a specific repository or project with a given role.

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "id": "example",
  "org_id": "example",
  "org_slug": "example",
  "slug": "example",
  "url": "example",
  "ttl_in_days": 0,
  "expires_at": "2025-01-01T00:00:00Z",
  "created_at": "2025-01-01T00:00:00Z",
  "updated_at": "2025-01-01T00:00:00Z",
  "accepted_count": 0,
  "invitee_count": 0,
  "org_role": "viewer",
  "repo": {
    "repo_id": "example",
    "repo_slug": "example",
    "repo_role": null
  },
  "team_id": "example",
  "restricted_to_count": 0
}
```

{% endcut %}
{.table-cell}
||
||

_status_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [OperationStatus](#entity-OperationStatus)

_Enum:_{.json-schema-reset .json-schema-value} `scheduled`, `in_progress`, `success`, `failed`, `cancel`
{.table-cell}
||
||

_status_url_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

</div>

<div class="openapi-entity">

### OperationStatus {#entity-OperationStatus}

**Type**: string

_Enum:_{.json-schema-reset .json-schema-value} `scheduled`, `in_progress`, `success`, `failed`, `cancel`

</div>

<div class="openapi-entity">

### MultiLink {#entity-MultiLink}

MultiLink represents a reusable invitation link that can be accepted by
multiple users. The link can be scoped to an organization and, optionally,
to a specific repository or project with a given role.

#|
|| **Name** | **Description** ||
||

_accepted_count_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: integer
{.table-cell}
||
||

_created_at_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;date-time&gt;

_Example:_{.json-schema-reset .json-schema-example} `2025-01-01T00:00:00Z`
{.table-cell}
||
||

_expires_at_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;date-time&gt;

_Example:_{.json-schema-reset .json-schema-example} `2025-01-01T00:00:00Z`
{.table-cell}
||
||

_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_invitee_count_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: integer

Maximum number of invitees who can accept the invitation. Unset means unlimited.
{.table-cell}
||
||

_org_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_org_role_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [RepoRole](#entity-RepoRole)

_Enum:_{.json-schema-reset .json-schema-value} `viewer`, `contributor`, `developer`, `maintainer`, `admin`
{.table-cell}
||
||

_org_slug_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_repo_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [RepoAssignment](#entity-RepoAssignment)

RepoAssignment specifies a repository and the role granted to a multi-link invitee.

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "repo_id": "example",
  "repo_slug": "example",
  "repo_role": "viewer"
}
```

{% endcut %}
{.table-cell}
||
||

_restricted_to_count_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: integer

Number of invitee restrictions configured on the multi-link. When zero, the
link is open to anyone; otherwise only the invitees listed via the invitees
sub-resource are allowed to accept it. Use ListMultiLinkInvitees to fetch
the full list.
{.table-cell}
||
||

_slug_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_team_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

IAM group ID of the team users join upon acceptance. Obtain it from
GET /orgs/{org_slug}/teams. The team belongs to this multi-link's organization.
Unset means no team assignment.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_ttl_in_days_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: integer

Time-to-live in days. If unset, the link never expires.
{.table-cell}
||
||

_updated_at_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;date-time&gt;

_Example:_{.json-schema-reset .json-schema-example} `2025-01-01T00:00:00Z`
{.table-cell}
||
||

_url_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "id": "example",
  "org_id": "example",
  "org_slug": "example",
  "slug": "example",
  "url": "example",
  "ttl_in_days": 0,
  "expires_at": "2025-01-01T00:00:00Z",
  "created_at": "2025-01-01T00:00:00Z",
  "updated_at": "2025-01-01T00:00:00Z",
  "accepted_count": 0,
  "invitee_count": 0,
  "org_role": "viewer",
  "repo": {
    "repo_id": "example",
    "repo_slug": "example",
    "repo_role": null
  },
  "team_id": "example",
  "restricted_to_count": 0
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### OperationError {#entity-OperationError}

#|
|| **Name** | **Description** ||
||

_details_{.json-schema-reset .json-schema-property}
{.table-cell}|
{% cut "**Type**: Optional details. Exact structure depends on error_code" %}

#|
||

_[additional]_{.json-schema-reset .json-schema-additional-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% endcut %}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{}
```

{% endcut %}
{.table-cell}
||
||

_error_code_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_message_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "error_code": "example",
  "message": "example",
  "details": {}
}
```

{% endcut %}

</div>

</div>

<div class="openapi__response__code__default">

## default

Both Client Errors (4xx) and Server Errors (5xx) are serialized into this scheme

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "error_code": "example",
  "message": "example",
  "request_id": "example",
  "details": null
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_details_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: unknown

_Example:_{.json-schema-reset .json-schema-example} `null`
{.table-cell}
||
||

_error_code_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_message_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_request_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

</div>

</div>

</div>

[*Deprecated]: No longer supported, please use an alternative and newer version.