# Tela ## Documentation ### Get started - [Welcome to Tela](https://docs.tela.com/en/welcome.md): Build AI applications in plain language, test them, and put them to work with your team or through the API - [Key concepts](https://docs.tela.com/en/key-concepts.md): What a Workspace, Project, Canvas, Workflow, Agent and App are, and which one to use for your task - [Your first Canvas](https://docs.tela.com/en/creating-your-first-canvas.md): Create a Canvas, run it on a document, save a Test Case and move it into a Project - [Your first Workflow](https://docs.tela.com/en/creating-your-first-workflow.md): Chain modules into a process, run it step by step and publish it - [Your first Agent](https://docs.tela.com/en/creating-your-first-agent.md): Create an Agent, define its purpose and inputs, test it in a conversation and publish it ### Build - [Credentials](https://docs.tela.com/en/credentials.md): Store API keys and secrets once and use them from Code Execution steps and Agents - [Publishing and environments](https://docs.tela.com/en/craft/publishing.md): Publish a version to Production or another environment, and go back to a previous one #### Canvas - [Editing prompts](https://docs.tela.com/en/craft/editing-prompts.md): How to write clear instructions that a model follows reliably - [Variables](https://docs.tela.com/en/craft/using-variables.md): Mark the parts of a Prompt that change on every run, such as the document to analyze - [Supported file formats](https://docs.tela.com/en/supported-file-formats.md): The document, image and audio formats a Variable accepts - [Output Format](https://docs.tela.com/en/craft/output-format.md): Define the structured fields a Canvas returns, from text and numbers to lists and categories - [Selecting a model](https://docs.tela.com/en/craft/selecting-models.md): Pick the model behind a Canvas and tune its temperature - [Tags](https://docs.tela.com/en/tags.md): Categorize and organize your Canvas executions with static and dynamic tags #### Workflow - [How a Workflow works](https://docs.tela.com/en/workflow/overview.md): What a Workflow is, how its page is organized and how it goes from Draft to App or API - [Inputs and references](https://docs.tela.com/en/workflow/inputs-and-references.md): Declare what a Workflow receives and pass values from Inputs and previous steps into each module - [AI Module and Classifier](https://docs.tela.com/en/workflow/ai-module-and-classifier.md): Write a prompt with a model and an Output Format per step, and classify or score data with typed questions - [Conditions and branches](https://docs.tela.com/en/workflow/conditions-and-branches.md): Route a run with Condition cases, operators and Else, end branches with Stop and join them with Connect - [Split, Crop and Map](https://docs.tela.com/en/workflow/documents-split-crop-map.md): Break documents into pages or parts, keep only some pages, and repeat steps for each item of a list - [Code Execution](https://docs.tela.com/en/workflow/code-execution.md): Transform data between steps with a small execute(input) function, with libraries and credentials - [Reusing Canvases, Agents and templates](https://docs.tela.com/en/workflow/reusing-canvases-agents-and-templates.md): Run an existing Canvas or Agent as a step and generate documents from .docx templates - [Outputs and results](https://docs.tela.com/en/workflow/outputs-and-results.md): What a Workflow run returns, what becomes reviewable, and where to read results: result pane, Debug, App, API and Test - [Running, testing and publishing](https://docs.tela.com/en/workflow/running-testing-and-publishing.md): Run a Workflow or a single step, debug runs, build Test Cases, publish versions, deploy an App, call the API and schedule runs - [Building .docx templates](https://docs.tela.com/en/how-to-build-docx-templates.md): Create Word templates with placeholders for the Document Templater module #### Agent - [Agent overview](https://docs.tela.com/en/agent/overview.md): What a Tela Agent is, how the two harnesses differ, what you find on the Agent page and how an Agent goes from idea to production - [Purpose and model](https://docs.tela.com/en/agent/purpose-and-model.md): Write the instructions your Agent follows, mention its inputs, skills, subagents and files, and choose the model and its advanced settings - [Inputs and outputs](https://docs.tela.com/en/agent/inputs-and-outputs.md): Declare the variables your Agent receives on each run and the structured result you expect back - [Skills, subagents and files](https://docs.tela.com/en/agent/skills-subagents-and-files.md): Give your Agent reusable know-how, helpers to delegate to and reference documents, and keep them through template updates - [Integrations and credentials](https://docs.tela.com/en/agent/integrations-and-credentials.md): Let your Agent call external services without ever seeing their secrets, control which credentials it may use, and attach other Tela resources as tools - [Testing an Agent](https://docs.tela.com/en/agent/testing.md): Try your Agent in a conversation, turn good runs into test cases with evaluator rules, and read the history of every run - [Publishing and versions](https://docs.tela.com/en/agent/publishing-and-versions.md): How every change becomes a version, what publishing does, how to view and restore versions, work on branches, make an Agent public and turn it into a template - [Running an Agent and getting results](https://docs.tela.com/en/agent/running-and-results.md): Use a published Agent as a Workflow step, from your own systems through the API, in tasks and on a schedule, and read the values it returns ### Test - [Test Cases overview](https://docs.tela.com/en/test-cases/overview.md): What a Test Case is, why you test, where the Test experience lives and the loop from the first run to a published version - [Creating Test Cases](https://docs.tela.com/en/test-cases/creating-test-cases.md): Every way to create a Test Case: from a run in Craft, from a reviewed Workstation task, from files, by hand, in bulk and through the API - [Running and reviewing Test Cases](https://docs.tela.com/en/test-cases/running-and-reviewing.md): Run one Test Case or the whole suite against the version you are viewing, read the statuses, review each attribute and run again - [Validation rules and metrics](https://docs.tela.com/en/test-cases/validation-rules-and-metrics.md): Expected and Wrong Answers, AI validation rules per attribute, how each run is validated automatically, and how the Accuracy Score is computed - [Comparing versions](https://docs.tela.com/en/test-cases/comparing-versions.md): Run the same Test Cases on several versions of a Canvas, read the difference, catch regressions and decide what to publish ### Operate - [Creating an App](https://docs.tela.com/en/workstation/creating-apps.md): Turn a published Canvas or Workflow into an App your team can use - [Workstation](https://docs.tela.com/en/workstation/workstation.md): Create tasks, review and approve results, and turn them into Test Cases - [Downloading results](https://docs.tela.com/en/workstation/downloading-results.md): Export approved tasks as CSV or JSON #### Schedules - [Schedules overview](https://docs.tela.com/en/schedules/overview.md): Run a published Canvas, Workflow or Agent by itself, on a recurring schedule or once - [Creating a schedule](https://docs.tela.com/en/schedules/creating-schedules.md): Fill in the New schedule form: destination, frequency, time zone, visibility and the inputs of each run - [Managing schedules and history](https://docs.tela.com/en/schedules/managing-schedules.md): Find a schedule, pause, edit or delete it, read its history and fix runs that failed ### Integrate #### Completion API - [Completion API overview](https://docs.tela.com/en/completion-api/overview.md): Run a published Canvas or Workflow from your code with POST /v2/chat/completions - [Variables and files](https://docs.tela.com/en/completion-api/variables-and-files.md): Fill the variables of a Canvas with text, file URLs, base64 content or files uploaded to Tela - [Messages](https://docs.tela.com/en/completion-api/messages.md): Send a chat history to the Canvas along with its variables - [Versions and environments](https://docs.tela.com/en/completion-api/versions-and-environments.md): Choose which version of the Canvas a request runs: Production, another environment or a pinned version - [Streaming](https://docs.tela.com/en/completion-api/streaming.md): Receive the answer of a Canvas while it is being generated - [Async and webhooks](https://docs.tela.com/en/completion-api/async-and-webhooks.md): Run a Canvas in the background, poll the result or receive it on your URL, and list past runs - [Errors and retries](https://docs.tela.com/en/completion-api/errors-and-retries.md): The status codes and error body of the Completion API, and which calls are safe to retry #### Workstation - [Creating tasks via API](https://docs.tela.com/en/creating-tasks.md): Create and fetch Workstation tasks from your own systems - [Workstation Events overview](https://docs.tela.com/en/workstation/events/overview.md): Get notified in your own systems every time a task is completed, fails or is approved - [Configuring events](https://docs.tela.com/en/workstation/events/configuration.md): Subscribe to task events through the interface or the API - [Authentication and headers](https://docs.tela.com/en/workstation/events/authentication.md): Secure your event deliveries with fixed or dynamic custom headers - [Payload reference](https://docs.tela.com/en/workstation/events/payload-reference.md): Complete event payload structure and delivery guarantees ## API Reference ### Introduction - [Introduction](https://docs.tela.com/api-reference/introduction.md): Base URL, authentication and conventions shared by every Tela API endpoint ### Completions - [Run Canvas](https://docs.tela.com/api-reference/completion/create.md): Executes a canvas - [Retrieve Canvas Run](https://docs.tela.com/api-reference/completion/get.md): Retrieve the status and details of an asynchronous chat completion using its unique identifier, enabling efficient polling and status monitoring. - [List completion runs](https://docs.tela.com/api-reference/completion-run/get-v1-completion-run.md): Returns a paginated list of completion runs in the authenticated workspace, most recently updated first (`updatedAt` desc, then `id` desc). Rows are returned with camelCase keys (unlike the snake_case webhook payload). ### Files - [Upload a File](https://docs.tela.com/api-reference/file/create.md): Upload a file to the Tela API - [Upload a File (v3)](https://docs.tela.com/api-reference/file/upload.md): Upload a file using the new v3 API endpoint ### Canvases - [List canvases](https://docs.tela.com/api-reference/canvas/get-prompt.md): Returns every canvas (prompt) the caller can access in the authenticated workspace: canvases that belong to an accessible project plus the caller's own personal drafts. - [Get a canvas](https://docs.tela.com/api-reference/canvas/get-prompt-id.md): Returns a single canvas by id. Personal drafts are only visible to their creator; any other caller receives `404` so the draft's existence is not revealed. ### Versions - [List Prompt Versions](https://docs.tela.com/api-reference/prompt-version/get.md): Returns a list of prompt versions for a specific prompt - [Create Prompt Version](https://docs.tela.com/api-reference/prompt-version/create.md): Creates a new version of a prompt - [Get Prompt Version](https://docs.tela.com/api-reference/prompt-version/get-by-id.md): Retrieves a specific prompt version by ID - [Update Prompt Version](https://docs.tela.com/api-reference/prompt-version/update.md): Updates an existing prompt version - [Delete Prompt Version](https://docs.tela.com/api-reference/prompt-version/delete.md): Deletes a specific prompt version - [Get the latest version of a canvas](https://docs.tela.com/api-reference/prompt-version/get-prompt-id-latest-version.md): Returns the most recently created, non-deleted version of the canvas together with its system message, active environments, `versionIndex` (1-based position counted from the oldest version) and `previousVersionId` (the version created immediately before it, or `null`). - [Get the promoted (production) version of a canvas](https://docs.tela.com/api-reference/prompt-version/get-prompt-id-promoted-version.md): Resolves the version that is currently live for the canvas: the version published to the system `production` environment, falling back to the most recently updated version flagged `promoted: true` for canvases that predate environments. - [List version history of a canvas](https://docs.tela.com/api-reference/prompt-version/get-prompt-version-history.md): Returns a paginated, lightweight list of a canvas's versions ordered from newest to oldest. Items carry lifecycle metadata (`draft`, `promoted`, `originVersionId`, environments, `versionIndex`) but not the prompt content or configuration; fetch `GET /prompt-version/{id}` for the full version. - [Get the version index map of a canvas](https://docs.tela.com/api-reference/prompt-version/get-prompt-version-index-map.md): Returns every non-deleted version id of the canvas with its 1-based `versionIndex` (1 is the oldest) and the id of the version created immediately before it. ### Version messages - [List messages of a prompt version](https://docs.tela.com/api-reference/prompt-version-message/get-prompt-version-message.md): Returns the non-deleted messages attached to a prompt version, ordered by `index`. A version normally holds a single `system` message that carries the prompt content; the same object is exposed as `message` on the version resources. - [Create a prompt version message](https://docs.tela.com/api-reference/prompt-version-message/post-prompt-version-message.md): Attaches a message to a prompt version. This is the supported way to write prompt content to an existing version: create the version with `POST /prompt-version` (optionally passing a single `message`), then manage its content here. - [Get a prompt version message](https://docs.tela.com/api-reference/prompt-version-message/get-prompt-version-message-id.md): Returns a single message by id. - [Update a prompt version message](https://docs.tela.com/api-reference/prompt-version-message/patch-prompt-version-message-id.md): Partially updates a message. All fields are optional; only the supplied ones change. Fails when the parent version is promoted or published to an environment (currently surfaced as `500`). - [Delete a prompt version message](https://docs.tela.com/api-reference/prompt-version-message/delete-prompt-version-message-id.md): Permanently deletes a message. Fails when the parent version is promoted or published to an environment (currently surfaced as `500`). ### Environments - [List environments](https://docs.tela.com/api-reference/environment/get-environment.md): Returns every environment of a canvas (prompt), ordered with `production` first and the remaining environments alphabetically. - [Create environment](https://docs.tela.com/api-reference/environment/post-environment.md): Creates a custom environment for a canvas. The name is trimmed and must satisfy the environment name rules: lowercase letters, digits and single hyphens, at most 64 characters, not a reserved name (`production`, `promoted`, `latest`, `draft`) and not a UUID. - [List environment publication history](https://docs.tela.com/api-reference/environment/get-environment-versions.md): Returns the publication history of one environment, newest publication first. Every time a version is published to the environment a new publication record is created and the previous one is marked unpublished, so the item with `isActive: true` (and `unpublishedAt: null`) is the version currently se… - [Get the version published to an environment](https://docs.tela.com/api-reference/environment/get-environment-version.md): Resolves the prompt version currently served by an environment and returns it in full, including its messages, variables and configuration. - [Publish a version to an environment](https://docs.tela.com/api-reference/environment/post-environment-publish-by-name.md): Publishes a prompt version to the environment identified by `envName` and returns the updated environment together with the published version. - [Delete environment](https://docs.tela.com/api-reference/environment/delete-environment-id.md): Soft-deletes a custom environment and marks its active publication as unpublished. The environment name becomes available again for re-creation. ### Test cases - [Retrieve Test Cases](https://docs.tela.com/api-reference/test-case/get.md): Get test cases for a prompt - [Create Test Cases](https://docs.tela.com/api-reference/test-case/create.md): Create one or more test cases - [Get Test Case by ID](https://docs.tela.com/api-reference/test-case/get-by-id.md): Retrieve a specific test case - [Update Test Case](https://docs.tela.com/api-reference/test-case/update.md): Update an existing test case - [Delete Test Case](https://docs.tela.com/api-reference/test-case/delete.md): Remove a test case - [Run a test case](https://docs.tela.com/api-reference/test-case/post-test-case-id-run.md): Executes one test case against a prompt version. A generation is created in `initializing` status before the background job starts, so the returned `generationId` can be polled or aborted immediately. - [Run many test cases](https://docs.tela.com/api-reference/test-case/post-test-case-run-all.md): Executes a batch of test cases against a prompt version. Selection precedence: explicit `testCaseIds`, else the canvas's test cases matching `filters`, else every test case of the canvas. - [Abort a running test case](https://docs.tela.com/api-reference/test-case/post-test-case-id-abort.md): Marks every non-terminal generation of the test case as `aborted` and cancels its queued or executing background jobs. ### Test case tags - [Add tags to many test cases](https://docs.tela.com/api-reference/test-case-tag/post-test-case-bulk-add-tags.md): Assigns every tag in `tagIds` to every test case in `testCaseIds`. Existing assignments are skipped, so the call is idempotent. - [Remove tags from many test cases](https://docs.tela.com/api-reference/test-case-tag/post-test-case-bulk-remove-tags.md): Removes every tag in `tagIds` from every test case in `testCaseIds`. Missing assignments are ignored. - [List tags of a test case](https://docs.tela.com/api-reference/test-case-tag/get-test-case-id-tags.md): Returns the tags currently assigned to the test case. - [Assign tags to a test case](https://docs.tela.com/api-reference/test-case-tag/post-test-case-id-tags.md): Assigns the given tags to the test case. Tags must belong to the same canvas as the test case. Responds with an empty body. - [Remove a tag from a test case](https://docs.tela.com/api-reference/test-case-tag/delete-test-case-id-tags-tagid.md): Removes a single tag assignment from the test case. - [List test case tags of a canvas](https://docs.tela.com/api-reference/test-case-tag/get-test-case-tags.md): Returns every non-deleted tag defined for the canvas. - [Create a test case tag](https://docs.tela.com/api-reference/test-case-tag/post-test-case-tags.md): Creates a tag scoped to a canvas. Tags are later assigned to test cases of that canvas. - [Update a test case tag](https://docs.tela.com/api-reference/test-case-tag/patch-test-case-tags-id.md): Partially updates a tag’s `name`, `color` or `promptId`. All fields are optional. - [Delete a test case tag](https://docs.tela.com/api-reference/test-case-tag/delete-test-case-tags-id.md): Soft-deletes the tag. It disappears from listings and from the test cases it was assigned to. ### Tasks - [Query Tasks](https://docs.tela.com/api-reference/task/query.md): Query and filter tasks from a Workstation/App using advanced filters on metadata and extracted data - [List tasks](https://docs.tela.com/api-reference/task/get-task.md): Returns a paginated list of tasks in the authenticated workspace. Soft-deleted tasks are never returned. - [Create tasks](https://docs.tela.com/api-reference/task/post-task.md): Creates one or more tasks. The body may be a single task object, an array of up to 100 task objects (all must share the same `promptApplicationId`), or an agent batch object (`sourceType: "agent"`). - [Get a task](https://docs.tela.com/api-reference/task/get-task-id.md): Returns a single task by ID. Soft-deleted tasks return 404. For Workstation/App tasks the caller must have access to the app. - [Update a task](https://docs.tela.com/api-reference/task/patch-task-id.md): Updates a task’s name, tags, output, or approves it. - [Delete a task](https://docs.tela.com/api-reference/task/delete-task-id.md): Soft-deletes a task (sets `deletedAt`). Deleted tasks disappear from all list and query endpoints. Requires the `member` role or higher; workspace-level API keys satisfy this. - [Create a task export job](https://docs.tela.com/api-reference/task/post-task-export-job.md): Starts an asynchronous export of a Workstation/App's tasks to CSV (default) or JSON. The job snapshots the current time: only tasks created at or before job creation are included. - [Get an export job](https://docs.tela.com/api-reference/task/get-task-export-job-id.md): Returns the current state of an export job. Only the identity that created the job can read it; other callers get 404. - [Get an export download URL](https://docs.tela.com/api-reference/task/get-task-export-job-id-download.md): Returns a signed download URL for a completed export job. The URL is valid for `expiresIn` seconds (3600) and serves the file as `tela-tasks-export-{jobId}.{csv|json|zip}` (`zip` when the CSV export was generated in `separate` mode). ### Workstation Events - [Create webhook subscription](https://docs.tela.com/api-reference/webhook/post-prompt-application-id-webhooks.md): Creates a webhook subscription on a Workstation application. Whenever one of the subscribed `events` happens on a task of that application, Tela sends an HTTP request to `url` with the event payload as JSON body. - [List webhook subscriptions](https://docs.tela.com/api-reference/webhook/get-prompt-application-id-webhooks.md): Returns the webhook subscriptions of an application, newest first, with pagination metadata. - [List webhook deliveries of an application](https://docs.tela.com/api-reference/webhook/get-prompt-application-id-webhook-deliveries.md): Returns delivery attempts across all webhooks of an application, newest first. Each delivery records the target URL, the response status and body returned by your endpoint, and the resulting status. - [Get webhook subscription](https://docs.tela.com/api-reference/webhook/get-webhook-webhookid.md): Returns a single webhook subscription. Deleted webhooks return `404`. - [Update webhook subscription](https://docs.tela.com/api-reference/webhook/patch-webhook-webhookid.md): Partially updates a webhook subscription. Only the fields present in the body are changed; `headers` and `events` replace the stored value entirely rather than merging. - [Delete webhook subscription](https://docs.tela.com/api-reference/webhook/delete-webhook-webhookid.md): Soft-deletes the subscription and deactivates it. Existing delivery records are kept. - [Send a test event to a webhook](https://docs.tela.com/api-reference/webhook/post-webhook-webhookid-test.md): Sends a synthetic event payload for `eventType` to the webhook's URL using its configured method and headers, and returns what your endpoint answered. - [Send a test event to an arbitrary URL](https://docs.tela.com/api-reference/webhook/post-webhook-test-url.md): Sends a synthetic `task.completed` event payload to `url` with `POST`, `Content-Type: application/json` and the given `headers`, without creating a subscription. - [List deliveries of a webhook](https://docs.tela.com/api-reference/webhook/get-webhook-webhookid-deliveries.md): Returns the delivery attempts of one webhook subscription, newest first. - [Resend a webhook delivery](https://docs.tela.com/api-reference/webhook/post-webhook-delivery-deliveryid-resend.md): Re-enqueues a past delivery. Tela rebuilds the payload from the task's current state (not the payload originally sent) and dispatches it asynchronously through the delivery worker, so the `200` response only confirms the resend was queued. ### Workflow runs - [List workflow runs](https://docs.tela.com/api-reference/workflow-run/get-workflow-runs.md): Lists workflow runs of a canvas in the authenticated workspace, newest first (`createdAt`). Filter by version, status or the environment the run was started from. - [Get a workflow run](https://docs.tela.com/api-reference/workflow-run/get-workflow-runs-id.md): Returns a single workflow run with its per-step execution results and the executed `graph`, whose nodes are enriched with status, output and error. - [Cancel a workflow run](https://docs.tela.com/api-reference/workflow-run/post-workflow-runs-id-cancel.md): Requests cancellation of a run. Any queued or executing background jobs for the run are cancelled and the run is marked `cancelled`. ## OpenAPI Specs - [openapi](/api-reference/openapi.yml) > The links below point to documentation indexes. Follow each `/_llms/` index recursively until you reach documentation pages. ## Indexes - [Brazilian Portuguese (121 pages)](https://docs.tela.com/_llms/pt-br.txt): Documentação, Referência de API. This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.