Create Multi-Link (By Organization ID)

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

Request

POST

https://api.sourcecraft.tech/orgs/id:{org_id}/invite-multilinks

Path parameters

Name

Description

org_id

Type: string

Example: ``

Body

application/json
{
  "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"
}

Name

Description

invitee_count

Type: integer

Maximum number of invitees who can accept the invitation. Unset means unlimited.

org_role

Type: RepoRole

Enum: viewer, contributor, developer, maintainer, admin

repo

Type: RepoAssignment

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

Example
{
  "repo_id": "example",
  "repo_slug": "example",
  "repo_role": "viewer"
}

restricted_to

Type: MultiLinkInvitee[]

Example
[
  {
    "email": "example",
    "user_id": "example"
  }
]

slug

Type: string

Example: example

team_id

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: example

ttl_in_days

Type: integer

Time-to-live in days. If unset, the link never expires.

RepoRole

Type: string

Enum: viewer, contributor, developer, maintainer, admin

RepoAssignment

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

Name

Description

repo_id

Type: string

Example: example

repo_role

Type: RepoRole

Enum: viewer, contributor, developer, maintainer, admin

repo_slug

Type: string

Example: example

Example
{
  "repo_id": "example",
  "repo_slug": "example",
  "repo_role": "viewer"
}

MultiLinkInvitee

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

Name

Description

email

Type: string

Example: example

user_id

Type: string

Example: example

Example
{
  "email": "example",
  "user_id": "example"
}

Responses

202 Accepted

A successful response.

Body

application/json
{
  "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": {}
  }
}

Name

Description

created_at

Type: string<date-time>

Example: 2025-01-01T00:00:00Z

error

Type: OperationError

Example
{
  "error_code": "example",
  "message": "example",
  "details": {}
}

modified_at

Type: string<date-time>

Example: 2025-01-01T00:00:00Z

operation_id

Type: string

Example: example

response

Type: 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.

Example
{
  "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
}

status

Type: OperationStatus

Enum: scheduled, in_progress, success, failed, cancel

status_url

Type: string

Example: example

OperationStatus

Type: string

Enum: scheduled, in_progress, success, failed, cancel

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

Type: integer

created_at

Type: string<date-time>

Example: 2025-01-01T00:00:00Z

expires_at

Type: string<date-time>

Example: 2025-01-01T00:00:00Z

id

Type: string

Example: example

invitee_count

Type: integer

Maximum number of invitees who can accept the invitation. Unset means unlimited.

org_id

Type: string

Example: example

org_role

Type: RepoRole

Enum: viewer, contributor, developer, maintainer, admin

org_slug

Type: string

Example: example

repo

Type: RepoAssignment

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

Example
{
  "repo_id": "example",
  "repo_slug": "example",
  "repo_role": "viewer"
}

restricted_to_count

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.

slug

Type: string

Example: example

team_id

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: example

ttl_in_days

Type: integer

Time-to-live in days. If unset, the link never expires.

updated_at

Type: string<date-time>

Example: 2025-01-01T00:00:00Z

url

Type: string

Example: example

Example
{
  "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
}

OperationError

Name

Description

details

Type: Optional details. Exact structure depends on error_code

[additional]

Type: string

Example: example

Example
{}

error_code

Type: string

Example: example

message

Type: string

Example: example

Example
{
  "error_code": "example",
  "message": "example",
  "details": {}
}

default

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

Body

application/json
{
  "error_code": "example",
  "message": "example",
  "request_id": "example",
  "details": null
}

Name

Description

details

Type: unknown

Example: null

error_code

Type: string

Example: example

message

Type: string

Example: example

request_id

Type: string

Example: example