# Send a document link on WhatsApp

> Sends a private link to a file, kept in Lumen and never uploaded to WhatsApp. The link stops working after the days you choose.

Source: https://docs.go-lumen.ai/reference/steps/whatsapp-send-document-link

## At a glance

| Property | Value |
| --- | --- |
| **Step name** | `whatsapp-send-document-link` |
| **Resource** | ClusterStep (`lumen.ai/v1alpha1`) |
| **Palette group, category** | notify, messages |
| **Credits** | **1** credit each time it succeeds |
| **Side effects** | yes: It changes something outside Lumen, so a retry asks first and a test shows what it would do instead of doing it. |
| **Installation must provide** | nothing |

## Inputs

| Property | Value |
| --- | --- |
| **Needs** | `file` |
| **Produces** | `fields` |
| **Works on** | item: one document at a time |

Needs and Produces are data types (file, text, fields, email). The editor offers a step only where what it needs is already on the path. See [Documents and data](https://docs.go-lumen.ai/concepts/how-flows-run.md#documents-and-data).

## Outputs

A later node references an output as `{nodeId.field}` in text, or `nodeId.field` in a condition.

| Output | Type |
| --- | --- |
| `whatsappMessageId` | string |
| `whatsappStatus` | string |

## Settings

Set under `config:` on the flow node. Text settings may contain `{nodeId.field}` placeholders.

| Setting | Type | Default | Description |
| --- | --- | --- | --- |
| `connectorRef` | string |  | Send from (minLength 1) |
| `to` | string |  | To (maxLength 200) |
| `toMember` | string |  | Their email. They must have joined this number with their phone (Profile, WhatsApp). (maxLength 320) |
| `file` | string |  | File names the run's file to link to; empty is its first PDF, or its first file. (maxLength 255) |
| `caption` | string |  | Caption is written above the link. (maxLength 1000) |
| `expiresDays` | integer | `7` | ExpiresDays is how long the link works: 1 to 30 days, default 7. (minimum 1; maximum 30) |

The full JSON Schema of these settings: [whatsapp-send-document-link.schema.json](https://docs.go-lumen.ai/schemas/steps/whatsapp-send-document-link.schema.json).

## Example

Send the signed receipt

```yaml title="config"
caption: הקבלה שלך מוכנה
expiresDays: 7
```

## Use it in a flow

A node that runs `whatsapp-send-document-link` goes under `spec.nodes` of a [Flow](https://docs.go-lumen.ai/concepts/how-flows-run.md#the-flow-as-yaml). Give it any id, and list the next node ids in next.

```yaml title="flow.yaml"
apiVersion: lumen.ai/v1alpha1
kind: Connector
metadata:
  name: my-whatsapp-cloud
  namespace: tenant-acme
spec:
  classRef: {name: whatsapp-cloud}
  config: {}
---
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
  name: whatsapp-send-document-link-example
  namespace: tenant-acme
spec:
  displayName: "Send a document link on WhatsApp"
  triggers:
    - id: start
      ref: {name: whatsapp-message-received}
      connectorRef: {name: my-whatsapp-cloud}
      next: [whatsapp-send-document-link]
  nodes:
    - id: whatsapp-send-document-link
      stepRef: {name: whatsapp-send-document-link}
      config:
        caption: הקבלה שלך מוכנה
        expiresDays: 7
```
