Administrator Guide

Salesforce API

Salesforce package API for CRM records, research, enrich, contact search, and agents.

Salesforce API v2

Last updated: 3 November 2026

This is the Salesforce package API. The caller is a YouEx user who has installed the package into one workspace.

The current contract is the API reference (PDF). For the in-app connection, owners and admins on a Salesforce-entitled plan use Workspace Settings → Integrations.

Salesforce API v2 is included on Professional and Enterprise (salesforcePackage). Use it for CRM, research, enrich, and agents from the package, and for lead sync through bulk upsert.

Base URL

https://engage.youex.ai/api/integrations/salesforce/v2

Paths below are relative to that base.

Authentication

Authorization: Bearer <access_token>
Content-Type: application/json

The token is an Auth0 access token for the Salesforce audience. A scope check passes when the token has any one of the scopes listed for that call.

youex.salesforce.read covers every read scope below. youex.salesforce.write covers every write scope below.

ScopeAllows
youex.salesforce.readAll reads
youex.salesforce.writeAll writes
youex.salesforce.workspace.readAccount, workspaces, fields, and non-lead CRM reads
youex.salesforce.workspace.writeInstall, uninstall, and non-lead CRM writes
youex.salesforce.leads.readLead reads and lead item queries
youex.salesforce.leads.writeLead writes, lead research, and lead enrich
youex.salesforce.agents.readAgent reads

Discovery

These routes do not require a token.

MethodPath
GET/.well-known/oauth-protected-resource
GET/.well-known/oauth-authorization-server

Install and account

CRM calls require a connected installation.

MethodPathScopePurpose
GET/install/startPublic, install limiterStart the package install
GET/install/callbackInstall callbackFinish install and bind a workspace
GET/accountWorkspace readSigned-in account
GET/installable-workspacesWorkspace readWorkspaces this user can install into
GET/installed-workspacesWorkspace readWorkspaces that already have an installation
POST/installWorkspace writeBind the token to a workspace
POST/uninstallWorkspace writeDisconnect a workspace
GET/workspacesWorkspace readInstalled workspaces
GET/workspaces/defaultWorkspace readDefault workspace
GET/workspaces/:workspaceIdWorkspace readOne workspace
POST/workspaces/:workspaceId/selectWorkspace readSelect the workspace

Changing the shared selection on POST /workspaces/:workspaceId/select also needs workspace write.

POST /install body:

{
  "workspaceId": "ws_123",
  "salesforceOrgId": "00Dxx0000000001",
  "salesforceUserId": "005xx0000000001",
  "salesforceUserEmail": "user@example.com",
  "packageVersion": "1.2.0"
}

salesforceUserId, salesforceUserEmail, and packageVersion may be null.

POST /uninstall body:

{ "workspaceId": "ws_123" }

Limits and errors

  • API routes: 180 requests per minute per IP.
  • Install routes: 30 requests per minute per IP.
  • Responses include standard rate-limit headers.
{
  "error": {
    "code": "insufficient_scope",
    "message": "Missing required scope. Expected one of: youex.salesforce.leads.write, youex.salesforce.write",
    "retryable": false
  }
}

A suspended workspace returns 402. Research and enrich also count against the workspace's monthly allowances.

CRM records

:workspaceId is the installed YouEx workspace. :id accepts the YouEx id or the stored Salesforce id.

Create bodies may include /_salesforceId. Unknown keys are rejected.

List query parameters are limit (1–200), cursor, and search, plus the filter named in the table.

A list response is:

{ "leads": [], "total": 0, "hasMore": false, "nextCursor": null }

Contacts, companies, and opportunities use the same shape with contacts, companies, or opportunities. A single record is { "lead": {} } (or contact, company, opportunity).

Bulk upsert accepts 1–200 items:

{
  "items": [
    { "/_salesforceId": "00Qxx0000000001", "name": "Avery Smith", "email": "avery@example.com" }
  ]
}

Response:

{
  "totalReceived": 1,
  "insertedCount": 1,
  "updatedCount": 0,
  "skippedCount": 0,
  "notFoundIds": [],
  "results": [
    {
      "index": 0,
      "action": "inserted",
      "inputId": "00Qxx0000000001",
      "recordId": "lead_01",
      "code": null,
      "message": null
    }
  ]
}

action is inserted, updated, or skipped.

Leads

MethodPathScopeNotes
GET/workspaces/:workspaceId/leadsLeads readFilter status
GET/workspaces/:workspaceId/leads/:idLeads read
POST/workspaces/:workspaceId/leadsLeads write
POST/workspaces/:workspaceId/leads/bulk-upsertLeads write1–200 items
PATCH/workspaces/:workspaceId/leads/:idLeads write
DELETE/workspaces/:workspaceId/leads/:idLeads write

