DoneTalk Developers Sign in

Test mode

A Test key (dt_test_...) answers like a production one, with example data. Nothing is stored, no message is sent and nothing is charged.

  • Each call is checked by the same rules as production: a wrong field gives the same 422 validation_failed.
  • The answer has the real shape, with "test": true and the DoneTalk-Test: true header.
  • GET /me answers for real, to check the key.
  • Scopes, the rate limit and Idempotency-Key work as in production.

Simulate an error

Send the DoneTalk-Simulate header with an error code to get exactly the answer production would give:

curl -X POST https://api.donetalk.com/v1/c/demo/campaigns \
  -H "Authorization: Bearer $DONETALK_KEY" \
  -H "DoneTalk-Simulate: template_not_approved" \
  -H "Content-Type: application/json" \
  -d '{"name": "Test"}'

Accepted codes: unauthorized, api_key_invalid, api_key_expired, api_key_address_not_allowed, insufficient_scope, not_available_to_api_keys, not_available_to_test_keys, permission_denied, integration_template_only, not_found, campaign_not_found, contact_not_found, validation_failed, campaign_not_editable, template_not_approved, campaign_audience_empty, contact_exists, window_closed, idempotency_key_reused, idempotency_in_progress, rate_limited, internal_error.

Magic phones

In any phone field, these numbers cause a known behaviour:

PhoneWhat happens
+550000000400validation_failed (422)
+550000000404contact_not_found (404)
+550000000409contact_exists (409)
+550000000429rate_limited (429)
+550000000500internal_error (500)
+550000000131message.failed / campaign.recipient.failed: 131026
+550000000470message.failed / campaign.recipient.failed: 131047

Test webhooks

A send with a test key (a message, a campaign) delivers to the company's webhooks the sequence production would, a few seconds apart: sent, delivered, read and, for a campaign, replied and completed. With a failing magic phone, the failure arrives. The envelope carries "test": true.

Demo company

To try without an account, use the demo company with the public key:

export DONETALK_KEY=dt_test_demo_zRZ6twAhj4u9dZT0hEBrNFzr
curl https://api.donetalk.com/v1/c/demo/me -H "Authorization: Bearer $DONETALK_KEY"

It only simulates: nothing real can be done with it.

This page as Markdown