API: Copy leads to another campaign

Modified on Thu, 6 Aug at 11:58 AM

API: Copy leads to another campaign

Hubhus has no “move lead” API. To continue a process in another campaign, copy the lead with a POST to /leads from an HTTP request template in the source campaign. Trigger the copy from an automation (status change, payment, button, and so on). The original lead stays where it is — optionally set a status you hide from the table view.

TL;DR

Create an internal API token. In the source campaign, add an HTTP & webhooks POST to https://api.leadvalidator.dk/leads using the create-lead template from your API documentation — set campaign_id to the target campaign and map fields with placeholders. Wire the template into an automation. To “move” visually, set the source lead to a status and hide that status under the lead table Options menu.

Get started in 4 steps

1

Create an internal API token

Go to Account → Integrations & API → API documentation → open the new API documentation → API Tokens → New API Token. Name it clearly (e.g. “Copy lead – internal”), grant write access to create leads, and save. Copy the token value — you need it in the HTTP request header. See API: Setup and authentication.

2

Create a POST HTTP request in the source campaign

In the from campaign, go to Campaign settings → HTTP & webhooks → + Create. Configure:

  • Method: POST
  • URL: https://api.leadvalidator.dk/leads
  • Headers: Content-Type: application/json and Authorization: Bearer YOUR_TOKEN
  • Body: Start from the create lead (POST) example in your Hubhus API documentation. Set campaign_id to the target campaign ID. Map field slugs with Hubhus placeholders from the current lead (e.g. {{email}}, {{firmanavn}}). Use the target campaign’s slug names and select option labels exactly as defined there.

Test the template with a real Lead ID before going live. Details: HTTP requests: Creating custom templates.

3

Trigger the copy with an automation (or button)

In the source campaign, create an automation that runs the HTTP request when the lead should be copied — e.g. invoice paid, offer accepted, status change, or a manual action button on the lead profile. Add requirements so the copy does not fire twice (max fires / “must not already have…”). See How to set up automations and How do I use action buttons?.

4

Optional: hide the source lead from the overview

There is no API move. After a successful copy, set the source lead to a status such as “Copied” / “Archived” (via the same automation). In the lead table, open Options and add that status under hidden statuses so it disappears from the default overview while remaining searchable if needed. See Managing and customizing the lead list.

Endpoint: POST /leads  ·  campaign_id: target campaign  ·  Template lives in: source campaign HTTP & webhooks
Read more

Copy vs move

  • Copy: POST creates a new lead in the target campaign. The source lead is unchanged unless your automation updates it.
  • Move: Not available as an API operation. Simulate a move by copying, then setting a source status you hide from the table Options menu.

Building the POST body

Use the create-lead example from Account → Integrations & API → API documentation (or the campaign API docs). Typical structure:

POST https://api.leadvalidator.dk/leads

{
  "campaign_id": TARGET_CAMPAIGN_ID,
  "field_values": {
    "email": "{{email}}",
    "firmanavn": "{{firmanavn}}"
  },
  "status_slug": "target-status-slug",
  "select_field_values": {
    "select_example": "Exact option label"
  }
}

Replace field slugs with the target campaign’s slugs (Campaign → API documentation → API slug values). Select option labels must match exactly, including special characters. Map only the fields that exist in both campaigns (or that you intentionally set on create).

Example automation triggers

  • Status becomes “Paid” / “Invoice paid”
  • Offer / quotation accepted
  • Manual action button: “Copy to [campaign name]”
  • Any other automation event you already use for handoff between processes

Avoid duplicate copies

Set max fires per lead on the automation, and/or set a select/status on the source lead after the first successful copy and require that it is not already set. Test with one lead before enabling for the whole campaign.

Related Hubhus patterns

  • Related campaigns are for parent/child links within Hubhus — different from copying into a separate campaign via API. See related-campaigns articles if that model fits better.
  • Keep the API token secret. Prefer a dedicated internal token for this flow so you can revoke it without affecting other integrations.

Common searches

copy lead • move lead • transfer lead • another campaign • POST /leads • HTTP webhooks • API token • hide status

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article