EmailmoversMyDataHub docs
Browse the docs

Reference / MCP tool reference

Reference

Push an order to a CRM

push_to_crm: Pushes an order's records to a connected CRM such as HubSpot or Salesforce, keyed on mydatahub_record_id, as record operations only: nothing is ever sent to the contacts.

Generated from the contractsView as Markdown

Pushes an order's records to a connected CRM such as HubSpot or Salesforce, keyed on mydatahub_record_id, as record operations only: nothing is ever sent to the contacts. dry_run defaults to true and reports what would be created, updated or skipped; a live push needs the user's confirmation or an agent key allowed push_to_crm on that connection, or it returns confirmation-required. Free; it needs pushes:write and a connection made in the app. Show the dry run to the user before a live push. Lawful basis is UK GDPR Article 6(1)(f) legitimate interests; email audiences include corporate subscribers only by default (PECR), so sole traders and ordinary partnerships are left out unless the toggle is changed.

PropertyValue
Tool namepush_to_crm
Position in tools/list17 of 22
CostFree
Scopepushes:write
AnnotationsreadOnlyHint false, destructiveHint false, idempotentHint true, openWorldHint true
KindWrite; idempotent, not destructive, open world
REST equivalentPOST /v1/orders/{id}/pushes

Input

The schema sets additionalProperties to false, so a member that is not listed is refused.

MemberTypeRequiredDescription
order_idstringyesThe order whose records to push.
connection_idstringyesFormat: a CRM connection id: conn_ followed by a 26 character ULID in upper case Crockford base32, such as conn_01JB3Y2X6Y7Z8A1B2C3D4E5F6G.
dry_runbooleannoDefault true: report what would change without writing. A live push needs approval: a person's confirmation, or an agent key allowed push_to_crm on this connection. Default true.
update_existingbooleannoUpdate records already in the CRM, matched on mydatahub_record_id. Default true. Default true.
confirmation_tokenstringnoThe token the approval page on mydatahub.emailmovers.com returns once the signed-in person approves. It is bound to that person (their sub), this spend (the machine quote_id, or the enrichment or push) and an expiry no later than the quote's, and it is redeemable once.

Example call

The params of a tools/call request:

{
  "name": "push_to_crm",
  "arguments": {
    "connection_id": "conn_01JB3Y2X6Y7Z8A1B2C3D4E5F6G",
    "order_id": "ord_01JB4N9S3W2X6Y7Z8A1B2C3D4E"
  }
}

Output

The result carries structuredContent that matches this schema, and one line of text that leads with the number.

MemberTypeAlways presentDescription
idstringyesFormat: a CRM push id: psh_ followed by a 26 character ULID in upper case Crockford base32, such as psh_01JB4NC3W2X6Y7Z8A1B2C3D4E5.
order_idstringyesFormat: an order id: ord_ followed by a 26 character ULID in upper case Crockford base32, such as ord_01JB4N9S3W2X6Y7Z8A1B2C3D4E.
connection_idstringyesFormat: a CRM connection id: conn_ followed by a 26 character ULID in upper case Crockford base32, such as conn_01JB3Y2X6Y7Z8A1B2C3D4E5F6G.
dry_runbooleanyes
statusenum: queued, running, completed, partial, failedyes
summaryobjectyes
summary.to_createinteger (0 or more)yes
summary.to_updateinteger (0 or more)yes
summary.already_presentinteger (0 or more)yes
summary.skippedinteger (0 or more)yes
summary.failedinteger (0 or more)yes
property_grouparray of enum: mydatahub_record_id, licence_expires_at, lawful_basis, article14_status, tps_ctps_screened_at, subscriber_class, suppression_status, compliance_receipt_urlyesThe MyDataHub property group written on every record (CrmPropertyGroup).
sampleCrmPropertyGroup or nullyesOn a dry run: the property group the first record would carry.
sample.mydatahub_record_idstringyesThe record id: a Salesforce External ID, a HubSpot unique property, a Pipedrive custom field.
sample.licence_expires_atstring (date) or nullyes
sample.lawful_basisenum: legitimate_interests_art6_1_fyes
sample.article14_statusenum: notified, publicly_notified_disproportionate_effort, pending_within_windowyes
sample.tps_ctps_screened_atstring (date) or nullyes
sample.subscriber_classenum: ltd, plc, llp, scottish_partnership, public_body, charity_incorporated, sole_trader, ordinary_partnership, and 1 moreyes
sample.suppression_statusenum: none, objected_to_emailmovers, objected_to_licensee, deceased, left_companyyesKept current: an objection reaching the record updates it in the CRM.
sample.compliance_receipt_urlstring (uri)yes
errorsarray of objectyes
errors[].record_idstringyes
errors[].messagestringyes
created_atstring (date-time)yes
completed_atstring (date-time) or nullyes

Errors

A failed call returns isError true. The text content leads with the sentence a person acts on, then the whole problem as JSON, with code, detail, next_step and did_you_mean. A 401 and a step-up 403 are answered at HTTP level so the client can start authorisation. See Errors.