The Leads API provides a simple interface to manage leads. 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 organization_name field.

The API allows you to create, read, delete and update your leads. You can retrieve individual leads, as well as list of all leads.

NameRead OnlyTypeDescription
idtruenumberUnique identifier of the lead.
creator_idtruenumberUnique identifier of the user who created the lead.
owner_idfalsenumberUnique identifier of the user who currently owns the lead.
first_namefalsestringFirst name of the lead.
last_namefalsestringLast name of the lead. Required unless organization_name field is provided.
organization_namefalsestringOrganization name of the lead. Required unless last_name field is provided.
statusfalsestringStatus of the lead.
source_idfalsenumberUnique identifier of the Source.
titlefalsestringJob title of the lead.
descriptionfalsestringLead description.
industryfalsestringOrganization's industry.
websitefalsestringLead's website.
emailfalsestringLead's email.
phonefalsestringLead's phone number.
mobilefalsestringLead's mobile phone number.
faxfalsestringLead's fax number.
twitterfalsestringLead's X (formerly Twitter) handle.
facebookfalsestringLead's Facebook nickname.
linkedinfalsestringLead's Linkedin nickname.
skypefalsestringLead's Skype nickname.
addressfalseAddressThe lead's address. For more information about address object see Address.
tagsfalsearrayAn array of tags for a lead. See more at Tags.
custom_fieldsfalseobjectCustom fields are a either a single key-value pair attached to a lead or a set of key-value pairs attached to a lead. See more at Custom Fields.
created_attruestringDate and time of the creation in UTC (ISO8601 format).
updated_attruestringDate and time of the last update in UTC (ISO8601 format).

Retrieve all leads

GET /v2/leads

Returns all leads available to the user, according to the parameters provided.

Parameters

NameRequiredTypeInDescription
pagefalsenumberQueryPage number to start from. Page numbering starts at 1 and omitting the page parameter will return the first page.
per_pagefalsenumberQueryNumber of records to return per page. The default limit is 25 and the maximum number that can be returned is 100.
sort_byfalsestringQueryA field to sort by. You can sort by filterable custom fields as well. Example: To sort by a custom field named "external_id", use ?sort_by=custom_fields:external_id. Supported custom field types: Number, Single Line Text, Dropdown, Multi Select). The default ordering is ascending. If you want to change the sort order to descending, append :desc to the field. Example: sort_by=last_name:desc. Possible values: "id", "first_name", "last_name", "organization_name", "email", "custom_fields", "created_at", "updated_at"
idsfalsestringQueryComma-separated list of lead IDs to be returned in a request.
creator_idfalsenumberQueryUser ID. Returns all leads created by that user.
owner_idfalsenumberQueryUser ID. Returns all leads owned by that user.
source_idfalsenumberQueryId of the Source.
first_namefalsestringQueryFirst name of the lead.
last_namefalsestringQueryLast name of the lead.
organization_namefalsestringQueryOrganization name of the lead.
statusfalsestringQueryStatus of the lead.
emailfalsestringQueryEmail address of the lead.
phonefalsestringQueryPhone number of the lead.
mobilefalsestringQueryMobile phone number of the lead.
address[city]falsestringQueryCity name.
address[postal_code]falsestringQueryZip or Postal code
address[state]falsestringQueryState/region name.
address[country]falsestringQueryCountry name.
custom_fieldsfalsestringQueryFilterable custom field. Example: To find leads with a custom field named "external_id" with a value of "SKU01", use the following: ?custom_fields[external_id]=SKU01. Supported custom field types: Number, Single Line Text, Dropdown, Multi Select. Custom fields must be defined and have a Filterable property assigned to them.
inclusiveoptionalbooleanQueryIndicates how filters should be combine. true value, the default, uses AND logic. false value uses OR logic to combine filters.

Allowed for

  • Agents

Using cURL

curl -v -X GET https://api.getbase.com/v2/leads \-H "Accept: application/json" \-H "Authorization: Bearer $ACCESS_TOKEN"

Example response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8Content-Language: en
{  "items": [    {      "data": {        "id": 1,        "creator_id": 1,        "owner_id": 1,        "first_name": "Mark",        "last_name": "Johnson",        "organization_name": "Design Services Company",        "status": "New",        "source_id": 10,        "title": "CEO",        "description": "I know him via Tom",        "industry": "Design Services",        "website": "http://www.designservice.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": {          "line1": "2726 Smith Street",          "city": "Hyannis",          "postal_code": "02601",          "state": "MA",          "country": "US"        },        "tags": [          "important"        ],        "custom_fields": {          "known_via": "tom"        },        "created_at": "2014-08-27T16:32:56Z",        "updated_at": "2014-08-27T16:32:56Z"      },      "meta": {        "type": "lead"      }    }  ],  "meta": {    "type": "collection",    "count": 1,    "links": {      "self": "http://api.getbase.com/v2/leads.json"    }  }}

