API Reference

The Deadlock Draft API allows you to create draft sessions and retrieve results. When a draft finishes, the result is sent to your webhook URL automatically.

Base URL:https://draft.deadlock.pro.br

Rate Limits

Per IP address. Headers RateLimit-* included in responses.

POSTCreate draft
20 req / 5 min
GETRead
120 req / min

Data Retention

Drafts are automatically deleted after 2 months.

Use the webhook to persist results on your side.

How it works

  1. You create a draft via the API, providing team names, format, and a callback_url.
  2. The API returns URLs for each team, a stream view, and an admin page.
  3. Share the team URLs with the captains. They pick and ban heroes in real-time.
  4. When the draft finishes, the server sends a POST webhook to your callback_url with the full result.

Endpoints

Creates a new draft session. Returns all codes needed to share with teams.

Request Body

{
  "name_a": "Team Alpha",
  "name_b": "Team Bravo",
  "sort": "a#-b#-a1-b2-a2-b1-b#-a#-b1-a2-b2-a1",
  "stream": false,
  "timer_seconds": 30,
  "callback_url": "https://your-server.com/webhook/draft"
}
FieldTypeRequiredDescription
name_astringYesName of Team A
name_bstringYesName of Team B
sortstringYesDraft format string (see Sort Formats below)
streambooleanNoEnable streamer mode (masks URLs). Default: false
timer_secondsnumberNoSeconds per turn. 0 = no timer. Default: 30
callback_urlstringNoURL to receive a POST webhook when the draft finishes

Response

{
  "data": {
    "id": 1,
    "code_url": "aB3xK9mQ",
    "code_admin": "xY7kL2nP9wRt",
    "code_a": "qW8eR5tY",
    "code_b": "uI0oP3aS",
    "name_a": "Team Alpha",
    "name_b": "Team Bravo",
    "sort": "a#-b#-a1-b2-a2-b1-b#-a#-b1-a2-b2-a1",
    "stream": false,
    "ready_a": false,
    "ready_b": false,
    "items": "[]",
    "timer_seconds": 30,
    "callback_url": "https://your-server.com/webhook/draft",
    "status": "waiting",
    "cover": "https://draft.deadlock.pro.br/aB3xK9mQ/cover"
  }
}

Retrieve the current state of a draft using the code_url returned from creation. Sensitive fields (team codes, admin code, callback URL) are stripped from the response.

Response

{
  "data": {
    "id": 1,
    "code_url": "aB3xK9mQ",
    "name_a": "Team Alpha",
    "name_b": "Team Bravo",
    "sort": "a#-b#-a1-b2-a2-b1-b#-a#-b1-a2-b2-a1",
    "stream": false,
    "ready_a": true,
    "ready_b": true,
    "status": "active",
    "items": [
      { "type": "ban", "team": "a", "hero": { "key": 13 }, "order": 1 },
      { "type": "ban", "team": "b", "hero": { "key": 7 }, "order": 2 },
      ...
    ],
    "timer_seconds": 30,
    "created_at": "2026-03-30 20:00:00",
    "cover": "https://draft.deadlock.pro.br/aB3xK9mQ/cover"
  }
}

Webhook

When a draft finishes (all picks and bans are completed), the server sends a POST request to the callback_url you provided during creation. This happens for both manual completions and auto-picks from timer expiry.

Webhook Payload

{
  "event": "draft.finished",
  "draft": {
    "id": 1,
    "code_url": "aB3xK9mQ",
    "cover": "https://draft.deadlock.pro.br/aB3xK9mQ/cover",
    "name_a": "Team Alpha",
    "name_b": "Team Bravo",
    "sort": "a#-b#-a1-b2-a2-b1-b#-a#-b1-a2-b2-a1",
    "status": "finished",
    "items": [
      { "type": "ban", "team": "a", "hero": { "key": 13, "collection": "deadlock_heroes" }, "order": 1 },
      { "type": "ban", "team": "b", "hero": { "key": 7, "collection": "deadlock_heroes" }, "order": 2 },
      { "type": "pick", "team": "a", "hero": { "key": 1, "collection": "deadlock_heroes" }, "order": 3 },
      { "type": "pick", "team": "b", "hero": { "key": 19, "collection": "deadlock_heroes" }, "order": 4 },
      { "type": "pick", "team": "b", "hero": { "key": 35, "collection": "deadlock_heroes" }, "order": 5 },
      ...
    ],
    "created_at": "2026-03-30 20:00:00"
  }
}

Notes:

  • Items with auto: true were auto-picked by the timer.
  • The hero.key corresponds to the hero ID from the Deadlock Heroes API.
  • The webhook is fire-and-forget. If your server is down, the payload is not retried.

Draft URLs

After creating a draft, use the returned codes to build URLs:

PageURLDescription
Team A Draft Page/{code_url}/{code_a}Private URL for Team A to pick/ban
Team B Draft Page/{code_url}/{code_b}Private URL for Team B to pick/ban
Stream/Spectator/{code_url}Public view for stream overlays
Admin Links/links/{code_admin}Page with all URLs (only for the organizer)

Sort Formats

The sort field defines the pick/ban order. Each block is separated by - and follows the format: [team][count_or_#]

a# = Team A bans 1 hero

b2 = Team B picks 2 heroes in a row

a1 = Team A picks 1 hero

FormatSort String
Standard (4 bans)a#-b#-a1-b2-a2-b1-b#-a#-b1-a2-b2-a1
Mini Tournament (2 bans)a#-b#-a1-b2-a2-b1-b1-a2-b2-a1
Watchparty (no bans)a1-b2-a2-b1-b1-a2-b2-a1
Simple (alternating)a1-b1-a1-b1-a1-b1-a1-b1-a1-b1-a1-b1
Advanced (dual picks)a1-b2-a2-b2-a2-b1-a1-b1

Quick Example

// 1. Create a draft with a webhook
const res = await fetch('https://draft.deadlock.pro.br/api/draft', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    name_a: 'Team Alpha',
    name_b: 'Team Bravo',
    sort: 'a#-b#-a1-b2-a2-b1-b#-a#-b1-a2-b2-a1',
    timer_seconds: 30,
    callback_url: 'https://your-server.com/webhook/draft',
  }),
})

const { data } = await res.json()

// 2. Share the URLs with teams:
//    Team A: https://draft.deadlock.pro.br/${data.code_url}/${data.code_a}
//    Team B: https://draft.deadlock.pro.br/${data.code_url}/${data.code_b}
//    Stream: https://draft.deadlock.pro.br/${data.code_url}

// 3. Poll the status (optional):
//    GET https://draft.deadlock.pro.br/api/draft/${data.code_url}

// 4. When the draft finishes, your webhook receives:
//    POST https://your-server.com/webhook/draft
//    { "event": "draft.finished", "draft": { ... } }