Add contract to project
curl 'https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_SLUG}/project/${TENDERLY_PROJECT_SLUG}/address' \
-H 'X-Access-Key: ${TENDERLY_ACCESS_KEY}' \
-H 'content-type: application/json' \
--data-raw '{"network_id":"1","address":"0x6b175474e89094c44da98b954eedeac495271d0f","display_name":"DAI Stablecoin"}' \
--compressedconst options = {
method: 'POST',
headers: {'X-Access-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({network_id: '1', address: '0x6b175474e89094c44da98b954eedeac495271d0f'})
};
fetch('https://api.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/address', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/address"
payload = {
"network_id": "1",
"address": "0x6b175474e89094c44da98b954eedeac495271d0f"
}
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/v1/account/{accountSlug}/project/{projectSlug}/address"
payload := strings.NewReader("{\n \"network_id\": \"1\",\n \"address\": \"0x6b175474e89094c44da98b954eedeac495271d0f\"\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))
}{
"id": "eth:1:0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c",
"contract": {
"id": "eth:1:0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c",
"contract_id": "eth:1:0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c",
"network_id": "1",
"public": true,
"verified_by": "etherscan",
"address": "0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c",
"contract_name": "ERC20ByMetadrop",
"type": "contract",
"compiler_version": "v0.8.21+commit.d9974bed",
"optimizations_used": true,
"optimization_runs": "200",
"created_at": "2023-12-08 22:36:21 +0000 UTC",
"language": "solidity"
},
"account": {
"id": "eth:1:0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c",
"contract_id": "eth:1:0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c",
"network_id": "1",
"public": true,
"verified_by": "etherscan",
"address": "0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c",
"contract_name": "ERC20ByMetadrop",
"type": "contract",
"compiler_version": "v0.8.21+commit.d9974bed",
"optimizations_used": true,
"optimization_runs": "200",
"created_at": "2023-12-08 22:36:21 +0000 UTC",
"language": "solidity"
},
"project_id": "1830efff-aa75-481e-b464-cedaf8b90960",
"added_by_id": "7d5e8b1f-8bf8-4eae-a70f-fb7d354b1cc2",
"details_visible": true,
"include_in_transaction_listing": true,
"display_name": "My new contract name",
"account_type": "contract",
"added_at": "2023-12-08 22:36:26.410442295 +0000 UTC m=+33221.750982874"
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "bad_request",
"message": "Bad request input parameters"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "unauthorized",
"message": "Unauthorized"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "insufficient_permissions",
"message": "Insufficient permissions"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "resource_not_found",
"message": "The resource you requested could not be found."
}
}{
"error": {
"id": "9a7bbe06-7f6f-4a45-8c78-8d64b9a9d0e1",
"slug": "too_many_requests",
"message": "API Rate limit exceeded."
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "internal_server_error",
"message": "Internal server error"
}
}Contracts
Add contract to project
Add a smart contract to a Tenderly project.
Note: If a contract is unverified on both Tenderly and external providers like Etherscan, Blockscout, or Routescan, it will be added to the project as unverified. However, if the contract is verified on an external provider, Tenderly will retrieve and apply the verification, subsequently adding the verified contract to the project.
POST
/
v1
/
account
/
{accountSlug}
/
project
/
{projectSlug}
/
address
Add contract to project
curl 'https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_SLUG}/project/${TENDERLY_PROJECT_SLUG}/address' \
-H 'X-Access-Key: ${TENDERLY_ACCESS_KEY}' \
-H 'content-type: application/json' \
--data-raw '{"network_id":"1","address":"0x6b175474e89094c44da98b954eedeac495271d0f","display_name":"DAI Stablecoin"}' \
--compressedconst options = {
method: 'POST',
headers: {'X-Access-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({network_id: '1', address: '0x6b175474e89094c44da98b954eedeac495271d0f'})
};
fetch('https://api.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/address', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/address"
payload = {
"network_id": "1",
"address": "0x6b175474e89094c44da98b954eedeac495271d0f"
}
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/v1/account/{accountSlug}/project/{projectSlug}/address"
payload := strings.NewReader("{\n \"network_id\": \"1\",\n \"address\": \"0x6b175474e89094c44da98b954eedeac495271d0f\"\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))
}{
"id": "eth:1:0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c",
"contract": {
"id": "eth:1:0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c",
"contract_id": "eth:1:0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c",
"network_id": "1",
"public": true,
"verified_by": "etherscan",
"address": "0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c",
"contract_name": "ERC20ByMetadrop",
"type": "contract",
"compiler_version": "v0.8.21+commit.d9974bed",
"optimizations_used": true,
"optimization_runs": "200",
"created_at": "2023-12-08 22:36:21 +0000 UTC",
"language": "solidity"
},
"account": {
"id": "eth:1:0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c",
"contract_id": "eth:1:0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c",
"network_id": "1",
"public": true,
"verified_by": "etherscan",
"address": "0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c",
"contract_name": "ERC20ByMetadrop",
"type": "contract",
"compiler_version": "v0.8.21+commit.d9974bed",
"optimizations_used": true,
"optimization_runs": "200",
"created_at": "2023-12-08 22:36:21 +0000 UTC",
"language": "solidity"
},
"project_id": "1830efff-aa75-481e-b464-cedaf8b90960",
"added_by_id": "7d5e8b1f-8bf8-4eae-a70f-fb7d354b1cc2",
"details_visible": true,
"include_in_transaction_listing": true,
"display_name": "My new contract name",
"account_type": "contract",
"added_at": "2023-12-08 22:36:26.410442295 +0000 UTC m=+33221.750982874"
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "bad_request",
"message": "Bad request input parameters"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "unauthorized",
"message": "Unauthorized"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "insufficient_permissions",
"message": "Insufficient permissions"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "resource_not_found",
"message": "The resource you requested could not be found."
}
}{
"error": {
"id": "9a7bbe06-7f6f-4a45-8c78-8d64b9a9d0e1",
"slug": "too_many_requests",
"message": "API Rate limit exceeded."
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "internal_server_error",
"message": "Internal server error"
}
}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
Account slug of the user
Project slug of the account
Body
application/json
Add contract to project payload
Response
A successful response.
An object with details about added contract.