canonical: https://jentic.com/apis/sim.ai/sim

# Sim API v2

The Sim API v2 builds, deploys, and runs AI agent workflows in Sim workspaces from code. You can create a workflow, edit its blocks and edges, version and deploy it, execute it synchronously, asynchronously, or as a stream, and then inspect each run, its logs, and the files it produced. Around the workflows, the API manages the resources they use: knowledge bases with semantic and hybrid search, tables with typed row queries, workspace files, custom tools, skills, sandboxes, credentials, and secrets. Workspace forking, organization membership, permission groups, and audit logs are also exposed for admins.

## For AI agents

Run and manage Sim AI agent workflows: execute a deployed workflow, follow its runs and logs, and manage the knowledge bases, tables, and files those workflows read and write.

## Scope

Does not host or train language models, process payments, or send email on its own. Use for building, deploying, running, and monitoring Sim AI workflows and their knowledge bases, tables, and files only.

## Capabilities

- Execute a deployed Sim workflow with executeWorkflowV2, synchronously, async, or streamed as NDJSON, and pass X-Run-Id to prevent duplicate runs
- Track workflow runs, read their outputs, download files they produced, and resume or cancel a run
- Build and change workflows by replacing their state, applying block operations with a dryRun option, and updating variables
- Version, deploy, roll back, and undeploy workflows, and publish a chat deployment for a workflow
- Search knowledge bases with semantic vector retrieval, optional hybrid full-text retrieval, and tag filters, and upload documents into them
- Query Sim tables with typed predicates and cursor pagination, insert rows in batches, and upsert or update rows
- Filter run logs by workflow, trigger, level, duration, cost, and model, and get log statistics for a workspace

## Use cases

### Let a coding agent run Sim workflows through Jentic

A coding agent such as Claude Code can hand work to an existing Sim workflow and read back the result, without the developer pasting a Sim key into the agent. Through Jentic, the agent searches for the execute operation, sends the workflow input, and then reads the run by id to get its outputs. The X-API-Key value or OAuth token is held by your own Jentic One instance, and you choose which Sim operations the agent may call.

Example prompt: Search Jentic for 'run a Sim workflow', call POST `/api/v2/workflows/{workflowId}/execute` for workflow wf_lead_scoring with input {"company": "Acme Ltd"} and an X-Run-Id of run-2026-11-25-001, then GET `/api/v2/workflows/{workflowId}/runs/{runId}` with includeOutput=true and return the result

### Workflow release management

Teams that ship Sim workflows like code can version, compare, deploy, and roll back from scripts or CI. The versions endpoints list and compare versions with base and target, deployWorkflow creates a new deployment version on every call, and rollbackWorkflow returns to an earlier version, so a release script can promote a tested version and back it out if needed.

Example prompt: Call GET `/api/v2/workflows/{workflowId}/versions/compare` with base 3 and target 4, then POST `/api/v2/workflows/{workflowId}/deploy`, and check GET `/api/v2/workflows/{workflowId}/deployment` until the new version is active

### Knowledge base retrieval for agents

Sim knowledge bases hold the documents workflows retrieve from. The API uploads documents into a knowledge base and searches one or more knowledge bases with semantic vector retrieval, optional hybrid full-text retrieval, and structured tag filters, with each result naming the knowledgeBaseId it came from, so an assistant can ground its answer in the right source.

Example prompt: POST `/api/v2/knowledge/{knowledgeBaseId}/documents` to upload refund-policy.pdf, then POST `/api/v2/knowledge/search` for 'refund window for annual plans' and return the top results with their knowledgeBaseId

### Run monitoring and cost tracking

Operators keeping an eye on production workflows can list run logs filtered by workflowIds, triggers, level, duration, cost, and model, open a single log by runId, and pull log statistics over a date range. That makes it possible to spot failing or expensive workflows and drill into the run that caused it.

