API Requests

Create API request endpoints

Define the reusable HTTP request that campaign workflow actions can run whenever they need external JSON data.

An API request endpoint stores the request configuration once so campaign workflows can reuse it. Each endpoint belongs to the selected workspace and can be enabled, disabled, edited, tested, or deleted from the API Requests integration page.

Before you start

Make sure the external API:

  • accepts requests from Leadpush
  • returns a JSON object or JSON array
  • responds within the timeout you plan to use
  • has the authentication values you need, such as bearer tokens or API keys

Avoid putting secrets in query strings or URL paths when the external API supports authentication headers.

Create an endpoint

Open API Requests

From the dashboard, choose a workspace, open Integrations, then open API Requests.

Create the endpoint

Select Create Endpoint and enter a descriptive name such as Customer Profile.

Configure the request

Choose the HTTP method, enter the URL template, set the timeout, and keep the endpoint enabled if it is ready for workflows.

Add optional templates

Use Request Body for a body template. Use Advanced request options for header and query parameter templates.

Save and test

Save the endpoint, then use Test endpoint to confirm Leadpush receives the expected JSON response.

Endpoint fields

FieldDescription
NameA workspace-visible label for the endpoint. Use a purpose-based name, such as Customer Profile or Plan Lookup.
EnabledDisabled endpoints cannot run from campaign workflows.
MethodThe HTTP method Leadpush should use: GET, POST, PUT, PATCH, or DELETE.
URL TemplateThe external URL. Template variables can be inserted into the URL path.
TimeoutHow long Leadpush waits before treating the request as failed.
Body TemplateOptional request body. Use JSON when the receiver expects JSON.
Headers TemplateOptional request headers, such as Authorization or X-API-Key.
Query TemplateOptional query string parameters. Values can include template variables.

Template variables

Use the template variable picker in the endpoint form to copy variables in the correct format.

VariableExample use
workspace.uuidSend the Leadpush workspace identifier to an internal API.
workspace.nameInclude the workspace name in a request body.
contact._idLook up a profile by Leadpush contact ID.
contact.attributes.emailLook up a customer by email address.
contact.subscribedPass the current subscription state.
campaign.uuidIdentify the campaign that is running.
campaign.nameInclude the campaign name in a request body or query parameter.
workflow.execution_uuidCorrelate the request to a workflow execution.
workflow.current_step_uuidCorrelate the request to the current workflow step.
workflow.<output_key>.<field>Reuse JSON returned by an earlier Fetch API Data step.
node.idInclude the current workflow node ID.
node.typeInclude the current workflow node type.

Example endpoint

Use a URL template when the external API can look up a record directly:

https://api.example.com/customers/{{ contact.attributes.email }}/profile

Use headers for authentication:

HeaderValue
AuthorizationBearer your-token
Acceptapplication/json

Use a body template when the API expects JSON:

{
  "contact_id": "{{ contact._id }}",
  "email": "{{ contact.attributes.email }}",
  "campaign": "{{ campaign.uuid }}"
}

Common mistakes