Orishare
API reference
POST
/streaks/{id}/freeze_grants

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

Header Parameters

Idempotency-Key*string

Required. Official clients generate a UUID when omitted by the caller.

Length1 <= length <= 255
X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length
If-Match*string

Required 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

application/json

application/json

curl -X POST "https://example.com/streaks/string/freeze_grants" \  -H "Idempotency-Key: string" \  -H "If-Match: string" \  -H "Content-Type: application/json" \  -d '{    "customer_id": "cust_example",    "program_revision": 2,    "operation_key": "operation-example",    "quantity": 1  }'
{  "id": "string",  "program_id": "string",  "customer_id": "string",  "participation_id": "string",  "state_revision": 0,  "execution_id": "string",  "outcome": "string",  "effects": [    null  ],  "transition_ids": [    "string"  ],  "freeze_entry_id": "string",  "freezes": 0}
POST
/streaks/{id}/freeze_returns

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

Header Parameters

Idempotency-Key*string

Required. Official clients generate a UUID when omitted by the caller.

Length1 <= length <= 255
X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length
If-Match*string

Required 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

application/json

curl -X POST "https://example.com/streaks/string/freeze_returns" \  -H "Idempotency-Key: string" \  -H "If-Match: string" \  -H "Content-Type: application/json" \  -d '{    "customer_id": "cust_example",    "program_revision": 2,    "operation_key": "operation-example",    "consume_id": "sfr_consume"  }'
{  "id": "string",  "program_id": "string",  "customer_id": "string",  "participation_id": "string",  "state_revision": 0,  "execution_id": "string",  "outcome": "string",  "effects": [    null  ],  "transition_ids": [    "string"  ],  "freeze_entry_id": "string",  "freezes": 0}
POST
/streaks/{id}/freeze_cancellations

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

Header Parameters

Idempotency-Key*string

Required. Official clients generate a UUID when omitted by the caller.

Length1 <= length <= 255
X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length
If-Match*string

Required 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

application/json

curl -X POST "https://example.com/streaks/string/freeze_cancellations" \  -H "Idempotency-Key: string" \  -H "If-Match: string" \  -H "Content-Type: application/json" \  -d '{    "customer_id": "cust_example",    "program_revision": 2,    "operation_key": "operation-example",    "purchase_id": "sfr_purchase"  }'
{  "id": "string",  "program_id": "string",  "customer_id": "string",  "participation_id": "string",  "state_revision": 0,  "execution_id": "string",  "outcome": "string",  "effects": [    null  ],  "transition_ids": [    "string"  ],  "freeze_entry_id": "string",  "freezes": 0}
POST
/streaks/{id}/corrections

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

Header Parameters

Idempotency-Key*string

Required. Official clients generate a UUID when omitted by the caller.

Length1 <= length <= 255
X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length
If-Match*string

Required 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

application/json

curl -X POST "https://example.com/streaks/string/corrections" \  -H "Idempotency-Key: string" \  -H "If-Match: string" \  -H "Content-Type: application/json" \  -d '{    "customer_id": "cust_example",    "program_revision": 2,    "operation_key": "operation-example",    "contribution_id": "pc_original",    "fraction": "1",    "reason": "Correct original contribution"  }'
{  "id": "string",  "program_id": "string",  "customer_id": "string",  "participation_id": "string",  "state_revision": 0,  "execution_id": "string",  "outcome": "string",  "effects": [    null  ],  "transition_ids": [    "string"  ],  "freeze_entry_id": "string",  "freezes": 0}
POST
/streaks/{id}/repairs

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

Header Parameters

Idempotency-Key*string

Required. Official clients generate a UUID when omitted by the caller.

Length1 <= length <= 255
X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

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

application/json

application/json

