API Documentation

The BJJ RollCall API provides programmatic access to gym information, class schedules, and training data. This RESTful API uses standard HTTP methods and returns JSON responses.

Note All API endpoints require authentication. You must include your API token in the Authorization header of each request.

Authentication

The API uses token-based authentication. Include your API token in the Authorization header with the Token prefix.

Getting Your API Token

  1. Log in to your BJJ RollCall account
  2. Navigate to your profile settings
  3. Find your API token in the "API Access" section
  4. Keep your token secure - treat it like a password

Authentication Example

curl -H "Authorization: Token YOUR_API_TOKEN_HERE" \
     https://bjjrollcall.com/gyms/api/v1/gyms/1/
Security Warning Never share your API token or commit it to version control. Use environment variables to store tokens in your applications.

Quick Start

Here's a quick example to get you started with the API:

1. Get Gym Information

curl -H "Authorization: Token YOUR_TOKEN" \
     https://bjjrollcall.com/gyms/api/v1/gyms/123/

2. View Gym Timetable

curl -H "Authorization: Token YOUR_TOKEN" \
     https://bjjrollcall.com/gyms/api/v1/gyms/123/timetable/

3. Update Your Gym

curl -X PATCH \
     -H "Authorization: Token YOUR_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{"description": "Updated gym description"}' \
     https://bjjrollcall.com/gyms/api/v1/gyms/123/update/

API Endpoints

All API endpoints are prefixed with /gyms/api/v1/. The base URL is:

https://bjjrollcall.com/gyms/api/v1/

View Gyms

GET /gyms/api/v1/gyms/{id}/

Retrieve detailed information about a specific gym including name, location, affiliation, and contact details.

Path Parameters

Parameter Type Description
id integer The unique identifier of the gym

Example Response

{
  "id": 123,
  "name": "Sydney BJJ Academy",
  "affiliation": "Gracie Barra",
  "address": "123 Main St, Sydney NSW 2000",
  "suburb": "Sydney",
  "state": "NSW",
  "country": "Australia",
  "website": "https://sydneybjj.com",
  "email": "info@sydneybjj.com",
  "phone": "+61 2 1234 5678",
  "description": "Premier Brazilian Jiu-Jitsu academy in Sydney",
  "latitude": -33.8688,
  "longitude": 151.2093
}
GET /gyms/api/v1/gyms/{id}/timetable/

Get the complete class schedule for a gym, including all days and class types.

Example Response

[
  {
    "id": 1,
    "weekday": 1,
    "weekday_display": "Monday",
    "start_time": "18:00:00",
    "end_time": "19:30:00",
    "class_type": "Gi",
    "instructor": "John Smith",
    "level": "All Levels",
    "notes": "Fundamentals class"
  }
]

Manage Your Gym

Gym Owner Access These endpoints are only available to gym owners and managers. You must be authenticated and have ownership permissions for the gym.
POST /gyms/api/v1/gyms/submit/

Submit a new gym for listing on BJJ RollCall. The gym will be reviewed before being made publicly visible.

Request Body

Field Type Required Description
name string Yes The gym name
address string Yes Full street address
suburb string Yes City or suburb
state string Yes State or province
country string Yes Country name
website string No Gym website URL
email string No Contact email
phone string No Contact phone number

Example Request

{
  "name": "Sydney BJJ Academy",
  "address": "123 Main St",
  "suburb": "Sydney",
  "state": "NSW",
  "country": "Australia",
  "website": "https://sydneybjj.com",
  "email": "info@sydneybjj.com",
  "phone": "+61 2 1234 5678"
}
PATCH /gyms/api/v1/gyms/{id}/update/

Update information for your gym. Only gym owners can update their gym details.

Example Request

{
  "description": "Updated description for our academy",
  "phone": "+61 2 9999 8888",
  "website": "https://newwebsite.com"
}

Timetable Management

Manage your gym's class schedule through the API. All times should be provided in your local timezone.

Timezone Handling When submitting timetable entries, use your local time. For example, if you're in Sydney (UTC+11) and your class starts at 6:00 PM local time, submit "18:00:00".
GET /gyms/api/v1/gyms/{gym_pk}/timetable/manage/

List all timetable entries for your gym.

POST /gyms/api/v1/gyms/{gym_pk}/timetable/manage/

Add a new class to your gym's timetable.

Request Body

Field Type Required Description
weekday integer Yes Day of week (0=Monday, 6=Sunday)
start_time string Yes Start time in HH:MM:SS format
end_time string Yes End time in HH:MM:SS format
class_type string Yes Type of class (e.g., "Gi", "No-Gi")
instructor string No Instructor name
level string No Class level (e.g., "Beginners", "All Levels")

Example Request

{
  "weekday": 0,
  "start_time": "18:00:00",
  "end_time": "19:30:00",
  "class_type": "Gi",
  "instructor": "John Smith",
  "level": "All Levels",
  "notes": "Fundamentals class"
}
PATCH /gyms/api/v1/gyms/{gym_pk}/timetable/{entry_pk}/

Update an existing timetable entry.

Path Parameters

Parameter Type Description
gym_pk integer The gym ID
entry_pk integer The timetable entry ID
DELETE /gyms/api/v1/gyms/{gym_pk}/timetable/{entry_pk}/

Remove a class from your gym's timetable.

Response

Returns 204 No Content on successful deletion.

Training Notes

Record and manage your personal training notes. These are private to your account.

GET /gyms/api/notes/

Retrieve all your training notes.

POST /gyms/api/notes/create/

Create a new training note.

Example Request

{
  "gym": 123,
  "date": "2026-02-08",
  "notes": "Worked on triangle chokes from closed guard",
  "techniques": ["Triangle Choke", "Closed Guard"],
  "sparring_rounds": 5
}

Error Handling

The API uses standard HTTP status codes to indicate success or failure:

Status Code Meaning Description
200 OK Request succeeded
201 Created Resource successfully created
204 No Content Request succeeded with no response body
400 Bad Request Invalid request data
401 Unauthorized Missing or invalid authentication token
403 Forbidden Authenticated but not authorized for this action
404 Not Found Resource doesn't exist
429 Too Many Requests Rate limit exceeded
500 Internal Server Error Server error - please contact support

Error Response Format

{
  "error": "Unauthorized",
  "detail": "Authentication credentials were not provided."
}

Rate Limiting

To ensure fair usage and system stability, the API implements rate limiting:

When you exceed the rate limit, you'll receive a 429 Too Many Requests response. The response headers include:

Best Practices

1. Use Environment Variables

Never hardcode API tokens in your source code. Use environment variables:

import os

API_TOKEN = os.getenv('BJJ_ROLLCALL_API_TOKEN')
headers = {'Authorization': f'Token {API_TOKEN}'}

2. Handle Errors Gracefully

Always check response status codes and handle errors appropriately:

response = requests.get(url, headers=headers)
if response.status_code == 200:
    data = response.json()
elif response.status_code == 404:
    print("Gym not found")
else:
    print(f"Error: {response.status_code}")

3. Respect Rate Limits

Implement exponential backoff when rate limited and cache responses when appropriate.

4. Use HTTPS

Always use HTTPS URLs to ensure your API token is transmitted securely.

5. Keep Tokens Secure

Treat API tokens like passwords. Rotate them regularly and revoke compromised tokens immediately.

Support & Resources

Need help with the API? We're here to assist:

Stay Updated API changes and new features are announced via email to API users. Make sure your contact information is up to date.

Last updated: February 2026 | API Version 1.0