Skip to main content
POST
/
relay
/
v1
/
policies
Create a policy
curl --request POST \
  --url https://api.swarmd.ai/relay/v1/policies \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "config": {
    "enabledLegs": {
      "requestFromSource": true,
      "requestToSink": true,
      "responseFromSink": true,
      "responseToSource": true
    },
    "entity": {
      "type": "BANK_ACCOUNT_NUMBER",
      "scoreThreshold": 0.5,
      "action": "LOG"
    },
    "type": "COMMUNICATION_AUDIT"
  },
  "description": "<string>",
  "validFrom": "2023-11-07T05:31:56Z",
  "validTo": "2023-11-07T05:31:56Z"
}
'
{
  "policyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "version": "<string>",
  "name": "<string>",
  "description": "<string>",
  "policyType": "<string>",
  "config": {
    "enabledLegs": {
      "requestFromSource": true,
      "requestToSink": true,
      "responseFromSink": true,
      "responseToSource": true
    },
    "entity": {
      "type": "BANK_ACCOUNT_NUMBER",
      "scoreThreshold": 0.5,
      "action": "LOG"
    },
    "type": "COMMUNICATION_AUDIT"
  },
  "validFrom": "2023-11-07T05:31:56Z",
  "validTo": "2023-11-07T05:31:56Z",
  "createdAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

JWT token (USER, AGENT, or SERVICE auth)

Body

application/json
name
string
required
config
object
required
description
string
validFrom
string<date-time>
validTo
string<date-time>

Response

201 - application/json

Created

policyId
string<uuid>
version
string
name
string
description
string
policyType
string
config
object
validFrom
string<date-time>
validTo
string<date-time>
createdAt
string<date-time>