-
Notifications
You must be signed in to change notification settings - Fork 0
Resources
This page documents every public function .
Collection endpoints typically return:
{ "data": [/* items */], "has_more": true }Single-object endpoints typically return the created/updated object (or a plain result object, depending on the API).
For endpoints that support pagination / field selection, you can pass either:
- Close-native:
_skip,_limit,_fields - Convenience aliases:
skip,limit,fields(the client converts them)
const Closecom = require('closecrm-node');
const api = new Closecom(process.env.CLOSE_API_KEY);Search leads. If options.query is not provided, the client can build a query string from the other properties in options.
const res = await api.lead.search({
query: 'company:"Acme"',
limit: 100,
skip: 0
});Create a lead. Requires data.name.
const lead = await api.lead.create({ name: 'Acme Inc' });Fetch one lead by id.
Update a lead.
Delete a lead.
Merge two leads. Requires data.source and data.destination.
List/search contacts.
Create a contact.
Fetch one contact.
Update a contact.
Delete a contact.
List/search activities across types.
search(options = {})create(data)read(id)update(id, data)delete(id)
search(options = {})create(data)read(id)update(id, data)delete(id)
search(options = {})create(data)read(id)update(id, data)delete(id)
search(options = {})create(data)read(id)delete(id)
Note: the client does not expose
updatefor SMS.
search(options = {})create(data)read(id)update(id, data)delete(id)
search(options = {})-
create(data, queryParams = {})— supports extra query params on create read(id)update(id, data)delete(id)
search(options = {})create(data)read(id)update(id, data)delete(id)
search(options = {})create(data)read(id)update(id, data)delete(id)
list()create(data)read(id)update(id, data)delete(id)
list()create(data)read(id)update(id, data)delete(id)
list()create(data)read(id)update(id, data)delete(id)
list()create(data)read(id)update(id, data)delete(id)
list()create(data)read(id)update(id, data)delete(id)
Custom activities are addressed by type.
search(type, options = {})create(type, data)read(type, id)update(type, id, data)delete(type, id)
Example:
const type = 'my_custom_activity_type';
const res = await api.custom_activity.search(type, { limit: 50 });list(options = {})create(data)read(id)update(id, data)delete(id)
list(options = {})create(data)read(id)update(id, data)delete(id)
Returns the current user for the API key.
List users.
Get a user.
Update a user.
list(options = {})read(id)update(id, data)
list(options = {})create(data)read(id)update(id, data)delete(id)
list()create(data)read(id)update(id, data)delete(id)
list()create(data)read(id)update(id, data)delete(id)
search(options = {})create(data)read(id)update(id, data)delete(id)
The client maps Close “saved searches” to saved_search, and also provides smart_view as an alias.
list(options = {})create(data)read(id)update(id, data)delete(id)
search(options = {})create(data)read(id)update(id, data)delete(id)
list(options = {})create(data)read(id)update(id, data)delete(id)
List predefined metrics used in activity reports.
Create an activity report (POST endpoint).
Sent emails report grouped by template.
Lead status change report.
Opportunity status change report.
Custom report.
List available fields for custom reports.
Opportunity funnel totals report (POST).
Opportunity funnel stages report (POST).
Search events. The client intentionally does not normalize skip/limit here; options are passed through as-is.
Get one event.
list(options = {})create(data)read(id)update(id, data)delete(id)
Close exposes email threads via activity endpoints.
-
list(options = {})— uses/activity/emailthread/ -
read(id)— uses/activity/emailthread/{id}/
list(options = {})read(id)
Bulk endpoints accept payloads as defined by Close’s API.
-
delete(data)— POST/bulk_delete/ -
email(data)— POST/bulk_email/ -
update(data)— POST/bulk_update/ -
action(data)— POST/bulk_action/
These are part of the Closecom class in close.com.js. While they are “internal-ish” (underscore methods), they exist on the instance and are used throughout.
Returns a new QueryBuilder instance.
const q = api.query().equals('status', 'Potential').and().contains('company', 'Acme');
const res = await api.lead.search({ query: q.toString() });Low-level method. If you call it with two args (field, value), operator defaults to :.
Adds field:value.
Adds field!:value.
Adds field*value.
Adds field>value.
Adds field<value.
Builds an OR group like (field:"a" OR field:"b").
Helpers for chaining conditions.
Returns the query string.
Fetch all pages for any search/list function that returns the { data, has_more } format.
const allLeads = await api.paginate(api.lead.search, { query: 'status:"Potential"', limit: 100 });Async iterator version of paginate(), yielding items one-by-one.
for await (const lead of api.stream(api.lead.search, { query: 'status:"Potential"' })) {
console.log(lead.id);
}Run operations in chunks with configurable concurrency, delay, and progress tracking.
Options:
-
concurrency(default:5) -
delayMs(default:100) onProgress(completed, total)-
continueOnError(default:false)
Returns:
{ "results": [/*...*/], "errors": [{ "item": {}, "error": {} }], "total": 123 }Just contact me:
E-Mail: contact@timdev.info Discord: timdev511