curl -X POST "https://example.com/streaks/string/repairs" \  -H "Idempotency-Key: string" \  -H "Content-Type: application/json" \  -d '{    "customer_id": "cust_example",    "charge": false  }'
{  "id": "string",  "program_id": "string",  "customer_id": "string",  "participation_id": "string",  "state_revision": 0,  "status": "repaired",  "current": "string",  "restored_length": "string",  "repaired_periods": 1,  "charged": true,  "cost": {    "currency_id": "string",    "amount": "string"  },  "transition_ids": [    "string"  ]}
GET
/streaks

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Query Parameters

limit?integer
Range1 <= value <= 100
Default50
cursor?string
Lengthlength <= 2048
status?string

Value in

  • "draft"
  • "active"
  • "paused"
  • "ended"
  • "archived"

Header Parameters

X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length

Response Body

application/json

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/streaks"
{  "data": [    {      "id": "string",      "environment_id": "string",      "kind": "streak",      "key": "string",      "name": "string",      "status": "draft",      "active_version_id": "string",      "authority": "legacy",      "legacy_table": "string",      "version": -9007199254740991,      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z",      "archived_at": "2019-08-24T14:15:22Z"    }  ],  "next_cursor": "string",  "has_more": true}
GET
/streaks/{id}

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

Header Parameters

X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length

Response Body

application/json

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/streaks/string"
{  "id": "string",  "environment_id": "string",  "kind": "streak",  "key": "string",  "name": "string",  "status": "draft",  "active_version_id": "string",  "authority": "legacy",  "legacy_table": "string",  "version": -9007199254740991,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z",  "archived_at": "2019-08-24T14:15:22Z"}
GET
/streaks/{id}/participations

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

Query Parameters

limit?integer
Range1 <= value <= 100
Default50
cursor?string
Lengthlength <= 2048
customer_id?string
Length1 <= length

Header Parameters

X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length

Response Body

application/json

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/streaks/string/participations"
{  "data": [    {      "id": "string",      "program_id": "string",      "program_version_id": "string",      "customer_id": "string",      "status": "enrolled",      "state_revision": "string",      "state": {        "schema": "orishare.mechanic-state/v1",        "revision": "string",        "kind": "streak",        "current": "string",        "best": "string",        "episode": "string",        "finalized_watermark": "string",        "current_period": {          "key": "string",          "progress": "string",          "status": "open"        },        "freezes": 0,        "at_risk_at": "2019-08-24T14:15:22Z",        "next_deadline_at": "2019-08-24T14:15:22Z"      },      "effective_trust": "anonymous_claim",      "timezone": "string",      "timezone_source": "environment",      "tzdata_version": "string",      "enrolled_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z",      "standing": "current"    }  ],  "next_cursor": "string",  "has_more": true}
GET
/streaks/{id}/participations/{participation_id}

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length
participation_id*string
Length1 <= length

Header Parameters

X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length

Response Body

application/json

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/streaks/string/participations/string"
{  "id": "string",  "program_id": "string",  "program_version_id": "string",  "customer_id": "string",  "status": "enrolled",  "state_revision": "string",  "state": {    "schema": "orishare.mechanic-state/v1",    "revision": "string",    "kind": "streak",    "current": "string",    "best": "string",    "episode": "string",    "finalized_watermark": "string",    "current_period": {      "key": "string",      "progress": "string",      "status": "open"    },    "freezes": 0,    "at_risk_at": "2019-08-24T14:15:22Z",    "next_deadline_at": "2019-08-24T14:15:22Z"  },  "effective_trust": "anonymous_claim",  "timezone": "string",  "timezone_source": "environment",  "tzdata_version": "string",  "enrolled_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z",  "standing": "current"}
GET
/streaks/{id}/participations/{participation_id}/freezes

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length
participation_id*string
Length1 <= length

Query Parameters

limit?integer
Range1 <= value <= 100
Default50
cursor?string
Lengthlength <= 2048

Header Parameters

X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length

Response Body

application/json

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/streaks/string/participations/string/freezes"
{  "data": [    {      "id": "string",      "participation_id": "string",      "kind": "grant",      "quantity": 1,      "created_at": "2019-08-24T14:15:22Z",      "settled": true,      "cancellable_quantity": 0    }  ],  "next_cursor": "string",  "has_more": true}