Secret API key bound to an environment.
In: header
Query Parameters
1 <= value <= 10050Value in
- "draft"
- "active"
- "paused"
- "archived"
Header Parameters
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/leagues"{ "data": [ { "id": "string", "key": "string", "name": "string", "status": "draft", "config": { "schema": "league/v1", "tiers": [ { "key": "string", "name": "string", "promote_count": 0, "demote_count": 0, "rewards": [], "promotion_reward": { "currency": "string", "amount": 1 } } ], "cohort_size": 5, "period": { "kind": "week", "start_weekday": 1, "start_minute": 0, "timezone": "environment" }, "score": { "source": "direct" }, "matching": "none", "settle_delay_minutes": 10, "min_score_to_promote": 1 }, "revision": -9007199254740991, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" } ], "next_cursor": "string", "has_more": true}Secret API key bound to an environment.
In: header
Header Parameters
Required. Official clients generate a UUID when omitted by the caller.
1 <= length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/leagues" \ -H "Idempotency-Key: string" \ -H "Content-Type: application/json" \ -d '{ "key": "weekly", "name": "Weekly league", "config": { "schema": "league/v1", "tiers": [ { "key": "bronze", "name": "Bronze", "promote_count": 10, "demote_count": 0, "rewards": [ { "rank_from": 1, "rank_to": 3, "reward": [ { "currency": "gems", "amount": 50 }, { "type": "item", "item": "xp_boost_15m", "quantity": 1 } ] } ] }, { "key": "silver", "name": "Silver", "promote_count": 7, "demote_count": 5, "rewards": [ { "rank_from": 1, "rank_to": 3, "currency": "gems", "amount": 100 } ], "promotion_reward": { "currency": "gems", "amount": 20 } }, { "key": "gold", "name": "Gold", "promote_count": 0, "demote_count": 5, "rewards": [] } ], "cohort_size": 30, "period": { "kind": "week", "start_weekday": 1, "start_minute": 0, "timezone": "environment" }, "score": { "source": "direct" }, "matching": "none", "settle_delay_minutes": 10, "min_score_to_promote": 1 } }'{ "id": "string", "key": "string", "name": "string", "status": "draft", "config": { "schema": "league/v1", "tiers": [ { "key": "string", "name": "string", "promote_count": 0, "demote_count": 0, "rewards": [], "promotion_reward": { "currency": "string", "amount": 1 } } ], "cohort_size": 5, "period": { "kind": "week", "start_weekday": 1, "start_minute": 0, "timezone": "environment" }, "score": { "source": "direct" }, "matching": "none", "settle_delay_minutes": 10, "min_score_to_promote": 1 }, "revision": -9007199254740991, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}Secret API key bound to an environment.
In: header
Path Parameters
1 <= lengthHeader Parameters
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/leagues/string"{ "id": "string", "key": "string", "name": "string", "status": "draft", "config": { "schema": "league/v1", "tiers": [ { "key": "string", "name": "string", "promote_count": 0, "demote_count": 0, "rewards": [], "promotion_reward": { "currency": "string", "amount": 1 } } ], "cohort_size": 5, "period": { "kind": "week", "start_weekday": 1, "start_minute": 0, "timezone": "environment" }, "score": { "source": "direct" }, "matching": "none", "settle_delay_minutes": 10, "min_score_to_promote": 1 }, "revision": -9007199254740991, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}Secret API key bound to an environment.
In: header
Path Parameters
1 <= lengthHeader Parameters
Required. Official clients generate a UUID when omitted by the caller.
1 <= length <= 255Required revision, checked in the owning transaction.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PATCH "https://example.com/leagues/string" \ -H "Idempotency-Key: string" \ -H "If-Match: string" \ -H "Content-Type: application/json" \ -d '{ "name": "Weekly league" }'{ "id": "string", "key": "string", "name": "string", "status": "draft", "config": { "schema": "league/v1", "tiers": [ { "key": "string", "name": "string", "promote_count": 0, "demote_count": 0, "rewards": [], "promotion_reward": { "currency": "string", "amount": 1 } } ], "cohort_size": 5, "period": { "kind": "week", "start_weekday": 1, "start_minute": 0, "timezone": "environment" }, "score": { "source": "direct" }, "matching": "none", "settle_delay_minutes": 10, "min_score_to_promote": 1 }, "revision": -9007199254740991, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}Secret API key bound to an environment.
In: header
Path Parameters
1 <= lengthHeader Parameters
Required. Official clients generate a UUID when omitted by the caller.
1 <= length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/leagues/string/activate" \ -H "Idempotency-Key: string" \ -H "Content-Type: application/json" \ -d '{ "expected_revision": 2 }'{ "id": "string", "key": "string", "name": "string", "status": "draft", "config": { "schema": "league/v1", "tiers": [ { "key": "string", "name": "string", "promote_count": 0, "demote_count": 0, "rewards": [], "promotion_reward": { "currency": "string", "amount": 1 } } ], "cohort_size": 5, "period": { "kind": "week", "start_weekday": 1, "start_minute": 0, "timezone": "environment" }, "score": { "source": "direct" }, "matching": "none", "settle_delay_minutes": 10, "min_score_to_promote": 1 }, "revision": -9007199254740991, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}Secret API key bound to an environment.
In: header
Path Parameters
1 <= lengthHeader Parameters
Required. Official clients generate a UUID when omitted by the caller.
1 <= length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/leagues/string/pause" \ -H "Idempotency-Key: string" \ -H "Content-Type: application/json" \ -d '{ "expected_revision": 2 }'{ "id": "string", "key": "string", "name": "string", "status": "draft", "config": { "schema": "league/v1", "tiers": [ { "key": "string", "name": "string", "promote_count": 0, "demote_count": 0, "rewards": [], "promotion_reward": { "currency": "string", "amount": 1 } } ], "cohort_size": 5, "period": { "kind": "week", "start_weekday": 1, "start_minute": 0, "timezone": "environment" }, "score": { "source": "direct" }, "matching": "none", "settle_delay_minutes": 10, "min_score_to_promote": 1 }, "revision": -9007199254740991, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}Secret API key bound to an environment.
In: header
Path Parameters
1 <= lengthHeader Parameters
Required. Official clients generate a UUID when omitted by the caller.
1 <= length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/leagues/string/resume" \ -H "Idempotency-Key: string" \ -H "Content-Type: application/json" \ -d '{ "expected_revision": 2 }'{ "id": "string", "key": "string", "name": "string", "status": "draft", "config": { "schema": "league/v1", "tiers": [ { "key": "string", "name": "string", "promote_count": 0, "demote_count": 0, "rewards": [], "promotion_reward": { "currency": "string", "amount": 1 } } ], "cohort_size": 5, "period": { "kind": "week", "start_weekday": 1, "start_minute": 0, "timezone": "environment" }, "score": { "source": "direct" }, "matching": "none", "settle_delay_minutes": 10, "min_score_to_promote": 1 }, "revision": -9007199254740991, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}Secret API key bound to an environment.
In: header
Path Parameters
1 <= lengthHeader Parameters
Required. Official clients generate a UUID when omitted by the caller.
1 <= length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/leagues/string/archive" \ -H "Idempotency-Key: string" \ -H "Content-Type: application/json" \ -d '{ "expected_revision": 2 }'{ "id": "string", "key": "string", "name": "string", "status": "draft", "config": { "schema": "league/v1", "tiers": [ { "key": "string", "name": "string", "promote_count": 0, "demote_count": 0, "rewards": [], "promotion_reward": { "currency": "string", "amount": 1 } } ], "cohort_size": 5, "period": { "kind": "week", "start_weekday": 1, "start_minute": 0, "timezone": "environment" }, "score": { "source": "direct" }, "matching": "none", "settle_delay_minutes": 10, "min_score_to_promote": 1 }, "revision": -9007199254740991, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}Secret API key bound to an environment.
In: header
Path Parameters
1 <= lengthHeader Parameters
Required. Official clients generate a UUID when omitted by the caller.
1 <= length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/leagues/string/contributions" \ -H "Idempotency-Key: string" \ -H "Content-Type: application/json" \ -d '{ "customer_id": "cust_0192f0c0a0b07c3d8e9f0a1b2c3d4e5f", "amount": 25 }'{ "entry": { "period_id": "string", "league_id": "string", "customer_id": "string", "cohort_id": "string", "tier_index": -9007199254740991, "score": -9007199254740991, "score_updated_at": "2019-08-24T14:15:22Z", "final_rank": -9007199254740991, "outcome": "promoted", "next_tier_index": -9007199254740991, "reward": [ { "kind": "rank", "currency": "string", "amount": -9007199254740991 } ], "reward_status": "none", "reward_granted_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z" }, "replayed": true}Secret API key bound to an environment.
In: header
Path Parameters
1 <= lengthQuery Parameters
1 <= value <= 10050Header Parameters
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/leagues/string/periods"{ "data": [ { "id": "string", "league_id": "string", "key": "string", "starts_at": "2019-08-24T14:15:22Z", "ends_at": "2019-08-24T14:15:22Z", "status": "open", "league_revision": -9007199254740991, "settled_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "config": { "schema": "league/v1", "tiers": [ { "key": "string", "name": "string", "promote_count": 0, "demote_count": 0, "rewards": [], "promotion_reward": { "currency": "string", "amount": 1 } } ], "cohort_size": 5, "period": { "kind": "week", "start_weekday": 1, "start_minute": 0, "timezone": "environment" }, "score": { "source": "direct" }, "matching": "none", "settle_delay_minutes": 10, "min_score_to_promote": 1 } } ], "next_cursor": "string", "has_more": true}Secret API key bound to an environment.
In: header
Path Parameters
1 <= lengthQuery Parameters
1 <= value <= 10050Header Parameters
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/league_periods/string/cohorts"{ "data": [ { "id": "string", "league_id": "string", "period_id": "string", "tier_index": -9007199254740991, "bucket": "string", "seq": -9007199254740991, "member_count": -9007199254740991, "created_at": "2019-08-24T14:15:22Z" } ], "next_cursor": "string", "has_more": true}Secret API key bound to an environment.
In: header
Path Parameters
1 <= lengthHeader Parameters
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/league_cohorts/string/standings"{ "league": { "id": "string", "key": "string", "name": "string" }, "period": { "id": "string", "league_id": "string", "key": "string", "starts_at": "2019-08-24T14:15:22Z", "ends_at": "2019-08-24T14:15:22Z", "status": "open", "league_revision": -9007199254740991, "settled_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z" }, "cohort": { "id": "string", "league_id": "string", "period_id": "string", "tier_index": -9007199254740991, "bucket": "string", "seq": -9007199254740991, "member_count": -9007199254740991, "created_at": "2019-08-24T14:15:22Z" }, "tier": { "index": -9007199254740991, "key": "string", "name": "string" }, "rows": [ { "rank": -9007199254740991, "score": -9007199254740991, "display_name": "string", "avatar_url": "string", "is_self": true, "zone": "promotion", "outcome": "promoted", "customer_id": "string" } ]}Secret API key bound to an environment.
In: header
Path Parameters
1 <= lengthQuery Parameters
1 <= value <= 10050Header Parameters
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/leagues/string/members"{ "data": [ { "league_id": "string", "customer_id": "string", "tier_index": -9007199254740991, "status": "active", "last_period_id": "string", "joined_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" } ], "next_cursor": "string", "has_more": true}Secret API key bound to an environment.
In: header
Path Parameters
1 <= lengthHeader Parameters
Required. Official clients generate a UUID when omitted by the caller.
1 <= length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/leagues/string/members" \ -H "Idempotency-Key: string" \ -H "Content-Type: application/json" \ -d '{ "customer_id": "cust_0192f0c0a0b07c3d8e9f0a1b2c3d4e5f", "status": "left" }'{ "league_id": "string", "customer_id": "string", "tier_index": -9007199254740991, "status": "active", "last_period_id": "string", "joined_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}Secret API key bound to an environment.
In: header
Path Parameters
The customer's id (cust_) or your external id for them
1 <= length <= 255Header Parameters
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/customers/string/leagues"{ "data": [ { "league": { "id": "string", "key": "string", "name": "string" }, "tier": { "index": -9007199254740991, "key": "string", "name": "string" }, "member_status": "active", "period": { "id": "string", "key": "string", "starts_at": "2019-08-24T14:15:22Z", "ends_at": "2019-08-24T14:15:22Z" }, "seconds_left": -9007199254740991, "paused": true, "entry": { "cohort_id": "string", "tier": { "index": -9007199254740991, "key": "string", "name": "string" }, "score": -9007199254740991, "rank": -9007199254740991, "zone": "promotion" }, "last_result": { "period_id": "string", "period_key": "string", "rank": -9007199254740991, "outcome": "promoted", "tier": { "index": -9007199254740991, "key": "string", "name": "string" }, "next_tier": { "index": -9007199254740991, "key": "string", "name": "string" }, "reward": [ { "kind": "rank", "currency": "string", "amount": -9007199254740991 } ], "reward_status": "none" } } ]}