Gym Staff API Documentation

Overview

This collection contains accounts which have access to Staff Site, where they can perform actions such as managing customer accounts and setting up events.

Fields

Name Type Restrictions Required? Description
id integer Automatic Automatic The unique identifier of the user. This is placed in the URL when making API calls for the user.
url string Automatic Automatic The unique API URL of the user.
email string (email address) Must be a valid, unique email address. May not be edited after creation. Yes (on creation) The user's email address. This is used to log in and for notifications.
first_name string None No The user's first name.
last_name string None No The user's last name.
default_gym_id integer Must be the ID of a gym. Yes The unique database ID of the user's default gym, used when checking in customers through the Staff Site, and other location-specific functions.
default_gym_name string Automatic Automatic The name of the user's default gym.
default_gym_url string (URL) Automatic Automatic The unique API URL of the user's default gym.
date_joined string (ISO-8601 datetime) Automatic Automatic When the user was added to the Capitan database.
is_active boolean None Yes Whether the user account is active. Set this false to remove access, rather than deleting the account.
can_manage_events boolean None Yes Whether the user is able to manage events. This includes operations such as cancelling reservations and setting up private events.
can_manage_members boolean None Yes Whether the user is able to manage customer accounts. This includes operations such as updating account information and approving documents.
can_manage_customer_proficiencies boolean None Yes Whether the user is able to add and remove proficiencies from customers.
can_export_customers boolean None Yes Whether the user is able to export customers.
can_access_reports boolean None Yes Whether the user is able to access reporting, such as revenue reports and check-in history.
is_organization_admin boolean None Yes Whether the user is able to administer their organization. This is required to manage staff accounts and edit organization configuration.
pin_mode_required boolean None No (defaults to false) Whether the user is automatically placed in PIN Mode when they log into the Staff Site, regardless of whether the checkbox is selected. This is used to ensure that shared computers are not accidentally logged into without PIN mode.
has_password boolean Automatic Automatic Whether the user has a password, and therefore whether they can log into the Staff Site.
has_pin boolean Automatic Automatic Whether the user has a PIN, and therefore whether they can take edit actions when the Staff Site is in PIN Mode.
password string (write-only) None No A write-only field used to change the user's password.

Filters

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

Name Syntax Description
Default Gym default_gym_id Filters for users with the given default gym. The provided value must be a gym ID.
General Search search Filters for users containing the given search terms. Matches against a number of fields, including email, first name, and last name.

Operations

List

Request
GET /api/users/

Response
200 OK
{
    "count": 17,
    "next": "https://api.hellocapitan.com/api/users/?page=2",
    "previous": null,
    "results": [
        {
            "id": 35,
            "url": "https://api.hellocapitan.com/api/users/35/",
            "email": "joe@example.com",
            "first_name": "Joe",
            ...
        },
        ...
    ]
}

Read

Request
GET /api/users/35/

Response
200 OK
{
    "id": 35,
    "url": "https://api.hellocapitan.com/api/users/35/",
    "email": "joe@example.com",
    "first_name": "Joe",
    ...
}

Create

Request
POST /api/users/
{
    "email": "jane@example.com",
    "first_name": "Jane",
    "last_name": "Doe",
    "default_gym_id": 12,
    "is_active": true,
    "can_manage_members": false,
    "is_organization_admin": false,
    "password": "6UpM2bxX"
}

Response
201 Created
{
    "id": 53,
    "url": "https://api.hellocapitan.com/api/users/53/",
    "email": "jane@example.com",
    "first_name": "Jane",
    ...
}

Replace

Request
PUT /api/users/53/
{
    "first_name": "Josephine",
    "last_name": "Doe",
    "default_gym_id": 12,
    "is_active": true,
    "can_manage_members": false,
    "is_organization_admin": false,
    "password": "m56HSf6x"
}

Response
200 OK
{
    "id": 53,
    "url": "https://api.hellocapitan.com/api/users/53/",
    "email": "jane@example.com",
    "first_name": "Josephine",
    ...
}

Update

Request
PATCH /api/users/53/
{
    "first_name": "Jill"
}

Response
200 OK
{
    "id": 53,
    "url": "https://api.hellocapitan.com/api/users/53/",
    "email": "jane@example.com",
    "first_name": "Jill",
    ...
}