> 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

# Simulate a fan message

POST https://api.evvahub.com/partner/v1/sandbox/creators/{creatorId}/simulate/message
Content-Type: application/json

Makes a synthetic fan write to a synthetic creator in the [sandbox](/sandbox).

The body is `{conversationId?, text?}`. Without `conversationId`, a new synthetic fan opens a conversation. `text` is 1–1000 characters; without it, a synthetic line is used. The message is a real chat message that the REST reads return.

**What is recorded**

The same events a real fan message records: `message.received`, preceded by `conversation.created` when the message opens the conversation. Every recorded event carries `data.sandbox: true` and goes to this creator's agency only. See [the event catalogue](/webhooks/events).

Nothing is ever written to an order, payment, ledger, billing, payout or entitlement record, and no platform event is emitted.

**Idempotency**

Send an `Idempotency-Key` so that a retry records nothing twice: the retry returns `200` with the first outcome instead of `201`.

**Errors**

* `403 SANDBOX_APPLICATION_REQUIRED` — a live application called the simulator for a real creator.
* `403 ENVIRONMENT_MISMATCH` — a live application called the simulator for a sandbox creator.
* `404 SANDBOX_CREATOR_NOT_FOUND` — the creator is not a current sandbox creator of your agency.
* `404 CONVERSATION_NOT_FOUND` — `conversationId` is not one of this sandbox creator's conversations.
* `409 SANDBOX_FAN_LIMIT` — a new synthetic fan is needed, and the creator already has the most allowed (50).

**Required scopes:** `read:messages`.

Reference: https://developers.evvahub.com/api-reference/sandbox/simulate-sandbox-message

## Authentication

- `Authorization` header (bearer token, required) — OAuth 2.0 client credentials. Request an access token at `POST /partner/v1/oauth/token` (`grant_type=client_credentials`) with the application's client secret or a `private_key_jwt` assertion, then send it as `Authorization: Bearer evpa_live_…` (or `evpa_test_…` for a sandbox application). Tokens are opaque and short lived (see `expires_in`); there is no refresh token. Each operation lists the scopes it requires.

## Request

### Path parameters

- `creatorId` (string, required) — The creator profile id — the ONLY source of the creator a request acts for.

### Headers

- `X-Creator-Id` (string, optional) — Optional echo of the path `creatorId`; any other value is refused with 403 CREATOR_CONTEXT_MISMATCH.
- `Idempotency-Key` (string, optional) — Optional. Up to 128 printable characters. A retry with the same key returns the first outcome and records nothing again.

### Body (application/json)

This endpoint expects a SandboxSimulateRequest.

- `conversationId` (string, optional)
- `messageId` (string, optional) — `ppv-unlock` only.
- `text` (string, optional) — `message` only.

## Response

### 200

A retry with the same `Idempotency-Key`: the first outcome, with nothing recorded again.

- `sandbox` (true, required)
- `kind` (enum, required)
  - Allowed values: `message`, `ppv-unlock`, `tip`, `subscription`, `order`
- `sourceEvents` (list of string, required) — The platform events a REAL action of this kind emits, resolved by the same resolver — never emitted here.
- `events` (list of SandboxSimulationEventsItems, required) — The events that were recorded, in order. In the feed, each also carries `data.sandbox = true`.
- `conversationId` (string, required, nullable)
- `messageId` (string, required, nullable)

### 201

Simulated. `events` lists what was recorded, and is empty when there is nothing to record.

- `sandbox` (true, required)
- `kind` (enum, required)
  - Allowed values: `message`, `ppv-unlock`, `tip`, `subscription`, `order`
- `sourceEvents` (list of string, required) — The platform events a REAL action of this kind emits, resolved by the same resolver — never emitted here.
- `events` (list of SandboxSimulationEventsItems, required) — The events that were recorded, in order. In the feed, each also carries `data.sandbox = true`.
- `conversationId` (string, required, nullable)
- `messageId` (string, required, nullable)

## Errors

### 400 Bad Request Error

Invalid or missing parameters: `INVALID_REQUEST` (`details` names the fields), or a more specific code of the operation.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 401 Unauthorized Error

Token missing, malformed, expired or revoked: `INVALID_TOKEN` (or `UNAUTHORIZED` when no bearer token was sent). Request a new token and retry.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 403 Forbidden Error

Not your creator, or not with this token: `GRANT_REVOKED` (no active link to the creator), `NOT_ASSIGNED`, `OAUTH_SCOPE_MISSING` (the creator has not consented to the scope), `INSUFFICIENT_SCOPE` (the token lacks it), `CREATOR_CONTEXT_MISMATCH`, `AGENCY_SUSPENDED`.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 404 Not Found Error

No such resource, or it belongs to another creator: `NOT_FOUND` or a more specific code.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 409 Conflict Error

Conflicts with the current state: `IDEMPOTENCY_KEY_REUSED` (the key was used for a different request), an approval that is still pending or already used, or a more specific code of the operation.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 429 Too Many Requests Error

Rate limited: `RATE_LIMIT_EXCEEDED`. Wait `Retry-After` seconds before retrying.

