- Docs
- Api%2Freference%2Febus%2FExecuteAction
Run an action
Do something to an object: create one, hand it over, update it, redeem it, destroy it. This is the only endpoint that changes an object, and everything it does is signed, priced and recorded. **What to send.** One action — `mint`, `transfer`, `redeem` and the rest are listed on the request below, and exactly one of them is set. Along with it, the wallet's action number, and the signature over what `POST /ebus/prepare` gave you. **What happens.** We check the signature, work out who signed, check they are allowed to do this to this object, price the action, take the fee from the organization's balance and apply the change — all together, so an action either happens completely or not at all. Nothing is charged for an action that is refused. **What you get back.** The action's identifier and what it did — for a `mint`, the identifiers of the objects it created. The action then appears in `GET /ebus/action-logs`, reaches every webhook watching for it, and is settled on chain shortly afterwards in a batch. **Custodial accounts.** Where Dual holds the keys, you can leave the signature out and we sign on the account's behalf. Accounts with their own passkey or crypto wallet must sign for themselves. The HTTP credential is optional when `auth` contains a valid self-custodial signature; this lets a relayer submit a signed action without receiving the owner's access token. A custodial action must use an access token or API key with the `ebus.actions.create` permission.
The access token returned after a successful sign-in, sent as
Authorization: Bearer <access_token>.
It identifies the person and the organization they are working in, and
it lasts about fifteen minutes. When it runs out, use their refresh
token at POST /auth/refresh-token instead of asking them to sign in
again.
In: header
Request Body
application/json
The action, the wallet's action number, and the signature.
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://api.dual.network/ebus/execute" \ -H "Content-Type: application/json" \ -d '{ "action": { "mint": { "template_id": "665f1c2d4b1a2c3d4e5f6a99", "num": 2, "to": "0xfedcba9876543210fedcba9876543210fedcba98" } }, "nonce": 3 }'{
"action_id": "665f1c2d4b1a2c3d4e5f6e01",
"steps": [
{
"action": "mint",
"output": {
"ids": [
"665f1c2d4b1a2c3d4e5f6a90",
"665f1c2d4b1a2c3d4e5f6a91"
]
}
}
]
}{
"code": 3,
"message": "invalid nonce"
}{
"code": 16,
"message": "no auth provided"
}{
"code": 13,
"message": "internal error"
}