Example prompt: Call GET `/api/v2/logs` with level error, startDate 2026-11-18, and endDate 2026-11-25, then GET `/api/v2/logs/stats` for the same window and summarise which workflows failed most and what they cost

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/api/v2/workflows/{workflowId}/execute` | Execute a workflow |
| GET | `/api/v2/workflows/{workflowId}/runs/{runId}` | Get a workflow run |
| GET | `/api/v2/workflows` | List workflows |
| POST | `/api/v2/workflows/{workflowId}/deploy` | Deploy a workflow |
| POST | `/api/v2/knowledge/search` | Search knowledge bases |
| POST | `/api/v2/tables/{tableId}/query` | Query table rows |
| GET | `/api/v2/logs` | List logs |
| POST | `/api/v2/tools/{toolId}/execute` | Run a built-in tool |

## Key resources

- **Workflows** — Create, edit state and variables, version, deploy, roll back, export and import, execute, and inspect runs and run files
- **Knowledge bases** — Create knowledge bases, upload and manage documents, sync connectors, manage tags, and run semantic or hybrid search
- **Tables** — Create tables and columns, insert, query, update, upsert, and delete rows, manage views, and import or export data
- **Files** — Upload, download, version, search, share, move, and delete workspace files and folders
- **Logs and audit logs** — List and filter run logs, read a single log, get log statistics, and read audit logs
- **Workspaces and organizations** — List workspaces and members, fork and sync workspaces, manage invitations, permission groups, and SSO providers
- **Tools, skills, credentials, and secrets** — Run built-in tools, manage custom tools, skills, sandboxes, credentials, and workspace or personal secrets

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 56 / 100
- **Maturity:** Foundational
- **Dimensions:**
  - Foundational Compliance: 48 / 100
  - Developer Experience & Jentic Compatibility: 70 / 100
  - AI-Readiness & Agent Experience: 62 / 100
  - Agent Usability: 43 / 100
  - Security: 55 / 100
  - AI Discoverability: 77 / 100
- **View full report:** https://jentic.com/apis/sim.ai/sim/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring Sim by hand means choosing between an X-API-Key and an OAuth token with `api:read` or `api:write` scope, knowing which operations reject workspace keys, and handling streaming NDJSON results and X-Run-Id deduplication. Through Jentic you install once, import Sim from the API Directory, store the credential once, and your agent calls it.
- **Permission scoping:** Sim puts the workflow id in the URL path (`/api/v2/workflows/{workflowId}/...`), so a rule can limit your agent to one workflow and the operations you pick for it, such as execute and read runs. You choose the operations it may call, so ones like setting secrets, deleting workflows, or changing organization members are not included unless you add them.
- **Credential handling:** Your Sim API key or OAuth token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'run a Sim workflow' or 'search a knowledge base', and Jentic returns the matching Sim operation with its input schema so the agent calls the right endpoint among hundreds without browsing the reference docs.

## Related APIs

- **n8n API** — Workflow automation platform API for managing and running workflows
- **Dify API** — LLM application platform with workflow and knowledge base APIs
- **Zapier NLA API** — Natural-language actions over Zapier integrations
- **OpenAI API** — Model provider for the language model steps inside AI workflows

## FAQ

### What authentication does the Sim API v2 use?

The Sim API v2 declares two schemes in its OpenAPI spec: an API key in the X-API-Key header, personal or workspace-scoped, generated under Settings then API Keys, or an OAuth 2.0 access token sent as an HTTP bearer token, where `api:read` permits reads and `api:write` also permits changes and execution. Some operations reject workspace keys and say so, and the execute operation also allows anonymous calls to public deployments. Multipart file upload sessions also send an upload-token header, the signed control token returned when the upload session is created. Through Jentic, your key or token is stored encrypted by your own Jentic One instance and injected at execution time, so it never enters the agent's prompt, logs, or context.

### Is there a Sim MCP server?

You don't need an MCP server to give your agent the Sim API v2. Jentic connects it directly from the API Directory: import it, store your credential once, and your agent calls it. Sim's own API can also publish a deployed workflow as an MCP tool on a workflow MCP server; that is separate from connecting the Sim API itself, which through Jentic loads no extra tool definitions into the agent's context.

### Can I limit what my agent is allowed to do with the Sim API v2?

Yes. For an agent that should only use one production workflow, write a rule that allows POST `/api/v2/workflows/{workflowId}/execute` and GET `/api/v2/workflows/{workflowId}/runs/{runId}` for that single workflow id. The agent can start runs and read their results, but it cannot edit the workflow, deploy a new version, or touch your secrets, credentials, or organization settings.

### What are the rate limits for the Sim API v2?

The OpenAPI spec does not give numeric rate limits. Some operation descriptions note a shared rate limit and say to respect the Retry-After header, so back off when it is returned. Check https://docs.sim.ai for current limits.

### How do I run a Sim workflow through Jentic?

Add the Sim API v2 to Jentic One from the Jentic directory and store your Sim API key. Your agent searches for 'run a Sim workflow', receives POST `/api/v2/workflows/{workflowId}/execute` with its input schema, and sends the workflow input, optionally with an X-Run-Id header so a retry cannot start a duplicate run. To run it on your own infrastructure, install Jentic One from its GitHub repo.

### Can I stream workflow output from the Sim API v2?

Yes. The execute operation supports a stream option, and requesting application/x-ndjson returns heartbeats and the final result. Timeouts return 200 with a failed status and TIMEOUT, so check the status field rather than the HTTP code alone.

### Can I search a Sim knowledge base from my agent?

Yes. POST `/api/v2/knowledge/search` searches one or more knowledge bases with semantic vector retrieval, optional hybrid full-text retrieval, and structured tag filters, and each result names the knowledgeBaseId it came from. Documents are added with POST `/api/v2/knowledge/{knowledgeBaseId}/documents.`