- `code` (enum, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
  - Allowed values: `RATE_LIMIT_EXCEEDED`, `TOO_MANY_MESSAGES`
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (RateLimitErrorDetails, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 500 Internal Server Error

Unexpected server error: `INTERNAL_ERROR`. Nothing internal is disclosed; quote the `X-Request-Id` when you report it.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 503 Service Unavailable Error

Temporarily unavailable: `SERVICE_UNAVAILABLE`, `TEMPORARILY_UNAVAILABLE`, `MEDIA_STORAGE_UNAVAILABLE` or `CREATOR_STANDING_UNAVAILABLE`. Retry after `Retry-After` seconds.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

## Types

### SandboxSimulationEventsItems

- `type` (string, required)
- `conversationId` (string, required, nullable)

### RateLimitErrorDetails

Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

- `retryAfterSec` (integer, required)
- `level` (enum, optional) — The DM send limit that refused the message, set only with `TOO_MANY_MESSAGES`. It is never a quota, a count or a key. - `conversation` — one side of one thread. - `sender` — a person's own ceiling; it does not apply to applications. - `creator` — everything sent for the creator, studio included. - `application` — everything your application sends. - `agency` — everything your agency sends. - `platform` — the agency's fair share of the platform: its throughput or its concurrency. See [rate limits](/authentication/rate-limits).
  - Allowed values: `conversation`, `sender`, `creator`, `application`, `agency`, `platform`

## Examples

### Sandbox_simulateSandboxMessage_example

**Request**

```json
{
  "text": "Hi! Just subscribed — loving the beach photos so far."
}
```

**Response**

```json
{
  "sandbox": true,
  "kind": "message",
  "sourceEvents": [
    "communication.message.created"
  ],
  "events": [
    {
      "type": "conversation.created",
      "conversationId": "cm4sa7c1e0025qz8wq2r8t4vh"
    },
    {
      "type": "message.received",
      "conversationId": "cm4sa7c1e0025qz8wq2r8t4vh"
    }
  ],
  "conversationId": "cm4sa7c1e0025qz8wq2r8t4vh",
  "messageId": "cm4sc1f6n0029qz8wu5h3m8ta"
}
```

**SDK Code**

```python Sandbox_simulateSandboxMessage_example
import requests

url = "https://api.evvahub.com/partner/v1/sandbox/creators/cm4r7k2xq0001qz8w3n5v6b2d/simulate/message"

payload = { "text": "Hi! Just subscribed — loving the beach photos so far." }
headers = {
    "Idempotency-Key": "0c8e2f6a-4d1b-4a97-b3e5-7f9c1d2a6b84",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```go Sandbox_simulateSandboxMessage_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.evvahub.com/partner/v1/sandbox/creators/cm4r7k2xq0001qz8w3n5v6b2d/simulate/message"

	payload := strings.NewReader("{\n  \"text\": \"Hi! Just subscribed — loving the beach photos so far.\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Idempotency-Key", "0c8e2f6a-4d1b-4a97-b3e5-7f9c1d2a6b84")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```php Sandbox_simulateSandboxMessage_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.evvahub.com/partner/v1/sandbox/creators/cm4r7k2xq0001qz8w3n5v6b2d/simulate/message', [
  'body' => '{
  "text": "Hi! Just subscribed — loving the beach photos so far."
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => '0c8e2f6a-4d1b-4a97-b3e5-7f9c1d2a6b84',
  ],
]);

echo $response->getBody();
```

### Sandbox_simulateSandboxMessage_example

**Request**

```json
{
  "text": "Hi! Just subscribed — loving the beach photos so far."
}
```

**Response**

```json
{
  "sandbox": true,
  "kind": "message",
  "sourceEvents": [
    "communication.message.created"
  ],
  "events": [
    {
      "type": "conversation.created",
      "conversationId": "cm4sa7c1e0025qz8wq2r8t4vh"
    },
    {
      "type": "message.received",
      "conversationId": "cm4sa7c1e0025qz8wq2r8t4vh"
    }
  ],
  "conversationId": "cm4sa7c1e0025qz8wq2r8t4vh",
  "messageId": "cm4sc1f6n0029qz8wu5h3m8ta"
}
```

**SDK Code**

```python Sandbox_simulateSandboxMessage_example
import requests

url = "https://api.evvahub.com/partner/v1/sandbox/creators/cm4r7k2xq0001qz8w3n5v6b2d/simulate/message"

payload = { "text": "Hi! Just subscribed — loving the beach photos so far." }
headers = {
    "Idempotency-Key": "0c8e2f6a-4d1b-4a97-b3e5-7f9c1d2a6b84",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```go Sandbox_simulateSandboxMessage_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.evvahub.com/partner/v1/sandbox/creators/cm4r7k2xq0001qz8w3n5v6b2d/simulate/message"

	payload := strings.NewReader("{\n  \"text\": \"Hi! Just subscribed — loving the beach photos so far.\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Idempotency-Key", "0c8e2f6a-4d1b-4a97-b3e5-7f9c1d2a6b84")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```php Sandbox_simulateSandboxMessage_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.evvahub.com/partner/v1/sandbox/creators/cm4r7k2xq0001qz8w3n5v6b2d/simulate/message', [
  'body' => '{
  "text": "Hi! Just subscribed — loving the beach photos so far."
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => '0c8e2f6a-4d1b-4a97-b3e5-7f9c1d2a6b84',
  ],
]);

echo $response->getBody();
```