Orishare
Api
GET
/challenges
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Query Parameters

status?string

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}
POST
/challenges
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Header Parameters

Idempotency-Key?string

Required by the API on this route (400 idempotency_key_required without it); the official clients generate a UUID when you omit it.

Length1 <= length <= 255

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

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"}
GET
/challenges/{id}
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Path Parameters

id*string
Length1 <= length

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"
{  "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"}
PATCH
/challenges/{id}
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Path Parameters

id*string
Length1 <= length

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

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"}
DELETE
/challenges/{id}
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Path Parameters

id*string
Length1 <= length

Response 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"
Empty
GET
/challenges/{id}/enrollments
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Path Parameters

id*string
Length1 <= length

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/enrollments"
{  "data": [    {      "challenge_id": "string",      "customer_id": "string",      "enrolled_at": "string"    }  ],  "next_cursor": "string",  "has_more": true}
POST
/challenges/{id}/enrollments
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Path Parameters

id*string
Length1 <= length

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/enrollments" \  -H "Content-Type: application/json" \  -d '{    "customer_id": "string"  }'
{  "challenge_id": "string",  "customer_id": "string",  "enrolled_at": "string"}
DELETE
/challenges/{id}/enrollments/{customer_id}
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Path Parameters

id*string
Length1 <= length
customer_id*string
Length1 <= length

Response 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"
Empty
GET
/challenges/{id}/progress
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Path Parameters

id*string
Length1 <= length

Query Parameters

customer_id?string

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}
POST
/challenges/{id}/progress/revoke
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Path Parameters

id*string
Length1 <= length

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

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"}
POST
/challenges/{id}/reevaluate
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Path Parameters

id*string
Length1 <= length

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

curl -X POST "https://example.com/challenges/string/reevaluate" \  -H "Content-Type: application/json" \  -d '{}'
{  "completed": 0,  "effects": [    null  ]}