Encounters API Documentation

Encounters API

Role Playing Game Encounter and Adventure Management API

Welcome to the Encounters API

This API provides endpoints for managing RPG encounters and adventures, with full JSON Schema validation for data integrity.

🎲 Encounters

Create, read, update, and delete individual RPG encounters. Each encounter includes monsters, NPCs, treasure, and environmental details.

🗺️ Adventures

Manage complete adventures containing multiple linked encounters, with level ranges and detailed narrative descriptions.

📋 JSON Schema

All content is validated against strict JSON schemas to ensure data consistency and structure compliance.

🔗 RESTful Design

Clean, predictable REST endpoints with standard HTTP methods and response codes.

Base URL

Development: http://localhost:3000/api/v1 Production: https://encounters.dev/api/v1

Content Type

Content-Type: application/json
Adventures API
GET /api/v1/adventures
Retrieve a list of all adventures
200 List of adventures
POST /api/v1/adventures
Create a new adventure with the provided data
Request Body (adventure-create schema)
{ "name": "string (required)", "description": "string (required)", "content": "string (required, JSON)", "published": "boolean (required)", "user_id": "integer (required)" }
201 Adventure created successfully
422 Validation errors
GET /api/v1/adventures/{id}
Retrieve a specific adventure by ID
200 Adventure details
404 Adventure not found
PATCH /api/v1/adventures/{id}
Update an existing adventure with new data
Request Body (adventure-update schema)
{ "name": "string (optional)", "description": "string (optional)", "content": "string (optional, JSON)", "published": "boolean (optional)", "user_id": "integer (optional)" }
200 Adventure updated successfully
404 Adventure not found
422 Validation errors
DELETE /api/v1/adventures/{id}
Delete a specific adventure by ID
204 Adventure deleted successfully
404 Adventure not found
Encounters API
GET /api/v1/encounters
Retrieve a list of all encounters
200 List of encounters
POST /api/v1/encounters
Create a new encounter with the provided data
Request Body (encounter-create schema)
{ "name": "string (required)", "description": "string (required)", "content": "string (required, JSON)", "published": "boolean (required)", "user_id": "integer (required)" }
201 Encounter created successfully
422 Validation errors
GET /api/v1/encounters/{id}
Retrieve a specific encounter by ID
200 Encounter details
404 Encounter not found
PATCH /api/v1/encounters/{id}
Update an existing encounter with new data
Request Body (encounter-update schema)
{ "name": "string (optional)", "description": "string (optional)", "content": "string (optional, JSON)", "published": "boolean (optional)", "user_id": "integer (optional)" }
200 Encounter updated successfully
404 Encounter not found
422 Validation errors
DELETE /api/v1/encounters/{id}
Delete a specific encounter by ID
204 Encounter deleted successfully
404 Encounter not found

JSON Schemas

All API requests and responses are validated against JSON schemas to ensure data integrity and consistency.

Request Schemas

Response Schemas

Content Schemas

The content field in adventures and encounters must conform to specific schemas: