Gyms API Documentation

Overview

This collection represents climbing gyms.

Fields

Name Type Restrictions Required? Description
id integer Automatic Automatic The unique identifier of the gym. This is placed in the URL when making API calls for the gym.
url string Automatic Automatic The unique API URL of the gym.
name string Must not be blank. Yes The gym's name.
hide_setter boolean None No Whether to hide setter names in the Climber App. If this is set to true, setters may still be recorded, but they will not be visible to climbers using the app. Defaults to false.
time_zone string Must be a time zone name in the tz database. Note that some uncommon time zones may not be supported. Yes The time zone of the gym.
scheduler_url_path string Must consist only of alphanumeric characters and hyphens. No The URL segment used to identify this gym in the Capitan scheduler. If this is empty than the scheduler is unavailable for this gym.
scheduler_landing_page_text string (markdown) None No The text displayed on this gym's landing page in the Capitan scheduler. This is formatted using Markdown.
scheduler_first_day_of_week string Must be one of: SUN (Sunday) or MON (Monday) No (defaults to SUN) The first day of the week in the Capitan scheduler's calendar.
created_at string (ISO-8601 datetime) Automatic Automatic When the gym was added to the Capitan database.
updated_at string (ISO-8601 datetime) Automatic Automatic When the gym's record in the Capitan database was last updated.
climbs_url string (URL) Automatic Automatic The API URL of the gym's climbs.
grades_url string (URL) Automatic Automatic The API URL of the gym's grades.
sections_url string (URL) Automatic Automatic The API URL of the gym's sections.

Operations

List

Request
GET /api/gyms/

Response
200 OK
{
    "count": 12,
    "next": "https://api.hellocapitan.com/api/gyms/?page=2",
    "previous": null,
    "results": [
        {
            "id": 35,
            "url": "https://api.hellocapitan.com/api/gyms/35/",
            "name": "The Climbing Gym East",
            ...
        },
        ...
    ]
}

Read

Request
GET /api/gyms/35/

Response
200 OK
{
    "id": 35,
    "url": "https://api.hellocapitan.com/api/gyms/35/",
    "name": "The Climbing Gym East",
    "hide_setter": false,
    ...
}

Create

Request
POST /api/gyms/
{
    "name": "The Climbing Gym West",
    "hide_setter": true
}

Response
201 Created
{
    "id": 53,
    "url": "https://api.hellocapitan.com/api/gyms/53/",
    "name": "The Climbing Gym West",
    "hide_setter": true,
    ...
}

Replace

Request
PUT /api/gyms/53/
{
    "name": "The Climbing Gym North West",
    "hide_setter": false
}

Response
200 OK
{
    "id": 53,
    "url": "https://api.hellocapitan.com/api/gyms/53/",
    "name": "The Climbing Gym North West",
    "hide_setter": false,
    ...
}

Update

Request
PATCH /api/gyms/53/
{
    "name": "The Climbing Gym South West"
}

Response
200 OK
{
    "id": 53,
    "url": "https://api.hellocapitan.com/api/gyms/53/",
    "name": "The Climbing Gym South West",
    "hide_setter": false,
    ...
}