Event Types API Documentation

Overview

This collection represents types of events occurring at a gym, such as climbing sessions and classes.

Subcollectons

  • Questions
  • Schedules

Fields

Name Type Restrictions Required? Description
id integer Automatic Automatic The unique identifier of the Event Type. This is placed in the URL when making API calls for the Event Type.
url string Automatic Automatic The unique API URL of the Event Type.
name string Must not be blank. Yes The Event Type's name.
gym_id integer Must be the ID of a gym. Event types may not be moved between gyms once created. Yes The unique ID of the gym containing this Event Type.
gym_name string Automatic Automatic The name of the gym containing this Event Type.
gym_url string (URL) Automatic Automatic The unique API URL of the gym containing this Event Type.
status string Must be one of the supported statuses. Yes The Event Type's publishing status, which determines its availability within the Scheduling Web App. For more information, see the status section.
capacity integer Must be between 1 and 1000, if provided. No The "facility" capacity: The maximum number of (non-cancelled) reservations allowed at any time across events of this type. This differs from the capacity field in the Schedules subcollection because events may overlap, in which case their combined reservations must not exceed their Event Type's capacity.
late_booking_window_minutes integer Must be less than 60. No How many minutes after an event's start the event may be reserved. This allows users to make bookings after the event has begun, or if set to a negative value, prevents them from booking too close to the start of the event. Defaults to 15 if not provided.
is_listed boolean None No Whether this Event Type is listed in the gym's Scheduling Web App homepage. Defaults to True if not provided.
created_at string (ISO-8601 datetime) Automatic Automatic When the Event Type was added to the Capitan database.
updated_at string (ISO-8601 datetime) Automatic Automatic When the Event Type's record in the Capitan database was last updated.
questions_url string (URL) Automatic Automatic The API URL of this Event Type's Questions subcollection.
schedules_url string (URL) Automatic Automatic The API URL of this Event Type's Schedules subcollection.
capitan_scheduler_url string (URL) Automatic Automatic The URL of this Event Type within the Scheduling Web App.

Statuses

Name Syntax Description
Draft DRA An unpublished draft Event Type. In the Scheduling Web App, the Event Type is only visible to gym staff.
Active ACT An active Event Type. The Event Type is available to all users.
Retired RET An retired Event Type. The Event Type is not available in the Scheduling Web App, except for the purpose of displaying past reservations.

Filters

See the filtering documentation for more information on how to use filters in the Capitan API.

Name Syntax Description
Gym ID gym_id Filters for Event Types at the given gym. The provided value must be a gym ID.
Status status Filters for Event Types with the given status.

Operations

List

Request
GET /api/event-types/

Response
200 OK
{
    "count": 11,
    "next": "https://api.hellocapitan.com/api/event-types/?page=2",
    "previous": null,
    "results": [
        {
            "id": 42,
            "url": "https://api.hellocapitan.com/api/event-types/42/",
            "name": "Belay Class",
            ...
        },
        ...
    ]
}

Read

Request
GET /api/event-types/42/

Response
200 OK
{
    "id": 42,
    "url": "https://api.hellocapitan.com/api/event-types/35/",
    "name": "Belay Class",
    ...
}

Create

Request
POST /api/event-types/
{
    "name": "Bouldering Technique Session",
    "gym_id": 7,
    "status": "DRA"
}

Response
201 Created
{
    "id": 53,
    "url": "https://api.hellocapitan.com/api/event-types/53/",
    "name": "Bouldering Technique Session",
    ...
}

Replace

Request
PUT /api/event-types/53/
{
    "name": "Bouldering Technique Class",
    "gym_id": 7,
    "status": "DRA"
}

Response
200 OK
{
    "id": 53,
    "url": "https://api.hellocapitan.com/api/event-types/53/",
    "name": "Bouldering Technique Class",
    ...
}

Update

Request
PATCH /api/event-types/53/
{
    "name": "Bouldering Technique Master Class",
}

Response
200 OK
{
    "id": 53,
    "url": "https://api.hellocapitan.com/api/event-types/53/",
    "name": "Bouldering Technique Master Class",
    ...
}