Authorization
bearer Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).
In: header
Query Parameters
Value in
- "draft"
- "active"
- "paused"
- "ended"
Response Body
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": "string", "ends_at": "string", "status": "draft", "version": 0, "created_at": "string", "updated_at": "string" } ], "next_cursor": "string", "has_more": true}Authorization
bearer Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).
In: header
Header Parameters
Required by the API on this route (400 idempotency_key_required without it); the official clients generate a UUID when you omit it.
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
curl -X POST "https://example.com/challenges" \ -H "Content-Type: application/json" \ -d '{ "name": "Finish three books", "qualifying": { "event": "content.completed" }, "target": 3, "contribution_key": "event.properties.content_id", "status": "active", "completion_actions": [ { "type": "points.award", "currency": "points", "amount": 300 } ] }'{ "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": "string", "ends_at": "string", "status": "draft", "version": 0, "created_at": "string", "updated_at": "string"}Authorization
bearer Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).
In: header
Path Parameters
1 <= lengthResponse Body
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": "string", "ends_at": "string", "status": "draft", "version": 0, "created_at": "string", "updated_at": "string"}Authorization
bearer Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).
In: header
Path Parameters
1 <= lengthRequest 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
curl -X PATCH "https://example.com/challenges/string" \ -H "Content-Type: application/json" \ -d '{}'{ "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": "string", "ends_at": "string", "status": "draft", "version": 0, "created_at": "string", "updated_at": "string"}Authorization
bearer Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).
In: header
Path Parameters
1 <= lengthResponse Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X DELETE "https://example.com/challenges/string"Authorization
bearer Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).
In: header
Path Parameters
1 <= lengthResponse Body
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": "string" } ], "next_cursor": "string", "has_more": true}Authorization
bearer Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).
In: header
Path Parameters
1 <= lengthRequest 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/enrollments" \ -H "Content-Type: application/json" \ -d '{ "customer_id": "string" }'{ "challenge_id": "string", "customer_id": "string", "enrolled_at": "string"}Authorization
bearer Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).
In: header
Path Parameters
1 <= length1 <= lengthResponse Body
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"Authorization
bearer Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).
In: header
Path Parameters
1 <= lengthQuery Parameters
Response Body
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": "string", "updated_at": "string" } ], "next_cursor": "string", "has_more": true}Authorization
bearer Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).
In: header
Path Parameters
1 <= lengthRequest 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
curl -X POST "https://example.com/challenges/string/progress/revoke" \ -H "Content-Type: application/json" \ -d '{ "customer_id": "string", "contribution": "string" }'{ "challenge_id": "string", "customer_id": "string", "period_key": "string", "count": 0, "status": "active", "contributions": [ "string" ], "completed_at": "string", "updated_at": "string"}Authorization
bearer Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).
In: header
Path Parameters
1 <= lengthRequest 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
curl -X POST "https://example.com/challenges/string/reevaluate" \ -H "Content-Type: application/json" \ -d '{}'{ "completed": 0, "effects": [ null ]}