# prov.embed.create_link

prov.embed.create_link in Python SDK. Mint a hosted page link (201): the same body and checks as `create_token`, Pro and up.

## Signature

```python
prov.embed.create_link(widget: HostedWidget, object_id: str, mode: Optional[str] = …, ttl: Optional[int] = …, session_ttl: Optional[int] = …, show: Optional[List[EmbedShowField]] = …, author: Optional[EmbedAuthor] = …, request: Optional[CaptureRequestSessionOptions] = …, rules: Optional[RulesEmbedScope] = …, idempotency_key: Optional[str] = …) -> EmbedLink
```

## Parameters

- `widget` (HostedWidget)
- `object_id` (str)
- `mode` (Optional[str], optional)
- `ttl` (Optional[int], optional)
- `session_ttl` (Optional[int], optional)
- `show` (Optional[List[EmbedShowField]], optional)
- `author` (Optional[EmbedAuthor], optional)
- `request` (Optional[CaptureRequestSessionOptions], optional)
- `rules` (Optional[RulesEmbedScope], optional)
- `idempotency_key` (Optional[str], optional)

## Returns

`EmbedLink`

## HTTP operation

[`POST /v1/embed/links`](https://provenanceauth.com/docs/api/embeds.md#post-v1-embed-links): Create a hosted page link

## Errors

- [`embed_object_kind_mismatch`](https://provenanceauth.com/docs/platform/errors.md#embed_object_kind_mismatch)
- [`insufficient_scope`](https://provenanceauth.com/docs/platform/errors.md#insufficient_scope)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`parameter_missing`](https://provenanceauth.com/docs/platform/errors.md#parameter_missing)
- [`plan_required`](https://provenanceauth.com/docs/platform/errors.md#plan_required)
- [`rules_embed_rule_missing`](https://provenanceauth.com/docs/platform/errors.md#rules_embed_rule_missing)
- [`trial_ended`](https://provenanceauth.com/docs/platform/errors.md#trial_ended)

## Example

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/attest/capture_requests`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x", "Content-Type": "application/json" },
  body: JSON.stringify({ "case_id": "LMB-20418", "delivery": "self", "session_type": "id" }),
})).json();
const captureRequestId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/embed/links`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x", "Content-Type": "application/json" },
  body: JSON.stringify({
    "widget": "capture_result",
    "object_id": captureRequestId,
    "show": [
      "case_id"
    ]
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/attest/capture_requests", headers={"Authorization": "Bearer prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x"}, json={
    "case_id": "LMB-20418",
    "delivery": "self",
    "session_type": "id"
}).json()
capture_request_id = step1["id"]
data = httpx.post(f"{api}/v1/embed/links", headers={"Authorization": "Bearer prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x"}, json={
    "widget": "capture_result",
    "object_id": capture_request_id,
    "show": [
        "case_id"
    ]
}).json()
```
