Skip to content

HTTP API

Dealer exposes a small Bottle HTTP surface on the same port as the WSGI server. There is no OpenAPI spec — this page documents the routes in controllers.py.

GET /health

Returns JSON with provider and tasks stack health:

{"dealer": {...}, "tasks": {...}}

Use for load balancers and local smoke checks after server.py starts.

POST /put

Enqueue an ad/campaign action for asynchronous execution.

Request body (JSON):

Field Required Purpose
user_id yes Drives permission lookup (may also appear under params)
action yes Action name checked against user settings
provider typical Selects worker (e.g. taboola, pinterest)
params typical Provider-specific payload

Permission gate: verify_action_permissions reads user settings from Redis/MySQL. Missing permission → 403.

Queue selection: priority jobs go to the queue RabbitMQ queue; others to buffer. Queue names come from SSM (see Configuration).

Response: acknowledgment that the message was published (not the provider result — execution is async).

DELETE /kill/<provider_name>

Stub endpoint — returns the provider name. Full kill/stream logic is marked TODO in source.

GET /service_check

Engine pool health check used internally.

Authentication

Unlike skynet-app-api, dealer does not issue JWTs. Callers (typically skynet-app-api or internal tools) pass user_id in the job body; dealer trusts the permission rows already stored for that user.