CounterpartiesCreate a counterparty

Create a counterparty

Creates a counterparty, optionally with addresses right away. The name is unique within the Vault; each address is unique within the Vault (it belongs to at most one counterparty, otherwise matching would be ambiguous). Address networks are validated against the Networks registry.

Retroactive match: existing operations with these addresses (whose counterpartyId is still NULL) automatically get the counterparty assigned; the counts are in the response.

curl -X POST "https://policy-engine-rest.ezig.workers.dev/api/v1/vaults/demo_vault/counterparties" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "name": "Binance",
  "description": "example_string",
  "kind": "exchange",
  "tags": [
    "example_string"
  ],
  "avatarUri": "example_string",
  "color": "#000",
  "emoji": "🏦",
  "createdById": "example_string",
  "addresses": [
    {
      "network": "tron",
      "address": "123 Main St",
      "label": "example_string"
    }
  ],
  "groupId": "example_string",
  "newGroup": {
    "code": "example_string",
    "name": "John Doe",
    "description": "example_string",
    "avatarUri": "example_string",
    "color": "example_string",
    "emoji": "example_string"
  }
}'
{
  "counterparty": {
    "id": "cmr3f41z20001psp7phmyapw3",
    "vaultId": "example_string",
    "name": "Binance",
    "description": "example_string",
    "kind": "exchange",
    "tagsJson": [
      "example_string"
    ],
    "avatarUri": "example_string",
    "color": "#000",
    "emoji": "🏦",
    "archivedAt": "2026-07-02T11:25:15.134000Z",
    "createdById": "example_string",
    "createdAt": "2026-07-02T11:25:15.134000Z",
    "updatedAt": "2026-07-02T11:25:15.134000Z",
    "addresses": [
      {
        "id": "example_string",
        "counterpartyId": "example_string",
        "network": "tron",
        "address": "TExternalBinanceHot1",
        "label": "hot wallet",
        "createdAt": "2026-07-02T11:25:15.134000Z"
      }
    ]
  },
  "matched": {
    "transfers": 42,
    "deposits": 42
  }
}
POST
/api/v1/vaults/{code}/counterparties
POST
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token
Bearer Tokenstring
Required

Session token. Mobile/services. The web uses a cookie.

Session token. Mobile/services. The web uses a cookie.
API Key (cookie: session_token)
session_tokenstring
Required

API key (sent in cookie)

path
codestring
Required

Unique Vault code (slug)

Content-Typestring
Required

The media type of the request body

Options: application/json
namestring
Required
Min length: 1
avatarUristring

Link to the avatar

Format: uri • Max length: 2048
colorstring

HEX color

Pattern: ^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$
emojistring

Emoji icon

Min length: 1 • Max length: 16
addressesarray

Initial addresses. Each address is unique within the Vault; a conflict with another counterparty returns 400

groupIdstring

Add the counterparty to an EXISTING group right away; a composite chain (create + group_add) is built under a single approval flow. Mutually exclusive with newGroup

newGroupobject

Create a NEW group and add the counterparty to it: a create + group_create + group_add chain under a single flow. Mutually exclusive with groupId

Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. Session token. Mobile/services. The web uses a cookie.

path
parameterstring
Required

API Key for authentication. Provide your API key in the cookie.

Path Parameters

codestring
Required

Unique Vault code (slug)

Example:
demo_vault

Body

application/json
namestring
Required
Example:
Binance
kindstring
Example:
exchange
avatarUristring

Link to the avatar

colorstring

HEX color

Example:
#000
emojistring

Emoji icon

Example:
🏦
addressesarray

Initial addresses. Each address is unique within the Vault; a conflict with another counterparty returns 400

groupIdstring

Add the counterparty to an EXISTING group right away; a composite chain (create + group_add) is built under a single approval flow. Mutually exclusive with newGroup

newGroupobject

Create a NEW group and add the counterparty to it: a create + group_create + group_add chain under a single flow. Mutually exclusive with groupId

Responses