API Resources
All examples assume THYME_AUTH_TOKEN contains a workspace-bound credential.
Add X-Workspace-Id when using an unbound key.
Set THYME_API_URL to your deployment's HTTP base as described in the
API overview. The interactive reference documents
individual action routes and request bodies.
Route summary
| Method | Path | Scope | Purpose |
|---|---|---|---|
GET, POST | /api/v1/projects | projects:read/write | List or create projects |
GET, PATCH | /api/v1/projects/{projectId} | projects:read/write | Read or update metadata |
GET | /api/v1/chains | chains:read | List enabled chains |
GET | /api/v1/functions?projectId=...&name=... | functions:read | List releases; a name filter adds reservation metadata |
GET, DELETE | /api/v1/functions/{functionId} | functions:read/delete | Read or soft-delete a release |
GET | /api/v1/functions/{functionId}/source | functions:source | Read extracted source |
POST | /api/v1/functions/{functionId}/copy | functions:upload | Copy code to a target name/tag release |
POST | /api/task/upload | functions:upload | Upload a multipart function bundle |
GET, POST | /api/v1/executables | executables:read/write | List or create executables |
GET, DELETE | /api/v1/executables/{executableId} | executables:read/write | Read or delete a non-active executable; pause active ones first |
POST | /api/v1/executables/{id}/{pause,resume,reprovision,regenerate} | executables:write | Lifecycle actions |
POST | /api/v1/executables/{id}/{run,simulate} | executables:run | Trigger a real or dry run |
PATCH | /api/v1/executables/{id}/{args,function,secrets,gas-mode,profile,sponsorship-provider,pinned,trigger} | executables:write | Update one configuration facet |
GET, PATCH | /api/v1/executables/{id}/storage | storage:read/write | Read or replace JSON state |
GET | /api/v1/executables/{id}/executions | executions:read | List executable runs |
GET, POST | /api/v1/executables/{id}/webhooks | webhooks:read/write | List or create webhook credentials |
GET | /api/v1/executions?projectId=... | executions:read | List project runs |
GET | /api/v1/executions/{id} | executions:read | Read a run |
GET | /api/v1/executions/{id}/logs | executions:read | Read ordered logs |
GET, POST | /api/v1/profiles | profiles:read/write | List profiles; create a legacy profile or, with kind: "safe_roles", prepare a bring-your-own-Safe Roles profile |
GET, PATCH | /api/v1/profiles/{id} | profiles:read/write | Read or rename a profile |
POST | /api/v1/profiles/{id}/setup | profiles:write | Confirm a Roles profile's setup transaction and activate it |
POST | /api/v1/profiles/{id}/{archive,unarchive,retry,share} | profiles:write | Profile lifecycle and cross-project sharing actions |
GET, POST | /api/v1/secrets | secrets:read/write | List metadata or create a write-only secret |
PATCH, DELETE | /api/v1/secrets/{id} | secrets:write | Rotate or delete a secret |
GET, PATCH, DELETE | /api/v1/webhooks/{id} | webhooks:read/write | Read, rename, or revoke a webhook |
POST | /api/v1/webhooks/{id}/rotate | webhooks:write | Rotate and return a one-time URL |
GET | /api/v1/usage | usage:read | Read current Functions cycle usage and projection |
Copy a function release
curl -X POST \
"$THYME_API_URL/api/v1/functions/FUNCTION_ID/copy" \
-H "Authorization: Bearer $THYME_AUTH_TOKEN" \
-H "Idempotency-Key: copy-price-watcher-v2" \
-H "Content-Type: application/json" \
--data '{
"targetProjectId": "PROJECT_ID",
"name": "price-watcher",
"versionTag": "v2"
}'Switch an executable to a release
The executable must be paused. The target function ID already identifies the name and immutable version tag.
curl -X PATCH \
"$THYME_API_URL/api/v1/executables/EXECUTABLE_ID/function" \
-H "Authorization: Bearer $THYME_AUTH_TOKEN" \
-H "Idempotency-Key: switch-executable-to-v2" \
-H "Content-Type: application/json" \
--data '{"functionId":"FUNCTION_V2_ID","args":"{\"threshold\":42}"}'An accepted response is asynchronous:
{
"success": true,
"requestId": "switch-request-id",
"state": "rebuilding"
}Poll GET /api/v1/executables/{id}. pendingFunctionSwitch disappears after
the atomic commit; lastFunctionSwitchError records a failed replacement.
Replace executable storage
Read storage first and pass its version back with the complete next JSON object:
curl -X PATCH \
"$THYME_API_URL/api/v1/executables/EXECUTABLE_ID/storage" \
-H "Authorization: Bearer $THYME_AUTH_TOKEN" \
-H "Idempotency-Key: storage-update-17" \
-H "Content-Type: application/json" \
--data '{"expectedVersion":16,"value":{"lastBlock":22000000}}'A stale version or active execution lock returns 409.
The serialized object must be at most 16 MiB when read or written through the
management API.
Create and rotate a webhook
curl -X POST \
"$THYME_API_URL/api/v1/executables/EXECUTABLE_ID/webhooks" \
-H "Authorization: Bearer $THYME_AUTH_TOKEN" \
-H "Idempotency-Key: create-webhook-deploy" \
-H "Content-Type: application/json" \
--data '{"name":"Deploy hook"}'The returned URL contains a secret and is shown only by create or rotate. Store it immediately. Idempotent copies of these responses are encrypted at rest.
Create an executable
Upload the function first and use an active profile in the same project. The profile determines the chain and must cover the function's permissions. This example requests sponsored execution; support and funding depend on the profile and deployment. See gas modes.
curl -X POST "$THYME_API_URL/api/v1/executables" \
-H "Authorization: Bearer $THYME_AUTH_TOKEN" \
-H "Idempotency-Key: create-price-watcher-v1" \
-H "Content-Type: application/json" \
--data '{
"projectId": "PROJECT_ID",
"functionId": "FUNCTION_ID",
"profileId": "PROFILE_ID",
"name": "price-watcher",
"trigger": { "type": "interval", "intervalMs": 60000 },
"args": "{\"threshold\":42}",
"gasMode": "sponsored",
"sandboxRuntime": "daytona"
}'args is a JSON-encoded string, not an object. Replace it with args matching
your function's schema. Secret bindings are separate and contain secret IDs,
not values: [{ "secretId": "SECRET_ID", "envKey": "PRICE_API_KEY" }].
Creation returns 201 while provisioning can continue asynchronously. Read the
executable and wait for it to become ready before running it.
Update configuration
Patch one facet at a time. This makes each change independently retryable.
| Facet | Body | Notes |
|---|---|---|
args | { "args": "{\"threshold\":42}" } | Supply valid JSON matching the function schema; binding permissions are rechecked. |
function | { "functionId": "FUNCTION_ID", "args": "{}" } | Pause first; returns 202 for an asynchronous replacement. |
secrets | { "secretBindings": [{ "secretId": "SECRET_ID", "envKey": "API_KEY" }] } | Replaces bindings; an empty list clears them. |
gas-mode | { "gasMode": "sponsored", "gasFallback": false } | Profile-specific gas restrictions still apply. |
profile | { "profileId": "PROFILE_ID" } | Must be compatible with the executable and function permissions. |
sponsorship-provider | { "sponsorshipProvider": "pimlico" } | Accepts pimlico or alchemy for supported profiles; managed Lift selection is not this field. |
pinned | { "pinned": true } | Changes the dashboard pin. |
trigger | { "trigger": { "type": "cron", "cronspec": "0 * * * *" } } | Uses the same trigger validation as creation. |
Each facet is PATCH /api/v1/executables/{id}/{facet}. A registered endpoint does
not imply that every profile kind or executable state allows the change. Read
the error response and use the lifecycle guide.
Run, simulate, and inspect logs
Use POST /api/v1/executables/{id}/simulate for a cloud dry run, or /run for
real execution. Both require executables:run. Successful submission queues
work; it is not confirmation of a blockchain transaction.
curl -X POST "$THYME_API_URL/api/v1/executables/EXECUTABLE_ID/simulate" \
-H "Authorization: Bearer $THYME_AUTH_TOKEN" \
-H "Idempotency-Key: simulate-price-watcher-1"
curl "$THYME_API_URL/api/v1/executables/EXECUTABLE_ID/executions?limit=20" \
-H "Authorization: Bearer $THYME_AUTH_TOKEN"
curl "$THYME_API_URL/api/v1/executions/EXECUTION_ID/logs" \
-H "Authorization: Bearer $THYME_AUTH_TOKEN"The project execution list's status filter accepts pending, running,
simulating, submitted, confirmed, failed, and skipped. Execution records
can also have submitted_unknown when submission needs reconciliation; that
state is not accepted by the list filter. Poll the run record and inspect its
logs; task output and on-chain confirmation are separate stages.
Profile administration
PATCH /api/v1/profiles/{id} accepts { "name": "New name" }, while creation
uses alias. Share uses { "targetProjectId": "PROJECT_ID", "alias": "operator" }.
Sharing is limited by profile kind and workspace rules. Without kind,
POST /api/v1/profiles creates legacy profiles only where that creation path
is enabled; sponsored Safe onboarding requires the owner wallet in the Console.
Archive, unarchive, and retry are separate POST actions. Retry applies to pending legacy profiles, not Safe or Roles onboarding. Archiving a profile does not delete its on-chain wallet or transfer funds. Read Profiles before changing a profile that executables depend on.
Bring your own Safe
A Roles profile for a Safe you already own takes two calls and one transaction
from the Safe owner's wallet. The Safe must be a deployed Safe 1.4.1 or 1.5.0
with threshold 1, ownerAddress must be one of its owners, and the chain must
have Roles and Lift sponsorship enabled. Thyme never holds a key that can send
the transaction.
Prepare the profile. The response carries the exact execTransaction calldata
for the owner to send as-is, the predicted Roles proxy and executor Safe
addresses, and the allowed calls the batch scopes:
curl -X POST "$THYME_API_URL/api/v1/profiles" \
-H "Authorization: Bearer $THYME_AUTH_TOKEN" \
-H "Idempotency-Key: prepare-payroll-main-1" \
-H "Content-Type: application/json" \
--data '{
"kind": "safe_roles",
"projectId": "PROJECT_ID",
"alias": "payroll-main",
"chainId": 11155111,
"safeAddress": "0xSAFE",
"ownerAddress": "0xOWNER",
"executionPolicy": {
"mode": "allowlist",
"rules": [
{ "target": "0xTOKEN", "selector": "0xa9059cbb",
"functionSignature": "transfer(address,uint256)" }
]
}
}'{
"data": {
"profile": {
"profileId": "PROFILE_ID", "alias": "payroll-main", "chainId": 11155111,
"status": "pending", "setupStatus": "pending",
"safeAddress": "0xSAFE", "ownerAddress": "0xOWNER",
"roleKey": "0x…", "sessionKeyAddress": "0x…",
"executorDeployed": false, "setupDataHash": "0x…"
},
"transaction": { "to": "0xSAFE", "value": "0x0", "data": "0x6a761202…" },
"predicted": { "rolesProxy": "0x…", "executorSafe": "0x…" },
"scopeRules": [
{ "target": "0xTOKEN", "selector": "0xa9059cbb",
"functionSignature": "transfer(address,uint256)" }
]
}
}Send transaction from the owner wallet (a plain eth_sendTransaction; the
batch is authorised by the sender, so it must not go through a Safe app or a
4337 bundler) and wait for the receipt. Then confirm:
curl -X POST "$THYME_API_URL/api/v1/profiles/PROFILE_ID/setup" \
-H "Authorization: Bearer $THYME_AUTH_TOKEN" \
-H "Content-Type: application/json" \
--data '{"txHash":"0xTX"}'Thyme re-reads the mined transaction (from the owner, to the Safe, carrying
exactly the prepared calldata), verifies the Roles module and executor Safe on
chain, provisions the managed Lift policy, and returns
{ "data": { "profileId", "setupStatus": "active", "txHash", "rolesProxyAddress", "executorSafeAddress", "liftIntegrationId", "liftPolicyId" } }. Repeating the
call with the same hash re-verifies and returns the same body.
GET /api/v1/profiles/{id} shows status, safeRoles.setupStatus,
safeRoles.lastError, the addresses and the allowed calls as
safeRoles.executionPolicy while you wait.
Repeating the prepare call with the same alias, Safe, owner and chain resumes the pending profile and returns the same addresses. A changed policy returns a new transaction; a batch handed out earlier stays confirmable.
| Status | code | Meaning |
|---|---|---|
400 | safe_not_eligible | Not deployed on that chain, not Safe 1.4.1/1.5.0, threshold above 1, or ownerAddress is not an owner |
400 | invalid_request | Policy, alias, address or selector problems; the message says which |
409 | chain_unavailable | Roles profiles, their pinned contracts or Lift sponsorship are not available on that chain |
409 | setup_not_mined | No receipt within the wait; call /setup again once it is mined. Until that call succeeds the profile reads safeRoles.setupStatus: "failed" with the timeout as lastError |
409 | conflict | Any other refusal, verbatim: alias in use, transaction does not carry the batch or was not sent by the owner, reverted, profile prepared as a sponsored Safe |
Only a successful response is stored and replayed for 24 hours; a 4xx or
409 releases the Idempotency-Key, so a retry may reuse it. Scope changes
and revocation of a Roles profile are not available over the API yet; use the
Console.