api_execute
Execute Ruby in a sandboxed VM against the Crevio REST API. Use api_search first
to find the endpoint and its body fields, then call it here. Chain calls, transform
results, return the final expression.
Available in your code
get(path, params = {}) # paths auto-prefixed with /v1, routed in-process
post(path, **body) # body as keyword args or a hash — both work
patch(path, **body)
delete(path)
find_endpoints(query) # -> ["METHOD /path — summary", ...]
iso8601(offset_seconds = 0) # mruby Time has no strftime/iso8601Returns the last expression; puts is side-channel only. Every run answers
{result:, calls:, output:} — calls audits each REST call (method, path,
status, plus error_code/param on failure). When result has unexpected nils,
read calls for a non-2xx. Never project only success fields ({id: r["id"]}) —
that hides the error from result.
Rules that the schema does not tell you
Params are unwrapped, Stripe-style: fields at the TOP level.
{product: {...}}is silently dropped by most endpoints.Associations take the bare resource name and a prefix_id string —
product: "prod_x", neverproduct_id:. Some required ones never appear in a schema'sproperties.Courses and content live under
/experiences, NOT/products.Lists answer
{object: "list", data: [...], has_more}; single resources answer the object directly.Connected integrations go through the same REST surface:
post("/connections/<id>/execute", tool: "<tool>", arguments: {...}), with ids fromget("/connections", search: "<service>").Sandboxed mruby: no
File,ENV,Net::HTTP,Process. 10s, 10 MB.
Example — publishing a product (the ordering trap)
A product cannot be created active: it needs a price variant first, or the call 422s.
product = post("/products", name: "...")
post("/price_variants", product: product["id"], name: "Standard",
amount_type: "fixed", amount: 4900, currency: "usd", billing_type: "one_time")
patch("/products/#{product["id"]}", status: "active")API groups: Access, Account, Ads, Analytics, ApiKeys, Approvals, Audio, BlogCategories, BlogPosts, Bookings, Bots, Broadcasts, Calls, Chapters, CheckoutConfiguration, CheckoutLinks, Checkouts, Connections, Customers, Deployments, Discounts, Domains, Email, EventSessions, EventSources, EventTypes, Events, Experiences, Files, FormSubmissions, FormationDocuments, Formations, Forms, ForumPosts, Images, Invoices, Jobs, Leads, LegalPages, Lessons, LinkItems, Logs, Me, OrderItems, Orders, Phone Consents, Phone Numbers, Phone Suppressions, PriceVariants, Products, Refunds, Reviews, Schedules, Secrets, Sites, Skills, Socials, Status, Subscriptions, Tags, TaskRuns, Tasks, Topics, Usage, Users, Video, Web, WebhookEndpoints, WebhookEvents.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Ruby code to execute. Use get/post/patch/delete for REST access or find_endpoints to discover endpoints. |