Lead sidebar

The app is displayed in the Lead Card location on the right side, along with native widgets.

Example manifest

"location": {
  "sell": {
    "lead_card": "assets/iframe.html"
  }
},

The following object is available in this location:

Events

In addition to the core events, the following events are available to apps in the Lead sidebar location:

You can also listen for changes on any object or property of the Lead object by adding the suffix .changed to its path. Any event handler bound to a .changed event receives an object with the name of the changed property, its previous value, and its new value. Example:

client.on('lead.creator.changed', (data) => {
  console.log(data);  // {propertyName, oldValue, newValue}
});

See Working with framework events.

lead.notes.added

Fires when a note is added to the lead. Any event handler bound to lead.notes.added receives the note object.

Example:

client.on('lead.notes.added', (note) => {
  console.log(note); // Note object
  // example:
  // {
  //   "id": 32661,
  //   "creator_id": 42616,
  //   "resource_type": "sales_account",
  //   "resource_id": 29732437,
  //   "content": "Called them, but no answer",
  //   "created_at": "2019-10-01T09:00:21Z",
  //   "updated_at": "2019-10-01T09:00:21Z"
  // }
});
lead.tasks.added

Fires when a task is added to the lead in the current tab. Any event handler bound to lead.tasks.added receives the task object.

Example:

client.on('lead.tasks.added', (task) => {
  console.log(task); // Task object
  // example:
  // {
  //   "id": 32661,
  //   "creator_id": 42616,
  //   "owner_id": 42616,
  //   "resource_type": "sales_account",
  //   "completed": false,
  //   "completed_at": null,
  //   "due_date": "2020-01-14T00:00:00Z",
  //   "overdue": false,
  //   "remind_at": null,
  //   "resource_id": 29732437,
  //   "content": "Schedule a meeting",
  //   "created_at": "2019-10-01T09:00:21Z",
  //   "updated_at": "2019-10-01T09:00:21Z"
  // }
});
lead.tasks.completed

Fires when a current lead's task is marked as completed in the current tab. Any event handler bound to lead.tasks.completed receives the task object.

Example:

client.on('lead.tasks.completed', (task) => {
  console.log(task); // Task object
  // example:
  // {
  //   "id": 32661,
  //   "creator_id": 42616,
  //   "owner_id": 42616,
  //   "resource_type": "sales_account",
  //   "completed": true,
  //   "completed_at": "2019-12-14T09:00:11Z",
  //   "due_date": "2020-01-14T00:00:00Z",
  //   "overdue": false,
  //   "remind_at": null,
  //   "resource_id": 29732437,
  //   "content": "Schedule a meeting",
  //   "created_at": "2019-10-01T09:00:21Z",
  //   "updated_at": "2019-10-01T09:00:21Z"
  // }
});

Lead object

A lead represents an individual or an organization that expresses interest in your goods or services. You can assign an organization to an individual via organizationName field.

lead

Retrieves the lead object with some of its properties.

get
client.get('lead')
returns
{
  "lead": {
    "id": 4,
    "firstName": "Mark",
    "lastName": "Johnson",
    "organizationName": "Design Services Company",
    "status": "Unqualified",
    "title": "CEO",
    "description": "I know him via Tom",
    "industry": "Design Services",
    "website": "www.designservices.com",
    "email": "[email protected]",
    "phone": "508-778-6516",
    "mobile": "508-778-6516",
    "fax": "+44-208-1234567",
    "twitter": "mjohnson",
    "facebook": "mjohnson",
    "linkedin": "mjohnson",
    "skype": "mjohnson",
    "address": null,
    "tags": ["important"],
    "createdAt": "2014-09-27T16:32:56Z",
    "updatedAt": "2014-09-28T16:32:56Z"
  }
}

Properties

Actions

lead.id

The unique identifier of the lead.

get
client.get('lead.id')
returns
{
  "lead.id": 4
}
lead.creator

The user who created the lead.

get
client.get('lead.creator')
returns
{
  "lead.creator": {
    "id": 8
  }
}
lead.creator.id

The unique identifier of the user.

get
client.get('lead.creator.id')
returns
{
  "lead.creator.id": 8
}
lead.owner

The user the lead is currently assigned to.

get
client.get('lead.owner')

See the User object for the returned properties (lead.owner.*).

lead.firstName

First name of the lead.

get
client.get('lead.firstName')
returns
{
  "lead.firstName": "Mark"
}
lead.lastName

Last name of the lead. Required only if the lead is an individual.

get
client.get('lead.lastName')
returns
{
  "lead.lastName": "Johnson"
}
lead.organizationName

Organization name of the lead. Required unless lastName field is provided.

get
client.get('lead.organizationName')
returns
{
  "lead.organizationName": "Design Services Company"
}
lead.status

Status of the lead.

get
client.get('lead.status')
returns
{
  "lead.status": "Unqualified"
}
lead.source

Source of the lead.

get
client.get('lead.source')
returns
{
  "lead.source": {
    "id": 10
  }
}
lead.source.id

