EmailmoversMyDataHub docs
Browse the docs

Reference / REST reference

Reference

Confirm a sample and get its download link

POST /v1/sample-downloads. Sent by the confirmation page when the person presses its button, with the token from the emailed link; the token is the credential, so no key or session is needed.

Generated from the contractsView as Markdown

POST /v1/sample-downloads

Sent by the confirmation page when the person presses its button, with the token from the emailed link; the token is the credential, so no key or session is needed. The first press confirms the address and chooses up to 10 records (verified named emails with an Article 14 notice, none at the person's own domain, at most 2 a company), read afresh against every suppression. Each press until the download gives a new single-use link for 5 minutes; after it, the answer says the sample was already downloaded. An unknown or expired token gets 404.

PropertyValue
EndpointPOST https://mydatahub.emailmovers.com/v1/sample-downloads
Operation idcreateSampleDownload
CostFree (0 credits)
AccessNo account, key or token needed.
TagSamples

Request

Parameters

NameInTypeRequiredDescription
MyDataHub-VersionheaderstringnoThe dated API version, pinned per key when left out. Non-breaking changes ship as new dates; the path major changes only for breaking changes, with a 12 month deprecation window.

Body

MemberTypeRequiredDescription
tokenstringyesThe token from the emailed link (the last part of /samples/confirm/{token}). Only a press of the confirmation page's button sends it, so a link scanner that opens the page uses nothing up.

Example request

curl -X POST "https://mydatahub.emailmovers.com/v1/sample-downloads" \
  -H "Content-Type: application/json" \
  --data '{
  "token": "q3V8xN2fK7mR1tY6pL0sD4hJ9wZ5cB8eA2gU7iO3nQ1"
}'

Responses

Headers: RateLimit, RateLimit-Policy.

MemberTypeAlways presentDescription
statusenum: ready, empty, downloadedyesready: download_url serves the sample once; empty: no record of the audience can be sent as a sample now, and nothing is supplied; downloaded: the sample was already served, and is never served twice.
recordsinteger (0 to 10)yesRecords in the sample: up to 10, fewer when fewer are left.
download_urlstring or nullyesA relative link on this host to the CSV, whose first lines are the licence. It works once, for 5 minutes, from the address that asked for it. Null unless ready.
expires_atstring (date-time) or nullyesWhen download_url stops working. Null unless ready.

Example response

{
  "status": "ready",
  "records": 10,
  "download_url": "/files/samples/sdl_Xr4mP8qT2vN6kJ1wL9sF3hD7bG5cZ0yA8eU2iO6nQ4t",
  "expires_at": "2026-10-11T10:20:00Z"
}

Errors

Every error is a problem object with a code and a next_step. Every response carries the RateLimit and RateLimit-Policy headers; see Rate limits.

StatusProblem codesWhen
400invalid-request, idempotency-key-required, unsupported-versionThe request could not be read, or an Idempotency-Key is missing.
404not-foundNo such object for this organisation.
422validation-failed, quote-required, dataset-unavailableThe request is not valid. errors lists every problem with a JSON pointer and did_you_mean.
429rate-limitedToo many requests. Wait for Retry-After.
Any other failureinternal-error, service-unavailable, tps-screen-expiredSomething failed on our side (500 internal-error) or the service is briefly unavailable (503 service-unavailable, with Retry-After). Nothing was charged; retry with the same Idempotency-Key. A count, sample, quote or order with telephone in play is also refused with 503 tps-screen-expired, with no Retry-After, while the dataset version's TPS and CTPS screen is more than 28 days old.