Skip to content

API Access

The Club Schedule API allows external systems to manage club members programmatically, enabling integration with membership management systems, payment processors, or other third-party applications.

Requirements:

  • Active Club Schedule subscription
  • Admin access to your club

Available Operations

  • Create member invitations
  • Deactivate members
  • Update membership expiration dates

Getting Started

Step 1: Generate Your API Key

  1. Log in as a club admin
  2. Navigate to Settings > API Settings
  3. Click Generate API Key
  4. Copy your API key immediately --- it will only be displayed once

Your API key will look like this: tcs_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6

Security reminders:

  • Store your API key in a secure location (environment variable, secrets manager)
  • Never commit API keys to version control
  • Never share your API key publicly

Step 2: Managing Your API Key

From the API Settings page, you can:

  • Disable Key --- temporarily stop all API access without deleting the key
  • Enable Key --- re-enable a disabled key
  • Regenerate Key --- create a new key (invalidates the old key immediately)

Authentication

All API requests must include your API key in the Authorization header using Bearer token format:

Authorization: Bearer tcs_your_api_key_here

Example Request

curl -X POST https://app.theclubschedule.com/api/v1/members/add/ \
  -H "Authorization: Bearer tcs_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"email": "john@example.com", "first_name": "John", "last_name": "Doe", "joined_date": "2024-01-15"}'

API Endpoints

Base URL: https://app.theclubschedule.com/api/v1

Create Member Invitation

Creates an invitation for a new member. The invited person receives an email with a link to accept the invitation and set up their account.

Endpoint: POST /api/v1/members/add/

Field Type Required Description
email string Yes Email address of the person to invite
first_name string Yes First name (max 100 characters)
last_name string Yes Last name (max 100 characters)
joined_date string Yes Date the member joined (format: YYYY-MM-DD)
member_through string No Membership expiration date (YYYY-MM-DD) or null for lifetime

Example request:

{
  "email": "john@example.com",
  "first_name": "John",
  "last_name": "Doe",
  "joined_date": "2024-11-15",
  "member_through": "2025-03-31"
}

Success response (201 Created):

{
  "id": 42,
  "email": "john@example.com",
  "first_name": "John",
  "last_name": "Doe",
  "joined_date": "2024-11-15",
  "member_through": "2025-03-31",
  "status": "pending",
  "invited_at": "2024-12-13T14:30:00Z",
  "expires_at": "2025-01-12T14:30:00Z",
  "email_sent": true
}

Note: If email sending fails, the invitation is still created. The response will include "email_sent": false with an email_error field.

Deactivate Member

Deactivates an existing member (soft delete). The member's data is preserved but they will no longer have access to the club.

Endpoint: POST /api/v1/members/deactivate/

Field Type Required Description
email string Yes Email address of the member to deactivate

Example request:

{
  "email": "john@example.com"
}

Success response (200 OK):

{
  "id": 15,
  "email": "john@example.com",
  "first_name": "John",
  "last_name": "Doe",
  "joined_date": "2024-01-15",
  "member_through": "2025-01-15",
  "is_active": false,
  "created_at": "2024-01-15T10:00:00Z",
  "updated_at": "2024-12-13T14:35:00Z"
}

Update Membership Expiration

Updates the membership expiration date for an existing member.

Endpoint: POST /api/v1/members/update-through/

Field Type Required Description
email string Yes Email address of the member
member_through string Yes New expiration date (YYYY-MM-DD) or null for lifetime membership

Set an expiration date:

{
  "email": "john@example.com",
  "member_through": "2025-12-31"
}

Set lifetime membership:

{
  "email": "john@example.com",
  "member_through": null
}

Success response (200 OK):

{
  "id": 15,
  "email": "john@example.com",
  "first_name": "John",
  "last_name": "Doe",
  "joined_date": "2024-01-15",
  "member_through": "2025-12-31",
  "is_active": true,
  "created_at": "2024-01-15T10:00:00Z",
  "updated_at": "2024-12-13T14:40:00Z"
}

Error Responses

All errors follow this format:

{
  "error": "Human-readable error message",
  "code": "machine_readable_code"
}

For validation errors, additional details are provided:

{
  "error": "Validation failed",
  "code": "validation_error",
  "details": {
    "email": ["Enter a valid email address."],
    "joined_date": ["Date has wrong format. Use YYYY-MM-DD."]
  }
}

Error Codes Reference

HTTP Status Code Description
400 validation_error Invalid request data --- check the details field
401 authentication_failed Missing, invalid, or disabled API key
403 permission_denied API access not available (e.g., subscription inactive)
404 not_found Member not found in your club
409 member_exists An active member with this email already exists
409 inactive_member_exists An inactive member exists --- use the web interface to resend their invitation
409 invitation_pending A pending invitation already exists for this email
409 already_inactive The member is already inactive
429 throttled Rate limit exceeded --- wait before retrying
500 internal_error Server error --- contact support if this persists

Rate Limiting

API requests are limited to 100 requests per hour per API key.

When you exceed the rate limit, you'll receive a 429 Too Many Requests response. Best practices:

  • Batch operations where possible
  • Implement exponential backoff for retries
  • Monitor the Retry-After header when rate limited

Security Best Practices

  1. Keep your API key secret --- treat it like a password
  2. Use environment variables --- never hardcode keys in your application
  3. Rotate keys periodically --- regenerate your key if you suspect compromise
  4. Monitor API activity --- check the Recent API Activity section in API Settings
  5. Use HTTPS only --- all API requests must use HTTPS

Common Integration Scenarios

Syncing with a Payment Processor

When a new member pays through your payment system:

  1. Call POST /api/v1/members/add/ with member details and set member_through to match their subscription end date
  2. The member receives an invitation email to join The Club Schedule

When membership is renewed:

  1. Call POST /api/v1/members/update-through/ with the new expiration date

When membership is cancelled:

  1. Call POST /api/v1/members/deactivate/ to remove their access

Example: Python Integration

import requests

API_KEY = "tcs_your_api_key_here"
BASE_URL = "https://app.theclubschedule.com/api/v1"

headers = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json"
}

# Add a new member
response = requests.post(
    f"{BASE_URL}/members/add/",
    headers=headers,
    json={
        "email": "newmember@example.com",
        "first_name": "Jane",
        "last_name": "Smith",
        "joined_date": "2024-12-13",
        "member_through": "2025-12-13"
    }
)

if response.status_code == 201:
    print("Invitation sent!")
    print(response.json())
elif response.status_code == 409:
    print("Member or invitation already exists")
else:
    print(f"Error: {response.json()}")

Need Help?

If you encounter issues with the API:

  1. Check the Recent API Activity in your API Settings for error details
  2. Verify your API key is active and not disabled
  3. Ensure your subscription is active
  4. Contact support at support@theclubschedule.com