Docs
ExtensionsRules

API Reference

The rules endpoints: manage rules and attach them to products.

All endpoints use your Kora API key (Authorization: Bearer <key>). Change the host variable in the playground to point at your own instance.

GET
/rules
AuthorizationBearer <token>

Your Kora API key, sent as Authorization: Bearer <key>.

In: header

Query Parameters

name?string

Response Body

application/json

curl -X GET "https://example.com/rules"
[  {    "name": "string",    "type": "version",    "action": "allow",    "config": {},    "message": "string",    "global": true,    "id": 0  }]
POST
/rules
AuthorizationBearer <token>

Your Kora API key, sent as Authorization: Bearer <key>.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/rules" \  -H "Content-Type: application/json" \  -d '{}'
{  "name": "string",  "type": "version",  "action": "allow",  "config": {},  "message": "string",  "global": true,  "id": 0}
PATCH
/rules
AuthorizationBearer <token>

Your Kora API key, sent as Authorization: Bearer <key>.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X PATCH "https://example.com/rules" \  -H "Content-Type: application/json" \  -d '{}'
Empty
DELETE
/rules
AuthorizationBearer <token>

Your Kora API key, sent as Authorization: Bearer <key>.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X DELETE "https://example.com/rules" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
Empty
POST
/rules/attach
AuthorizationBearer <token>

Your Kora API key, sent as Authorization: Bearer <key>.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/rules/attach" \  -H "Content-Type: application/json" \  -d '{    "rule": "string",    "product": "string"  }'
[  "string"]
POST
/rules/detach
AuthorizationBearer <token>

Your Kora API key, sent as Authorization: Bearer <key>.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/rules/detach" \  -H "Content-Type: application/json" \  -d '{    "rule": "string",    "product": "string"  }'
[  "string"]