Writable lead fields match the CRM lead, including name, email, secondaryEmail, phone, secondaryPhone, linkedinUrl, company, companyWebsite, title, status, notes, tags, customFields, contactId, companyId, and opportunityId.

Contacts

MethodPathScopeNotes
GET/workspaces/:workspaceId/contactsWorkspace readFilters status, companyId
GET/workspaces/:workspaceId/contacts/:idWorkspace read
POST/workspaces/:workspaceId/contactsWorkspace write
POST/workspaces/:workspaceId/contacts/bulk-upsertWorkspace write
PATCH/workspaces/:workspaceId/contacts/:idWorkspace write
DELETE/workspaces/:workspaceId/contacts/:idWorkspace write

Companies

MethodPathScopeNotes
GET/workspaces/:workspaceId/companiesWorkspace readFilter type
GET/workspaces/:workspaceId/companies/:idWorkspace read
POST/workspaces/:workspaceId/companiesWorkspace write
POST/workspaces/:workspaceId/companies/bulk-upsertWorkspace write
PATCH/workspaces/:workspaceId/companies/:idWorkspace write
DELETE/workspaces/:workspaceId/companies/:idWorkspace write

Opportunities

MethodPathScopeNotes
GET/workspaces/:workspaceId/opportunitiesWorkspace readFilter stage
GET/workspaces/:workspaceId/opportunities/:idWorkspace read
POST/workspaces/:workspaceId/opportunitiesWorkspace write
POST/workspaces/:workspaceId/opportunities/bulk-upsertWorkspace write
PATCH/workspaces/:workspaceId/opportunities/:idWorkspace write
DELETE/workspaces/:workspaceId/opportunities/:idWorkspace write

closePlan and closingNotes accept null and are stored as empty strings.

Contact, company, and opportunity writes use the same customer fields as the Zapier CRM records, plus /_salesforceId and customFields.

Shared status and stage values are the same as the REST API.

Research and enrich are asynchronous. The start call returns 202 with a job id. Poll the status path until finished is true. A research or enrich that is already running returns 202 with finished: false and does not start a second run.

MethodPathScopePurpose
POST/workspaces/:workspaceId/leads/:id/researchLeads writeStart lead research
GET/workspaces/:workspaceId/lead-research/:leadResearchIdLeads readLead research status
POST/workspaces/:workspaceId/leads/:id/enrichLeads writeStart lead enrich
GET/workspaces/:workspaceId/lead-enrichments/:leadEnrichmentIdLeads readLead enrich status
POST/workspaces/:workspaceId/contacts/:id/researchWorkspace writeStart contact research
GET/workspaces/:workspaceId/contact-research/:contactResearchIdWorkspace readContact research status
POST/workspaces/:workspaceId/contacts/:id/enrichWorkspace writeStart contact enrich
GET/workspaces/:workspaceId/contact-enrichments/:contactEnrichmentIdWorkspace readContact enrich status
POST/workspaces/:workspaceId/companies/:id/researchWorkspace writeStart company research
GET/workspaces/:workspaceId/company-research/:companyResearchIdWorkspace readCompany research status
POST/workspaces/:workspaceId/companies/:id/contact-searchesWorkspace writeFind people at a company
GET/workspaces/:workspaceId/contact-searches/:contactSearchIdWorkspace readContact-search status

Contact search body:

{ "jobTitle": "VP Sales", "exactMatch": false, "limit": 10 }

limit is 1–100 and defaults to 10. The start response includes contactSearchId, companyId, status (pending, processing, completed, failed), and finished.

Research and enrich status bodies include status, finished, success, failed, data, and error (code and message) when the job failed.

Fields, items, and agents

MethodPathScopePurpose
GET/workspaces/:workspaceId/fields?instance=leadWorkspace readSelectable fields for lead, contact, company, or opportunity
POST/workspaces/:workspaceId/itemsSee belowRead selected fields for many records
GET/workspaces/:workspaceId/agentsAgents readAgents in the workspace
GET/workspaces/:workspaceId/agents/:idAgents readOne agent

Body for POST /workspaces/:workspaceId/items:

{
  "instance": "lead",
  "fieldKeys": ["name", "email", "status"],
  "limit": 100,
  "cursor": null,
  "search": "acme"
}

fieldKeys has 1–200 entries. limit is 1–1000. search and filter cannot be sent together. Lead items require leads read. Other instances require workspace read.

The response is { "workspaceId", "instance", "items", "total", "hasMore", "nextCursor" }.

Copyright © 2026