Create a lead

POST /v2/leads

Creates a new lead. A lead may represent a single individual or an organization.

Parameters

NameRequiredTypeInDescription
last_nametruestringBodyRequired only if a lead is an individual. company_name is empty.
organization_nametruestringBodyRequired only if a lead is an organization. last_name is empty.
first_namefalsestringBody
owner_idfalsenumberBodyDefaults to user's unique identifier the lead is created by.
statusfalsestringBody
source_idfalsenumberBody
unqualified_reason_idfalsenumberBody
titlefalsestringBody
descriptionfalsestringBody
industryfalsestringBody
websitefalsestringBody
emailfalsestringBody
phonefalsestringBody
mobilefalsestringBody
faxfalsestringBody
twitterfalsestringBody
facebookfalsestringBody
linkedinfalsestringBody
skypefalsestringBody
addressfalseAddressBody
tagsfalsearrayBodyExample: ["important"]
custom_fieldsfalseobjectBodyExample: {"known_via": "tom"}. See Custom Fields.

Allowed for

  • Agents

Using cURL

curl -v -X POST https://api.getbase.com/v2/leads \-H "Accept: application/json" \-H "Content-Type: application/json" \-H "Authorization: Bearer $ACCESS_TOKEN" \-d '{  "data": {    "first_name": "Mark",    "last_name": "Johnson",    "organization_name": "Design Services Company",    "source_id": 10,    "title": "CEO",    "description": "I know him via Tom",    "industry": "Design Services",    "website": "http://www.designservice.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": {      "line1": "2726 Smith Street",      "city": "Hyannis",      "postal_code": "02601",      "state": "MA",      "country": "US"    },    "tags": [      "important"    ],    "custom_fields": {      "known_via": "tom"    }  }}'

Example response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8Content-Language: en
{  "data": {    "id": 1,    "creator_id": 1,    "owner_id": 1,    "first_name": "Mark",    "last_name": "Johnson",    "organization_name": "Design Services Company",    "status": "New",    "source_id": 10,    "title": "CEO",    "description": "I know him via Tom",    "industry": "Design Services",    "website": "http://www.designservice.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": {      "line1": "2726 Smith Street",      "city": "Hyannis",      "postal_code": "02601",      "state": "MA",      "country": "US"    },    "tags": [      "important"    ],    "custom_fields": {      "known_via": "tom"    },    "created_at": "2014-08-27T16:32:56Z",    "updated_at": "2014-08-27T16:32:56Z"  },  "meta": {    "type": "lead"  }}

Retrieve a single lead [GET]

GET /v2/leads/:id

Returns a single lead available to the user, according to the unique lead ID provided. If the specified lead does not exist, this query returns an error.

Parameters

NameRequiredTypeInDescription
idtruenumberQueryUnique identifier of the lead.

Allowed for

  • Agents

Using cURL

curl -v -X GET https://api.getbase.com/v2/leads/1 \-H "Accept: application/json" \-H "Authorization: Bearer $ACCESS_TOKEN"

Example response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8Content-Language: en
{  "data": {    "id": 1,    "creator_id": 1,    "owner_id": 1,    "first_name": "Mark",    "last_name": "Johnson",    "organization_name": "Design Services Company",    "status": "New",    "source_id": 10,    "title": "CEO",    "description": "I know him via Tom",    "industry": "Design Services",    "website": "http://www.designservice.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": {      "line1": "2726 Smith Street",      "city": "Hyannis",      "postal_code": "02601",      "state": "MA",      "country": "US"    },    "tags": [      "important"    ],    "custom_fields": {      "known_via": "tom"    },    "created_at": "2014-08-27T16:32:56Z",    "updated_at": "2014-08-27T16:32:56Z"  },  "meta": {    "type": "lead"  }}

Update a lead

PUT /v2/leads/:id

Updates lead information. If the specified lead does not exist, this query returns an error.

In order to modify tags, you need to supply the entire set of tags. tags are replaced every time they are used in a request.

Parameters

NameRequiredTypeInDescription
idtruenumberQueryUnique identifier of the lead.
owner_idfalsenumberBody
first_namefalsestringBodye.g.Mark
last_namefalsestringBodye.g.Johnson
organization_namefalsestringBodye.g.Design Services Company
statusfalsestringBodye.g.Unqualified
source_idfalsenumberBody
unqualified_reason_idfalsenumberBody
titlefalsestringBodye.g.CEO
descriptionfalsestringBodye.g.I know him via Tom
industryfalsestringBodye.g.Design Services
websitefalsestringBodye.g.www.designservices.com
emailfalsestringBodye.g.[email protected]
phonefalsestringBodye.g.508-778-6516
mobilefalsestringBodye.g.508-778-6516
faxfalsestringBodye.g.+44-208-1234567
twitterfalsestringBodye.g.mjohnson
facebookfalsestringBodymjohnson
linkedinfalsestringBodye.g. mjohnson
skypefalsestringBodye.g. mjohnson
addressfalseAddressBody
tagsfalsearrayBodyTo modify the list, you must supply the entire updated list. Example: ["important"]
custom_fieldsfalseobjectBodyExample: {"known_via": "tom"}. See Custom Fields.

