Skip to main content
PATCH
/
leads
/
{id}
JavaScript
import Whop from '@whop/sdk';

const client = new Whop({
  apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});

const lead = await client.leads.update('lead_xxxxxxxxxxxxx');

console.log(lead.id);
{
  "id": "lead_xxxxxxxxxxxxx",
  "created_at": "2023-12-01T05:00:00.401Z",
  "updated_at": "2023-12-01T05:00:00.401Z",
  "referrer": "https://twitter.com/whabormarket",
  "metadata": {},
  "user": {
    "id": "user_xxxxxxxxxxxxx",
    "email": "john.doe@example.com",
    "name": "John Doe",
    "username": "johndoe42"
  },
  "product": {
    "id": "prod_xxxxxxxxxxxxx",
    "title": "Pickaxe Analytics"
  },
  "member": {
    "id": "<string>"
  }
}

Authorizations

Authorization
string
header
required

A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************

Path Parameters

id
string
required

The unique identifier of the lead to update, starting with 'lead_'.

Example:

"lead_xxxxxxxxxxxxx"

Body

application/json

Parameters for UpdateLead

metadata
object

A JSON object of custom metadata to set on the lead, replacing any existing metadata.

referrer
string | null

The updated referral URL for the lead, such as 'https://example.com/landing'.

Response

A successful response

A prospective customer who has expressed interest in a company or product but has not yet purchased.

id
string
required

The unique identifier for the lead.

Example:

"lead_xxxxxxxxxxxxx"

created_at
string<date-time>
required

The datetime the lead was created.

Example:

"2023-12-01T05:00:00.401Z"

updated_at
string<date-time>
required

The datetime the lead was last updated.

Example:

"2023-12-01T05:00:00.401Z"

referrer
string | null
required

The URL of the page that referred this lead to the company. Null if no referrer was captured.

Example:

"https://twitter.com/whabormarket"

metadata
object
required

Custom key-value pairs attached to this lead. Null if no metadata was provided.

user
object
required

The user account associated with this lead.

product
object
required

The product the lead expressed interest in. Null if the lead is not associated with a specific product.

member
object
required

The company member record if this lead has converted into a paying customer. Null if the lead has not converted.