Skip to main content
POST
AhaSend Go SDK
The AhaSend API returns a validating or scheduled campaign to draft. It stops the list check that runs, or cancels the scheduled send. Access requires campaigns:send. After the request, you can change the campaign with Update Campaign and send it again with Send Campaign. A campaign that has queued mail answers 409. So does a campaign in any status other than validating or scheduled. The request takes no body. An empty JSON object is accepted. This operation accepts an Idempotency-Key header. A refusal from this operation is stored for the key, so send a corrected request with a new key. See Idempotency and campaign retries.

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

Response

The campaign, back in draft

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.