ERIC REST API

Create campaign
POST /api/campaigns

Создаёт кампанию

Request body

Object
title
string

Название кампании

Example:
Shards of Aether
genre
string

Жанр

Example:
dark fantasy
pitch
string

Краткое содержание

Example:
Star shards corrupt the realm
Examples

minimal

{"title": "Shards of Aether"}

full

{"title": "Shards of Aether", "genre": "dark fantasy", "pitch": "Star shards corrupt the realm"}

Responses

201 Created

Кампания создана

Body
Object
id
string

id кампании

Example:
64f1c3f4e1a24d3c8a9b1234
title
string

Название кампании

Example:
Shards of Aether
genre
string

Жанр кампании

Example:
dark fantasy
pitch
string

Короткое описание

Example:
Star shards corrupt the realm
created_at
string

Время создания кампании

Example:
2025-10-20T12:34:56.000Z
400 Error

Обязательное поле title не заполнено

Create party
POST /api/parties

Создает партию с привязкой к кампании

Request body

Object
campaign_id
string

id кампании

title
string

Название партии

goals
Array of string

Цели партии

scenes
Array of Scene

Сцены

Examples

minimal

{
  "campaign_id": "64f1c3f4e1a24d3c8a9b1234",
  "title": "Party 1 — The Heist"
}

full

{
  "campaign_id": "64f1c3f4e1a24d3c8a9b1234",
  "title": "Party 1 — The Heist",
  "goals": ["steal ledger", "escape"],
  "scenes": [
    {
      "title": "Ambush on the bridge",
      "order": "1",
      "blocks": [
        { "type": "text", "content": { "content": "Timer: 6 ticks" } },
        { "type": "ref", "ref": { "provider": "dnd5eapi", "refType": "monsters", "index": "animated-armor" } }
      ]
    },
    { "title": "Roof chase", "order": "2", "blocks": [] }
  ]
}

Responses

201 Created

Партия успешно создана

Body
Object
id
string

id партии

Example:
68fcc0590e311a01d7610426
campaign_id
string

id кампании

Example:
64f1c3f4e1a24d3c8a9b1234
title
string

название партии

Example:
Party 1 — The Heist
goals
string

цели

Example:
"steal ledger", "escape"
scenes
string

сцены внутри партии

Example:
[]
created_at
string

дата и время создания партии

Example:
2025-10-25T15:45:45.586220
Examples
{
    "id": "68fcc0590e311a01d7610426",
    "campaign_id": "64f1c3f4e1a24d3c8a9b1234",
    "title": "Party 1 — The Heist",
    "goals": "\"steal ledger\", \"escape\"",
    "scenes": "[]",
    "created_at": "2025-10-25T15:45:45.586220"
}
400 Bad Request

Обязательное поле title не заполнено

404 Not Found

campaign_id не найден

Create NPC
POST /api/parties/{party_id}/npcs

Создает NPC

Path variables

party_id
string required

ID партии

Request body

Object
name
string

Имя NPC

role
string

Описание роли

appearance
string

Внешность

traits
Array of string

Черты характера

notes
string

Заметки мастера

Examples

minimal

{ "name": "Vera the Harper" }

full

{
  "name": "Vera the Harper",
  "role": "ally",
  "appearance": "scar across eyebrow, calm voice",
  "traits": ["quick wit", "discreet"],
  "notes": "hates cultists"
}

Responses

201 Created

NPC создан

Body
Object
id
string

id NPC

party_id
string

id партии

campaign_id
string

id кампании

name
string

имя NPC

role
string

роль

appearance
string

внешний вид

traits
string

характеристики

notes
string

заметки

created_at
string

дата и время создания

Examples
{
  "id": "68f7a123c1ff7d44bcc54abc",
  "party_id": "68f7a111c1ff7d44bcc54111",
  "campaign_id": "68f79999c1ff7d44bcc54999",
  "name": "Vera the Harper",
  "role": "ally",
  "appearance": "scar across eyebrow, calm voice",
  "traits": ["quick wit", "discreet"],
  "notes": "hates cultists"
  "created_at": "2025-10-20T12:34:56.000Z"
}
400 Bad Request

Обязательное поле name не заполнено

Body
Object
error
string
detail
string
Examples
{ "error": "`name` is required" }
404 Not Found

party_id не найден

