---
title: "Create a referral link attribution"
method: POST
path: "/referral_link_attributions"
tags: ["Referral Link Attributions"]
---

# Create a referral link attribution

`POST /referral_link_attributions`

## Request

- Base URL: `https://api.lassotech.com/api/v1/rest`
- URL: `https://api.lassotech.com/api/v1/rest/referral_link_attributions`
- Auth: API key in header `x-lasso-access-token`

Create a referral attributed to a partner's referral link, typically from the `lid` and `cid`
values your CRM captured from the visitor. Requires `partners_edit`.

Send `referral_link_id` (the `lid` value), `click_uuid` (the `cid` value), or both. With only
`click_uuid`, the referral link is resolved from the click. The referral link must be active,
and a lead form must be configured on the partner type or the account.

The referral is created as `open`, or as `accepted` if your referral link settings say so.

### Idempotency
A CRM deal, opportunity or lead ID (`hubspot_deal_id`, `salesforce_opportunity_id`,
`salesforce_lead_id`, `pipedrive_deal_id`) belongs to one referral. If a referral already carries
the ID you send, that referral is returned with `200 OK` and nothing is created, so a re-fired
workflow is safe. If it belongs to a different partner than the referral link's, you get a `409`
instead.

## Request body

- object: Send `referral_company_name`, `referral_contact_name`, or both; a referral needs a name.
  - `referral_link_id` string: Identifier of the active referral link (for example `RL-3930CB`). Required if click_uuid is not provided.
  - `click_uuid` string, uuid: UUID of a referral link click. If provided, the referral link is resolved from the click.
  - `referral_company_name` string: Company name of the referral
  - `referral_email` string: Email of the referral contact. When omitted, the referral is stored with a generated placeholder address.
  - `referral_contact_name` string: Name of the referral contact
  - `hubspot_deal_id` string: HubSpot deal ID
  - `hubspot_contact_id` string: HubSpot contact ID
  - `hubspot_company_id` string: HubSpot company ID
  - `salesforce_opportunity_id` string: Salesforce opportunity ID
  - `salesforce_account_id` string: Salesforce account ID
  - `salesforce_lead_id` string: Salesforce lead ID
  - `salesforce_contact_id` string: Salesforce contact ID
  - `pipedrive_organization_id` string: Pipedrive organization ID
  - `pipedrive_person_id` string: Pipedrive person ID
  - `pipedrive_deal_id` string: Pipedrive deal ID

## Response `200`

A referral already carries this CRM opportunity ID; it is returned and nothing is created

- object
  - `lead` Lead
    - `slug` string
    - `status` 'open' | 'accepted' | 'qualified' | 'closed_won' | 'closed_lost' | 'rejected' | 'churned' | 'expired'
    - `source_type` string, nullable
    - `company_name` string, nullable
    - `contact_name` string, nullable
    - `email` string, nullable
    - `partner_slug` string, nullable
    - `partner_lasso_key` string, nullable: The partner's Lasso Partner Key, the value to send back as `partner_lasso_key`.
    - `partner_member` object, nullable: The partner contact this referral is attributed to, if any.
      - `slug` string
      - `full_name` string, nullable
      - `email` string, nullable
    - `rewards` object[]: The rewards copied onto this referral from the partner's plan. Empty until the referral is accepted. `payee_type` says who each reward is owed to, so you can confirm a partner-contact reward actually landed rather than being skipped for want of a contact.
      - `name` string, nullable
      - `reward_type` string
      - `amount` string
      - `amount_type` string
      - `currency` string
      - `payee_type` 'partner' | 'partner_user'
    - `amount` string: Deal amount.
    - `currency_code` string
    - `expected_close_date` string, date, nullable
    - `co_sold` boolean
    - `deleted_at` string, date-time, nullable
    - `expires_at` string, date-time, nullable
    - `billing_start_date` string, date: The date this referral's billing starts from, after any override is applied.
    - `billing_start_date_override` string, date, nullable: The override set with `billing_start_date` on update, or null when the date is derived from your billing settings.
    - `created_at` string, date-time
    - `updated_at` string, date-time

## Other responses

- `201`: Lead created
- `401`: Missing or invalid API key
- `403`: API key lacks required permission
- `409`: The CRM ID is already linked to a referral of a different partner
- `422`: The referral could not be created. Messages include `REFERRAL_LINK_ID_OR_CLICK_UUID_REQUIRED` (`base`), `NOT_FOUND` (`referral_link_id` for an unknown or inactive link, `click_uuid` for an unknown click), `NO_LEAD_FORM` (`base`), and validation errors such as a missing name.
- `429`: Rate limit exceeded. Wait the number of seconds in `Retry-After`, then retry.

---

[API](https://skmtc.dev/onelasso/apis/lasso-rest-api.md) · [All operations](https://skmtc.dev/onelasso/apis/lasso-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/onelasso/apis/lasso-rest-api/revisions/bbc328f5e2d1?raw)
