# PUT /lead-magnets/:lead_magnet_id/gift-script/secrets/:secret_name

**Resource:** [LEAD_MAGNETS](./lead-magnets.md)  
**MCP tool:** `set_lead_magnet_gift_script_secret`  
**Scopes:** `lead_magnets:write`, `automations:write`  
**Write operation:** yes

Add or replace a third-party secret the gift script needs (write-only, the value is never returned). The script reads it as secrets.NAME.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `lead_magnet_id` | path | string | yes | The lead magnet whose Made for you gift the script makes. |
| `secret_name` | path | string | yes |  |
| `value` | body | string | yes | The secret value. Write-only: it is never returned. |
| `require_approval` | body | boolean | no | Optional. Set true to route this write into the approval queue for human review instead of executing it immediately (returns 202 + an approval_id). Works even when your key/token has permission to execute directly. |

## Request example

```bash
curl -X PUT   "https://api.trustpager.com/functions/v1/api/v1/lead-magnets/:lead_magnet_id/gift-script/secrets/:secret_name"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"value":"...","require_approval":"..."}'
```

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`