← All integrations

Close

Let an agent work your sales CRM without the run of it. It searches and reads leads, contacts and opportunities, creates and updates them, logs notes and creates and completes tasks, and deleting a lead can wait for a person.

Closesecret · CLOSE
host
api.close.com
connect
API key, per user
  • Create lead

    close-create-lead

  • Update lead

    close-update-lead

  • Delete lead

    close-delete-lead

  • Create contact

    close-create-contact

writes are off until switched on

Reads and writes in Close. Writes are off until you switch them on.

Each one is a named operation from the pack. Reads change nothing.

Writes

  • Create lead

    read back

    close-create-lead

    Create one lead with a name, and optionally a url, a description, a status and its contacts (each with emails and phones).

  • Update lead

    read back

    close-update-lead

    Update one lead's name, url, description or status. Fields you leave out stay as they are.

  • Delete lead

    read back

    close-delete-lead

    Delete one lead with its contacts, opportunities, tasks and activities. It cannot be undone through the API.

  • Create contact

    read back

    close-create-contact

    Create one contact on an existing lead, with a name, and optionally a title, emails and phones.

  • Create opportunity

    read back

    close-create-opportunity

    Create one opportunity on a lead, optionally with a status, a value in cents, a value period, a confidence and a note. The value records what the deal is worth; no money moves. Close uses the organization's default status when it is left out.

  • Update opportunity

    read back

    close-update-opportunity

    Update one opportunity's status (to move it or mark it won or lost), value in cents, value period, confidence or note. Fields you leave out stay as they are. The value records what the deal is worth; no money moves.

  • Add note

    read back

    close-add-note

    Log one note activity on a lead, in plain text. Nobody is notified outside Close.

  • Create task

    read back

    close-create-task

    Create one open task on a lead, with its text, and optionally a due date and an assignee. Close assigns it to the key's own user when assigned_to is left out.

  • Complete task

    read back

    close-complete-task

    Mark one task complete.

Reads

  • Search leads

    close-search-leads

    Search leads with Close's search syntax, or list all leads when query is left out. Returns up to 20 leads a page, each with id, display_name, status_id, status_label, url and dates, plus has_more and total_results. Examples: name:"Acme", email_address:"jo@acme.com", company:"Acme". Page with skip while has_more is true. Close makes very deep skips slow or refuses them, so narrow the query instead.

  • Get lead

    close-get-lead

    Get one lead: name, description, url, status, its contacts (with emails and phones), its opportunities and addresses, and dates. Custom fields are not returned.

  • Get contact

    close-get-contact

    Get one contact: name, title, the lead it belongs to (lead_id), emails, phones, urls and dates. A lead's contacts and their ids are listed by get-lead.

  • List lead statuses

    close-list-lead-statuses

    List the organization's lead statuses: id and label. A lead's status_id is one of these.

  • List opportunity statuses

    close-list-opportunity-statuses

    List the organization's opportunity statuses: id, label and type (active, won or lost). An opportunity's status_id is one of these.

  • List opportunities

    close-list-opportunities

    List opportunities, 20 a page, of one lead, of one user or of one status type. Each has its id, lead_id, status_id, status_label, status_type, value (in cents), value_period, value_formatted, confidence, note, owner (user_id) and dates. Page with skip while has_more is true.

  • Get opportunity

    close-get-opportunity

    Get one opportunity: lead, status and its type, value (in cents), value_period, confidence, note, contact, owner and dates.

  • List tasks

    close-list-tasks

    List lead tasks, 20 a page, of one lead, of one assignee, open or complete. Each has its id, lead_id, text, date (due), is_complete, assigned_to and date_created. Other task types (missed calls, voicemails) are not listed. Page with skip while has_more is true.

  • Get task

    close-get-task

    Get one task: lead, text, due date, is_complete, assignee and dates.

  • List activities

    close-list-activities

    List the activities on one lead, 10 a page: notes, calls, emails and SMS, or one of those types. Each has its _type, id, date_created, contact_id, user_id, and for a call its direction and duration, for a note its text. Email bodies are not returned. Page with skip while has_more is true. A page of long notes can be cut at the response limit.

  • Get note

    close-get-note

    Get one note activity: its text (note and note_html), lead, contact, author and dates. Note ids come from list-activities.

How do users connect? Each one brings their own Close.

  1. 1.Call for the userYour server invokes the action for the signed-in user. Without a Close connection, the SDK throws EndUserNotConnectedError with a connect link.
  2. 2.The user pastes a keyThe link opens a form that shows where in Close's settings to create the key. The link lasts 10 minutes and works once.
  3. 3.Anlyon checks itThe key is checked with Close before it is kept, and bound to api.close.com. It is never shown back.
  4. 4.Your server confirmsYour server confirms the connection for the user who is signed in, and the call goes through.

Guardrails. Suggested limits and approvals, for you to review.

Suggested limits

  • 100 leads created a day
  • 200 leads updated a day
  • 20 leads deleted a day
  • 100 contacts created a day
  • 50 opportunities created a day
  • 200 opportunities updated a day
  • 300 notes a day
  • 200 tasks created a day
  • 300 tasks completed a day

Suggested approvals

  • A person approves deleting a lead

What the key must allow

  • An API key you create, which starts with api_
  • It acts as you in your organization

Good to know

  • Create the key from a user whose role fits what your agent should do.
  • Close accepts two leads with the same name. The agent searches before it creates.

For your own account

  1. 1.In Close, open Settings, Developer, API keys, and create a key.
  2. 2.In Anlyon, open Actions, then Integrations, choose Close and paste the key.
  3. 3.Anlyon checks the key with Close before storing it. It becomes a secret named CLOSE, bound to api.close.com.

Close in your code. For one of your users, or for your own account.

Act for one of your users from your server, or connect your company's own Close with the CLI.

close.ts
import { Client, EndUserNotConnectedError } from "@anlyonhq/sdk";const anlyon = new Client({ apiKey: process.env.ANLYON_API_KEY! });try {  const { data } = await anlyon    .forUser(session.userId)    .actions.invoke("close-add-note", {      lead_id: "lead_4bG2zxvPh3dEw0MF6oP1u2",      note: "Asked for the security review."    });  return { status: "done", grade: data.grade };} catch (error) {  if (error instanceof EndUserNotConnectedError) {    // The user connects their own Close, then you call again.    return { status: "connect_required", url: error.connectUrl };  }  throw error;}

Let your agent act for your users, safely.

A few lines of server code, then send a user a connect link. Nothing to host.

$ claude mcp add --transport http anlyon https://api.anlyon.com/mcp