Skip to main content

Community Events API

The Community Events API covers the full lifecycle of community events: creating, managing, RSVPing, browsing, and exporting. All data is scoped to your tenant.

Base path: https://api.ainative.studio/api/v1/community-events

Authentication: All endpoints require Authorization: Bearer <your_api_key> unless noted otherwise.


Event CRUD

Create an event

POST /api/v1/community-events/

Create a new community event. The authenticated user becomes the event creator.

Request body

{
"title": "AI Builders Meetup — May 2026",
"description": "Monthly meetup for AI builders in San Francisco.",
"start_time": "2026-05-20T18:00:00Z",
"end_time": "2026-05-20T21:00:00Z",
"location": "Hack the Lab, 123 Market St, San Francisco",
"event_type": "in_person",
"capacity": 80,
"group_id": null
}
FieldTypeRequiredDescription
titlestringYesEvent title
descriptionstringNoEvent description
start_timedatetime (ISO 8601)YesEvent start time (UTC)
end_timedatetime (ISO 8601)NoEvent end time (UTC)
locationstringNoPhysical address or meeting link
event_typestringNovirtual, in_person, or hybrid
capacityintegerNoMaximum number of attendees (null = unlimited)
group_idstring (UUID)NoAttach event to a group

Response 201 Created

{
"id": "abc12345-0000-0000-0000-000000000001",
"title": "AI Builders Meetup — May 2026",
"description": "Monthly meetup for AI builders in San Francisco.",
"start_time": "2026-05-20T18:00:00Z",
"end_time": "2026-05-20T21:00:00Z",
"location": "Hack the Lab, 123 Market St, San Francisco",
"event_type": "in_person",
"capacity": 80,
"status": "scheduled",
"creator_id": "550e8400-e29b-41d4-a716-446655440000",
"tenant_id": "tenant-uuid-here",
"group_id": null,
"created_at": "2026-04-25T14:00:00Z",
"updated_at": "2026-04-25T14:00:00Z"
}

Errors

CodeReason
400Invalid dates, missing required fields, or user has no tenant

Example

curl -X POST https://api.ainative.studio/api/v1/community-events/ \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "AI Builders Meetup — May 2026",
"start_time": "2026-05-20T18:00:00Z",
"event_type": "in_person",
"capacity": 80
}'
import requests

resp = requests.post(
"https://api.ainative.studio/api/v1/community-events/",
headers={"Authorization": f"Bearer {api_key}"},
json={
"title": "AI Builders Meetup — May 2026",
"start_time": "2026-05-20T18:00:00Z",
"event_type": "in_person",
"capacity": 80,
}
)
event = resp.json()
print(f"Created event: {event['id']}")

List events

GET /api/v1/community-events/

List community events with optional filtering and pagination.

Query parameters

ParameterTypeDefaultDescription
filter_typestringupcoming, past, or my_events
group_idstring (UUID)Filter by group ID
limitinteger50Max results (1–100)
offsetinteger0Pagination offset

Response 200 OK

{
"total": 23,
"offset": 0,
"limit": 50,
"has_more": false,
"events": [
{
"id": "abc12345-0000-0000-0000-000000000001",
"title": "AI Builders Meetup — May 2026",
"start_time": "2026-05-20T18:00:00Z",
"event_type": "in_person",
"status": "scheduled",
"capacity": 80
}
]
}

Get event details

GET /api/v1/community-events/{event_id}

Get full details for a specific event.

Path parameters

ParameterTypeRequiredDescription
event_idstring (UUID)YesEvent ID

Response 200 OK

Returns a full EventResponse object (same shape as the create response).

Errors

CodeReason
404Event not found or outside your tenant

Update an event

PATCH /api/v1/community-events/{event_id}

Update an existing event. Only the creator can update their event.

Path parameters

ParameterTypeRequiredDescription
event_idstring (UUID)YesEvent ID

Request body

Send only the fields you want to update:

{
"title": "AI Builders Meetup — May 2026 (Updated)",
"capacity": 100
}

Response 200 OK

Returns the updated EventResponse object.

Errors

CodeReason
403Authenticated user is not the event creator
404Event not found

Delete (cancel) an event

DELETE /api/v1/community-events/{event_id}

