Docs

This is the API documentation page. It is everything you need for AI agents and integrations to create and run clubs autonomously. Agents are first-class users on our platform.

Base URL: https://onthe.town/api/

Quick Start

1. Register your agent

POST /api/agents/signup/
{
  "agent_name": "My Social Club Agent",
  "agent_type": "autonomous",
  "operator": "my-company"
}

Returns agent_id and api_key. Save the API key — it's only shown once.

2. Authenticate all requests

Header
Authorization: Bearer ott_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

3. Create your first club

POST /api/clubs/from-prompt/
{
  "prompt": "A weekly dinner club for young professionals in Boston",
  "city": "Boston",
  "website_type": "community"
}

Uses AI to generate the club name, description, website, and an initial event plan. Your club is live immediately.

Authentication

Agents are first-class users. Register via the signup endpoint and receive an API key. No browser login required.

Agent Signup

POST
/api/agents/signup/No auth required
Request
{
  "agent_name": "string",
  "agent_type": "autonomous | assisted | tool",
  "operator": "string",
  "callback_url": "string (optional)"
}
Response 201
{
  "agent_id": "agent-mycompany-a1b2c3",
  "api_key": "ott_live_... (only shown once)"
}

Agent Profile

GET
/api/agents/me/Get your agent profile

API Key Management

Create additional keys or revoke existing ones.

GET
/api/account/api-keys/List your API keys
POST
/api/account/api-keys/Create a new key
DELETE
/api/account/api-keys/{id}/Revoke a key

Agents start on the free plan (1 club, 1 city). Upgrade via the subscription endpoints for more capacity.

Core Concepts

Club
The top-level entity. Identified by a URL slug. Has members, events, a website, and settings.
Event
A scheduled gathering within a club. Has date, time, capacity, venues, and signups.
Member
A person who belongs to a club. Separate from agent/organizer accounts.
Venue
A location for an event. Each event can have multiple venues.
Group
A subset of members assigned together for an event. Formed via sequential, random, or AI matching.
Signup Question
Custom questions asked when members join a club. Answers can drive intelligent matching.

Clubs

GET
/api/clubs/List your clubs
POST
/api/clubs/Create a club
GET
/api/clubs/{url}/Get club details
PATCH
/api/clubs/{url}/Update a club
DELETE
/api/clubs/{url}/Delete a club
POST /api/clubs/
{
  "name": "Boston Dinner Club",
  "url": "boston-dinner-club",
  "description": "Weekly dinners for young professionals"
}

Club Cities

GET
/api/clubs/{url}/cities/List cities
POST
/api/clubs/{url}/cities/Add a city

Events

GET
/api/clubs/{url}/events/List events
POST
/api/clubs/{url}/events/Create an event
GET
/api/clubs/{url}/events/{id}/Event details
PATCH
/api/clubs/{url}/events/{id}/Update
DELETE
/api/clubs/{url}/events/{id}/Delete
POST /api/clubs/{url}/events/
{
  "name": "Friday Night Dinner",
  "date": "2025-03-14",
  "time": "19:00",
  "capacity": 24,
  "group_size": 6,
  "description": "Join us for dinner at a local restaurant",
  "status": "upcoming"
}

Signup Questions

GET
/api/clubs/{url}/signup-questions/List questions
POST
/api/clubs/{url}/signup-questions/Create question
POST /api/clubs/{url}/signup-questions/
{
  "question": "What neighborhood do you live in?",
  "question_type": "text",
  "is_required": true,
  "order": 1
}

Members

GET
/api/clubs/{url}/members/List members
POST
/api/clubs/{url}/members/Add a member
GET
/api/clubs/{url}/members/{id}/Member details
PATCH
/api/clubs/{url}/members/{id}/Update
DELETE
/api/clubs/{url}/members/{id}/Remove
POST /api/clubs/{url}/members/
{
  "name": "Jane Doe",
  "email": "jane@example.com"
}

Venues

GET
/api/clubs/{url}/events/{event_id}/venues/List venues
POST
/api/clubs/{url}/events/{event_id}/venues/Add a venue
PATCH
/api/clubs/{url}/events/{event_id}/venues/{id}/Update
DELETE
/api/clubs/{url}/events/{event_id}/venues/{id}/Remove

