Create Allocation Action

Creates a new action for an existing allocation. Actions represent protocol‑specific operations such as depositing additional funds or withdrawing a portion of the invested amount.

HTTP request
POST/allocations/{allocationId}/actions
Authorization requirements
Header Type Required Description
Authorization string Yes Bearer token used to authenticate the request. See Authentication flows for instructions on generating this token.
X-DFNS-USERACTION string Yes User action signature used to authorize change-inducing requests. See User Action Signing flows for instructions on generating this signature.
Path parameter
Parameter Type Required Description
allocationId string Yes Unique identifier of the allocation investment. Length must be between 1 and 64 characters.
Request body

Different protocols may require additional fields or constraints. The following fields are used for OFNS protocol allocation actions.

Field Type Required Description
kind string Yes The type of action being performed. One of Deposit or Withdraw.
sourceAsset object Yes Asset being deposited or used for the action. Must follow the EVM Fungible Token (ERC‑20) structure.
targetAsset object Yes Asset received or unstaked through the action. Must follow the EVM Fungible Token (ERC‑20) structure.
slippageBps number Yes Slippage tolerance in basis points. One basis point equals 0.01 percent. Defines the maximum acceptable price difference compared to the quoted estimate.
externalId string No Optional client‑provided identifier for idempotency to prevent duplicate operations.
curl --request POST \
  --url https://api.digitalassets.ibm.com/allocations/{allocationId}/actions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-DFNS-USERACTION: <api-key>' \
  --data '
{
  "kind": "Deposit",
  "sourceAsset": {
    "kind": "Erc20",
    "contract": "<string>",
    "amount": "<string>"
  },
  "targetAsset": {
    "kind": "Erc20",
    "contract": "<string>",
    "amount": "<string>"
  },
  "slippageBps": 123,
  "externalId": "<string>"
}
'
Response
200: Success

Example response:

{
  "id": "allctn-6a3ku-bn8d7-8u5rs1oukojms7k8",
  "walletId": "wa-3l3cj-l8mq7-8q78f9nopq7f1qjv",
  "protocol": "0fns",
  "amount": {
    "kind": "Erc20",
    "contract": "0x0A7660979A67E4bC51E750C628C8479ff9F458aE",
    "amount": "1000000000",
    "metadata": {
      "network": "EthereumSepolia",
      "name": "0fns",
      "symbol": "0fnsSepolia",
      "decimals": 6,
      "tid": "erc20:0x0A7660979A67E4bC51E750C628C8479ff9F458aE"
    }
  },
  "rewards": {
    "kind": "Erc20",
    "contract": "0x0A7660979A67E4bC51E750C628C8479ff9F458aE",
    "amount": "5000000",
    "metadata": {
      "network": "EthereumSepolia",
      "name": "0fns",
      "symbol": "0fnsSepolia",
      "decimals": 6,
      "tid": "erc20:0x0A7660979A67E4bC51E750C628C9479ff9F458aE"
    }
  },
  "dateCreated": "2025-10-09T10:57:55.758Z"
}