Oktopost

Integration Actions

Execute operations on connected integrations like Salesforce, Marketo, and HubSpot through a unified API.

Integration Actions

Perform operations on connected integrations through the Oktopost API. This endpoint provides a unified interface to execute actions on Salesforce, Marketo, and HubSpot integrations.

The integration must have a valid status and be enabled before actions can be executed. Use the Integrations endpoint to verify integration state.

Execute Action

Execute an action on a connected integration. The available actions depend on the integration type.

Parameters

ParameterTypeRequiredDescription
idStringYesThe Integration ID (15 characters, e.g. 014000000000001).
actionNameStringYesThe action name. Must be a supported action for the integration type.
payloadJSONNoJSON-encoded object containing action-specific parameters. Default: .

Request

curl https://api.oktopost.com/v2/integration-action -X POST \
  -d id="014000000000001" \
  -d actionName="contact.getByEmail" \
  -d payload='{"email":"john@example.com"}'

Response

{
  "Result": true,
  "IntegrationAction": {
    "Id": "12345",
    "Email": "john@example.com",
    "FirstName": "John",
    "LastName": "Doe"
  }
}

Error Response

{
  "Result": false,
  "Errors": ["Missing required field: email"]
}

Supported Integrations

  • Salesforce — Leads, Contacts, Accounts, Tasks, Cases, Case Comments
  • Marketo — Lists, Leads, Custom Activities
  • HubSpot — Contacts, Timeline Events

Salesforce Actions

Lead

ActionDescriptionPayload Fields
lead.getByIdGet a lead by Salesforce IDid (string, required)
lead.getByEmailGet a lead by email addressemail (string, required)
lead.searchSearch leads by keywordsearch (string, required)
lead.createCreate a new leaddata (object, required) — field/value pairs
lead.updateUpdate an existing leadid (string, required), data (object, required)

Example — Create Lead

curl https://api.oktopost.com/v2/integration-action -X POST \
  -d id="014000000000001" \
  -d actionName="lead.create" \
  -d payload='{"data":{"LastName":"Doe","Company":"Acme","Email":"john@acme.com"}}'

Contact

ActionDescriptionPayload Fields
contact.getByIdGet a contact by Salesforce IDid (string, required)
contact.getByEmailGet a contact by email addressemail (string, required)
contact.searchSearch contacts by keywordsearch (string, required)
contact.createCreate a new contactdata (object, required) — field/value pairs
contact.updateUpdate an existing contactid (string, required), data (object, required)

Account

ActionDescriptionPayload Fields
account.getByIdGet an account by Salesforce IDid (string, required)
account.createCreate a new accountdata (object, required) — field/value pairs
account.updateUpdate an existing accountid (string, required), data (object, required)
account.deleteDelete an accountid (string, required)

Task

ActionDescriptionPayload Fields
task.createCreate a new taskdata (object, required) — field/value pairs

Case

ActionDescriptionPayload Fields
case.getByIdGet a case by Salesforce IDid (string, required)
case.getAllGet all cases(none)
case.createCreate a new casedata (object, required) — field/value pairs
case.updateUpdate an existing caseid (string, required), data (object, required)

Case Comment

ActionDescriptionPayload Fields
caseComment.getByIdGet a comment by IDid (string, required)
caseComment.getByCaseIdGet all comments for a casecaseId (string, required)
caseComment.createAdd a comment to a casecaseId (string, required), data (object, required)
caseComment.updateUpdate a case commentcaseId (string, required), commentId (string, required), data (object, required)

For Salesforce create and update actions, the data object should contain Salesforce field API names as keys. Required fields depend on your Salesforce org configuration.


Marketo Actions

List

ActionDescriptionPayload Fields
list.getAllGet all static lists(none)
list.addLeadsAdd leads to a static listlistId (string, required), leadIds (array of integers, required)

Example — Add Leads to List

curl https://api.oktopost.com/v2/integration-action -X POST \
  -d id="014000000000002" \
  -d actionName="list.addLeads" \
  -d payload='{"listId":"1234","leadIds":[100,200,300]}'

Lead

ActionDescriptionPayload Fields
lead.createUpdateCreate or update a leademail (string, required), data (object, required) — attributes to sync
lead.createCreate a new leaddata (object, required) — see supported fields below

Supported fields for lead.create:

Email, Company, FirstName, LastName, Phone, StreetAddress, City, State, Country, ZipCode, JobTitle, WorkPhone, WorkEmail

Custom fields (ending in __c) are automatically matched against your Marketo instance schema.

Example — Create Lead

curl https://api.oktopost.com/v2/integration-action -X POST \
  -d id="014000000000002" \
  -d actionName="lead.create" \
  -d payload='{"data":{"Email":"john@acme.com","FirstName":"John","LastName":"Doe","Company":"Acme"}}'

Activity

ActionDescriptionPayload Fields
activity.addCustomAdd a custom activityleadId (integer, required), activityTypeId (integer, required), primaryAttributeValue (string, required)

Optional fields for activity.addCustom:

FieldTypeDescription
attributesObjectAssociative object of {fieldName: value} pairs for activity attributes
activityDateStringISO 8601 date string. Defaults to current time if omitted.

Example — Add Custom Activity

curl https://api.oktopost.com/v2/integration-action -X POST \
  -d id="014000000000002" \
  -d actionName="activity.addCustom" \
  -d payload='{"leadId":12345,"activityTypeId":100001,"primaryAttributeValue":"https://example.com/post","attributes":{"postUrl":"https://example.com/post","network":"LinkedIn"}}'

HubSpot Actions

Contact

ActionDescriptionPayload Fields
contact.getByEmailLook up a contact by emailemail (string, required)
contact.getByIdLook up a contact by HubSpot IDid (string, required)
contact.createCreate a new contactdata (object, required) — property/value pairs

For HubSpot contact lookups (contact.getByEmail, contact.getById), a null contact is returned when no match is found — this is not treated as an error.

Property names for contact.create must use HubSpot's internal lowercase names: email, firstname, lastname, company, phone, website, etc.

Example — Create Contact

curl https://api.oktopost.com/v2/integration-action -X POST \
  -d id="014000000000003" \
  -d actionName="contact.create" \
  -d payload='{"data":{"email":"john@acme.com","firstname":"John","lastname":"Doe","company":"Acme"}}'

Example — Lookup Response (not found)

{
  "Result": true,
  "IntegrationAction": {
    "contact": null
  }
}

Timeline Event

ActionDescriptionPayload Fields
event.upsertCreate or update a timeline eventid (string, required), eventTypeId (string, required), email (string, required)

Optional fields for event.upsert:

FieldTypeDescription
extraDataObjectAdditional data to attach to the event
propertiesObjectToken values for the event template

Example — Upsert Event

curl https://api.oktopost.com/v2/integration-action -X POST \
  -d id="014000000000003" \
  -d actionName="event.upsert" \
  -d payload='{"id":"evt-001","eventTypeId":"12345","email":"john@acme.com","properties":{"postTitle":"My Post"}}'

Validation

The endpoint validates in the following order:

  1. Permission — The API key must have the Integration Add permission.
  2. Integration — The integration must exist and belong to the authenticated account.
  3. Status — The integration status must be valid.
  4. State — The integration state must be enabled.
  5. Integration type — The integration type must be supported (salesforce, marketo, hubspot).
  6. Action — The action must be valid for the integration type.
  7. Payload — All required fields for the action must be present and non-empty.

Error Codes

HTTP CodeCondition
400Invalid payload, unsupported action, validation failure, or integration action error
401Authentication failed (invalid API credentials or expired integration token)
404Integration not found or does not belong to account
500Unexpected server error