Skip to main content
POST
/
v1
/
policies
Create policy
curl --request POST \
  --url https://api.ledger.so/v1/policies \
  --header 'Api-Key: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "ttlMinutes": 123,
  "onExpiry": "freeze",
  "activeHoursStart": 11,
  "activeHoursEnd": 11,
  "activeTimezone": "<string>",
  "activeDays": [
    123
  ],
  "maxAmount": 123,
  "cumulativeMax": 123,
  "maxAuthCount": 123,
  "cooldownMinutes": 123,
  "limitPerAuth": 123,
  "limitPerDay": 123,
  "limitPerMonth": 123,
  "allowedMccs": [
    "<string>"
  ],
  "blockedMccs": [
    "<string>"
  ],
  "merchantHint": "<string>",
  "onDrift": "freeze",
  "requireAttestation": true,
  "intentTolerance": 0.5,
  "credentialExposure": "never"
}
'
{
  "object": "policy",
  "id": "<string>",
  "name": "<string>",
  "createdAt": 123,
  "updatedAt": 123,
  "description": "<string>",
  "timeRestrictions": {
    "ttlMinutes": 123,
    "onExpiry": "freeze",
    "activeHoursStart": 11,
    "activeHoursEnd": 11,
    "activeTimezone": "<string>",
    "activeDays": [
      3
    ]
  },
  "spendingRestrictions": {
    "maxAmount": 123,
    "cumulativeMax": 123,
    "maxAuthCount": 123,
    "cooldownMinutes": 123,
    "limitPerAuth": 123,
    "limitPerDay": 123,
    "limitPerMonth": 123
  },
  "merchantRestrictions": {
    "allowedMccs": [
      "<string>"
    ],
    "blockedMccs": [
      "<string>"
    ],
    "merchantHint": "<string>",
    "onDrift": "freeze"
  },
  "attestation": {
    "requireAttestation": true,
    "intentTolerance": 0.5,
    "credentialExposure": "never"
  }
}

Authorizations

Api-Key
string
header
required

API key for authentication. Get your key from the Dashboard.

Body

application/json
name
string
required

Unique name for this policy

description
string
ttlMinutes
integer

Card expires after N minutes

onExpiry
enum<string>
Available options:
freeze,
close
activeHoursStart
integer
Required range: 0 <= x <= 23
activeHoursEnd
integer
Required range: 0 <= x <= 23
activeTimezone
string
activeDays
integer[]
maxAmount
integer
cumulativeMax
integer
maxAuthCount
integer
cooldownMinutes
integer
limitPerAuth
integer
limitPerDay
integer
limitPerMonth
integer
allowedMccs
string[]
blockedMccs
string[]
merchantHint
string
onDrift
enum<string>
Available options:
freeze,
alert
requireAttestation
boolean
intentTolerance
number
Required range: 0 <= x <= 1
credentialExposure
enum<string>
Available options:
never,
extensionOnly,
rawPan

Response

Policy created

object
enum<string>
required
Available options:
policy
id
string
required
name
string
required

Unique name for this policy within the organization

createdAt
integer
required
updatedAt
integer
required
description
string
timeRestrictions
object
spendingRestrictions
object
merchantRestrictions
object
attestation
object