Skip to content

Send a campaign's invitation to one person

POST
/distribution/{id}/invitations
curl --request POST \
--url 'https://app.surveyrock.com/api/v1/distribution/example/invitations?dry_run=1' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: example' \
--data '{ "email": "hello@example.com", "first_name": "example", "last_name": "example" }'

Send a launched email campaign’s invitation to one address. The campaign must have been allowed to send this way by a person in SurveyRock; nothing here can do that or raise its limits. Nothing you send reaches the email except a first and last name, through the merge tags the campaign uses. An address with no contact gets one. status is queued (accepted, not delivered) or skipped, with reason opted_out, undeliverable, recently_invited or already_responded: a person who may not be emailed is an answer, not an error, and costs no send. With dry_run=1 every check runs, nothing is written and the answer says what would have happened. The personal survey link is never returned. Needs the distribution:send scope, which only an issued client can hold, on a person’s tick.

id
required
string
Idempotency-Key
required
string
>= 1 characters <= 128 characters

1 to 128 characters, chosen by the caller. A retry with the same key and body replays the first response instead of applying the write twice; the same key with a different body is a 409

dry_run
string
Allowed values: 1

1 to run every check and write nothing

Media typeapplication/json
object
email
required
string format: email
first_name
string
last_name
string
Examplegenerated
{
"email": "hello@example.com",
"first_name": "example",
"last_name": "example"
}

Skipped, or a dry run

Queued

The connection lacks distribution:send (send_permission_required), the role cannot send, or the plan does not include it (feature_locked)

No mail went: the campaign is not armed or was switched off, a budget or the month’s allowance is used up, or the account or survey cannot send. The message says what to do

email is missing or is not an address

Too many requests a minute; pacing only