Secret API key bound to an environment.
In: header
Query Parameters
1 <= value <= 20050length <= 2048Value in
- "draft"
- "active"
- "paused"
- "ended"
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/challenges"{ "data": [ { "id": "string", "name": "string", "qualifying": { "event": "string", "conditions": null }, "target": 0, "period": "none", "contribution_key": "string", "enrollment": "automatic", "repeatable": true, "completion_actions": [ null ], "campaign_id": "string", "starts_at": "2019-08-24T14:15:22Z", "ends_at": "2019-08-24T14:15:22Z", "status": "draft", "version": 0, "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/challenges" \ -H "Idempotency-Key: string" \ -H "Content-Type: application/json" \ -d '{ "name": "Three purchases", "qualifying": { "event": "purchase" }, "target": 3 }'{ "id": "string", "name": "string", "qualifying": { "event": "string", "conditions": null }, "target": 0, "period": "none", "contribution_key": "string", "enrollment": "automatic", "repeatable": true, "completion_actions": [ null ], "campaign_id": "string", "starts_at": "2019-08-24T14:15:22Z", "ends_at": "2019-08-24T14:15:22Z", "status": "draft", "version": 0, "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/challenges/string"{ "id": "string", "name": "string", "qualifying": { "event": "string", "conditions": null }, "target": 0, "period": "none", "contribution_key": "string", "enrollment": "automatic", "repeatable": true, "completion_actions": [ null ], "campaign_id": "string", "starts_at": "2019-08-24T14:15:22Z", "ends_at": "2019-08-24T14:15:22Z", "status": "draft", "version": 0, "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
Optional legacy revision. Missing or malformed values follow the existing route parser.
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/challenges/string" \ -H "Content-Type: application/json" \ -d '{ "target": 4 }'{ "id": "string", "name": "string", "qualifying": { "event": "string", "conditions": null }, "target": 0, "period": "none", "contribution_key": "string", "enrollment": "automatic", "repeatable": true, "completion_actions": [ null ], "campaign_id": "string", "starts_at": "2019-08-24T14:15:22Z", "ends_at": "2019-08-24T14:15:22Z", "status": "draft", "version": 0, "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
curl -X DELETE "https://example.com/challenges/string"Secret API key bound to an environment.
In: header
Path Parameters
1 <= lengthQuery Parameters
1 <= value <= 20050length <= 2048Header 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/challenges/string/enrollments"{ "data": [ { "challenge_id": "string", "customer_id": "string", "enrolled_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
Optional. When sent, the stored response is replayed for 24 h.
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
application/json
application/json
curl -X POST "https://example.com/challenges/string/enrollments" \ -H "Content-Type: application/json" \ -d '{ "customer_id": "cust_00000000000000000000000000000042" }'{ "challenge_id": "string", "customer_id": "string", "enrolled_at": "2019-08-24T14:15:22Z"}Secret API key bound to an environment.
In: header
Path Parameters
1 <= length1 <= lengthHeader Parameters
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X DELETE "https://example.com/challenges/string/enrollments/string"Secret API key bound to an environment.
In: header
Path Parameters
1 <= lengthQuery Parameters
1 <= value <= 20050length <= 2048Header 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/challenges/string/progress"{ "data": [ { "challenge_id": "string", "customer_id": "string", "period_key": "string", "count": 0, "target": 0, "status": "active", "contributions": [ "string" ], "completed_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
Optional. When sent, the stored response is replayed for 24 h.
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/challenges/string/progress/revoke" \ -H "Content-Type: application/json" \ -d '{ "customer_id": "cust_00000000000000000000000000000042", "contribution": "order_42" }'{ "challenge_id": "string", "customer_id": "string", "period_key": "string", "count": 0, "status": "active", "contributions": [ "string" ], "completed_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
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 POST "https://example.com/challenges/string/reevaluate" \ -H "Content-Type: application/json" \ -d '{ "customer_id": "cust_00000000000000000000000000000042" }'{ "completed": 0, "conflicts": 0, "effects": [ null ]}