Skip to main content
POST
/
api
/
approval-policies
Create a new approval policy for the authenticated organization
curl --request POST \
  --url https://app.solya.app/api/approval-policies \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "actionFamily": "RESTOCK_PLAN",
  "name": "High-value restock approval",
  "scopeShopIds": [
    "shop-uuid-1"
  ],
  "thresholdValue": 50000
}
'
{
  "actionFamily": "RESTOCK_PLAN",
  "createdAt": "2026-06-05T10:00:00.000Z",
  "createdBy": null,
  "id": "policy-uuid-new",
  "isActive": true,
  "name": "High-value restock approval",
  "organizationId": "org-uuid-1",
  "scopeBrandIds": [],
  "scopeCollections": [],
  "scopeShopIds": [
    "shop-uuid-1"
  ],
  "scopeSupplierIds": [],
  "thresholdValue": 50000,
  "updatedAt": null,
  "updatedBy": null
}

Authorizations

Authorization
string
header
required

User session token issued by NextAuth. For human users accessing Solya via the web application.

Body

application/json
actionFamily
enum<string> | null
required
Available options:
RESTOCK_PLAN,
REBALANCE_PLAN,
MARKDOWN_PLAN,
PRE_SEASON_PLAN,
RECOMMENDATION,
WORKFLOW,
SUPPLIER_RETURN_PLAN,
SUPPLIER_EXCHANGE_PLAN
name
string
required
Required string length: 1 - 255
thresholdValue
number
required
Required range: x >= 0
scopeBrandIds
string[]
Minimum string length: 1
scopeCollections
string[]
Minimum string length: 1
scopeShopIds
string[]
Minimum string length: 1
scopeSupplierIds
string[]
Minimum string length: 1

Response

Successful response

data
object
required
success
enum<boolean>
required
Available options:
true