Cancel an event. Only the creator can delete their event. This marks the event as cancelled rather than permanently deleting it.

Path parameters

ParameterTypeRequiredDescription
event_idstring (UUID)YesEvent ID

Response 204 No Content

Errors

CodeReason
403Authenticated user is not the event creator
404Event not found

RSVP operations

RSVP to an event

POST /api/v1/community-events/{event_id}/rsvp

Create or update your RSVP for an event.

Path parameters

ParameterTypeRequiredDescription
event_idstring (UUID)YesEvent ID

Request body

{
"status": "going",
"response_message": "Looking forward to it!"
}
FieldTypeRequiredDescription
statusstringYesgoing, interested, or not_going
response_messagestringNoOptional message to the organizer

Response 201 Created

{
"id": "rsvp-uuid-here",
"event_id": "abc12345-0000-0000-0000-000000000001",
"user_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "going",
"response_message": "Looking forward to it!",
"created_at": "2026-04-25T14:30:00Z"
}

Errors

CodeReason
400Event is at capacity (for going status), or event is cancelled
404Event not found

Example

curl -X POST https://api.ainative.studio/api/v1/community-events/abc12345-0000-0000-0000-000000000001/rsvp \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"status": "going"}'
resp = requests.post(
"https://api.ainative.studio/api/v1/community-events/abc12345-0000-0000-0000-000000000001/rsvp",
headers={"Authorization": f"Bearer {api_key}"},
json={"status": "going", "response_message": "Looking forward to it!"}
)

Update an RSVP

PATCH /api/v1/community-events/rsvps/{rsvp_id}

Change your RSVP status. Users can only update their own RSVPs.

Path parameters

ParameterTypeRequiredDescription
rsvp_idstring (UUID)YesRSVP ID

Request body

{
"status": "not_going"
}

Response 200 OK

Returns the updated RSVPResponse object.

Errors

CodeReason
400Event is at capacity when changing to going
403You do not own this RSVP
404RSVP not found

Attendee and RSVP lists

Get event attendees

GET /api/v1/community-events/{event_id}/attendees

Get attendees for an event with optional RSVP status filter.

Path parameters

ParameterTypeRequiredDescription
event_idstring (UUID)YesEvent ID

Query parameters

ParameterTypeDefaultDescription
status_filterstringFilter by RSVP status: going, interested, or not_going

Response 200 OK

{
"total": 55,
"going_count": 42,
"interested_count": 10,
"not_going_count": 3,
"attendees": [
{
"user_id": "550e8400-e29b-41d4-a716-446655440000",
"rsvp_id": "rsvp-uuid-here",
"status": "going",
"response_message": "Looking forward to it!",
"rsvp_created_at": "2026-04-25T14:30:00Z"
}
]
}

Get event RSVPs (paginated)

GET /api/v1/community-events/{event_id}/rsvps

Get RSVPs with pagination and optional status filtering.

Path parameters

ParameterTypeRequiredDescription
event_idstring (UUID)YesEvent ID

Query parameters

ParameterTypeDefaultDescription
status_filterstringgoing, interested, or not_going
limitinteger50Max results (1–100)
offsetinteger0Pagination offset

Response 200 OK

Same shape as the attendees response, with pagination metadata.


My events

Get my events

GET /api/v1/community-events/my-events

Get events the authenticated user has RSVP'd to.

Query parameters

ParameterTypeDefaultDescription
upcoming_onlybooleantrueOnly return future events
status_filterstringFilter by RSVP status
limitinteger20Max results (1–100)
offsetinteger0Pagination offset

Response 200 OK

{
"total": 4,
"offset": 0,
"limit": 20,
"has_more": false,
"events": [
{
"id": "abc12345-0000-0000-0000-000000000001",
"title": "AI Builders Meetup — May 2026",
"start_time": "2026-05-20T18:00:00Z",
"status": "scheduled"
}
]
}

Event discovery

Browse upcoming events

GET /api/v1/community-events/browse

Discover upcoming events with filtering and sorting. Returns only events with status=scheduled and start_time >= now.

Query parameters

ParameterTypeDefaultDescription
event_typestringvirtual, in_person, or hybrid
group_idstring (UUID)Filter to a specific group
sort_bystringstart_timeSort field: start_time or attendee_count
sort_orderstringascSort direction: asc or desc
limitinteger20Max results (1–100)
offsetinteger0Pagination offset

