Skip to main content

Admin APIs

Get Single Account

This endpoint allows administrators to retrieve details for a specific account.

info

This request must have the authorization header. Refer to Authorization method guide for more details

Request

PropertyValue
methodGET
url$baseUrl/admin/accounts/:id
Content-Typeapplication/json

Path Parameters

ParameterDescription
idThe ID of the account
curl -X GET "$baseUrl/admin/accounts/2" \
-H "Authorization: Bearer $token"

Response

Http Code: 200

{
"data": {
"id": 2,
"name": "First Account",
"email": "first@email.com",
"email_verified_at": "2025-05-08T23:16:29.000Z",
"api_key_generated_at": "2025-05-08T23:16:29.000Z",
"preferences": {
"allow_negative_balance": false
},
"created_at": "2025-05-08T15:21:41.017Z",
"updated_at": "2025-05-08T23:17:25.456Z"
},
"message": "Account retrieved successfully"
}

Get Paginated Accounts

This endpoint allows administrators to retrieve a paginated list of all accounts.

info

This request must have the authorization header. Refer to Authorization method guide for more details

Request

PropertyValue
methodGET
url$baseUrl/admin/accounts
Content-Typeapplication/json

Query Parameters

ParameterTypeRequiredDefaultDescription
pagenumberNo1Page number for pagination
per_pagenumberNo20Number of results per page
searchstringNo-Search term for account name/email
email_verifiedbooleanNo-Filter by email verification status (true/false)
sort_bystringNocreated_atSort field (effective_odds, effective_amount, created_at)
sort_directionstringNoascSort direction (asc, desc)
curl -X GET "$baseUrl/admin/accounts?page=1&per_page=10&search=email&email_verified=true&sort_by=created_at&sort_direction=desc" \
-H "Authorization: Bearer $token"

Response

Http Code: 200

{
"data": [
{
"id": 2,
"name": "First Account",
"email": "first@email.com",
"email_verified_at": "2025-05-08T23:16:29.000Z",
"api_key_generated_at": "2025-05-08T23:16:29.000Z",
"preferences": {
"allow_negative_balance": false
},
"created_at": "2025-05-08T15:21:41.017Z",
"updated_at": "2025-05-08T23:17:25.456Z"
},
{
"id": 1,
"name": "Admin Account",
"email": "admin@email.com",
"email_verified_at": "2025-05-01T12:00:00.000Z",
"api_key_generated_at": "2025-05-01T12:00:00.000Z",
"preferences": {},
"created_at": "2025-05-01T12:00:00.000Z",
"updated_at": "2025-05-01T12:00:00.000Z"
}
],
"per_page": 20,
"page": 1,
"total": 2,
"from": 1,
"to": 2,
"last_page": 1
}

Force Update Wager Outcome

This endpoint allows administrators to force-update the outcome of a wager, even if it has already been decided.

info

This request must have the authorization header. Refer to Authorization method guide for more details

Request

PropertyValue
methodPOST
url$baseUrl/admin/wagers/force-update-outcome
Content-Typeapplication/json

Body

PropertyTypeRequiredDescription
account_idnumberYesThe ID of the account
wager_referencestringYesThe reference ID of the wager
outcomestringYesThe new outcome (undecided, win, half-win, loss, half-loss, push, void)
descriptionstringNoDescription of why the outcome was changed
curl -X POST "$baseUrl/admin/wagers/force-update-outcome" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $token" \
-d '{
"account_id": 2,
"wager_reference": "wager-9",
"outcome": "win",
"description": "Outcome corrected after review"
}'

Response

Http Code: 200

{
"message": "Wager outcome updated successfully"
}

Set Bet Inactive

This endpoint allows administrators to deactivate a bet by its ID. When a bet is set as inactive, it will trigger a rollback of the bet's financial impact, restoring user balances and exposure to their previous state.

Important Behavior

When a bet is set as inactive:

  • The bet's is_active status is set to false
  • A rollback transaction is performed to restore user balances
  • The bet's offer status remains unchanged
  • An audit trail is created with the admin user's details
  • If the bet has already been settled, appropriate balance adjustments are made

Request

PropertyValue
methodPOST
url$baseUrl/admin/bets/:betId/set-inactive
Content-Typeapplication/json

Path Parameters

ParameterDescription
betIdThe ID of the bet to deactivate
curl -X POST "$baseUrl/admin/bets/7/set-inactive" \
-H "Authorization: Bearer $token" \
-H "Content-Type: application/json"

Response

Http Code: 200

{
"message": "Bet set inactive successfully"
}

Set Bet Active

This endpoint allows administrators to reactivate a previously deactivated bet by its ID. When a bet is set as active, it will restore the bet's financial impact on user balances and exposure.

Important Behavior

When a bet is set as active:

  • The bet's is_active status is set to true
  • Transaction actions are performed to restore the bet's financial impact
  • The bet's offer status remains unchanged
  • An audit trail is created with the admin user's details
  • User balances and exposure are updated based on the bet's current state

Request

PropertyValue
methodPOST
url$baseUrl/admin/bets/:betId/set-active
Content-Typeapplication/json

Path Parameters

ParameterDescription
betIdThe ID of the bet to reactivate
curl -X POST "$baseUrl/admin/bets/7/set-active" \
-H "Authorization: Bearer $token" \
-H "Content-Type: application/json"

Response

Http Code: 200

{
"message": "Bet set active successfully"
}

Force Update Bet Override Outcome

This endpoint allows administrators to force update the override outcome of a specific bet. This is useful for correcting bet outcomes when there are disputes or errors in the original settlement.

Important Behavior

When a bet's override outcome is updated:

  • The current bet's financial impact is rolled back first
  • The bet's override_outcome is updated to the new value
  • If the bet is in "requesting" or "accepting" state and the override outcome is not "undecided", the bet's offer status is changed to "expired"
  • If the override outcome is set to "undecided" and the bet is "expired", the offer status is restored to "requesting" or "accepting"
  • New transaction actions are performed based on the updated outcome
  • An audit trail is created with the admin user's details

Request

PropertyValue
methodPOST
url$baseUrl/admin/bets/force-update-override-outcome
Content-Typeapplication/json

Body Parameters

ParameterTypeRequiredDescription
account_idnumberYesThe ID of the account that owns the bet
bet_idnumberYesThe ID of the bet to update
override_outcomestringNoThe new override outcome (undecided, win, loss, push, half-win, half-loss, void, or null to remove)
descriptionstringNoOptional description for the action
curl -X POST "$baseUrl/admin/bets/force-update-override-outcome" \
-H "Authorization: Bearer $token" \
-H "Content-Type: application/json" \
-d '{
"account_id": 2,
"bet_id": 7,
"override_outcome": "win",
"description": "Corrected outcome after review"
}'

Response

Http Code: 200

{
"message": "Override outcome updated successfully"
}