Skip to main content
GET
/
worlds
/
{id}
/
observations
Observations
curl --request GET \
  --url https://api.example.com/worlds/{id}/observations

Observations

Retrieve observations recorded during MockWorld execution.

Request

GET https://api.mokra.ai/api/worlds/{id}/observations

URL Parameters

ParameterDescription
idWorld ID

Headers

HeaderRequiredDescription
X-API-KeyYesYour Mokra API key

Query Parameters

ParameterTypeDescription
servicestringFilter by service slug
formatstringjson (default) or text

Response

{
  "observations": [
    {
      "id": "obs_abc123",
      "timestamp": "2024-03-15T10:30:00Z",
      "service": "stripe",
      "method": "POST",
      "path": "/v1/charges",
      "status_code": 200,
      "description": "Created charge for $50.00 USD",
      "duration_ms": 45
    },
    {
      "id": "obs_def456",
      "timestamp": "2024-03-15T10:30:01Z",
      "service": "sendgrid",
      "method": "POST",
      "path": "/v3/mail/send",
      "status_code": 202,
      "description": "Sent email to customer@example.com",
      "duration_ms": 32
    }
  ]
}

Example

curl https://api.mokra.ai/api/worlds/world_abc123/observations \
  -H "X-API-Key: mk_live_your_key"

Text format

curl "https://api.mokra.ai/api/worlds/world_abc123/observations?format=text" \
  -H "X-API-Key: mk_live_your_key"
Response:
POST stripe/v1/charges → Created charge for $50.00 USD
POST sendgrid/v3/mail/send → Sent email to customer@example.com

Filter by service

curl "https://api.mokra.ai/api/worlds/world_abc123/observations?service=stripe" \
  -H "X-API-Key: mk_live_your_key"

Errors

StatusDescription
401Invalid or missing API key
404World not found