Body
Object
error
string
detail
string
Examples
{ "error": "Party not found" }
Get monsters
GET /api/monsters

Подгружает данные из https://www.dnd5eapi.co/api/2014/monsters. Поддерживает фильтр по CR через параметр challenge_rating (одно значение, несколько значений или строка со списком).

Request parameters

challenge_rating
array of string optional

Сложность монстра

Collection format: csv

Responses

200 OK

Данные о монстрах получены

Body
Object
count
number

Количество элементов

results

Массив монстров

Examples

without filters

{
  "count": 325,
  "results": [
    { "index": "aboleth", "name": "Aboleth", "url": "/api/2014/monsters/aboleth" }
  ]
}

with challenge rate

{
  "count": 42,
  "results": [
    { "index": "animated-armor", "name": "Animated Armor", "url": "/api/2014/monsters/animated-armor" }
  ]
}
400 Bad Request

Неправильный запрос

Body
Object
error
string
detail
string
Examples
{
  "error": "Network error calling D&D API",
  "detail": "HTTPSConnectionPool(... timeout=10)"
}
502 Bad Gateway

Ошибка сети

Get rules
GET /api/rule-sections/{index}

Подгружает данные из https://www.dnd5eapi.co/api/2014/rule-sections.

Path variables

index
string required

Индекс раздела правил. Примеры: ability-checks, movement, traps

Responses

200 OK

Данные о правилах получены

Body
Object
DndRuleSection
Examples
{
  "index": "ability-checks",
  "name": "Ability Checks",
  "url": "/api/2014/rule-sections/ability-checks",
  "desc": [
    "An ability check tests a character's or monster's innate talent and training...",
    "To make an ability check, roll a d20 and add the relevant modifier..."
  ]
}
400 Bad Request

Неправильный запрос

502 Bad Gateway

Ошибка сети

Body
Object
error
string
detail
string
Examples
{
  "error": "Network error calling D&D API",
  "detail": "HTTPSConnectionPool(... timeout=10)"
}
Save favorite
POST /api/favorites

Добавляет элемент в избранное

Request body

Object
kind
string

Тип элемента

index
string

Идентификатор в справочнике

description
string

Заметка мастера

campaign_id
string

Привязка к кампании

Examples

minimal

{ "kind": "spell", "index": "acid-splash" }

with describtion

{ "kind": "monster", "index": "animated-armor", "description": "Броня для засады на мосту" }

with campaign

{ "campaign_id": "68f798689c1ff7d44bcc54e7", "kind": "item", "index": "alchemy-jug" }

Responses

201 Created
Body
Object
id
string

id записи

kind
string

Тип элемента

index
string

Идентификатор в справочнике

description
string

Описание

campaign
string

Id кампании

saved_at
string

Дата и время сохранения

Examples
{
  "id": "68f7aa11c1ff7d44bcc54fff",
  "kind": "monster",
  "index": "animated-armor",
  "description": "Броня для засады на мосту",
  "campaign": "68f798689c1ff7d44bcc54e7",
  "created_at": "2025-10-21T12:34:56.000Z"
}
400 Bad Request
Body
Object
error
string
detail
string
Examples
{ "error": "kind and index are required" }
404 Not Found
Body
Object
error
string
detail
string
Examples
{
  "error": "Campaign not found",
  "detail": "If you pass campaignId, it must refer to an existing document."
}
Scene

Упорядоченный фрагмент: содержит заголовок (title), порядковый номер в партии (order) и список блоков (blocks) из SceneBlock, определяющих содержание сцены (заметки, элементы из справочника, NPC).

Object
title
string

Название

order
integer

Порядковый номер в партии

blocks
Array of SceneBlock

Список блоков, определяющих содержание сцены

SceneBlock

Атомарный элемент сцены: блок одного из типов text / ref / npc. Для text используется поле content, для ref — объект ref, для npc — npcId; остальные поля при этом пусты.

Object
type
string

text, ref, npc

content
string

Заметки автора

ref
string

Ссылка на объект из справочника (монстр, заклинание, предмет, правило и т. п.).

npcId
string

id npc

DnDApiResults

Данные о монстре

Object
index
string

Индекс монстра

name
string

Имя монстра

url
string

Ссылка на данные о конкретном монстре

DndRuleSection

Данные о правиле

Object
index
string

Индекс правила

name
string

Название правила

url
string

Ссылка на правила

desc
Array of string

Описание правила