Skip to main content
POST
AhaSend Go SDK
The AhaSend API makes a new draft from a campaign. Access requires campaigns:write. The source campaign can be in any status, so you can copy a campaign that was already sent. The new draft gets:
  • A copy of the design. The copy belongs to the new draft.
  • The subject, the preview text, the sender and the reply-to.
  • The lists of the source that still exist, in the same order.
name sets the name of the new draft. Without it, the name is Copy of and the name of the source, cut to 255 characters. The request body is optional. This operation accepts an Idempotency-Key header. See Idempotency.

Authorizations

Authorization
string
header
required

API key for authentication. Non-empty Security Requirement values are AhaSend API-key roles. Roles listed within one requirement object are jointly required; separate requirement objects are alternatives.

Headers

Idempotency-Key
string

Optional idempotency key for safe request retries. Must be a unique string for each logical request. An identical request with a completed stored outcome returns the original status and body. An in-progress execution returns 409, a changed method/path/body returns 422, and a released 5xx execution may run again. Keys for non-secret responses expire after 24 hours. API-key create responses include a one-time secret_key, so successful encrypted replay responses for those operations expire after 5 minutes.

Maximum string length: 255

Path Parameters

account_id
string<uuid>
required

Account ID

campaign_id
string<uuid>
required

Campaign ID

Body

application/json

The copy's name. Without one the copy is named Copy of and the source's name, cut to 255 characters.

name
string

Name of the copy. Spaces around it are dropped.

Required string length: 1 - 255

Response

Campaign duplicated

A campaign as List Campaigns returns it, without its lists, content and issues.

object
enum<string>
required

Object type identifier

Available options:
campaign
id
string<uuid>
required

Campaign ID

created_at
string<date-time>
required

When the campaign was created

updated_at
string<date-time>
required

When the campaign's own fields last changed

name
string
required

Campaign name, as it appears in the dashboard. Recipients do not see it.

subject
string | null
required

The subject line. Null until one is set.

preheader
string | null
required

The preview text, which most inboxes show after the subject. Null until one is set.

from
object | null
required

The sender. Null until a complete sender is set, and when its domain was deleted. name is an empty string when the campaign has no sender name, so the object can be sent back as it is.

Example:
reply_to
string<email> | null
required

The reply-to address. Null when none is set.

status
enum<string>
required

Where the campaign is in its life. Only a draft can be changed or deleted.

  • draft: being prepared.
  • validating: scheduled, and its lists are being checked.
  • waiting_for_review: held for a review before it sends.
  • scheduled: accepted, waiting for its send time.
  • sending: sending now.
  • paused: sending stopped for now; status_reason says why.
  • sent: every message was sent.
  • canceled: stopped before it finished; status_reason says why.
  • failed: could not be sent; status_reason says why.
Available options:
draft,
validating,
waiting_for_review,
scheduled,
sending,
paused,
sent,
canceled,
failed
status_reason
string | null
required

Why the campaign is in its status, when there is a reason to give. Null otherwise.

send_at
string<date-time> | null
required

When the campaign sends or sent, in UTC. Null until it is scheduled.

send_resumes_at
string<date-time> | null
required

When a send that reached the account's daily marketing limit continues, in UTC. Null otherwise.

finished_at
string<date-time> | null
required

When the send ended, in UTC. Null until then.

list_ids
string<uuid>[]
required

The lists the campaign sends to, in the order they were saved. A list that was deleted is left out.

editor
enum<string> | null
required

The editor of the campaign's design. Null while the campaign has no design.

Available options:
advanced,
simple,
html
content
object | null
required

The content of the campaign's design. Null while it has no design, or its design has neither HTML nor text.

ready
boolean | null
required

Whether the draft has no issue, so it can be sent. Null unless the campaign is a draft.

issues
object[] | null
required

The reasons the draft cannot be sent yet, in a fixed order; empty when it is ready. Null unless the campaign is a draft.