An API for DnD using the pre-2024 5e rules.
- Standard Laravel project
- Database currently not using migrations - use latest SQL dump in
databasedirectory
Endpoints here currently use a hard-coded user id of 1. This will change once auth endpoints are added.
Get a list of all characters for the current user.
Create a new character. The returned guid will be used to interact with this character later.
Gets a list of all available classes for a player character.
Gets a list of all available backgrounds for a player character.
Gets a list of all available races for a player character.
Gets a specific character.
Updates details for a specific character. The body of the request should contain details required for that type of update:
{"updateType": "class", "charClassId": class_id}- whereclass_idis one of those returned from theGET /characters/classesendpoint.{"updateType": "background", "charBackgroundId":background_id, "characteristics": []}- wherebackground_idis one of those returned from theGET /characters/backgroundsendpoint, and thecharacteristicsarray is a list of selected characteristics appropriate to that background.{"updateType": "race", "charRaceId": race_id}- whererace_idis one of those returned from theGET /characters/racesendpoint.{"updateType": "abilities", "abilityRolls": [{"abilityId": [1-6], "guid": dice_roll_guid}]}- where all 6 abilities (1-6) have a correspondingguidthat matches a previous dice roll request. Each guid must be unique, and should be a 4d6 roll as per character creation rules.{"updateType": "languages", "languages": []}- wherelanguagesis an array of language ids. If more are given than a character has available, the list will be truncated.
Gets a list of all languages available for a character to know.
Gets a list of randomly generated names for a character to use.
Gets a list of randomly generated names for a character to use based on one of the following:
- angel
- demon
- dwarf
- elf
- fey
- generic
- gnome
- goblin
- halfling
- ogre
- orc
Gets a list of all items currently in the DB.
Gets a list of all items of a specific type currently in the DB. The type can be one of:
- armor
- book
- clothing
- food
- other
- pack
- potion
- projectile
- weapon
- gemstone
- art object
Gets a random item of the specified type. This may also return a randomly generated item of the specified type, which is added to the DB. The type should be one of:
- armor - this can accept a query param called
proficiencythat can be one of the following values used to limit the type of returned item:- heavy
- medium
- light
- shield
- book
- clothing
- food
- other
- potion
- projectile
- weapon - this can accept a query param called
proficiencythat can be one of the following values used to limit the type of returned item:- melee (simple)
- melee (martial)
- ranged (simple)
- ranged (martial)
- gemstone
- art object
Gets a list of all spells.
Gets a list of all spells for a specific level 0-9, where 0 is cantrip.
Gets a list of all spells for a specific school, which should be one of:
- abjuration
- conjuration
- divination
- enchantment
- evocation
- illusion
- necromancy
- transmutation
Gets a list of all spells for a specific school and level. Level should be 0-9 (where 0 is cantrip), and school should be one of:
- abjuration
- conjuration
- divination
- enchantment
- evocation
- illusion
- necromancy
- transmutation
Gets all spells for a specific class, using one of the class id values returned from GET /characters/classes
Gets all spells of the specified level or below for a specific class, using one of the class id values returned from GET /characters/classes.
Creates rolls of the dice specified in the body of the request. A sample request for 4d6 and 2d20 would look like this:
{"dice": {"d6": 4, "d20": 2}}
The Laravel framework is open-sourced software licensed under the MIT license.