Unique identifier of the source.

get
client.get('lead.source.id')
returns
{
  "lead.source.id": 10
}
lead.title

The lead's job title.

get
client.get('lead.title')
returns
{
  "lead.title": "CEO"
}
lead.description

The lead's description.

get
client.get('lead.description')
returns
{
  "lead.description": "I know him via Tom"
}
lead.industry

The lead's industry.

get
client.get('lead.industry')
returns
{
  "lead.industry": "Design Services"
}
lead.website

The lead's website address.

get
client.get('lead.website')
returns
{
  "lead.website": "www.designservices.com"
}
lead.email

The lead's email address.

get
client.get('lead.email')
returns
{
  "lead.email": "[email protected]"
}
lead.phone

The lead's phone number.

get
client.get('lead.phone')
returns
{
  "lead.phone": "508-778-6516"
}
lead.mobile

The lead's mobile phone number.

get
client.get('lead.mobile')
returns
{
  "lead.mobile": "508-778-6516"
}
lead.fax

The lead's fax number.

get
client.get('lead.fax')
returns
{
  "lead.fax": "+44-208-1234567"
}
lead.twitter

The lead's Twitter handle.

get
client.get('lead.twitter')
returns
{
  "lead.twitter": "mjohnson"
}
lead.facebook

The lead's Facebook nickname.

get
client.get('lead.facebook')
returns
{
  "lead.facebook": "mjohnson"
}
lead.linkedin

The lead's LinkedIn nickname.

get
client.get('lead.linkedin')
returns
{
  "lead.linkedin": "mjohnson"
}
lead.skype

The lead's Skype nickname.

get
client.get('lead.skype')
returns
{
  "lead.skype": "mjohnson"
}
lead.address

The lead's address.

get
client.get('lead.address')
returns
{
  "lead.address": {
    "line1": "2726 Smith Street",
    "city": "Hyannis",
    "postalCode": "02601",
    "state": "MA",
    "country": "US"
  }
}
lead.address.line1

First line of the address. Example: number and street name.

get
client.get('lead.address.line1')
returns
{
  "lead.address.line1": "2726 Smith Street"
}
lead.address.city

City name.

get
client.get('lead.address.city')
returns
{
  "lead.address.city": "Hyannis"
}
lead.address.postalCode

Zip code or equivalent.

get
client.get('lead.address.postalCode')
returns
{
  "lead.address.postalCode": "02601"
}
lead.address.state

State name.

get
client.get('lead.address.state')
returns
{
  "lead.address.state": "MA"
}
lead.address.country

Country name.

get
client.get('lead.address.country')
returns
{
  "lead.address.country": "US"
}
lead.tags

An array of tags for the lead.

get
client.get('lead.tags')
returns
{
  "lead.tags": ["important"]
}
lead.customFields

Custom fields are a key-value pair attached to a lead.

get
client.get('lead.customFields')
returns
{
  "lead.customFields": ['Last Location', 'Current Vendor', 'my custom field name']
}
lead.customFields:fieldName

Retrieves the value of a custom field. Add the custom field name to the path of the request after a colon.

get
client.get('lead.customFields:my custom field name')
retuns
{
  "lead.customFields:my custom field name": "my value"
}

See Custom Fields in the Sell REST API docs for possible return types.

lead.createdAt

Lead's creation date and time (UTC, ISO8601 format).

get
client.get('lead.createdAt')
returns
{
  "lead.createdAt": "2014-09-27T16:32:56Z"
}
lead.updatedAt

Lead's last update date and time (UTC, ISO8601 format).

get
client.get('lead.updatedAt')
returns
{
  "lead.updatedAt": "2014-09-28T16:32:56Z"
}
lead.notes
lead.notes.create

Creates a note for the lead.

invoke
client.invoke('lead.notes.create', 'Called them, but no answer.');
argument
  • Content of the note (string)
returns
{
  "lead.notes.create": {
    "id": 32661,
    "creator_id": 42616,
    "resource_type": "sales_account",
    "resource_id": 29732437,
    "content": "Called them, but no answer",
    "created_at": "2019-10-01T09:00:21Z",
    "updated_at": "2019-10-01T09:00:21Z"
  }
}
lead.tasks
lead.tasks.create

Creates a task for the lead.

invoke
client.invoke('lead.tasks.create', 'Schedule a meeting', '2020-01-14');
arguments
  • Content of the task (string)
  • Due date of the task (string)
returns
{
  "lead.tasks.create": {
    "id": 32661,
    "creator_id": 42616,
    "owner_id": 42616,
    "resource_type": "sales_account",
    "completed": false,
    "completed_at": null,
    "due_date": "2020-01-14T00:00:00Z",
    "overdue": false,
    "remind_at": null,
    "resource_id": 29732437,
    "content": "Schedule a meeting",
    "created_at": "2019-10-01T09:00:21Z",
    "updated_at": "2019-10-01T09:00:21Z"
  }
}