> ## Documentation Index
> Fetch the complete documentation index at: https://docs.strails.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Sync vs. Async Mode

> How to toggle synchronous and asynchronous behavior in the Strails Mock Sandbox.

By default, sandbox endpoints respond synchronously with a completed status. To simulate asynchronous processing and receive a webhook callback, use one of the following methods.

## Option 1: Query Parameter

Append `?mockMode=async` to the request URL:

```http theme={null}
POST https://sandbox.stablesrail.io/v1/onboarduser?mockMode=async
```

## Option 2: HTTP Header

Send the `x-mock-mode: async` header:

```http theme={null}
POST https://sandbox.stablesrail.io/v1/onboarduser
x-mock-mode: async
```

> The query parameter takes precedence over the header. If neither is provided, the request defaults to **sync** mode.

## Async Response Example

```json theme={null}
{
  "status": "success",
  "response_code": "00",
  "message": "SUCCESS",
  "data": {
    "requestId": "req-s-a1b2c3d4e5f6g7h8i9j0",
    "status": "processing",
    "userHash": "usr-s-...",
    "message": "User registration request has been submitted for processing",
    "estimatedCompletionTime": "2-5 minutes"
  }
}
```

A webhook event is scheduled after a short delay (default \~3 seconds) to the configured webhook URL.
