Skip to main content
POST
AhaSend Go SDK
The AhaSend API adds 1 to 1,000 existing contacts to one list, and answers when the work is done. Access requires lists:write. Entries:
  • Each entry names exactly one of email and id.
  • This operation only adds. A new membership is confirmed. A membership that already exists is reported already_member and does not change, whatever its status. So a batch never removes an unsubscribe.
  • No contact is created. An entry that names no contact of the account is reported not_found.
Results:
  • data gives one result for each entry, in the order of the request. position is the index of the entry. outcome is added, already_member, not_found or invalid. added and already_member include the membership, and not_found and invalid include a reason.
  • added, skipped and failed count the results. skipped counts already_member, and failed counts not_found and invalid.
  • An entry is invalid when it names neither or both of email and id, has any other field, has an id that is not a UUID, or has an email that fails the checks of contact writes.
  • An entry that repeats an identifier of an earlier entry is invalid, and so is that earlier entry. Email addresses are compared after they are trimmed and changed to lowercase, so A@example.com and a@example.com are the same.
  • When one contact is named once by email and once by ID, the first entry is added and the later one is already_member.
  • One invalid entry does not stop the others. A field other than data in the body, an empty data array or more than 1,000 entries is refused with 400 for the whole request.
Pacing: 1,000 is a limit, not a target. Measure how long a batch takes with real data. Send the next batch only after the previous response arrives, and send smaller batches or wait longer when the time grows. After a 429, wait before you continue. The API does not promise a fixed throughput. See API rate limits. This operation accepts an Idempotency-Key header. The memberships and the stored response are saved together. A retry with the same key replays the 200, the 404 for a missing list or the 400 for 24 hours. 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

list_id
string<uuid>
required

List ID

Body

application/json
data
object[]
required
Required array length: 1 - 1000 elements

Response

Ordered per-entry outcomes

object
enum<string>
required
Available options:
list
added
integer
required

Entries whose membership this request created

Required range: x >= 0
skipped
integer
required

Entries reported already_member

Required range: x >= 0
failed
integer
required

Entries reported not_found or invalid

Required range: x >= 0
data
object[]
required