cURL
Actions
Create Web3 Action
Create a new Web3 Action. You can also set the Web3 Action to be deployed once it’s been created.
POST
cURL
Authorizations
An API key is a token that a client provides when making API calls. The key can be sent as a request header:
curl 'https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_SLUG}/project/${TENDERLY_PROJECT_SLUG}/simulate' \
-H 'X-Access-Key: ${TENDERLY_ACCESS_KEY}' \
...
Learn how to generate API access tokens at Tenderly Docs.
Path Parameters
Account slug of the user
Project slug of the account
Body
application/json
Create web3 action payload
A Web3 Action creation payload.
Example:
{
"name": "block-action",
"description": "Triggers on every 10th block on ETH Mainnet and Polygon.",
"source": "// Do not change function name.\nconst actionFn = async (context, blockEvent) => {\n console.log(blockEvent)\n\n // To access project's secret\n // let secret = await context.secrets.get('MY-SECRET')\n\n // To access project's storage\n // let value = await context.storage.getStr('MY-KEY')\n // await context.storage.putStr('MY-KEY', 'MY-VALUE')\n\n // Your logic goes here :)\n}\n// Do not change this.\nmodule.exports = { actionFn }",
"triggerType": "BLOCK",
"runtime": "V2",
"function": "actionFn",
"invocationType": "ASYNC",
"trigger": {
"type": "block",
"block": { "network": ["1", "137"], "blocks": 10 }
}
}
Should Web3 Action be immediately deployed.
Example:
true
Response
A successful response.
- Create Web3 Action Block Response
- Create Web3 Action Periodic Response
- Create Web3 Action Webhook Response
An object with details about created Web3 Action of Block type.