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>"
}
}Update the metadata or referrer information on an existing lead record.
Required permissions:
lead:managemember:email:readaccess_pass:basic:readmember:basic:readimport 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>"
}
}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 ***************************
The unique identifier of the lead to update, starting with 'lead_'.
"lead_xxxxxxxxxxxxx"
Parameters for UpdateLead
A JSON object of custom metadata to set on the lead, replacing any existing metadata.
The updated referral URL for the lead, such as 'https://example.com/landing'.
A successful response
A prospective customer who has expressed interest in a company or product but has not yet purchased.
The unique identifier for the lead.
"lead_xxxxxxxxxxxxx"
The datetime the lead was created.
"2023-12-01T05:00:00.401Z"
The datetime the lead was last updated.
"2023-12-01T05:00:00.401Z"
The URL of the page that referred this lead to the company. Null if no referrer was captured.
"https://twitter.com/whabormarket"
Custom key-value pairs attached to this lead. Null if no metadata was provided.
The user account associated with this lead.
Show child attributes
The product the lead expressed interest in. Null if the lead is not associated with a specific product.
Show child attributes
The company member record if this lead has converted into a paying customer. Null if the lead has not converted.
Show child attributes
Was this page helpful?