> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vertracloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Share Link for a Template

> Creates a share link for a private template, in use mode or full-copy mode, with an optional use limit and expiry.

This call creates a share link for a private template and answers `201` with the link and its token. **The token is shown only in this response and cannot be recovered**: store it now. Only a hash of it is kept, and the response is not cached. A token starts with `vtpl_`.

A link has one of two modes. A `use` link lets whoever opens it create their own applications from the template, without copying it. A `full_copy` link gives them a private template of their own, independent of yours, that counts against their limit of 5 private templates. `full_copy` needs `share.full_copy` set to `true` in the template, and it is not available for a [closed template](https://docs.vertracloud.app/templates/use/closed-templates.md) or for a version that has `env_hidden` variables. Read [Share links](https://docs.vertracloud.app/templates/create/share-links.md) before choosing.

Needs the `templates:write` scope when called with an API key. Only the owner of the template can create links; in a workspace, a member cannot even list them. Receivers see the notice "Not verified by Vertra" on the preview.

**template\_id** `string` *required*

The template ID.

**workspace\_id** `string`

If the template belongs to a workspace, the workspace's ID.

**mode** `string`

`use` or `full_copy`. Default `use`.

**max\_uses** `integer`

The maximum number of uses. Without it, there is no limit. A use is counted when someone starts creating from the link; a use that is refused or undone is given back.

**expires\_in\_days** `integer`

The number of days until the link expires. Without it, the link does not expire.

```bash cURL theme={null}
curl -X POST https://api.vertracloud.app/v1/templates/tpl-abc123def456/share-links \
  -H "Authorization: Bearer $VERTRA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "mode": "use", "max_uses": 10, "expires_in_days": 7 }'
```

### Response

**response** `object`

The link.

**Toggle object**

**id** `string`

The link ID.

**template\_id** `string`

The template the link belongs to.

**mode** `string`

`use` or `full_copy`.

**last4** `string`

The last 4 characters of the token, to tell links apart.

**uses** `integer`

How many times the link was used.

**max\_uses** `integer | null`

The maximum number of uses, or `null` for no limit.

**expires\_at** `string | null`

When the link expires, or `null` when it does not expire.

**revoked\_at** `string | null`

When the author revoked the link, or `null`.

**created\_at** `string`

When the link was created.

**token** `string`

The full token. Shown once.

```json Response theme={null}
{
  "response": {
    "id": "lnk-abc123def456",
    "template_id": "tpl-abc123def456",
    "mode": "use",
    "last4": "x9Qa",
    "uses": 0,
    "max_uses": 10,
    "expires_at": "2026-11-03T14:02:00Z",
    "revoked_at": null,
    "created_at": "2026-10-27T14:02:00Z",
    "token": "vtpl_EXAMPLE_TOKEN_SHOWN_ONLY_ONCE_x9Qa"
  }
}
```

### Error Responses

**code** `string`

The error code indicating the reason for the failure. Possible values:

* `API_KEY_SCOPE_DENIED`: The API key does not have the `templates:write` scope (`403`).
* `TEMPLATE_NOT_FOUND`: The template does not exist, is deleted or is not yours (`404`).
* `TEMPLATE_SAVE_NOT_ALLOWED`: `full_copy` was requested and the template does not allow it (`share.full_copy` is not `true`) (`403`).
* `TEMPLATE_CLOSED`: `full_copy` was requested for a closed template (`403`).
* `VALIDATION_ERROR`: `max_uses` or `expires_in_days` is not a positive integer (`400`).
* `WORKSPACE_OWNER_ONLY`: Only the workspace owner creates links for its templates.

```json Error Response theme={null}
{
  "code": "TEMPLATE_CLOSED"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.