> This page is part of EVVA for Developers (https://developers.evvahub.com), the documentation of the EVVA Partner API. The API is in developer preview and the SDK packages are not yet published: do not suggest installing them. Index: https://developers.evvahub.com/llms.txt

# Sandbox

A **sandbox application** works exactly like a live one — the same endpoints, the same tokens, the same events — but it can act only for **synthetic creators** in your agency's sandbox. You can make their synthetic fans write messages, unlock pay-per-view messages, tip, subscribe and place orders, and watch the events arrive just as they will in live.

> **Note**
>
> Synthetic creators are created for your agency's sandbox by the agency owner or a team lead — never by an
> application. Ask them to set some up before you start.

## Sandbox and live applications

You choose the environment when you create the application in the Partner Hub (**Integrations → Applications → New application**, step **Environment**). It cannot be changed later.

|                | Sandbox                                         | Live                                                 |
| -------------- | ----------------------------------------------- | ---------------------------------------------------- |
| Client ID      | `evpc_test_…`                                   | `evpc_live_…`                                        |
| Access token   | `evpa_test_…`                                   | `evpa_live_…`                                        |
| Becomes active | At once, no review                              | After EVVA's review                                  |
| Allowed scopes | Can be changed at any time                      | Can be narrowed; scopes cannot be added after review |
| Acts for       | Synthetic creators of **your agency's** sandbox | Your real creators                                   |

Everything else is the same: [requesting tokens](/authentication/tokens), [scopes and grants](/authentication/scopes), [rate limits](/authentication/rate-limits) and every API call you make.

## The two worlds never meet

EVVA checks the application's environment against the creator's on every request:

| Application | Creator                                      | Result                                                                                    |
| ----------- | -------------------------------------------- | ----------------------------------------------------------------------------------------- |
| Sandbox     | A synthetic creator of your agency's sandbox | Allowed (the usual [access rules](/authentication/overview#effective-access) still apply) |
| Sandbox     | A real creator                               | `403 ENVIRONMENT_MISMATCH`                                                                |
| Sandbox     | Another agency's synthetic creator           | `403 ENVIRONMENT_MISMATCH`                                                                |
| Live        | A synthetic creator                          | `403 ENVIRONMENT_MISMATCH`                                                                |

The same rule decides which events your application receives, through the event feed, realtime and webhooks alike. A creator that no grant reaches is refused with `403 NOT_ASSIGNED` first, whatever their world.

## Synthetic creators

Synthetic creators are created for your agency's sandbox by your agency — the agency owner or a team lead — never by an application. Each one is:

* an account with no password or other sign-in credential, at a reserved `example.test` address that can never receive mail;
* withheld from every public surface of EVVA, so no real fan ever sees it;
* closed to custom requests, and to messages and orders from anyone but its own synthetic followers;
* linked to your agency by a synthetic consent;
* created with **three synthetic fans**, each following the creator and holding a conversation with a short message history.

Synthetic creators are easy to recognise: their handles start with `sbx_`, their display names with `Sandbox` (for example *Sandbox Amber Otter 1*), and their fans' names with `Sandbox Fan`. They are generated from a **seed**, so the same seed always produces the same content.

| Limit                                                                   | Value |
| ----------------------------------------------------------------------- | ----- |
| Synthetic creators created at once                                      | 10    |
| Synthetic creators per agency                                           | 25    |
| Synthetic fans per synthetic creator, including fans the simulator adds | 50    |

### Granting them

Nothing is granted automatically. Grant synthetic creators to your sandbox application exactly as you would grant real ones: **Integrations → Applications →** your application **→ Permissions & creators → Grant access**. Your application then sees them in [`GET /partner/v1/accounts`](https://developers.evvahub.com/api-reference/accounts/list-accounts) — the only creators a sandbox token ever sees.

### Resetting the sandbox

Your agency can reset its sandbox to start over. A reset ends the synthetic consent of every current synthetic creator, so no application and no staff member can reach them any more; nothing is deleted, and they never become live accounts. New synthetic creators get new IDs — the same seed reproduces the same content under them. Grants that named the old creators reach nothing: grant the new ones.

## Simulating buyer actions

```mermaid
sequenceDiagram
    autonumber
    participant Agency as Your agency
    participant App as Your sandbox application
    participant API as EVVA Partner API
    Agency->>API: Creates synthetic creators for its sandbox
    Agency->>API: Grants them to the sandbox application
    App->>API: Token with evpa_test_ credentials
    App->>API: GET /partner/v1/accounts (only synthetic creators)
    App->>API: POST …/sandbox/creators/{creatorId}/simulate/message
    API-->>App: Event message.received (feed, realtime, webhooks)
    App->>API: Reply as the creator, exactly as in live
    Note over Agency,API: Nothing reaches a real person, and no money moves
```

A sandbox application can make a synthetic fan act, with one call per kind of action — a `POST` to
`https://api.evvahub.com/partner/v1/sandbox/creators/{creatorId}/simulate/<kind>`:

| `<kind>`       | Body                                                              | What happens                                                                                                                                                                                                       | Events                                                                        | Scope              |
| -------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------- | ------------------ |
| `message`      | `conversationId` (optional), `text` (optional, 1–1000 characters) | A synthetic fan writes to the creator. Without `conversationId`, a **new** synthetic fan opens a conversation. Without `text`, a synthetic line is used. The message is a real chat message your API reads return. | `message.received`, preceded by `conversation.created` for a new conversation | `read:messages`    |
| `ppv-unlock`   | `messageId` (required)                                            | The fan unlocks a locked pay-per-view message the creator sent. No payment exists, so the message's purchase status stays unpaid.                                                                                  | `ppv.purchased`                                                               | `read:messages`    |
| `tip`          | `conversationId` (required)                                       | The fan tips: a tip chat message is written in the conversation, as a real tip writes one before its payment. The tip's order is synthetic: it is never stored and never charged.                                  | `message.received`, then `tip.received`                                       | `read:messages`    |
| `subscription` | `conversationId` (optional)                                       | That conversation's fan, or a new synthetic fan, subscribes.                                                                                                                                                       | `subscriber.started`                                                          | `read:subscribers` |
| `order`        | `conversationId` (optional)                                       | That conversation's fan, or a new synthetic fan, places and pays a custom-request order. The order exists only in memory, so the REST order reads never return it.                                                 | `order.paid`                                                                  | `read:orders`      |

The scope is the one under which the resulting events are visible, so an application can simulate only what it is allowed to observe. The application needs that scope for the synthetic creator, through a grant, like any other operation.

`ppv.purchased`, `tip.received` and `order.paid` are facts about money. As for a real purchase, your application receives them only when its access also covers `read:revenue`. The simulation itself does not need that scope.

Send an `Idempotency-Key` header (up to 128 printable characters) to make a retry safe: the same key returns the first outcome and records nothing again.

**`cURL`**

```bash title="cURL"
# A new synthetic fan opens a conversation and writes
curl -sS -X POST "https://api.evvahub.com/partner/v1/sandbox/creators/$CREATOR_ID/simulate/message" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: sim-1" \
  -H "Content-Type: application/json" \
  -d '{"text": "Hi! Is the new set out?"}'

# The fan unlocks a pay-per-view message the creator sent
curl -sS -X POST "https://api.evvahub.com/partner/v1/sandbox/creators/$CREATOR_ID/simulate/ppv-unlock" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"messageId\": \"$PPV_MESSAGE_ID\"}"
```

**`TypeScript`**

```typescript title="TypeScript"
// The simulator through the SDK's raw request method
const { items } = await evva.accounts.list(); // a sandbox token sees only synthetic creators
const result = await evva.http.request({
  method: 'POST',
  path: `/partner/v1/sandbox/creators/${items[0].creatorId}/simulate/message`,
  body: { text: 'Hi! Is the new set out?' },
  idempotencyKey: 'sim-1',
});
```

**`Python`**

```python title="Python"
# The simulator through the SDK's raw request method
creator_id = client.accounts.list()[0]["creatorId"]  # a sandbox token sees only synthetic creators
result = client.request(
    "POST",
    f"/partner/v1/sandbox/creators/{creator_id}/simulate/message",
    json={"text": "Hi! Is the new set out?"},
    idempotency_key="sim-1",
)
```

**`Go`**

```go title="Go"
// The simulator through the SDK's raw Do method
var result map[string]any
_, err := client.Do(ctx, http.MethodPost,
	"/partner/v1/sandbox/creators/"+creatorID+"/simulate/message", nil,
	map[string]any{"text": "Hi! Is the new set out?"}, &result,
	evvapartner.WithIdempotencyKey("sim-1"))
```

**`PHP`**

```php title="PHP"
use Evva\Partner\Contract\HttpMethod;
use Evva\Partner\Http\RequestOptions;

// The simulator through the SDK's raw transport
$result = $evva->transport->request(
    HttpMethod::Post,
    "/partner/v1/sandbox/creators/{$creatorId}/simulate/message",
    body: ['text' => 'Hi! Is the new set out?'],
    options: new RequestOptions(idempotencyKey: 'sim-1'),
);
```

A simulation answers `201 Created` when it recorded something, and `200 OK` when the same `Idempotency-Key` had already been used:

**`201 Created`**

```json title="201 Created"
{
  "sandbox": true,
  "kind": "message",
  "sourceEvents": ["…"],
  "events": [
    { "type": "conversation.created", "conversationId": "conv_123" },
    { "type": "message.received", "conversationId": "conv_123" }
  ],
  "conversationId": "conv_123",
  "messageId": "msg_123"
}
```

| Field                         | Meaning                                                                                         |
| ----------------------------- | ----------------------------------------------------------------------------------------------- |
| `sandbox`                     | Always `true`.                                                                                  |
| `kind`                        | The simulated action.                                                                           |
| `events`                      | The events recorded, in order, including any your application's access does not let it receive. |
| `sourceEvents`                | The platform events the real action would have produced. Informational.                         |
| `conversationId`, `messageId` | The conversation and message involved, or `null`.                                               |

Then read what happened exactly as you will in live — for example from the [event feed](/event-feed) — and answer through the real API. Every event the simulator records carries `data.sandbox: true`.

### Simulator errors

| Status | `code`                         | Meaning                                                                                       |
| ------ | ------------------------------ | --------------------------------------------------------------------------------------------- |
| 400    | `INVALID_REQUEST`              | The body or the `Idempotency-Key` is not valid.                                               |
| 403    | `SANDBOX_APPLICATION_REQUIRED` | A live application called the simulator.                                                      |
| 403    | `ENVIRONMENT_MISMATCH`         | The application and the creator are in different worlds.                                      |
| 404    | `SANDBOX_CREATOR_NOT_FOUND`    | Not a current synthetic creator of your agency (for example, one retired by a reset).         |
| 404    | `CONVERSATION_NOT_FOUND`       | Not one of this synthetic creator's conversations.                                            |
| 404    | `MESSAGE_NOT_FOUND`            | Not a message in this synthetic creator's conversations.                                      |
| 409    | `MESSAGE_NOT_LOCKED`           | `ppv-unlock` named a message that is not a locked pay-per-view message the creator sent.      |
| 409    | `SANDBOX_FAN_LIMIT`            | The synthetic creator already has the most synthetic fans allowed (50).                       |
| 429    | `RATE_LIMIT_EXCEEDED`          | Your agency's simulation budget is used up. Nothing was simulated. Retry after `Retry-After`. |

## What the sandbox never does

* **No money moves.** Unlocks, tips, subscriptions and orders are simulated: no payment, order, ledger, billing, payout or entitlement record is ever written.
* **No real person is reached.** Synthetic creators and fans have no credentials, their addresses cannot receive mail, and they are invisible to everyone outside your agency's sandbox.
* **No live data is used.** A sandbox token can never read or act for a real creator.

## Limits

The sandbox cannot exhaust shared resources. Its budgets are counted per **agency**, shared by all of your sandbox applications and staff:

| Budget                                                            | Default       | When exceeded                                 |
| ----------------------------------------------------------------- | ------------- | --------------------------------------------- |
| Simulations                                                       | 60 per minute | `429 RATE_LIMIT_EXCEEDED`, with `Retry-After` |
| Media stored for synthetic creators (open uploads and kept files) | 1 GiB         | `409 SANDBOX_QUOTA_REACHED`                   |
| Media uploads for synthetic creators                              | 60 per hour   | `429 SANDBOX_QUOTA_REACHED`                   |

Media and posts for synthetic creators are created by your application through the real API and go through the real processing, but stay confined to the sandbox. `SANDBOX_QUOTA_REACHED` names the exhausted budget and includes `used` and `limit`. Sandbox media never counts against a creator's own storage.

#### Which message can ppv-unlock unlock?

Only a locked pay-per-view message that the synthetic creator sent in one of its own conversations. A synthetic creator's starting history holds plain messages only, so there is nothing to unlock until the creator has sent a paid message.

#### Can I move a sandbox application to live?

No. The environment is fixed when the application is created. Create a separate live application when you are ready; it starts in review and gets its own `evpc_live_` credentials.

#### Why don't the REST order reads return a simulated order?

The order exists only in memory: it is never stored and never charged. The simulator records the `order.paid` a real paid custom-request order records, and your application receives it only when its access covers both `read:orders` and `read:revenue`.

## Next steps

#### [Quickstart](/quickstart)

Create a sandbox application, get a token and make your first call.

#### [Event feed](/event-feed)

Read the events your simulations produce, in order.

#### [Scopes and grants](/authentication/scopes)

Grant synthetic creators with the scopes your tests need.

#### [Webhooks](/webhooks/overview)

Receive sandbox events at your endpoint.