cURL
curl 'https://api.tenderly.co/api/v2/account/${TENDERLY_ACCOUNT_SLUG}/project/${TENDERLY_PROJECT_SLUG}/simulation-drafts' \
-X 'POST' \
-H 'X-Access-Key: ${TENDERLY_ACCESS_KEY}' \
-H 'content-type: application/json' \
--data-raw '{
"payload": {
"v": 2,
"network": { "id": "1" },
"rows": [
{
"contractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"from": "0xab5801a7d398351b8be11c439e05c5b3259aec9b",
"inputDataType": "raw",
"rawFunctionInput": "0xa9059cbb000000000000000000000000ab5801a7d398351b8be11c439e05c5b3259aec9b00000000000000000000000000000000000000000000000000000000000f4240"
}
]
}
}' \
--compressedconst options = {
method: 'POST',
headers: {'X-Access-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
payload: {
v: 2,
network: {id: '1'},
rows: [
{
contractAddress: '0xdac17f958d2ee523a2206206994597c13d831ec7',
from: '0xab5801a7d398351b8be11c439e05c5b3259aec9b',
inputDataType: 'raw',
rawFunctionInput: '0xa9059cbb000000000000000000000000ab5801a7d398351b8be11c439e05c5b3259aec9b00000000000000000000000000000000000000000000000000000000000f4240'
}
]
}
})
};
fetch('https://api.tenderly.co/api/v2/account/{accountSlug}/project/{projectSlug}/simulation-drafts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tenderly.co/api/v2/account/{accountSlug}/project/{projectSlug}/simulation-drafts"
payload = { "payload": {
"v": 2,
"network": { "id": "1" },
"rows": [
{
"contractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"from": "0xab5801a7d398351b8be11c439e05c5b3259aec9b",
"inputDataType": "raw",
"rawFunctionInput": "0xa9059cbb000000000000000000000000ab5801a7d398351b8be11c439e05c5b3259aec9b00000000000000000000000000000000000000000000000000000000000f4240"
}
]
} }
headers = {
"X-Access-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tenderly.co/api/v2/account/{accountSlug}/project/{projectSlug}/simulation-drafts"
payload := strings.NewReader("{\n \"payload\": {\n \"v\": 2,\n \"network\": {\n \"id\": \"1\"\n },\n \"rows\": [\n {\n \"contractAddress\": \"0xdac17f958d2ee523a2206206994597c13d831ec7\",\n \"from\": \"0xab5801a7d398351b8be11c439e05c5b3259aec9b\",\n \"inputDataType\": \"raw\",\n \"rawFunctionInput\": \"0xa9059cbb000000000000000000000000ab5801a7d398351b8be11c439e05c5b3259aec9b00000000000000000000000000000000000000000000000000000000000f4240\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Access-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"resource_id": "3f2a6c1e-8f1b-4c8e-9a2d-6b1e0f7c4d21"
}
Simulator
Create a simulation draft
Save a Simulator setup, a single call or a bundle with state overrides, as a draft and get an ID for a shareable link that prefills the Simulator.
POST
/
v2
/
account
/
{accountSlug}
/
project
/
{projectSlug}
/
simulation-drafts
cURL
curl 'https://api.tenderly.co/api/v2/account/${TENDERLY_ACCOUNT_SLUG}/project/${TENDERLY_PROJECT_SLUG}/simulation-drafts' \
-X 'POST' \
-H 'X-Access-Key: ${TENDERLY_ACCESS_KEY}' \
-H 'content-type: application/json' \
--data-raw '{
"payload": {
"v": 2,
"network": { "id": "1" },
"rows": [
{
"contractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"from": "0xab5801a7d398351b8be11c439e05c5b3259aec9b",
"inputDataType": "raw",
"rawFunctionInput": "0xa9059cbb000000000000000000000000ab5801a7d398351b8be11c439e05c5b3259aec9b00000000000000000000000000000000000000000000000000000000000f4240"
}
]
}
}' \
--compressedconst options = {
method: 'POST',
headers: {'X-Access-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
payload: {
v: 2,
network: {id: '1'},
rows: [
{
contractAddress: '0xdac17f958d2ee523a2206206994597c13d831ec7',
from: '0xab5801a7d398351b8be11c439e05c5b3259aec9b',
inputDataType: 'raw',
rawFunctionInput: '0xa9059cbb000000000000000000000000ab5801a7d398351b8be11c439e05c5b3259aec9b00000000000000000000000000000000000000000000000000000000000f4240'
}
]
}
})
};
fetch('https://api.tenderly.co/api/v2/account/{accountSlug}/project/{projectSlug}/simulation-drafts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tenderly.co/api/v2/account/{accountSlug}/project/{projectSlug}/simulation-drafts"
payload = { "payload": {
"v": 2,
"network": { "id": "1" },
"rows": [
{
"contractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"from": "0xab5801a7d398351b8be11c439e05c5b3259aec9b",
"inputDataType": "raw",
"rawFunctionInput": "0xa9059cbb000000000000000000000000ab5801a7d398351b8be11c439e05c5b3259aec9b00000000000000000000000000000000000000000000000000000000000f4240"
}
]
} }
headers = {
"X-Access-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tenderly.co/api/v2/account/{accountSlug}/project/{projectSlug}/simulation-drafts"
payload := strings.NewReader("{\n \"payload\": {\n \"v\": 2,\n \"network\": {\n \"id\": \"1\"\n },\n \"rows\": [\n {\n \"contractAddress\": \"0xdac17f958d2ee523a2206206994597c13d831ec7\",\n \"from\": \"0xab5801a7d398351b8be11c439e05c5b3259aec9b\",\n \"inputDataType\": \"raw\",\n \"rawFunctionInput\": \"0xa9059cbb000000000000000000000000ab5801a7d398351b8be11c439e05c5b3259aec9b00000000000000000000000000000000000000000000000000000000000f4240\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Access-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"resource_id": "3f2a6c1e-8f1b-4c8e-9a2d-6b1e0f7c4d21"
}
Authorizations
ApiKeyAuthBearerAuth
An API key is a token that a client provides when making API calls. Send it as the X-Access-Key request header on any endpoint:
curl '<API_ENDPOINT>' \ -H 'X-Access-Key: ${TENDERLY_ACCESS_KEY}' \ ...
Learn how to generate API access tokens at Tenderly Docs.
Path Parameters
Body
application/json
Request body for creating a simulation draft.