## Responses and Errors

All successful responses are sent with 2xx HTTP codes.

All errors will be sent with 4xx, 5xx HTTP codes.

### Error Response Body:

| Field | Required | Description |
|  --- | --- | --- |
| code | True | System code for identification type of the error. |
| message | False | Message with error details. |
| timestamp | False | Timestamp of the error occurrence. |
| path | False | Request path that caused the error. |


### Example of Error Response Body:

```
{
    "code": "REQUEST_NOT_VALID",
    "message": "gameId - must not be empty, betNumber - must not be null, startDate - must not be null, timezone - must not be empty, currencyCode - must not be null, endDate - must not be null, strategy - must not be null, bet - must not be null, name - must not be empty",
    "timestamp": "2025-01-15T10:30:00.000Z",
    "path": "/api/v1/campaign"
}
```

### Errors

| HTTP Code | Code | Description |
|  --- | --- | --- |
| 400 | ACTION_FORBIDDEN | Action is forbidden for current state of the campaign. |
| 400 | REQUEST_NOT_VALID | Invalid request arguments. |
| 400 | CAMPAIGN_ALREADY_STARTED | Campaign could not be changed after it was started. |
| 400 | CAMPAIGN_ALREADY_ENDED | Campaign could not be changed after it was ended. |
| 400 | CAMPAIGN_DISABLED | Campaign could not be changed after it was disabled. |
| 400 | ROUND_NOT_FINISHED | Round is not finished. |
| 400 | GAME_NOT_SUPPORTED | Game is not supported. |
| 400 | BRAND_REQUIRED | Brand ID is required in the request path. |
| 401 | NOT_AUTHORIZED | Authentication failed. |
| 403 | ACCESS_TO_ROUND_DENIED | Access to round denied. |
| 403 | INSUFFICIENT_SCOPE | The principal does not have the required scope to access this endpoint. |
| 403 | BRAND_NOT_ALLOWED | The principal does not have access to the specified brand. |
| 403 | BRAND_MISMATCH | The brand ID in the path does not match the principal's associated brand. |
| 404 | CAMPAIGN_NOT_FOUND | Campaign not found. |
| 404 | PARTICIPANT_NOT_FOUND | Campaign participant not found. |
| 404 | ROUND_NOT_FOUND | Round not found. |
| 404 | GAME_ACTION_EVENTS_SUBSCRIPTION_NOT_FOUND | Game Action Events Subscription not found. |
| 429 | TOO_MANY_REQUESTS | When requests per second exceed the limit. |
| 500 | UNKNOWN_ERROR | Something went wrong, request not processed. |
| 504 | TIMEOUT | The server did not respond within the expected time. |