## Create a share link

`share_links.create(ShareLinkCreateParams**kwargs)  -> ShareLinkCreateResponse`

**post** `/compute/v1/share-links`

Create an unauthenticated, read-only share link covering one or more predictions and/or pipelines that all live in the same workspace. The returned `id` is the bearer credential — treat it as a secret.

### Parameters

- `expires_at: str`

- `access_parameters: Optional[AccessParameters]`

  Access-control parameters for the share link. Discriminated by `access_mode`: `public` requires no other fields; `email` requires a non-empty `allowed_emails` list.

  - `class AccessParametersPublicShareLinkAccessParameters: …`

    Public access: anyone holding the share link ID can read.

    - `access_mode: Literal["public"]`

      - `"public"`

  - `class AccessParametersEmailShareLinkAccessParameters: …`

    Email-restricted access: only the addresses in `allowed_emails` can read the link.

    - `access_mode: Literal["email"]`

      - `"email"`

    - `allowed_emails: Sequence[str]`

      Email addresses allowed to read the link. Must contain at least one address; up to 100 entries.

- `pipeline_ids: Optional[Sequence[str]]`

  Pipelines to expose through the share link. Must belong to the resolved workspace. Up to 100 entries.

- `prediction_ids: Optional[Sequence[str]]`

  Predictions to expose through the share link. Must belong to the resolved workspace. Up to 100 entries.

- `workspace_id: Optional[str]`

  Workspace ID. Only used with admin API keys. Ignored (or validated) for workspace-scoped keys.

### Returns

- `class ShareLinkCreateResponse: …`

  - `id: str`

    Share link ID. This value is the bearer credential used to access the linked resources — treat it as a secret.

  - `access_parameters: AccessParameters`

    Access-control parameters for the share link. Discriminated by `access_mode`: `public` requires no other fields; `email` requires a non-empty `allowed_emails` list.

    - `class AccessParametersPublicShareLinkAccessParameters: …`

      Public access: anyone holding the share link ID can read.

      - `access_mode: Literal["public"]`

        - `"public"`

    - `class AccessParametersEmailShareLinkAccessParameters: …`

      Email-restricted access: only the addresses in `allowed_emails` can read the link.

      - `access_mode: Literal["email"]`

        - `"email"`

      - `allowed_emails: List[str]`

        Email addresses allowed to read the link. Must contain at least one address; up to 100 entries.

  - `archived_at: Optional[datetime]`

    When the share link was archived, or null if it has never been archived.

  - `created_at: datetime`

    When the share link was created.

  - `expires_at: datetime`

    When the share link stops granting access.

  - `pipeline_ids: List[str]`

    Pipelines exposed by this share link.

  - `prediction_ids: List[str]`

    Predictions exposed by this share link.

  - `workspace_id: str`

    Workspace that owns the share link and the referenced resources.

  - `url: Optional[str]`

    Visitable share link URL for the deployment's public app. Present when the deployment has a configured app host; otherwise construct as `<your-app-host>/share/{id}`. Treat as a secret — the `{id}` segment is the bearer credential.

### Example

```python
import os
from boltz_api import Boltz

client = Boltz(
    api_key=os.environ.get("BOLTZ_API_KEY"),  # This is the default and can be omitted
)
share_link = client.share_links.create(
    expires_at="expires_at",
)
print(share_link.id)
```

#### Response

```json
{
  "id": "shr_qoEFr2BlPTBLuM5BinaC8x7iVPP_AwppEOmlxQjJ-eo",
  "access_parameters": {
    "access_mode": "public"
  },
  "archived_at": "2019-12-27T18:11:19.117Z",
  "created_at": "2019-12-27T18:11:19.117Z",
  "expires_at": "2019-12-27T18:11:19.117Z",
  "pipeline_ids": [
    "string"
  ],
  "prediction_ids": [
    "string"
  ],
  "workspace_id": "workspace_id",
  "url": "https://lab.boltz.bio/share/shr_qoEFr2BlPTBLuM5BinaC8x7iVPP_AwppEOmlxQjJ-eo"
}
```