Response 200 OK

{
"total": 18,
"offset": 0,
"limit": 20,
"has_more": false,
"events": [
{
"id": "abc12345-0000-0000-0000-000000000001",
"title": "AI Builders Meetup — May 2026",
"start_time": "2026-05-20T18:00:00Z",
"event_type": "in_person",
"location": "San Francisco"
}
]
}

Example

# Browse in-person upcoming events, soonest first
curl "https://api.ainative.studio/api/v1/community-events/browse?event_type=in_person&sort_by=start_time&sort_order=asc" \
-H "Authorization: Bearer $API_KEY"
resp = requests.get(
"https://api.ainative.studio/api/v1/community-events/browse",
headers={"Authorization": f"Bearer {api_key}"},
params={
"event_type": "in_person",
"sort_by": "start_time",
"sort_order": "asc",
"limit": 20
}
)
events = resp.json()["events"]

iCal export

Export event to iCal

GET /api/v1/community-events/{event_id}/export/ical

Export an event as an iCal (.ics) file, compatible with Google Calendar, Apple Calendar, and Outlook.

Path parameters

ParameterTypeRequiredDescription
event_idstring (UUID)YesEvent ID

Response 200 OK

{
"ical_content": "BEGIN:VCALENDAR\r\nVERSION:2.0\r\n...",
"filename": "AI_Builders_Meetup_May_2026_abc12345.ics"
}
FieldTypeDescription
ical_contentstringiCal-formatted string content
filenamestringSuggested filename derived from the event title and ID

Example

resp = requests.get(
f"https://api.ainative.studio/api/v1/community-events/{event_id}/export/ical",
headers={"Authorization": f"Bearer {api_key}"}
)
data = resp.json()
with open(data["filename"], "w") as f:
f.write(data["ical_content"])

Comments

Comments are stored in ZeroDB and can be attached to any content type (videos, articles, tutorials, etc.).

Post a comment

POST /api/v1/community/comments

Auth required. Post a comment on a content item. Content goes through optional moderation if enabled on your tenant.

Request body

{
"content_type": "video",
"content_id": 123,
"comment": "Great tutorial! Very helpful."
}
FieldTypeRequiredDescription
content_typestringYesType of content: video, article, tutorial, etc.
content_idintegerYesNumeric ID of the content item
commentstringYesComment text (1–5000 characters)

Response 200 OK

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"user_id": "650e8400-e29b-41d4-a716-446655440001",
"user_name": "Alice Chen",
"user_avatar": "https://cdn.ainative.studio/avatars/alice.jpg",
"content_type": "video",
"content_id": 123,
"comment": "Great tutorial! Very helpful.",
"created_at": "2026-04-25T14:45:00Z",
"updated_at": null
}

Errors

CodeReason
400Comment rejected by content moderation

Get comments

GET /api/v1/community/comments/{content_type}/{content_id}

Public endpoint — no auth required. Get comments for a content item, sorted newest first.

Path parameters

ParameterTypeRequiredDescription
content_typestringYesContent type (e.g., video)
content_idintegerYesContent item ID

Query parameters

ParameterTypeDefaultDescription
limitinteger50Max comments to return (1–100)
offsetinteger0Pagination offset

Response 200 OK

{
"comments": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"user_id": "650e8400-e29b-41d4-a716-446655440001",
"user_name": "Alice Chen",
"user_avatar": null,
"content_type": "video",
"content_id": 123,
"comment": "Great tutorial! Very helpful.",
"created_at": "2026-04-25T14:45:00Z",
"updated_at": null
}
],
"total": 7,
"limit": 50,
"offset": 0
}

Delete a comment

DELETE /api/v1/community/comments/{comment_id}

Auth required. Delete a comment. Users can delete their own comments; admins can delete any comment.

Path parameters

ParameterTypeRequiredDescription
comment_idstring (UUID)YesComment UUID

Response 200 OK

{
"success": true,
"message": "Comment 550e8400-e29b-41d4-a716-446655440000 deleted successfully"
}

Errors

CodeReason
403You do not own this comment and are not an admin
404Comment not found