HTTP Methods

Understand how to interact with the EliteCircle API using standard HTTP verbs. Each method follows RESTful conventions and maps directly to membership, course, and subscription operations.

Overview

The EliteCircle API uses standard HTTP methods to indicate the desired action against a resource. All endpoints expect and return JSON payloads unless otherwise specified. Authentication is required for all methods except `GET /api/v1/public/courses`.

🔑 Note: All requests must include the Authorization: Bearer <token> header. Tokens can be generated via your developer dashboard.
Method Purpose Idempotent? Safe?
GETRetrieve resource(s)YesYes
POSTCreate new resourceNoNo
PUTReplace entire resourceYesNo
PATCHUpdate partial resourceNoNo
DELETERemove resourceYesNo

GET Read Resources

Use GET to retrieve data without modifying it. Parameters are passed via query strings.

GET /api/v1/members/{id}
cURL
curl -X GET "https://api.elitecircle.com/v1/members/1024" \\ -H "Authorization: Bearer $TOKEN"

Returns 200 OK with the member object. Use pagination parameters ?page=&limit= for list endpoints.

POST Create Resources

Use POST to submit new data. The payload is sent in the request body as JSON.

POST /api/v1/subscriptions
JavaScript (Fetch)
const response = await fetch('https://api.elitecircle.com/v1/subscriptions', { method: 'POST', headers: { 'Authorization': `Bearer ${process.env.API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ member_id: '1024', plan: 'professional', billing_cycle: 'monthly' }) });

Returns 201 Created with the new subscription object and webhook confirmation.

PUT Update Full Resources

Use PUT to completely replace an existing resource. Missing fields will be reset to defaults unless marked as immutable.

PUT /api/v1/members/{id}
⚠️ Warning: Sending an incomplete payload to a PUT endpoint may overwrite existing data. Use PATCH for partial updates.
Python (Requests)
import requests payload = { "email": "new@email.com", "plan": "enterprise", "metadata": { "role": "admin", "department": "engineering" } } requests.put( "https://api.elitecircle.com/v1/members/1024", headers={"Authorization": f"Bearer ${TOKEN}"}, json=payload )

PATCH Partial Updates

Use PATCH to modify specific fields without affecting others. Ideal for toggling features or updating single attributes.

PATCH /api/v1/members/{id}/preferences
JSON Payload
{ "notifications_email": false, "dashboard_theme": "dark" }

Returns 200 OK with the updated preferences object. Other fields remain unchanged.

DELETE Remove Resources

Use DELETE to permanently remove a resource. This action is irreversible and triggers account deprovisioning workflows.

DELETE /api/v1/subscriptions/{id}
🛡️ Safety: Deleted resources enter a 30-day soft-delete window. Use ?hard=true to bypass (requires elevated scopes).
cURL
curl -X DELETE "https://api.elitecircle.com/v1/subscriptions/sub_8f3k2" \\ -H "Authorization: Bearer $TOKEN"

Returns 204 No Content on success. Active subscriptions will trigger prorated refunds automatically.

Best Practices

  • Always use idempotency_keys for POST requests to prevent duplicate charges or enrollments on network retries.
  • Prefer PATCH over PUT when updating user profiles to avoid accidental data loss.
  • Respect rate limits: 100 req/min for GET, 30 req/min for write operations. Monitor X-RateLimit-Remaining headers.
  • Use webhooks for async events (e.g., subscription.renewed, course.completed) instead of polling.

Error Handling

EliteCircle uses conventional HTTP status codes. Errors return a JSON body with error, message, and details fields.

Error Response
{ "error": { "code": "invalid_api_key", "message": "The provided API key is expired or revoked.", "status": 401, "request_id": "req_9x2m4p1" } }

Implement exponential backoff for 429 Too Many Requests and circuit breakers for 5xx server errors.