Skip to content
On this page and tools

Start here

Test mode

A test key lets you, or an AI agent writing your integration, call the real API and get real-shaped answers from sample data. Get a call wrong, write the same entry twice, send garbage: nothing reaches a real Space, nobody gets an email, and you are not charged.

  1. Make a test key For your Space's information, open /dash/integrations/api-tokens, choose Create key, then Test. For the public directory, do the same at /dash/developers/keys. A test key is ready straight away, with any permission you tick, including changing your directory. No review.
  2. Keep it in an environment variable Put it in BYNEFIT_API_KEY, the same place your live key will go later, so switching is one line.
  3. Call the API as normal Same addresses, same headers, same answers. Only the data is pretend.
curl -i "https://bynefit.com/dash/api/v1/events?limit=2" \
  -H "Authorization: Bearer bapi_tk_test_YOUR_KEY"
200 OKapplication/json
HTTP/1.1 200 OK
X-Bynefit-Mode: test
X-RateLimit-Limit: 500

{
    "data": [
        {
            "id": "evt_test_0001",
            "type": "event",
            "event_type": "member.joined",
            "actor": {
                "id": "usr_test_0001"
            },
            "subject": {
                "id": "mem_test_0001",
                "type": "membership"
            },
            "created_at": "2026-10-01T06:00:00+00:00"
        },
        {
            "id": "evt_test_0002",
            "type": "event",
            "event_type": "form.submitted",
            "actor": {
                "id": "usr_test_0002"
            },
            "subject": {
                "id": "sub_test_0102",
                "type": "form_submission"
            },
            "created_at": "2026-10-01T00:00:00+00:00"
        }
    ],
    "next_cursor": "MjAyNi0xMC0wMSAwMDowMDowMHwy",
    "has_more": true,
    "livemode": false
}

How to tell a test key from a live one

TestLive
Space key starts withbapi_tk_test_bapi_tk_
Developer key starts withbapi_pk_test_bapi_pk_
Every response carries the headerX-Bynefit-Mode: testX-Bynefit-Mode: live
Every JSON body carries"livemode": falseNo extra field
Sample ids look likeusr_test_0001, evt_test_0007Long random ids

Have your code check the header before it does anything it cannot undo, and stop if it ever sees test where it expected live, or the other way round.

What the sample data holds

The same sample data comes back every time, so a test you write today still passes next month. Filters, paging and errors work exactly as they do live.

PermissionAddressWhat you get
Your SpaceGET /dash/api/v1/teams/currentOne sample Space, with 11 active members.
ActivityGET /dash/api/v1/events30 events: people joining, forms sent in, donations and tasks.
TasksGET /dash/api/v1/tasks15 tasks across every status and priority.
Member profilesGET /dash/api/v1/users12 members named Sample Member 1, 2, 3, with addresses at example.test.
Forms and answersGET /dash/api/v1/forms3 forms, each with 4 answers.
PaymentsGET /dash/api/v1/payments10 donations and membership payments in USD.
Public directoryGET /dash/api/v1/resources12 made-up organisations, one per category.

None of it is about real people. Names are numbered, email addresses end in example.test, phone numbers use the 555 range, and websites end in example.org. A test key never returns your Space's records, not even its name. The one thing it looks up is a partner's list of registered event names, so a partner-events dry run can tell you which events it would accept.

What gets saved, and for how long

Writes are checked exactly like a live call: the same required fields, the same errors, the same status codes and the same response. What happens next is different.

CallIn test mode
Add, import, edit or delete directory entries
/dash/api/resources
Saved in a private sandbox that only this key can see. Read them back with GET /dash/api/resources; new entries also show up in that key's GET /dash/api/v1/resources.
Suggest a directory entry
/dash/api/resources/submit
Saved in the sandbox. No moderator sees it and it is never published.
Send partner events
POST /dash/api/v1/beacons
Checked against your registered events and answered with "test": true. Nothing is stored.
curl -X POST https://bynefit.com/dash/api/resources \
  -H "Authorization: Bearer bapi_tk_test_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Sample Food Pantry","category":"food","website":"https://pantry.example.org"}'

curl "https://bynefit.com/dash/api/resources" \
  -H "Authorization: Bearer bapi_tk_test_YOUR_KEY"

What a test key cannot call

Some things have no sample data. A test key gets a clear refusal there, never real data:

403 Forbiddenapplication/json
{
    "error": "test_mode_unsupported",
    "message": "Test keys only work with sample data, and this endpoint has none. Use a live key here.",
    "livemode": false,
    "docs_url": "https://bynefit.com/docs/test-mode"
}
RefusedWhy
GET /dash/api/v1/beacons/summaryPartner event totals are real numbers about your product.
The embed widgetThe widget shows your real Space to visitors.
Checkout linksA checkout takes real money.

Limits

Testing webhooks

Webhooks have their own test. On /dash/integrations/webhooks, choose Send test event on an endpoint. Bynefit posts a sample event to that address, signed with its secret exactly like a real delivery, and shows you the status code your server answered and how long it took. The details are on the Webhooks page.

Moving to a live key

  1. Make a live key on the same page with the permissions your code used. Changing your directory needs a review for live keys; the Keys and review page explains it.
  2. Swap the value of BYNEFIT_API_KEY. Nothing else in your code should change.
  3. Throw away any sample ids you saved. They do not exist outside test mode.
  4. Make one read call and check the response says X-Bynefit-Mode: live before you let anything write.
  5. Revoke the test key when you no longer need it.

What exists and what does not