Skip to content
Thyme Docs

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

MethodPathScopePurpose
GET, POST/api/v1/projectsprojects:read/writeList or create projects
GET, PATCH/api/v1/projects/{projectId}projects:read/writeRead or update metadata
GET/api/v1/chainschains:readList enabled chains
GET/api/v1/functions?projectId=...&name=...functions:readList releases; a name filter adds reservation metadata
GET, DELETE/api/v1/functions/{functionId}functions:read/deleteRead or soft-delete a release
GET/api/v1/functions/{functionId}/sourcefunctions:sourceRead extracted source
POST/api/v1/functions/{functionId}/copyfunctions:uploadCopy code to a target name/tag release
POST/api/task/uploadfunctions:uploadUpload a multipart function bundle
GET, POST/api/v1/executablesexecutables:read/writeList or create executables
GET, DELETE/api/v1/executables/{executableId}executables:read/writeRead or delete a non-active executable; pause active ones first
POST/api/v1/executables/{id}/{pause,resume,reprovision,regenerate}executables:writeLifecycle actions
POST/api/v1/executables/{id}/{run,simulate}executables:runTrigger a real or dry run
PATCH/api/v1/executables/{id}/{args,function,secrets,gas-mode,profile,sponsorship-provider,pinned,trigger}executables:writeUpdate one configuration facet
GET, PATCH/api/v1/executables/{id}/storagestorage:read/writeRead or replace JSON state
GET/api/v1/executables/{id}/executionsexecutions:readList executable runs
GET, POST/api/v1/executables/{id}/webhookswebhooks:read/writeList or create webhook credentials
GET/api/v1/executions?projectId=...executions:readList project runs
GET/api/v1/executions/{id}executions:readRead a run
GET/api/v1/executions/{id}/logsexecutions:readRead ordered logs
GET, POST/api/v1/profilesprofiles:read/writeList or create profiles
GET, PATCH/api/v1/profiles/{id}profiles:read/writeRead or rename a profile
POST/api/v1/profiles/{id}/{archive,unarchive,retry,share}profiles:writeProfile lifecycle and cross-project sharing actions
GET, POST/api/v1/secretssecrets:read/writeList metadata or create a write-only secret
PATCH, DELETE/api/v1/secrets/{id}secrets:writeRotate or delete a secret
GET, PATCH, DELETE/api/v1/webhooks/{id}webhooks:read/writeRead, rename, or revoke a webhook
POST/api/v1/webhooks/{id}/rotatewebhooks:writeRotate and return a one-time URL
GET/api/v1/usageusage:readRead 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.

FacetBodyNotes
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. Safe and Roles onboarding requires the owner wallet in the Console; POST /api/v1/profiles creates legacy profiles only where that creation path is enabled.

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.