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": "<string>",
  "metadata": {},
  "user": {
    "id": "user_xxxxxxxxxxxxx",
    "email": "[email protected]",
    "name": "John Doe",
    "username": "johndoe42"
  },
  "product": {
    "id": "prod_xxxxxxxxxxxxx",
    "title": "<string>"
  },
  "member": {
    "id": "<string>"
  }
}

Authorizations

Authorization
string
header
required

The app API key from an app from the /dashboard/developer page

Path Parameters

id
string
required

The ID of the lead to update.

Example:

"lead_xxxxxxxxxxxxx"

Body

application/json

Parameters for UpdateLead

metadata
object

Custom metadata for the lead.

referrer
string | null

The url referrer of the lead.

Response

A successful response

An object representing a lead (someone who is interested in a whop).

id
string
required

The ID of the lead.

Example:

"lead_xxxxxxxxxxxxx"

created_at
string<date-time>
required

The timestamp of when the lead was created.

Example:

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

updated_at
string<date-time>
required

The timestamp of when the lead was last updated.

Example:

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

referrer
string | null
required

The referrer URL that brought this lead.

metadata
object
required

Custom metadata for the lead.

user
object
required

The user who is the lead.

product
object
required

The access pass the lead is interested in, if available.

member
object
required

The converted member, if any.