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

# Create a download link

> Creates a link to the pass that expires.

Use this instead of the permanent `distributionUrl` when a link should stop working after a while. See [Deliver passes](/guides/deliver-passes).

<ParamField path="id" type="string" required>
  The pass ID.
</ParamField>

<ParamField header="Idempotency-Key" type="string" required>
  A unique value for this request.
</ParamField>

<ParamField body="expiresInSeconds" type="integer" default="3600">
  How long the link works, in seconds.
</ParamField>

### Response

<ResponseField name="id" type="string">
  Unique ID, starting with `dlink_`. Use it to revoke the link.
</ResponseField>

<ResponseField name="passId" type="string">
  The pass the link opens.
</ResponseField>

<ResponseField name="url" type="string">
  The link to send to the holder. It's returned only once.
</ResponseField>

<ResponseField name="expiresAt" type="string">
  When the link stops working.
</ResponseField>

<ResponseField name="createdAt" type="string">
  When the link was created.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl https://api.tapace.lk/v1/passes/pass_7hGk2LmQ9xVt4RnB8cYe/download-links \
    -H "Authorization: Bearer $TAPACE_API_KEY" \
    -H "Idempotency-Key: 3e7a1c9b-2d4f-4a6e-b8c1-7f5d2e9a4b10" \
    -H "Content-Type: application/json" \
    -d '{ "expiresInSeconds": 3600 }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "object": "download_link",
    "id": "dlink_Vb3Nq8Lm2Xr7Tk4Pz9Wc",
    "passId": "pass_7hGk2LmQ9xVt4RnB8cYe",
    "url": "https://pass.tapace.lk/dl/kX2r9QvL7mT4nB8cYe3WpZ",
    "expiresAt": "2026-10-13T11:00:00.000Z",
    "createdAt": "2026-10-13T10:00:00.000Z"
  }
  ```
</ResponseExample>


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