Allowed for

  • Agents

Using cURL

curl -v -X PUT https://api.getbase.com/v2/leads/:id \-H "Accept: application/json" \-H "Content-Type: application/json" \-H "Authorization: Bearer $ACCESS_TOKEN" \-d '{  "data": {    "tags": [      "important",      "friend"    ]  }}'

Example response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8Content-Language: en
{  "data": {    "id": 1,    "creator_id": 1,    "owner_id": 1,    "first_name": "Mark",    "last_name": "Johnson",    "organization_name": "Design Services Company",    "status": "New",    "source_id": 10,    "title": "CEO",    "description": "I know him via Tom",    "industry": "Design Services",    "website": "http://www.designservice.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": {      "line1": "2726 Smith Street",      "city": "Hyannis",      "postal_code": "02601",      "state": "MA",      "country": "US"    },    "tags": [      "important",      "friend"    ],    "custom_fields": {      "known_via": "tom"    },    "created_at": "2014-08-27T16:32:56Z",    "updated_at": "2014-08-27T16:32:56Z"  },  "meta": {    "type": "lead"  }}

Delete a lead

DELETE /v2/leads/:id

Delete an existing lead. If the specified lead does not exist, this query returns an error. This operation cannot be undone.

Parameters

NameRequiredTypeInDescription
idtruenumberQueryUnique identifier of the lead.

Allowed for

  • Agents

Using cURL

curl -v -X DELETE https://api.getbase.com/v2/leads/1 \-H "Authorization: Bearer $ACCESS_TOKEN"

Example response

HTTP/1.1 204 No Content

Upsert a lead

POST /v2/leads/upsert

Create a new lead or update an existing, based on a value of a filter or a set of filters. At least a single filter - query parameter - is required. If no parameters are present, the request will return an error.

Behaviour:

  1. If multiple leads match a set of filters, the request will return an error - 409.
  2. If a single lead matches, then the existing lead is updated
  3. If none matches the query, a new lead is created

Notice Use Upsert API, instead of Create or Update, to avoid creating unwanted, duplicated records. Also very useful if you want Sell to carry external system ids - stored as custom fields.

Parameters

NameRequiredTypeInDescription
creator_idfalsenumberBodyUser ID. Returns all leads created by that user.
owner_idfalsenumberBodyUser ID. Returns all leads owned by that user.
source_idfalsenumberBodyId of the Source.
first_namefalsestringBodyFirst name of the lead.
last_namefalsestringBodyLast name of the lead.
organization_namefalsestringBodyOrganization name of the lead.
statusfalsestringBodyStatus of the lead.
emailfalsestringBodyEmail address of the lead.
phonefalsestringBodyPhone number of the lead.
mobilefalsestringBodyMobile phone number of the lead.
address[city]falsestringBodyCity name.
address[postal_code]falsestringBodyZip or Postal code
address[country]falsestringBodyCountry name.
custom_fieldsfalsestringBodyFilterable custom field. Example: To perform an upsert on a lead with a custom field named "external_id" with a value of "SKU01", use the following: ?custom_fields[external_id]=SKU01. Custom fields must be defined and have a Filterable property assigned to them. Supported custom field types: Number, Single Line Text, Dropdown, Multi Select.
inclusivefalsebooleanBodyIndicates how filters should be combine. true value, the default, uses AND logic. false value uses OR logic to combine filters.

Allowed for

  • Agents

Using cURL

curl -v -X POST https://api.getbase.com/v2/leads/upsert?custom_fields[external_id]=SKU01 \-H "Accept: application/json" \-H "Content-Type: application/json" \-H "Authorization: Bearer $ACCESS_TOKEN" \-d '{  "data": {    "address": {      "line1": "494 Oak Lane"    },    "custom_fields": {      "external_id": "SKU01"    }  }}'

Example response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8Content-Language: en
{  "data": {    "id": 1,    "creator_id": 1,    "owner_id": 1,    "first_name": "Mark",    "last_name": "Johnson",    "organization_name": "Design Services Company",    "status": "New",    "title": "CEO",    "description": "I know him via Tom",    "industry": "Design Services",    "website": "http://www.designservice.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": {      "line1": "494 Oak Lane",      "city": "Hyannis",      "postal_code": "02601",      "state": "MA",      "country": "US"    },    "tags": [      "important"    ],    "custom_fields": {      "external_id": "SKU01",      "known_via": "tom"    },    "created_at": "2015-07-16T17:14:16Z",    "updated_at": "2014-08-27T16:32:56Z"  },  "meta": {    "type": "lead"  }}