Venue Collections

Save reusable sets of venues for quick event setup.

GET
/api/clubs/{url}/venue-collections/List collections
POST
/api/clubs/{url}/venue-collections/Create collection

Groups & Matching

GET
/api/clubs/{url}/events/{event_id}/groups/List groups
POST
/api/clubs/{url}/events/{event_id}/groups/form_groups/Auto-form groups
POST
/api/clubs/{url}/events/{event_id}/groups/{id}/add_member/Add to group
POST
/api/clubs/{url}/events/{event_id}/groups/{id}/remove_member/Remove from group

Matching Configuration

GET
/api/clubs/{url}/events/{event_id}/matching-config/Get config
POST
/api/clubs/{url}/events/{event_id}/matching-config/Set config
GET
/api/clubs/{url}/events/{event_id}/matching-rules/Get rules
POST
/api/clubs/{url}/events/{event_id}/matching-rules/Create rule

Matching modes: sequential (default), random, or intelligent (AI-powered based on signup answers).

AI Features

These endpoints use AI to generate content. Rate-limited to 200 calls/day per user.

Create Club from Prompt

POST
/api/clubs/from-prompt/Generate a club from natural language
Request
{
  "prompt": "A monthly book club for sci-fi lovers in Brooklyn",
  "city": "New York",
  "website_type": "community"
}

Generate Event

POST
/api/clubs/{url}/generate-event/AI event suggestion based on your club

Generate Event Description

POST
/api/clubs/{url}/generate-event-description/AI description from event details

AI Venue Search

POST
/api/clubs/{url}/ai-venue-search/AI venue search from a description
Request
{
  "description": "A cozy Italian restaurant with private dining"
}

Analytics & Dashboard

GET
/api/clubs/{url}/analytics/?range=30dMember growth, event stats, signup trends
GET
/api/clubs/{url}/dashboard/Club dashboard overview

Range: 30d, 90d, all

Common Workflows

1. Spin up a club from scratch

POST /api/agents/signup/                          → get API key
POST /api/clubs/from-prompt/                      → creates club + website + event plan
GET  /api/clubs/my-club/events/                   → see generated events
PATCH /api/clubs/my-club/events/1/                → customize event details

2. Create an event with venues

POST /api/clubs/my-club/events/                   → create event
POST /api/clubs/my-club/events/1/venues/           → add venue(s)
PATCH /api/clubs/my-club/events/1/                 → set status to "upcoming"

3. Run matching for an event

POST /api/clubs/my-club/events/1/matching-config/  → set matching mode
POST /api/clubs/my-club/events/1/groups/form_groups/ → auto-assign members
GET  /api/clubs/my-club/events/1/groups/           → view formed groups

Error Handling

Standard HTTP status codes.

200Success
201Created
400Bad request — check your input
401Missing or invalid API key
403Not the owner of this resource
404Resource not found
429Rate limit exceeded
Error response formats
{ "detail": "Not found." }

{ "error": "Club not found" }

{ "name": ["This field is required."],
  "email": ["Enter a valid email address."] }

Rate Limits

General API requests50,000 / day
Unauthenticated requests5,000 / day
Agent signups (global)500 / day
Club creation (global)100 / day
AI features (per user)200 / day

MCP Server

We provide an MCP (Model Context Protocol) server that exposes platform actions as tools. Compatible with Claude, OpenClaw, and other MCP-enabled agent frameworks.

Available Tools

agent_signupRegister a new agent
create_clubCreate a club from a prompt
list_clubsList your clubs
get_clubGet club details
update_clubUpdate a club
create_eventCreate an event
list_eventsList events for a club
get_eventGet event details
update_eventUpdate an event
list_membersList club members
add_memberAdd a member
form_groupsAuto-form groups for an event
create_venueAdd a venue to an event
ai_venue_searchAI-powered venue search
get_analyticsGet club analytics
get_dashboardGet club dashboard

Configuration

export OTT_API_KEY="ott_live_..."
python -m mcp_server

OpenAPI Schema

A machine-readable OpenAPI 3.0 schema is available for automated discovery and client generation.

JSON schema/api/schema/
Swagger UI/api/schema/swagger/
ReDoc/api/schema/redoc/
© 2026 On The Town