***
title: Introduction
description: >-
Inject intelligence where it matters - Rightbrain lets you wire AI into your
tech stack, making your existing platforms smarter.
---------------------------------------------------
Rightbrain isn't another agent or automation platform, **just intelligence exactly where your team and customers need it**, making your existing platforms and workflows smarter.
This is achieved through Tasks, custom AI functions that can be triggered from anywhere in your stack - through an API, webhook, scheduled job, or user action.
Tasks are LLMs with set instructions to process incoming data and respond in a pre-defined output format, perfectly designed for surfacing in an app's user interface, storing in your database or initiating another step in a wider workflow.
#### Core components of Tasks:
| Property | Description |
| -------------- | -------------------------------------------------------------------- |
| **Stateless** | Self-contained with no dependencies between runs and no drift |
| **Triggered** | Activated by events - API calls, workflows, or user actions |
| **Consistent** | Pre-defined instructions and output format for maximum compatibility |
| **Composable** | Can be chained, reused, or embedded into any process |
By wiring Tasks into existing systems, teams can safely add AI to any workflow **without having to build or maintain an AI platform**.
### Example Tasks
* **Content Moderator** – Review user-generated content for compliance
* **Invoice Processor** – Extract line items, totals, and vendor details
* **Data Classifier** – Categorise and route support tickets or feedback
* **Image Generator** – Create branded visuals from text prompts
* **Competitor Analyser** – Research and summarise a company’s top competitors
### Where It Fits
Rightbrain Tasks can be called through **REST API** or **MCP** - the flow is identical in each case.
They connect business rules with AI, making your existing tools smarter, faster, and more adaptive.
[Learn how Rightbrain works →](/docs/getting-started/how-it-works)
***
## How Teams Use Rightbrain
* Build AI-powered features using natural language
* Enrich existing products without extra infra
* Test, tune, and launch features fast in the dashboard
* Deploy safely with version control and rollback
* Monitor performance and costs as they happen
* Enable teams and remove bottlenecks with custom AI tooling
* Role-based permissions for every team
* Track usage, costs, and performance in real time
* Roll out new AI tools safely with A/B testing
* Monitor and audit AI responses
* Embed AI into any app with a single API call
* Built-in OAuth 2.0 for secure access
* Handle text, images, files, urls and web searches as dynamic inputs
* Get predictable JSON, text, document, image or audio outputs
* Monitor, debug, and ship with full observability
## For AI Agents & Assistants
Using Cursor, Claude, or other AI coding assistants? We provide **machine-readable documentation endpoints** optimised for AI agents.
Drop our docs into any LLM to give it instant context on Rightbrain's capabilities and APIs.
## Build with Rightbrain
Build your first Task in our no-code dash
Everything devs need to get started
***
**Ready to ship AI that actually works?**
Start your 7-day free trial and join over 1,000 teams already building with Rightbrain.
[Start Free Trial →](https://app.rightbrain.ai)
***
title: Why Rightbrain?
description: Most AI projects fail before they reach production. Rightbrain changes that.
-----------------------------------------------------------------------------------------
## The Problem: Most AI never makes it to production
95% of AI proof-of-concepts fail before deployment.\
Not because the models don’t work - but because everything around them does.
Teams spend months building scaffolding: APIs, infrastructure, observability, compliance, rollback logic.
By the time it’s ready, the opportunity has passed.
**8 months** is the average time it takes for a team to move from prototype to production. Most never make it.
***
## The Real Bottleneck: Infrastructure, Not Intelligence
Prototypes are easy. Production is hard.
### 1. The Infrastructure Trap
“Week 1: We built a ChatGPT wrapper!”\
“Week 4: We need error handling.”\
“Week 8: Where are the logs?”\
“Week 16: The compliance team has questions.”\
“Week 32: Let’s start again - properly this time.”
Teams build everything from scratch, only to realise they needed versioning, audit trails, and rollbacks from day one.
### 2. The Integration Maze
AI features end up scattered across different systems - Python scripts, Lambda functions, third-party tools - with no shared monitoring, no consistent schema, and no control.
### 3. The Scaling Wall
The proof-of-concept works on one input. In production, it breaks under real data, real users, and real expectations.
***
## The Rightbrain Approach: From Prompt to Production
Rightbrain replaces custom infrastructure with a **Task-based architecture** - small, modular AI units that can be deployed anywhere, securely, and at scale.
| The Old Way (Monolithic AI) | The Rightbrain Way (Task-Based) |
| ---------------------------------- | --------------------------------------------- |
| Models buried in custom code | Modular **Tasks** you can call via API |
| No version control or rollback | **Versioned and auditable** by default |
| Inconsistent results | **Structured, predictable outputs** every run |
| Hard to test and debug | **Observable and testable** units |
| Works in demo, fails in production | **Built for reliability at scale** |
Rightbrain turns AI from an experiment into an operational system.
***
## Proof in Action: PAL.health
**Goal**\
Launch a production-ready AI health coach app - without any AI infrastructure.
**Solution**
Rightbrain Tasks power every AI feature in their platform.
**Results**
* 15 production Tasks deployed in weeks
* 200+ optimisations per Task
* Feature ideas created by the founder and the underlying Task API's handed off to the mobile developers
> I can switch models, fix issues, and ship updates daily without waiting on engineers. Without Rightbrain, this simply wouldn’t be possible.
* Chris Davison, Founder & CEO, [PAL.](https://pal.health)
***
## Why It Matters
Companies that win with AI aren’t the ones with the biggest models.\
They’re the ones that **ship fast, iterate safely, and scale predictably**.
Rightbrain gives you the foundation to do exactly that -\
from **natural language idea → production-ready AI feature** in a fraction of the time.
***
## Is Rightbrain Right for You?
| Perfect Fit | Consider Alternatives |
| ------------------------------------------------ | -------------------------------------------- |
| You need production AI inside existing products | You’re only exploring basic prototypes |
| You want fast iteration without building infra | You prefer full in-house platform teams |
| You need governance and compliance from day one | You’re experimenting with single-use scripts |
| You want predictable costs and model flexibility | You don’t plan to scale AI features |
***
Build your first Task in our no-code dashboard
Learn the architecture behind Rightbrain Tasks
***
## title: How Rightbrain Works
Rightbrain provides composable AI capabilities that integrate directly into your applications. No complex infrastructure. No orchestration layers. Just production-grade AI that works.
## The Integration Pattern
Every Task follows the same four-step flow, whether you're calling it via REST API, MCP, or agent protocols:
An event fires in your system - a user action, API call, or webhook that needs AI processing.
Data from the trigger event is sent to the Rightbrain Task. This can be text, structured data, files, or images.
The Task executes its defined AI logic: your chosen model, prompt, and schema, with the right context provided at runtime.
Validated, structured output is returned to your application - ready to store, display, or feed into other Tasks.
This pattern is consistent across all integration methods, making it simple to build once and deploy anywhere.
## Integration Methods
**Call Tasks like any REST API**
Send a request with your input data, get structured output back. OAuth 2.0 authenticated, production-ready.
**Perfect for:**
* Server-side applications
* Batch processing
* Synchronous workflows
**Make Tasks available to AI assistants**
Tasks can be exposed via Model Context Protocol, making them discoverable and usable by any MCP-compatible AI client.
**Perfect for:**
* AI agent workflows
* Claude, Cursor and other MCP clients
* Cross-platform AI tool distribution
**Receive results asynchronously**
Configure Task Forwarders to send results to your endpoints when processing completes.
**Perfect for:**
* Long-running tasks
* Event-driven architectures
* Queue-based processing
## Governance Built In
🧭 **Observability** - Every execution logged with inputs, outputs, timing, and costs
🔐 **Access Control** - OAuth 2.0 authentication with role-based permissions
🌿 **Versioning** - Revisions enabling A/B testing and weighted traffic
🛡️ **Compliance** - Audit trails, data residency, and enterprise-grade security
## TL;DR
Rightbrain removes all the complexity between your application and AI capabilities:
* No infrastructure to manage
* No models to host
* No prompt versioning to build
* No monitoring to implement
* No governance to figure out
**You focus on functionality. We handle everything else.**
***
Build your first Task in our no-code dash
Example use cases to inspire your own
***
title: Create Your First Task
description: Build and deploy a production-ready AI tool in 5 minutes
---------------------------------------------------------------------
Let's build your first Rightbrain Task. In this quickstart, we'll draft a prompt, structure your outputs and choose an appropriate model for the job.
**What You'll Build**: A Task that analyses customer reviews, extracts sentiment, and validates product images - all in one API call.
## Understanding Task Components
Before we start, let’s understand the four core components of every Task:
💬 **Instructions** - Craft clear prompts that tell the model exactly what to do and how to behave.
**🧩 Dynamic Inputs** - Use placeholders, such as `{customer_review}`, to insert real input data at runtime
📊 **Structured Outputs** - Define your expected fields and schema to ensure consistent, predictable responses.
🧠 **Model Selection** - Choose the model that best balances speed, cost, and capability for your use case.
## Step 1: Set Your Prompts
First, we'll compose the Task instructions using the user prompt. For this demo, we're building a sentiment analysis Task that can also verify product images.
The user prompt tells the AI what to do with the input data. Use clear, specific instructions for best results.
### User Prompt
Navigate to the user prompt field and enter:
```
Please conduct a comprehensive sentiment analysis on the {customer_review} and describe the product image (if one is included). Verify that the image matches the product described in the review.
```
Notice the `{customer_review}` variable - this is a dynamic placeholder that gets replaced with actual data when the Task runs. The Task is also designed to handle optional image inputs.
### System Prompt (Optional)
You can add a system prompt to define the AI's role and behavior:
```
You are an expert product review analyst specializing in e-commerce sentiment analysis and visual verification.
```
## Step 2: Configure Inputs and Outputs
Now we'll define what data goes in and what structure comes out.
### Define Input Variables
Your Task can accept:
* **Text strings** – simple text inputs like support tickets, reviews or any text data feed.
* **Images** – visual inputs such as product photos, receipts, or screenshots for multimodal analysis and verification.
* **Documents** – commonly Word, PDF, PPT or CSV files for data extraction, summarisation or classification.
* **URLs** – web addresses that the Task can fetch and analyse for content, metadata or linked resources.
* **Web Search **- a live search via Perplexity that returns up to the top 20 results for further analysis.
For our Task, the `{customer_review}` variable is automatically detected from your prompt. You can add additional inputs if needed.
### Specify Output Structure
Define exactly what data structure you want back. This ensures every Task execution returns consistent, parseable results.
Add these outputs to your Task manually or by pasting the JSON schema:
Whether the review is positive, negative, or neutral
A description of the product image. Returns "N/A" if no image provided
Whether the image matches the product described in the review
```json
{
"sentiment": {
"type": "str",
"description": "Whether the review is positive, negative, or neutral"
},
"image_description": {
"type": "str",
"description": "A description of the product image. Returns \"N/A\" if no image provided"
},
"image_match": {
"type": "str",
"description": "Whether the image matches the product described in the review"
}
}
```
**Pro tip**: Always provide clear descriptions for your outputs. This helps the model understand exactly what you expect and improves accuracy.
## Step 3: Choose Model and Configure Settings
### Select Your Model
Different models excel at different tasks. For our sentiment analysis with image verification, we need a vision-capable model:
**Claude Sonnet 4.5** 🖼️
* Excellent for combined text and image analysis
* Cost-effective for production use
* Fast response times
Other vision-capable models are available through the model selection interface, including: `Gemini 2.5 Pro`, `GPT 5`, `Gemini 2.5 Flash`, `GPT 5 Mini`, `Claude Haiku 4.5`, `Llama 4 Maverick`
### Configure Task Settings
Set to `0.3` for consistent, focused analysis.\
Lower values (0.1–0.3) produce more deterministic outputs, ideal for classification tasks.
You can specify a fallback model in the Task settings. If your primary model fails four consecutive times, the Task will automatically route subsequent runs to the designated fallback model.
**Congratulations!** You've created your first Task. It's now available via the API endpoint under the Integrate tab.
## What's Next?
Run and test your Task
Integrate via REST API
***
title: Running Your Task
description: Test and execute your Tasks through the Rightbrain dashboard
-------------------------------------------------------------------------
Once you've created a Task, it's time to test and run it. This guide covers how to execute your Task through the Rightbrain dashboard.
## Accessing the Run Task View
Navigate to the **Run Task** view to test your Task execution. You can access this directly from your dash homepage or right after creating a task.
**Task run view**
Let's run through what you can expect to see in this view:
**Configuration & Inputs**
* LLM model selection - primary and fallback
* Input fields for your variables
* Image upload for vision tasks
* User & system prompts
* Output format schema
**Results & History**
* Run history logs
* Usage & performance statistics
* Output results display
* Token and credit tracking
## Understanding Input Variables
Tasks are designed to run on dynamic input variables (e.g., `{customer_review}`). The platform automatically detects these variables from your prompts and creates corresponding input fields.
**Plain Text Variables**
* Direct text entry for string variables
* Support for long-form content
* Special characters and emojis supported
* No size limit for testing
**Example variables**: `{customer_review}`, `{product_description}`, `{user_query}`
**Images**
* JPEG, PNG formats
* Enable with `image_required: true`
* Automatic image optimisation available
* Multiple images per task supported
**Documents**
* PDF, DOCX, TXT, CSV, XLSX
* Content automatically extracted
* Requires a corresponding filename
**Web Content**
* Complete URLs with `https://`
* Content fetched automatically
* Must be publicly accessible
* Handles HTML, JSON, and plain text
* Optional fallback text if the url fetch fails
**Example variables**: `{webpage_url}`, `{api_endpoint}`, `{article_link}`
**Search Results:**
* Conducts a Perplexity web search for your variable
* Can be configured to return the top to 5-20 results
* Augmented with additional text such as 'Top competitors for `{variable}`' which runs a search for full search term as opposed to just the variable
* Search results can be used for further analysis
**Example searches and variables**: 'top competitors for `{company}`', latest news related to `{topic}`', 'weekly investments in `{industry}`'
**Multiple Input Types**: Tasks can combine different input types. For example, a task might compare text to images, summarise documents with web content, or analyse URLs alongside uploaded files.
## Providing Test Data
### Text Input Example
For our sentiment analysis task let's provide a value for the input variable `{customer_review}`:
```plaintext
My toaster exploded during breakfast, sending flaming bread across the kitchen! 😱 On the bright side, I've discovered a new way to heat up the whole house.But seriously folks, this isn't just a hot topic – it's a fire hazard!The warranty card didn't mention anything about impromptu fireworks displays. 🎆
```
We simply hit **Run Task** and we'll get a response:
Now let's try adding an accompanying image:
## Executing the Task
### Running Your Test
**Quick Execute**: Press `⌘↩` on Mac or `Ctrl+Enter` on Windows to run your task instantly
Ensure all required inputs are provided
Click **Run Task** button
Processing indicator appears on the right panel
Results will display when model completes the task
### Understanding the Response
**User-Friendly Display**
A formatted presentation of your outputs:
* Each field labeled clearly
* Values displayed with proper formatting
* Nested objects expanded
* Lists shown as bullet points
* Booleans as checkmarks/crosses
Best for quick validation and review.
**Complete Response Data**
```json
{
"task_id": "0195d1ff-1f05-437a-95ac",
"task_revision_id": "0195d1ff-1f42-f14e",
"response": {
// Your structured output
},
"metadata": {
"tokens": 2181,
"credits": "9.00",
"timing": 4.77
}
}
```
Best for debugging and integration planning.
**Execution Details**
* Task IDs: Unique identifiers
* Token Usage: Input/output/total
* Processing Time: In seconds
* Credits Charged: Cost of execution
* Model Used: Which LLM processed
* Revision: Version that ran
## Iterating on Your Task
### Quick Iteration Workflow
Edit prompts directly in the task editor. Each change creates a new revision automatically.
Run tests immediately without deployment. Results appear in seconds.
Use Compare Mode to see results side-by-side across different revisions.
## Next Steps
Learn to interpret execution outputs in detail
Connect tasks to your applications
***
title: Understanding Task Results
description: >-
Learn how to interpret Task outputs, analyze execution data, and understand
performance metrics from your AI tools
--------------------------------------
Learn how to interpret Task outputs, analyse execution data, and understand performance metrics.
## Response Structure
### Complete Response Format
After running a task, you receive a comprehensive response containing:
```json
{
"task_id": "0195d1ff-1f05-437a-95ac-6de8969cb47b",
"task_revision_id": "0195d1ff-1f42-f14e-8b65-641baf9dc32e",
"response": {
"sentiment": "negative",
"image_match": true,
"image_description": "The image shows a severely damaged toaster..."
},
"run_data": {
"submitted": {
"customer_review": "My toaster exploded during breakfast..."
},
"files": [
"be8d9e69-9f2a-4bfd-bbf4-559d6b4eb5d0.jpeg"
]
},
"id": "0195d207-32bb-d03d-cfdc-f4516e9222c8",
"created": "2025-03-26T10:37:15.687874Z",
"input_tokens": 2051,
"output_tokens": 130,
"total_tokens": 2181,
"input_processor_timing": 0.0001468900591135025,
"llm_call_timing": 4.773190421052277,
"charged_credits": "9.00"
}
```
### Key Response Components
Your model output is contained in the `response` field, while the rest of the task response contains other useful information including performance metrics and metadata.
Unique identifier of the Task definition
Specific revision that processed this run
Unique identifier for this specific execution
Contains the structured output matching your defined `output_format`
The exact input parameters provided
Array of file IDs if images or documents were uploaded
Number of tokens in the prompt sent to the model
Number of tokens in the model's response
Combined token count for billing
Time spent processing inputs (seconds)
Time spent on the actual LLM call (seconds)
Total credits consumed for this execution
ISO timestamp of when the task was executed
Additional fields may include error details if execution failed
## Performance Metrics
### Token Usage Analysis
Understanding token consumption in your results:
| **Input Token Components →** | **← Output Token Components** |
| --------------------------------- | ----------------------------------- |
| • User and system prompt length | • Complexity of output structure |
| • Input variable content size | • Verbosity of model responses |
| • Injected context (if using RAG) | • Number of fields in output format |
* Consistent token usage across similar inputs.
* Unexpected spikes in token consumption.
* Patterns that indicate optimisation opportunities.
### Timing Breakdown
Each execution provides timing metrics:
**Input Processing Time** (`input_processor_timing`)
* URL fetching duration
* Document extraction time
* Image preprocessing
* RAG context retrieval
**LLM Call Time** (`llm_call_timing`)
* Model inference duration
* Varies by model and input size
* Primary component of total latency
**Total Response Time**
* Sum of all processing stages
* Includes network latency
* Helps identify performance bottlenecks
## Cost Tracking
Each execution shows credits consumed (`charged_credits`):
**🧮 Cost Factors**
* Model selection - higher-end models consume more credits per token
* Token count - both input and output tokens contribute to cost
**⚙️ Optimisation**
* Compare model performance vs. credit consumption
* Simplify prompts to minimise unnecessary tokens
* Reduce output verbosity where possible
## Next Steps
Connect tasks to your applications via REST API
Use our TypeScript SDK for easy integration
***
title: Authentication
description: >-
Authenticate with API Keys or OAuth 2.0. Learn when to use each, and how to
create credentials in the Rightbrain dashboard.
-----------------------------------------------
Rightbrain supports two authentication methods - **API Keys** and **OAuth 2.0 Clients**.
You can create and manage both under [**Settings → API Clients**](https://app.rightbrain.ai/preferences?tab=api-clients)
## Which Method to Use
| Method | Best For | Authentication Type | Typical Usage |
| ----------------------------------------- | -------------------------------------------------- | --------------------------------- | ------------------------------------- |
| **API Keys** | Server-to-server automation, internal tools, CI/CD | Long-lived static key | Quick backend integrations or testing |
| **OAuth 2.0 (Client Credentials)** | Service-to-service or multi-tenant systems | Short-lived access tokens | Secure access between services |
| **OAuth 2.0 (Authorization Code / PKCE)** | User-facing or client apps | User consent and delegated access | Frontend apps, SaaS integrations |
## Creating an API Key
Use **API Keys** for simple, persistent authentication in server environments.
### 1. Open Settings → API Clients
Visit your [Rightbrain Dashboard](https://app.rightbrain.ai/preferences?tab=api-clients) and open the **API Clients** tab.
### 2. Click “Create API Key”
Click **+ Create API Key** and enter a descriptive name.
### 3. Copy your key
Once created, copy and store your key securely.
### 4. Use it in requests
```bash
curl -X POST https://app.rightbrain.ai/v1/org/{org_id}/project/{project_id}/task/{task_id}/run \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"task_input": {"data": "Example input"}}'
```
Never expose API Keys in browser or client-side code.\
For user-facing apps, always use OAuth 2.0.
## Creating an OAuth 2.0 Client
OAuth 2.0 is recommended when you need short-lived, revocable tokens, ideal for distributed systems or multi-user applications.
### 1. Open Settings → API Clients
In your [Dashboard](https://app.rightbrain.ai/preferences?tab=api-clients), click **+ Create OAuth Client**.
### 2. Choose a grant type
* **Client Credentials** for server-to-server integrations
* **Authorization Code or PKCE** for user login or delegated access
### 3. Save and copy credentials
After saving, copy your **Client ID** and **Client Secret** - they’ll only appear once.
### 4. Request an access token
```bash
curl -X POST https://oauth.rightbrain.ai/oauth2/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET" \
-d "scope=offline_access"
```
Response:
```json
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "offline_access"
}
```
OAuth tokens are short-lived by design. Refresh or regenerate them periodically depending on your integration.
## Quick Reference
| Use Case | Recommended Authentication |
| ------------------------------ | ------------------------------------- |
| Internal automation or scripts | API Key |
| Backend microservices | OAuth 2.0 (Client Credentials) |
| User login or delegated access | OAuth 2.0 (Authorization Code / PKCE) |
| Local testing and prototyping | API Key |
Deploy and call Tasks via REST API
Use the TypeScript SDK for type-safe access
***
title: Creating Tasks via Dashboard
description: Build and deploy Tasks using Rightbrain's no-code interface
------------------------------------------------------------------------
Learn how to create, configure, and deploy Tasks using the Rightbrain dashboard. This guide walks you through the visual interface designed for non-technical users to build AI-powered tasks without writing code.
**No coding required. **The Rightbrain dashboard provides an intuitive interface for creating Tasks with AI assistance at every step.
## Overview of the Task Creation Process
Creating a task involves three quick steps:
### 1. Prompts
Define what your task should do using natural language instructions. Use clear, direct language so the AI understands the task’s goal and context.
### 2. Inputs / Outputs
Configure input variables and output formatting for your Task. This ensures your data flows in and out of the model consistently and predictably.
### 3. Config
Name your Task, add a short description, and set model parameters such as temperature and fallback models.
## Step 1: Define Your Prompts
Navigate to **Create Task** and start in the **Prompts** tab.
### User Prompt
The user prompt is where you tell the AI what to do with the input data.
Start with a simple, focused task description
* Start with a basic instruction like: `"Please conduct sentiment analysis on the {customer_review}"`
* Variables are automatically detected when you use `{brackets}`
The **Rightbrain Assistant** can enhance your prompt automatically:
* Click when the assistant appears
* Review the improved version
* Choose to "Insert Prompt" or customise further
### System Prompt (Auto-generated)
The Rightbrain Assistant automatically creates an appropriate system prompt that:
* Defines the AI's role and expertise
* Sets additional context for the task
* Ensures consistent behaviour
The system prompt is generated behind the scenes. You can view and edit it by expanding the "System Prompt" section if needed.
## Step 2: Configure Input/Output (I/O Tab)
Next up is the **I/O** tab to define your task's data structure.
### Input Configuration
Your input variables are automatically detected from the prompt:
Variables from your prompt appear here automatically
For `{customer_review}`:
* **Name**: customer\_review
* **Type**: String (default)
* Click the **pencil icon** to edit variable settings
#### Input Format Options
Click the pencil icon next to any input variable to configure its format:
**📝 String (default)**
* Text provided directly when running the task
* Use for: reviews, descriptions, questions
**🌐 Web Crawl**
* Automatically fetches content from a web page URL
* Use for: website analysis, content extraction
**📄 PDFs, PPT and CSVs**
* Extracts content from uploaded file(s)
* Use for: document analysis, invoice processing
**🔎 Perplexity Search**
* Performs a live web search and retrieves a set number of top results
* Use for: research tasks, knowledge retrieval, context expansion
To use URL, document or Perplexity search processing, edit your input variable and select the appropriate format option. The system will automatically handle content extraction when the task runs.
### Image Handling
Images work differently from other inputs - they don't require prompt variables:
**To accept images in your task:**
1. Don't add a variable like `{image}` to your prompt
2. Instead, navigate to the **Images** section in the Input tab
3. Toggle **"Required images"** if images are required for the Task
4. Optionally enable **"Auto convert images"** for optimisation
**Example prompt for image tasks:**
```plaintext
Analyse this product image and provide quality assessment
```
Note: No `{image}` variable needed - the image is automatically included
### Output Configuration
Define what information the task should return:
**Important**: Choose your output modality FIRST before adding any properties. This determines whether your task generates text, images, or audio.
* 📝 **Text Output**
* Default structured data format
* Returns formatted text with defined properties
* Use for: analysis, classification, extraction, and summarisation
* 🖼️ **Image Output**
* AI-generated visuals created from prompts
* Produces image files directly in your results
* Use for: visualisations, designs, artwork, product photos
* 🎧 **Audio Output**
* AI-generated audio or speech files
* Converts model output into spoken responses or sounds
* Use for: voice assistants, accessibility, sound generation
#### For Text Outputs - Define Properties
When using Text output mode, you can define structured data:
Click **"Add Property"** to manually define outputs:
1. Enter a property name (e.g., "sentiment")
2. Add a description
3. Select the type (String, Number, Boolean, etc.)
4. Indicate whether the property is an Array
5. For options, add the allowed values using **"Add Enum"**
**Schema vs Visual Views:**
* Schema: Shows the technical structure
* Visual: Displays a user-friendly preview
Click **"Generate Output"** to have the assistant create the structure:
1. The assistant analyses your prompt
2. Suggests relevant output fields
3. You can accept all or individual fields
4. Customise the suggested format as needed
**For Image and Audio outputs**: No additional properties are needed. The task will generate the appropriate file type based on your prompts and inputs.
### Output Types Guide
For **Text output mode**, choose the appropriate type for each field:
### Output Types Guide
For **Text output mode**, choose the appropriate type for each field:
| **Type** | **Description** | **Examples** |
| --------------- | ------------------------------------------------- | ------------------------------------------------------------- |
| **String/Text** | Text fields for freeform responses | Summaries; classifications; extracted text |
| **Enum** | String with fixed choice options | positive/negative/neutral; low/medium/high; approved/rejected |
| **Boolean** | True/False values for binary decisions | is\_valid; requires\_review; matches\_criteria |
| **Number** | Decimal values for numeric data (supports floats) | Scores (0–100.0); percentages; prices |
| **Integer** | Whole numbers only | counts; quantities; rank positions |
## Step 3: Configure Settings
Click the **Settings** tab to finalise your task configuration.
### Task Information
A descriptive name for your task
Auto-generated example: "Sentiment Analyser"
Requirements: Letters, numbers, spaces, and hyphens only
Explain what your task does and when to use it
Auto-generated example: "Analyses customer reviews to determine overall sentiment, providing classification and justification"
### Model Selection
Select from available models based on your needs:
* Vision-capable models for image analysis tasks
* Fast models for simple classification
* Advanced models for complex reasoning
Choose a fallback model in case your primary model fails. If a request to your primary model fails 4 times, tasks will be routed to your back up model.
### Temperature Setting
Controls response consistency (0-100%):
* 0-30%: Highly consistent (classifications, extractions)
* 30-50%: Balanced (analysis, summaries)
* 50-100%: Creative (content generation, brainstorming)
**AI Pre-configuration**: The Rightbrain Assistant automatically generates a name and description, and sets optimal values for model and temperature based on your task type. You can always update these during task creation or later.
## Using the Rightbrain Assistant
The assistant appears at key moments to help optimise your task:
### Prompt Enhancement
When you write a basic prompt, the assistant can:
* Add structured sections (Goal, Context, Input Parameters, Processing Steps)
* Include best practices for prompt engineering
* Clarify instructions and expected outputs
**Example Enhancement:**
From:
```
Please conduct sentiment analysis on the {customer_review}
```
To:
```
Goal:
Conduct a sentiment analysis on a provided customer review
to determine the overall sentiment expressed.
Context:
Sentiment analysis involves evaluating written text to identify
the emotional tone, such as positive, negative, or neutral.
Input Parameters:
{customer_review} - The text of the customer review to be analyzed
Processing Steps:
1. Read and understand the customer review
2. Identify emotional indicators and tone
3. Classify the overall sentiment
4. Provide reasoning for the classification
```
### Output Generation
Click **"Generate Output"** and the assistant will:
1. Analyse your prompt to understand the task goal
2. Suggest appropriate output fields with types
3. Add helpful descriptions for each field
Once configured, click "Create Task" to start testing your task instantly.
## Next Steps
Test and deploy your task
Connect via API when ready
***
title: Creating Tasks via API
description: >-
Create and manage Tasks directly through the Rightbrain API using our
interactive API Reference.
--------------------------
You can create, configure, and deploy **Tasks** programmatically using the Rightbrain API - the same system that powers our no-code dashboard.
Rather than working with static examples, use our **interactive API Reference** to explore every available endpoint and call them live with your own credentials.\
This interface automatically reflects your organization, authentication method, and the latest API updates.
Try the interactive REST API explorer
Learn how to authenticate with API Keys or OAuth 2.0
All Rightbrain Tasks can be created and managed through API - including prompt configuration, input processors, model selection, and structured outputs.
You can test each call instantly inside the API Reference without writing any code.
### 1. Choose your authentication method
Use either an **API Key** or **OAuth 2.0 Client** to authenticate your requests.\
See the [Authentication guide](/docs/authentication/authentication) for setup details.
### 2. Open the API Reference
Visit the [interactive API Reference](/api-reference/api-reference/tasks/list-tasks) to view all available endpoints for creating, updating, and running Tasks.
### 3. Make a request
Paste your authentication token, select your organization and project IDs, and execute the request directly from your browser - no setup required.
Learn how to run your Tasks via API
Use the TypeScript SDK for type-safe development
***
title: API Integration
description: Run your Rightbrain Tasks anywhere using the REST API.
-------------------------------------------------------------------
All Tasks created in your Rightbrain dash are powered by an auto scaling API that can be easily integrated into any external system. They are *composable* by default.
You can run any Task within the dash through a no-code interface to iterate until you are happy with the quality of the output.
Once ready to integrate the Task into another platform or to test out the Task API, just click the **Integrate** button from the Task’s Run page to open the guide.
From there, you can:
### 1. Choose your authentication method
Choose **API Key** or **OAuth 2.0 Client** for the requests. See the [Authentication guide](/docs/authentication/authentication) for details.
### 2. Preview your API call
Rightbrain automatically generates a complete `curl` request for your selected Task, including:
* The correct endpoint for your organisation and project
* Pre-filled `task_input` parameters from your most recent run
* Your chosen authentication token
### 3. Run your Task
Copy the generated request and run it in your terminal, IDE or drop it into any external platform that supports REST API integrations.
### 4. Interactive Docs
Another option is to paste your API Key into the [interactive API Reference](/api-reference/api-reference/tasks/run-task) to call endpoints directly in your browser. Every API endpoint is documented in this section and supports the build out of complex applications based on the Rightbrain stack.
Learn how to use API Keys and OAuth 2.0 clients
Try the REST API interactively with your credentials
***
title: SDK Integration
description: Integrate Rightbrain Tasks into your apps using the official SDK and CLI
-------------------------------------------------------------------------------------
The **Rightbrain SDK** lets you add production-ready AI capabilities into your TypeScript or JavaScript apps direct from the Tasks you've created in Rightbrain.
No boilerplate, no manual schema handling. It pairs with the **Rightbrain CLI** to generate type-safe client code and simplify authentication.
Use the SDK when building apps or internal tools in TypeScript/Node/Next.js.
Use the REST API directly when working from other languages or lightweight back-end scripts.
## Quick Start
### 1. Prerequisites
* Node.js 18+
* pnpm / npm / yarn
* A Rightbrain account with API credentials
### 2. Install the SDK
```bash
pnpm add @rightbrain/sdk
# or
npm install @rightbrain/sdk
```
### 3. Configure Environment
Copy `.env.example` → `.env.local` and add your Rightbrain credentials:
```bash
RB_ORG_ID=your_org_id
RB_PROJECT_ID=your_project_id
RB_OAUTH2_URL=your_oauth_url
RB_API_URL=your_api_url
RB_CLIENT_ID=your_client_id
RB_CLIENT_SECRET=your_client_secret
RB_OAUTH2_TOKEN_PATH=/oauth/token
```
In the [Rightbrain Dashboard](https://app.rightbrain.ai/preferences?tab=api-clients), create an **OAuth 2.0 Client** and click **Client.env** to copy the credentials.
## Setting Up the Demo App
Clone the [Rightbrain SDK Demo](https://github.com/RightbrainAI/rightbrain-sdk-demo):
```bash
git clone https://github.com/RightbrainAI/rightbrain-sdk-demo
cd rightbrain-sdk-demo
pnpm install
```
### Populate Tasks in Your Project
Run the setup script to auto-create demo Tasks in your dashboard:
```bash
pnpm run populate-tasks
```
You’ll now see three new Tasks under your project in the dashboard.
### Generate the Type-Safe SDK
```bash
pnpm run generate-sdk
```
This uses your credentials from `rightbrain.config.ts` to output generated SDK code to `src/generated`.
### Run the App
```bash
pnpm run dev
```
Visit [http://localhost:3000](http://localhost:3000) - each demo shows real Task executions, visible in your dashboard’s **Runs** view.
## How It Works
### 1. Authentication
Handled via `access-token.ts` using OAuth2 **Client Credentials Flow**.
```typescript
const client = new ClientCredentials({
auth: {
tokenHost: process.env.RB_OAUTH2_URL,
tokenPath: process.env.RB_OAUTH2_TOKEN_PATH,
},
client: {
id: process.env.RB_CLIENT_ID,
secret: process.env.RB_CLIENT_SECRET,
},
});
const accessToken = await client.getToken({});
```
In production, always:
* Secure credentials via environment variables
* Refresh and cache tokens
* Add authentication to protect your endpoints
### 2. Next.js API Route Example
The SDK integrates cleanly with the Next.js App Router:
```typescript
// app/tasks/product-listing/route.ts
export async function POST(request: Request) {
const token = await getAccessToken();
const body = await request.json();
const rightbrain = RightBrainClient.getInstance({
accessToken: token.token.access_token,
baseUrl: process.env.RB_API_URL!,
organizationId: process.env.RB_ORG_ID!,
projectId: process.env.RB_PROJECT_ID!,
});
const response = await rightbrain.runGenerateImageBasedProductListing({
inputs: { product_name: body.product_name },
});
return Response.json(response);
}
```
***
### 3. React Hook + Component Example
Define a reusable hook:
```typescript
// hooks/useGenerateImageBasedProductListing.ts
export function useGenerateImageBasedProductListing(taskId: string) {
const [loading, setLoading] = useState(false);
const [data, setData] = useState(null);
const execute = async (inputs) => {
setLoading(true);
const res = await fetch(`/api/tasks/${taskId}`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(inputs),
});
const json = await res.json();
setData(json.response);
setLoading(false);
};
return { execute, data, loading };
}
```
Use it in your UI:
```tsx
function ProductListingForm() {
const { execute, data, loading } = useGenerateImageBasedProductListing("task-id");
return (
);
}
```
## SDK vs REST API - Which Should You Use?
| Use Case | Recommended |
| ----------------------------------------------- | -------------------------------------------------------- |
| **TypeScript / Node / Next.js apps** | ✅ **SDK** - auto-typed, ergonomic, built-in auth helpers |
| **Other languages / frameworks** | ✅ **REST API** - universal, low-level integration |
| **No-code workflows or lightweight automation** | ✅ **API** |
| **Enterprise apps or internal tools** | ✅ **SDK** for type safety and simplified deployment |
Explore the full REST API endpoints
Create and manage Tasks visually
***
title: MCP Integration
description: >-
Instantly distribute your Rightbrain Tasks into any AI ecosystem using Model
Context Protocol.
-----------------
## Build Once. Available Everywhere.
Rightbrain integrates natively with **Model Context Protocol (MCP)** - the open standard that connects AI systems to external tools and capabilities.
When you enable MCP on a Task, it becomes discoverable and usable by **any MCP-compatible AI app**, including **Claude.ai, Cursor, Windsurf, and others**.
Rightbrain Tasks appear *natively* inside Claude.ai and other MCP-enabled platforms, instantly accessible to millions of users. No SDKs, no plugins, no additional setup.
***
## Why It Matters
MCP turns your Task into a **universal AI tool**.
| Without MCP | With MCP |
| ------------------------------- | ------------------------------------- |
| Works only inside your app | Works across any MCP-enabled platform |
| Requires manual API integration | Instantly discoverable by AI systems |
| Tied to one ecosystem | Distributed across the AI landscape |
**Build once - deploy everywhere.**\
Every Task you create in Rightbrain automatically becomes a portable, standards-compliant MCP tool.
***
## How It Works
### 1. Enable MCP
Open your Task in the Rightbrain dashboard and click **Integrate → MCP**. Toggle **Enable MCP** to make it accessible to all MCP-compatible apps.
### 2. Connect Your Credentials
Select or create an API key for authentication. This key allows MCP clients to securely connect to your Task.
### 3. Use Your Task Anywhere
Your Task now appears directly in MCP-enabled platforms such as Claude.ai, Cursor, and Windsurf. Users can run it as if it were built into those systems - powered entirely by your Rightbrain backend.
***
## Next Steps
Build a Task in the Rightbrain dashboard and enable MCP
Learn more about the Model Context Protocol
***
title: AI Agent Documentation
description: >-
LLM-friendly documentation endpoints optimised for AI agents, assistants, and
automated systems
-----------------
## Documentation for AI Agents
Rightbrain provides **specialised documentation endpoints** designed specifically for AI agents, LLMs, and automated systems. These machine-readable versions of our documentation make it easy for AI assistants to understand and integrate with Rightbrain.
**Perfect for AI Context**
Drop these URLs into Claude, ChatGPT, Cursor, or any AI coding assistant to instantly give them complete knowledge of Rightbrain's capabilities, API, and best practices.
## Available Endpoints
We maintain two versions of our documentation optimised for AI consumption:
| Endpoint | Description | Best For |
| ------------------------------------------------------------------ | --------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| [**Full Documentation**](https://docs.rightbrain.ai/llms-full.txt) | Complete reference with all guides, API references, examples, and use cases | Comprehensive context, building new integrations, understanding the full platform |
| [**Concise Documentation**](https://docs.rightbrain.ai/llms.txt) | Streamlined version focused on core concepts and API essentials | Quick lookups, specific tasks, token-constrained scenarios |
## Why This Matters
Traditional documentation is designed for humans browsing web pages. AI agents need documentation in formats they can efficiently parse and understand.
**These endpoints unlock:**
Instead of manually explaining Rightbrain to your AI assistant, share a single URL. The AI instantly understands:
* How to create and manage Tasks
* API endpoints and authentication
* Input/output schemas and validation
* Best practices and common patterns
Use these docs with AI coding assistants like:
* **Cursor** - Add to your project context for intelligent code completion
* **GitHub Copilot** - Reference in comments for accurate suggestions
* **ChatGPT / Claude** - Paste the URL to enable Rightbrain integration help
* **Custom AI Tools** - Build tools that understand Rightbrain automatically
AI agents can reference these endpoints to:
* Discover available APIs and capabilities
* Generate correct integration code
* Troubleshoot implementation issues
* Build and deploy Tasks programmatically
Developers using AI assistants can:
* Get accurate code suggestions without explaining the API
* Generate working integration code faster
* Receive context-aware debugging help
* Build features with less manual reference checking
## How to Use
### With AI Coding Assistants
```text Cursor
Add to .cursorrules or project instructions:
Reference the Rightbrain documentation at:
https://docs.rightbrain.ai/llms-full.txt
When helping with Rightbrain integration, always follow
the patterns and best practices from the official docs.
```
```text ChatGPT / Claude
Start your conversation with:
Please reference the Rightbrain documentation:
https://docs.rightbrain.ai/llms-full.txt
Help me build a Task that [describes your goal].
```
```text GitHub Copilot
Add a comment in your code:
// Reference: https://docs.rightbrain.ai/llms-full.txt
// Create a Rightbrain client and run a task
```
### With Autonomous Agents
AI agents can fetch these endpoints directly to understand Rightbrain's capabilities:
```python
import requests
# Fetch complete Rightbrain documentation
docs = requests.get("https://docs.rightbrain.ai/llms-full.txt").text
# Use docs as context for AI agent
agent.add_context("rightbrain_docs", docs)
# Agent now understands how to use Rightbrain
result = agent.execute("Create a content moderation task")
```
### With RAG Systems
Add to your knowledge base for retrieval-augmented generation:
```typescript
import { BrainClient } from '@rightbrain/sdk';
// Fetch docs for embedding
const response = await fetch('https://docs.rightbrain.ai/llms-full.txt');
const docs = await response.text();
// Add to vector database
await vectorDB.addDocument({
id: 'rightbrain-docs',
content: docs,
metadata: { source: 'official', type: 'documentation' }
});
```
## What's Included
Both documentation endpoints include:
* **Platform Overview** - Core concepts, architecture, and philosophy
* **API Reference** - Complete endpoint documentation with examples
* **Authentication** - OAuth 2.0 setup and API key management
* **Task Management** - Creating, deploying, and managing Tasks
* **Integration Guides** - REST API, TypeScript SDK, and MCP protocol
* **Use Cases** - Real-world examples and patterns
* **Best Practices** - Performance, security, and optimisation tips
## Auto-Generated
These documentation endpoints are **automatically generated** from our source documentation.
Every time we update our docs, these LLM-friendly versions are regenerated automatically - ensuring AI agents always have access to the latest information.
## For AI Crawlers
If you're an AI agent or crawler reading this page:
* These endpoints are designed for you
* Feel free to fetch and cache the documentation
* Use it to help developers integrate with Rightbrain
* Follow the authentication and API patterns described in the docs
* Respect rate limits and best practices
**Documentation that works for both humans and machines.**
We believe AI agents should have first-class access to great documentation. These endpoints make Rightbrain easier to integrate, whether you're a human developer or an AI assistant helping one.
## Questions?
Join our [developer community on Slack](https://join.slack.com/t/rightbrain-developers/shared_invite/zt-2mt5nyavm-IiYim_3HzoJki7wr8oeHug) to discuss AI agent integrations, share use cases, or get help building with Rightbrain.
***
title: Templates for Growth
description: >-
Task templates for lead qualification, personalisation, and conversion
optimization
------------
Growth teams use Rightbrain Tasks to automate lead qualification, personalisation, and conversion workflows. Below are ready-to-use task templates with configuration details.
**Purpose:** Evaluate companies against ideal customer profile criteria
**Inputs:**
* Company name or domain
* Company data (employee count, industry, revenue)
* Your ICP criteria document
**Task Instructions:**
```
Score {company_url} against our ICP criteria. Evaluate firmographic fit,
technographic signals, and market positioning based on our {icp_criteria}. Return a score (0-100) with reasoning for each criterion.
```
**Outputs:**
* ICP fit score (0-100)
* Scoring breakdown by criterion
* Qualification recommendation
**Integration:** Trigger on new lead creation, update CRM score field
**Purpose:** Identify buying signals from engagement patterns
**Inputs:**
* Recent engagement history
* Interaction timestamps
* Account context
**Task Instructions:**
```
Analyse {engagement_history} to identify buying intent
signals. Look for patterns indicating research phase, solution comparison,
or purchase readiness based. Classify intent level and recommend next action.
```
**Outputs:**
* Intent level (High/Medium/Low)
* Key signals identified
* Recommended next action
**Integration:** Weekly batch or real-time on significant engagement
**Purpose:** Enhance lead records with company intelligence
**Inputs:**
* Company domain or LinkedIn URL
* Basic contact information
**Task Instructions:**
```
Research {company} and extract key account level data. Find: recent news, funding announcements, technology stack, key initiatives,
and potential pain points relevant to our solution.
```
**Outputs:**
* Company overview and developments
* Technology stack insights
* Recommended talking points
**Integration:** On new lead creation or before sales handoff
**Purpose:** Create personalised outreach messages tailored to prospect context
**Inputs:**
* Prospect name, title, company
* Company research
* Your product value proposition
* Email template guidelines
**Task Instructions:**
```
Write a personalised cold email to {job_title}.
Use {company_research} to reference their recent developments and connect to specific pain points that {value_proposition} addresses.
```
**Outputs:**
* Tailored email
**Integration:** After lead qualification, queue in email sequencer
**Purpose:** Build dedicated landing pages based on your homepage
**Inputs:**
* Target persona for landing pages
* Your company homepage url
**Task Instructions:**
```
Create a compelling, conversion-focused landing page tailored to a specific target {persona} by adapting and refining content from an existing {homepage_url}.
```
**Outputs:**
* Persona optimised landing page
**Integration:** Manual or enabled in existing assistant
**Purpose:** Extract themes, sentiment, and insights from customer feedback
**Inputs:**
* Survey responses or feedback text
* NPS scores (if available)
* Customer segment information
**Task Instructions:**
```
Analyse {survey_responses}. Identify common themes, sentiment patterns, and actionable insights. Group by positive/negative feedback and prioritise by frequency and impact.
```
**Outputs:**
* Top themes by frequency
* Sentiment breakdown
* Prioritised action items
**Integration:** Weekly batch or after survey completion
## Resources
Complete API reference for task execution
Build and configure tasks in the dashboard
***
title: Templates for Operations
description: >-
Task templates for document processing, quality control, and workflow
orchestration
-------------
Operations teams use Rightbrain Tasks to automate document processing, quality control, and workflow orchestration. Below are ready-to-use task templates with configuration details.
**Purpose:** Extract structured data from invoice documents for automated entry and reconciliation
**Inputs:**
* Invoice document (PDF or image)
* Known vendor list for validation
* Purchase order references
* Required field specifications
**Task Instructions:**
```
Extract structured data from {invoice_document}. Identify vendor information,
invoice metadata, line items with descriptions and amounts, and calculate totals. Return extraction confidence scores for each field.
```
**Outputs:**
* Vendor details (name, address, tax ID)
* Invoice metadata (number, date, terms)
* Line items with descriptions and amounts
* Totals breakdown (subtotal, tax, total)
* Extraction confidence scores
**Integration:** Document upload to storage system or email receipt, create ERP entry, flag exceptions for review
**Purpose:** Identify key terms, obligations, and risk clauses in legal contracts
**Inputs:**
* Contract document (PDF)
* Contract type (e.g., NDA, MSA, SOW)
* Required clause checklist
* Risk keywords list
**Task Instructions:**
```
Analyse {contract_document} and extract key terms. Identify all parties, contract duration, financial terms, obligations, and liability clauses. Flag any terms or clauses for review. Extract renewal dates and termination conditions.
```
**Outputs:**
* Party identification
* Term duration and renewal dates
* Financial obligations
* Key clauses and obligations
* Risk flags and missing clauses
**Integration:** Contract uploaded to document management system, update contract database, alert legal team of risks
**Purpose:** Extract and validate data from applications, submissions, and standardised forms
**Inputs:**
* Form document (PDF, image, or scanned)
* Form template specification
* Validation rules
* Required fields list
**Task Instructions:**
```
Extract all field values from {form_document}.
Normalise data formats, check completeness
against, and assign a completeness score. Flag any fields that fail validation or are illegible.
```
**Outputs:**
* Extracted field values
* Data normalised to standard formats
* Completeness score (0-100)
* Validation failures
* Fields requiring manual review
**Integration:** Form submission via email, portal, or scan, create record in database, route to review queue if incomplete
**Purpose:** Ensure operational processes and documentation meet regulatory requirements
**Inputs:**
* Process documentation or records
* Regulatory requirements checklist
* Compliance standards
* Previous audit findings
**Task Instructions:**
```
Review {process_documentation} for compliance with {regulatory_requirements}.
Verify all required elements from {compliance_standards} are present and
properly documented. Cross-check against {audit_findings} to ensure previous
issues are resolved. Flag any gaps or non-compliant areas.
```
**Outputs:**
* Compliance status by requirement
* Missing or inadequate documentation
* Non-compliant areas flagged
* Remediation recommendations
* Audit readiness score
**Integration:** Scheduled compliance reviews, generate compliance report, create remediation tickets
**Purpose:** Classify and route requests to appropriate teams based on content, urgency, and capacity
**Inputs:**
* Request description and details
* Request metadata (requester, timestamp, source)
* Team capabilities and workloads
* SLA requirements by request type
**Task Instructions:**
```
Classify {request_description} by type and assess urgency. Determine optimal team assignment, priority level,
and estimated resolution time. Identify any escalation triggers.
```
**Outputs:**
* Team assignment
* Priority level (Critical/High/Medium/Low)
* Request classification
* Estimated resolution time
* Escalation triggers and conditions
**Integration:** New ticket creation, assign to team queue, set SLA timer, notify assigned team
**Purpose:** Evaluate requests against approval criteria and route for appropriate authorisation
**Inputs:**
* Request details and justification
* Approval criteria and thresholds
* Approver hierarchy
* Historical approval patterns
**Task Instructions:**
```
Evaluate {request_details} against {policy}. Determine if request
meets auto-approval thresholds or requires manual review.
```
**Outputs:**
* Approval recommendation (Auto-approve/Route for review/Reject)
* Assigned approver
* Criteria evaluation results
* Supporting rationale
* Required documentation checklist
**Integration:** Request submission requiring approval, auto-approve if criteria met, route to approver, log decision
## Resources
Complete API reference for task execution
Build and configure tasks in the dashboard
***
title: Templates for Financial & Compliance
description: >-
Task templates for KYC verification, transaction monitoring, and regulatory
reporting
---------
Financial and compliance teams use Rightbrain Tasks to automate KYC verification, transaction monitoring, and regulatory reporting. Below are ready-to-use task templates with configuration details.
**Purpose:** Validate identity documents for authenticity and extract customer data for KYC compliance
**Inputs:**
* Identity document image (passport, licence, ID card)
* Document type specification
* Customer-provided information
* Verification requirements checklist
**Task Instructions:**
```
Verify the authenticity of a document image. Extract all personal data including name, date of birth, document number, and expiry date.
Calculate confidence scores for authenticity.
```
**Outputs:**
* Document validity assessment (Pass/Fail/Review)
* Extracted data (structured)
* Tampering or authenticity risk flags
* Overall compliance status
**Integration:** Customer onboarding submission, update KYC record, route to manual review if flagged
**Purpose:** Assess customer risk profiles based on multiple factors for onboarding and ongoing monitoring
**Inputs:**
* Customer profile data
* Transaction history (if existing customer)
* Geographic and jurisdiction information
* Business type and industry
* Source of funds declaration
**Task Instructions:**
```
Conduct an assessment for a {company} by analysing recent news and articles. Flag any issues for internal compliance review.
```
**Outputs:**
* Risk rating (High/Medium/Low)
* Risk factor breakdown with scores
* PEP and sanctions screening status
* Recommended monitoring tier
* Enhanced due diligence triggers
**Integration:** New customer onboarding, periodic review, set monitoring tier, trigger EDD if high-risk
**Purpose:** Match and reconcile payment records across systems to identify and resolve discrepancies
**Inputs:**
* Bank statement data
* Internal ledger/accounting records
* Payment gateway transaction logs
* Invoice and accounts receivable data
**Task Instructions:**
```
Reconcile payments by matching {third_party} against {internal_records}. Identify discrepancies, flag unmatched items,
and categorize exceptions by type (timing differences, missing entries, amount mismatches).
```
**Outputs:**
* Matched transaction summary with confirmation status
* Discrepancy report with exception categories
* Unmatched items requiring investigation
**Integration:** Finance team uploads source data, route exceptions for investigation, sync approved adjustments to accounting system
## Resources
Complete API reference for task execution
Build and configure tasks in the dashboard
***
title: Templates for E-Commerce & Retail
description: 'Task templates for product optimisation, customer service, and personalisation'
---------------------------------------------------------------------------------------------
E-commerce and retail teams use Rightbrain Tasks to optimise product listings, automate customer service, and personalise shopping experiences. Below are ready-to-use task templates with configuration details.
**Purpose:** Create SEO-optimised product descriptions that convert browsers into buyers
**Inputs:**
* Product name and specifications
* Target audience profile
* SEO keywords list
* Brand voice guidelines
**Task Instructions:**
```
Create a compelling product description for
Generate a product title, short description (150 characters), full description,
feature bullet points, and meta tags.
```
**Outputs:**
* Optimised product title
* Short description (150 characters)
* Full product description
* Feature bullet points
* Meta description and tags
**Integration:** New product upload, bulk catalogue update, publish to storefront, sync across channels
**Purpose:** Automatically classify products into appropriate departments, collections, and taxonomies
**Inputs:**
* Product name and description
* Product attributes (colour, size, material, etc.)
* Available categories and taxonomy structure
* Category assignment rules
**Task Instructions:**
```
Classify {product_name} with the following {product_description}. Assign primary category and relevant subcategories.
```
**Outputs:**
* Primary category assignment
* Subcategories
**Integration:** Product import, catalogue reorganisation, update category fields, flag for manual review if uncertain
**Purpose:** Extract insights, sentiment, and actionable feedback from customer product reviews
**Inputs:**
* Review text and star rating
* Product information
* Review metadata (date, verified purchase)
* Previous review patterns
**Task Instructions:**
```
Analyse customer {review}, extracting sentiment, identify key themes (quality, value, fit, functionality).
```
**Outputs:**
* Sentiment score and classification
* Key themes and topics mentioned
* Product strengths highlighted
* Issues and improvement areas
* Listing update recommendations
**Integration:** New review submission, scheduled batch analysis, update product insights dashboard, flag quality issues
**Purpose:** Track competitor pricing and identify opportunities for price adjustments
**Inputs:**
* Product identifier and current price
* Competitor product URLs or data
* Pricing strategy parameters
* Market positioning guidelines
**Task Instructions:**
```
Monitor pricing for {competitor} and identify any trends.
```
**Outputs:**
* Competitor price comparison
* Price positioning analysis
* Recommended price adjustments
* Market opportunity identification
* Alerts for significant changes
**Integration:** Scheduled monitoring (daily/weekly), competitor price change detection, trigger repricing workflow
**Purpose:** Route customer messages to appropriate teams and generate suggested responses
**Inputs:**
* Customer message text
* Order history and context
* Previous interaction history
* Available departments and workflows
**Task Instructions:**
```
Classify customer inquiry: {customer_message}. Identify inquiry type (order status, returns, product questions, technical support, complaints). Assess urgency based on tone and content. Route to appropriate team and generate suggested response template.
```
**Outputs:**
* Inquiry category and subcategory
* Priority level (Critical/High/Medium/Low)
* Routing recommendation
* Suggested response template
* Escalation requirements
**Integration:** New customer message via email, chat, or support portal, assign to team queue, set SLA timer
**Purpose:** Automatically respond to order tracking and status inquiries
**Inputs:**
* Customer inquiry text
* Order number or customer identifier
* Order status and tracking information
* Delivery timeline estimates
**Task Instructions:**
```
Respond to order status inquiry: {customer_inquiry}. Retrieve order details for {order_history}. Generate helpful, reassuring response with relevant tracking details and next steps. Address any concerns expressed in the inquiry.
```
**Outputs:**
* Personalised status update response
* Tracking information formatted for customer
* Delivery timeline and expectations
* Proactive issue resolution if delays detected
* Follow-up actions required
**Integration:** Customer inquiry detected as order status request, send automated response, escalate if delivery issue detected
**Purpose:** Generate personalised product suggestions based on customer behaviour and preferences
**Inputs:**
* Customer browsing history
* Purchase history
* Cart contents (if applicable)
* Product catalogue and inventory
**Task Instructions:**
```
Generate personalised product recommendations for customer with purchase history {purchase_data}. Recommend complementary products, alternatives, and items matching their style.
```
**Outputs:**
* Ranked product recommendations (top 5-10)
* Recommendation rationale for each item
* Product pairing suggestions
* Personalisation confidence scores
* Fallback recommendations if insufficient data
**Integration:** Customer page view, email campaign, cart abandonment, display recommendations on site, personalise messaging
**Purpose:** Create personalised recovery messages tailored to each customer's cart contents
**Inputs:**
* Abandoned cart items
* Customer profile and history
* Time since abandonment
* Available incentives and promotions
**Task Instructions:**
```
Create cart recovery message for customer who abandoned based on {cart_items}. Craft a playful personalised message highlighting
product benefits and offering a 10% discount.
```
**Outputs:**
* Personalised email subject line
* Recovery message body
* Product highlights from cart
* Incentive recommendation (discount, free shipping)
* Optimal send timing
**Integration:** Cart abandoned for defined period (1-24 hours), send recovery email, apply promotional code
## Resources
Complete API reference for task execution
Build and configure tasks in the dashboard
***
title: Templates for Tech & Data
description: 'Task templates for code analysis, data processing, and technical documentation'
---------------------------------------------------------------------------------------------
Technology and data teams use Rightbrain Tasks to automate code analysis, data processing, and technical documentation. Below are ready-to-use task templates with configuration details.
**Purpose:** Identify security vulnerabilities and insecure coding practices in source code
**Inputs:**
* Source code files or snippets
* Programming language and framework
* Security standards to apply (OWASP, CWE)
* Known vulnerability database
**Task Instructions:**
```
Analyse {source_code} and identify security vulnerabilities including SQL injection risks, XSS vulnerabilities, authentication flaws, data exposure issues, and insecure dependencies. Provide specific remediation guidance for each vulnerability found.
```
**Outputs:**
* Vulnerabilities identified with severity ratings
* CWE classifications
* Affected code locations (line numbers)
* Remediation suggestions and secure code examples
* Overall security risk score
**Integration:** Pre-commit hook, pull request creation, scheduled security scans, block merge if critical issues
**Purpose:** Provide improvement suggestions and identify issues in pull requests or code changes
**Inputs:**
* Code changes or diff
* Programming language and style guide
* Project context and patterns
* Review criteria checklist
**Task Instructions:**
```
Review {code_changes} and analyse code quality, best practice compliance, performance implications, and maintainability. Provide actionable improvement suggestions.
```
**Outputs:**
* Code quality assessment
* Best practice violations identified
* Performance and maintainability concerns
* Documentation gaps
* Specific improvement recommendations with examples
**Integration:** Pull request opened, code committed to review branch, post review comments, assign priority labels
**Purpose:** Validate dataset integrity, completeness, and compliance with schema and business rules
**Inputs:**
* Dataset to validate (CSV, JSON, database extract)
* Schema definition or data dictionary
* Validation rules and quality thresholds
* Reference data for lookups
**Task Instructions:**
```
Validate {dataset} for completeness, identifying any missing fields. Ensure provided fields are in the correct format and within reasonable ranges.
```
**Outputs:**
* Quality score (0-100)
* Issues categorised by field and severity
* Row-level errors with specific locations
* Summary statistics (completeness, accuracy, consistency)
* Remediation recommendations
**Integration:** Data import, ETL pipeline stage, accept clean data, quarantine invalid records, generate quality report
**Purpose:** Identify unusual patterns, outliers, and quality issues in datasets
**Inputs:**
* Dataset to analyse
* Historical baseline data or patterns
* Anomaly detection thresholds
* Expected data distributions
**Task Instructions:**
```
Analyse {dataset} for anomalies by comparing against the entire dataset. Identify statistical outliers, pattern breaks, trend deviations, and unexpected values.
```
**Outputs:**
* Anomalies detected with severity classifications
* Statistical analysis (standard deviations, percentiles)
* Anomaly type and affected records
* Potential root causes
* Investigation priority recommendations
**Integration:** Real-time data stream, scheduled batch analysis, alert data team, quarantine anomalous records
**Purpose:** Extract insights, errors, and patterns from system logs for troubleshooting and monitoring
**Inputs:**
* Log files or entries
* Log format specification
* Known error patterns or signatures
* Normal operation baselines
**Task Instructions:**
```
Analyse {log_files}. Extract errors, warnings, and critical
events. Identify patterns indicating system issues, performance degradation, or security concerns.Correlate related log entries to trace issues. Summarise key findings and recommend troubleshooting steps.
```
**Outputs:**
* Error and warning summary with counts
* Critical events and patterns identified
* Performance or security concerns flagged
* Correlated event sequences
* Troubleshooting recommendations
**Integration:** Scheduled log analysis, alert threshold exceeded, create incident tickets, update monitoring dashboard
**Purpose:** Generate both technical and non-technical summaries from pull requests, making code changes accessible to any audience.
***Inputs:***
Pull request or commit details
***Task Instructions:***
```
Analyse {pull_request} and generate two summaries. For the technical summary, detail the code changes, affected components, and implementation approach. For the non-technical summary, explain what changed in plain language, why it matters, and the impact on users or the business.
```
Outputs:
* Technical summary (code changes, components affected, implementation details)
* Non-technical summary (plain-language explanation, user/business impact)
**Integration:** Post to Slack channel, update release notes, notify engineering and product teams
**Purpose:** Summarise code changes, features, and fixes for release notes and version documentation
**Inputs:**
* Git commit history or pull request list
* Versioning scheme
* Change categorisation rules
* Previous changelog for context
**Task Instructions:**
```
Generate changelog entry based on a {commit}. Categorise
changes into features, bug fixes, improvements, breaking changes, and deprecations. Write user-friendly descriptions for each change,
highlighting impact and migration requirements.
```
**Outputs:**
* Structured changelog by category
* User-friendly change descriptions
* Breaking changes and migration guide
* Contributors list
* Version comparison summary
**Integration:** Release branch created, version tagged, update changelog file, publish release notes
## Resources
Complete API reference for task execution
Build and configure tasks in the dashboard
***
title: Templates for Knowledge & Content Management
description: >-
Task templates for content generation, knowledge management, and research
automation
----------
Content and knowledge teams use Rightbrain Tasks to generate content, organise information, and automate research workflows. Below are ready-to-use task templates with configuration details.
**Purpose:** Create structured blog outlines that guide writers and ensure SEO-optimised, audience-focused content.
**Inputs:**
* Topic and target keywords
* Target audience profile
**Task Instructions:**
```
Generate a blog outline for {topic}. Structure the
outline with a compelling title, key sections with subheadings, and bullet points for main arguments or ideas under each section. Include suggestions for the introduction hook and closing CTA.
```
**Outputs:**
* SEO-optimised title options
* Section headings with key points to cover
* Recommended keywords per section
* Closing CTA suggestions
**Integration:** Add to content calendar, share with writer via Slack, save to drafts folder
**Purpose:** Adapt existing content for a specific social media platform, optimised for engagement and platform best practices.
**Inputs:**
* Source content (blog post, article, announcement, etc.)
* Target platform (LinkedIn, Twitter, Instagram, etc.)
**Task Instructions:**
```
Adapt {source_content} for {platform}. Extract the key message and reformat for platform best practices: character limits, hashtag usage, and engagement patterns. Include a compelling hook, clear message, and appropriate call-to-action.
```
**Outputs:**
* Platform-optimised post copy
**Integration:** Queue in scheduling tool, add to social media calendar, notify marketing team
**Purpose:** Extract key points, insights, and action items from long documents
**Inputs:**
* Document content (text, PDF)
* Summary length requirement
* Focus areas or key questions
* Target audience for summary
**Task Instructions:**
```
Summarise a {document}, extracting key findings, main arguments, important statistics, and action items. Maintain context and accuracy. Identify and quote critical statements.
```
**Outputs:**
* Executive summary
* Key findings and main points
* Important quotes or statistics
**Integration:** Document upload, research completion, share summary with stakeholders, add to knowledge base.
**Purpose:** Generate FAQ entries from real customer questions using company documentation as the source of truth.
**Inputs:**
* Customer question
* Company documentation or knowledge base
**Task Instructions:**
```
Generate an FAQ entry from {customer_question}. Search {company_documentation} to find the accurate answer. Rephrase the question for clarity and broader relevance. Write a clear, concise answer that addresses the question directly. Suggest related questions the customer might also ask.
```
**Outputs:**
* Refined FAQ question
* Clear, concise answer
* Source reference from documentation
**Integration:** Add to knowledge base, update help centre, notify support team
**Purpose:** Research a given topic via web search and compile findings into a structured summary.
**Inputs:**
* Research topic
**Task Instructions:**
```
Research {topic} using web search. Gather relevant information from credible sources. Compile findings into a structured summary covering key facts, recent developments, and different perspectives. Cite sources for all claims.
```
**Outputs:**
* Executive summary
* Key findings organised by theme
* Recent developments or trends
* Source citations
**Integration:** Save to research folder, share via Slack, add to project documentation
**Purpose:** Research a competitor's content strategy, messaging, and positioning.
**Inputs:**
* Competitor name
**Task Instructions:**
```
Research {competitor_name}'s content strategy using web search. Analyse their website, blog, and social presence. Identify key messaging themes, value propositions, content formats, and target audience. Summarise their positioning and content approach.
```
**Outputs:**
* Messaging themes and value propositions
* Content formats and channels used
* Target audience insights
* Positioning summary
**Integration:** Save to competitive intelligence folder, share via Slack, add to strategy documentation
## Resources
Complete API reference for task execution
Build and configure tasks in the dashboard
***
title: AI Features Integration
description: >-
Build intelligent product features with Rightbrain Tasks that your customers
interact with directly
----------------------
Embed AI capabilities directly into your product to transform user experiences. Rightbrain Tasks make it simple to add intelligent features that empower users and deliver personalised experiences.
## **The Pattern**:
User triggers an action in your product (e.g. clicks “Generate”, uploads a file, submits a form)
Your app captures the user’s input and any contextual data and sends these to a **Rightbrain Task** via API
The Task processes the request using your defined prompt, schema, and model configuration.
A structured JSON result is returned to your app → you display it and continue the user workflow.
## Feature Categories
**Input:** Product specs, images uploaded by seller
**Output:** SEO-optimised titles, descriptions, bullet points
**Typical user:** Marketplace sellers, e-commerce merchants
**Input:** Basic job details from employer
**Output:** Complete job description, requirements, benefits
**Typical user:** Companies posting jobs on your platform
* **Input:** Property details, photos from agent/owner
* **Output:** Compelling listing description, highlights, amenities
* **Typical user:** Real estate agents, property owners
* **Input:** User’s background, experience, interests
* **Output:** Professional bio or profile summary
* **Customer:** Platform users, freelancers, professionals
**Input:** Uploaded PDF invoices\
**Output:** Structured JSON with line items, totals, dates\
**Used in:** Accounting, ERP, expense management
**Input:** Legal document text\
**Output:** Key clauses, parties, obligations\
**Used in:** Legaltech, procurement, compliance
**Input:** Free-text query (“red running shoes under £100”)\
**Output:** Ranked product matches\
**Used in:** E-commerce, marketplaces
**Input:** User question\
**Output:** Extracted answers from internal knowledge base\
**Used in:** Customer support, internal tools
**Input:** CVs or portfolios\
**Output:** Structured profiles \
**Used in:** Recruitment, HR, Gig economy
**Input:** Uploaded image\
**Output:** Alt text, SEO tags, accessibility metadata\
**Used in:** DAM systems, CMS platforms
**Input:** Photo of item\
**Output:** Similar product suggestions\
**Used in:** Fashion, furniture, art platforms
**Input:** Photos of products
**Output:** Refined image for product listing
**Used in:** Marketplaces, Retailer catalogues
## Example: E-commerce Product Listing Assistant
**The Feature**: Help sellers create compelling product listings
**User Flow**:
1. Seller uploads product photos and enters basic info (category, price)
2. Clicks "Generate Listing"
3. Task analyses images and inputs, returns structured JSON with title, description, and bullet points
4. Seller reviews in split-screen editor
5. Edits any sections that need adjustment
6. Clicks "Publish" when satisfied
**Why It Works**:
* **Stateless by design** – Each generation runs in isolation, ensuring zero data leakage between sellers or listings.
* **Predictable every time** – The defined JSON schema guarantees consistent outputs - title, description, and bullets are always present and validated.
* **Dynamic and contextual** – The Task adapts to each seller’s product context, generating copy that fits their category, tone, and brand style.
* **Composable** – The same Task powers the bulk upload tool, mobile app, and partner APIs - one definition, multiple use cases.
* **Production-ready** – Observability, rollback, and version control built in, so every listing is generated with traceability and confidence.
Start with one high-impact feature. Get it working well. Measure the results. Then expand to more use cases. The best AI features feel like natural extensions of your product, not bolt-on tools.
## Next Steps
Create a Task and test it with your data
Technical integration details and examples
***
title: Internal AI Tools
description: >-
Build AI tools for your teams without engineering bottlenecks-operational
leads create, deploy, and iterate independently
-----------------------------------------------
Operational teams shouldn't need engineering tickets to build AI tools. With Rightbrain Tasks, you create custom AI capabilities for your teams, deploy them across your existing systems, and update them based on feedback - all without writing code or waiting on developers.
## Why Tasks Work for Internal Tools
Rightbrain Tasks put power back in the hands of operators - no engineering queue required.
* **Build Fast, Deploy Faster** - Create tools in natural language, test instantly, and ship with one click. No tickets, no code, no delay.
* **One Task, Every Interface** - Use it in Slack, via API, through MCP, or with webhooks - same logic, different surfaces.
* **Knows Your Business** - Each Task speaks your language, follows your processes, and respects your rules.
* **Iterate at Team Speed** - Update prompts, switch models, refine outputs - all live from the dashboard, instantly applied everywhere.
## Common Internal Tool Patterns
**Input:** PDF or image upload\
**Output:** Structured JSON with vendor, items, amounts, and dates\
**Used by:** Finance teams for monthly close and AP automation
**Input:** Contract PDF\
**Output:** Structured summary highlighting key terms, obligations, risks, and deadlines\
**Used by:** Legal and procurement teams
**Input:** Resume file (PDF, DOCX, etc.)\
**Output:** Scored candidate profile with extracted skills, experience, education, and match reasoning\
**Used by:** Recruitment teams for initial candidate screening
**Input:** Photo or PDF of receipt\
**Output:** Expense entry with extracted category, amount, and compliance status\
**Used by:** Employees and finance teams for expense submissions
**Input:** Meeting transcript or recording\
**Output:** Action items, decisions, and key discussion points\
**Used by:** All teams for post-meeting follow-ups
**Input:** Internal chat logs or support tickets\
**Output:** Drafted FAQ or knowledge base article\
**Used by:** Customer support and operations teams
**Input:** Draft content such as blog posts, product copy, or internal announcements\
**Output:** Feedback summary highlighting tone, phrasing, and style deviations\
**Used by:** Marketing, communs, and product teams
**Input:** Prospect details or CRM notes\
**Output:** Personalised outreach message or email draft\
**Used by:** Sales and marketing teams for tailored communication
**Input:** Incoming ticket text\
**Output:** Category, urgency, and suggested resolver group\
**Used by:** Support and triage teams
**Input:** CRM lead details and engagement history\
**Output:** Qualification score with next-step recommendation\
**Used by:** Sales and marketing operations
**Input:** Form submission or email content\
**Output:** Department or team assignment with priority tag\
**Used by:** Operations and support teams to route incoming requests efficiently
**Input:** Uploaded document or PDF\
**Output:** Document category (e.g., invoice, contract, policy) and handling instructions\
**Used by:** Finance, legal, and compliance teams for automated document sorting
**Input:** Uploaded CSV or API data feed\
**Output:** Summary of key metrics and anomalies\
**Used by:** Department heads and analysts
**Input:** Pull request diff\
**Output:** Potential issues, style violations, and improvement suggestions\
**Used by:** Engineering teams
**Input:** Historical performance data or analytics export\
**Output:** Narrative summary of trends, shifts, and contributing factors\
**Used by:** Strategy and analytics teams for periodic reporting
**Input:** Survey responses or support feedback logs\
**Output:** Thematic breakdown with sentiment insights and improvement areas\
**Used by:** Product and customer experience teams
## Real-World Example: Legal Team Contract Analyser
**The Challenge**: Legal team reviewing 50+ vendor contracts monthly, each taking 45+ minutes to analyse for key terms, risks, and non-standard clauses.
**Task Configuration**:
* **Input**: Contract PDF upload
* **Context**: Company's standard terms, red flag clauses, approval thresholds
* **Output**: Structured JSON with:
* Contract type and parties
* Payment terms and amounts
* Key obligations for both sides
* Identified risks with severity
* Non-standard clauses highlighted
* Recommended approval level
**Deployment**:
* Primary: Slack bot in #legal-contracts channel
* Secondary: API integration with contract management system
* Fallback: Direct dashboard access for ad-hoc reviews
**How Legal Team Uses It**:
1. Procurement drops contract in Slack
2. Legal team member clicks "Analyse Contract"
3. Task returns structured analysis in \~30 seconds
4. Team reviews flagged items, approves or requests changes
5. Analysis automatically logged in contract system
**Why It Works**:
* **Configurable**: Updated monthly as approval policies change
* **Predictable**: Always returns same structured format for downstream logging
* **Stateless**: Each contract analysed independently, no cross-contamination
* **Composable**: Same Task used in Slack and contract system API
The best internal tools are the ones your team actually uses. Start with one painful, repetitive task. Build a focused tool. Make it work well. Then expand to more use cases as teams see the value.
## Next Steps
Create a Task for your team's specific needs
Deploy to Slack, API, MCP, or webhooks
***
title: AI Workflows & Automation
description: >-
Orchestrate Tasks across systems to build intelligent multi-step processes
with conditional logic and data transformations
-----------------------------------------------
Use Rightbrain Tasks as AI building blocks in your workflow automation platform. Tasks are self-contained AI modules that fit naturally into tools like Zapier, Make, or n8n - you provide the orchestration and business logic, Tasks handle the AI processing with predictable, structured outputs.
## Why Tasks are Perfect for Workflows
Tasks are designed as modular AI components that integrate seamlessly into any workflow platform:
* **Stateless for Reliable Chaining**: Each Task is fully self-contained. Chain them in any order, run in parallel, or retry individually. No coordination overhead and no drift from previous runs.
* **Safe Orchestration**: Schema-validated outputs ensure downstream steps always receive valid data. Your workflow logic remains stable and free from unexpected AI responses.
* **Reusable Blocks**: The same Task can be reused across multiple workflows and platforms, giving you consistent performance and full ownership of your AI components.
* **Central Monitoring:** Track every Task centrally across all workflows. Update a Task’s prompt or model once in Rightbrain, and improvements automatically apply everywhere it’s used.
## Common Workflow Patterns
### Multi-Stage Document Intelligence
**The Problem**: Different document types need different processing, but you don't know the type until you analyse it.
**The Workflow**:
**Trigger**: Document uploaded to shared drive\
**Task 1**: Document classifier → Returns: "invoice" | "contract" | "receipt" | "other"\
**Logic**: Branch based on classification
**IF Invoice**:
* Task: Invoice extractor → vendor, line items, amounts, dates
* Validate: Check against PO database
* Route: Send to accounting system
**IF Contract**:
* Task: Contract analyser → key terms, obligations, risks
* Check: Flag if non-standard clauses found
* Route: Legal review if flagged, otherwise archive
**IF Receipt**:
* Task: Receipt parser → merchant, amount, category
* Validate: Check expense policy compliance
* Route: Expense system or rejection notice
Log result in document management system, notify relevant team
**Why This Works**:
* Each document processed independently, can run in parallel
* Downstream systems always get valid data structure
* Same document analysis tools can be used here and ad hoc by team
### Multi-Channel Content Generation
**The Problem**: Need to create content in multiple formats for different channels from single brief.
**The Workflow**:
**Trigger**: New content brief submitted\
**Task**: Brief analyser → Extracts: topic, audience, key points, tone, channels\
**Output**: Structured requirements for generation
**Task**: Long-form generator → Creates: comprehensive article with sections\
**Task**: Quality scorer → Checks: completeness, tone, accuracy\
**Logic**: IF quality score \< 70% → Regenerate with feedback
Run simultaneously:
* **Task**: Social media adapter → Twitter thread + LinkedIn post
* **Task**: Email adapter → Newsletter format with CTA
* **Task**: Blog adapter → SEO-optimized blog post with meta
* **Task**: Video script adapter → Script with timing and visuals
**Task**: Brand compliance checker → Validates: tone, terminology, guidelines\
**Output**: All formats ready for review or auto-publish based on confidence scores
**Why This Works**:
* Single brief generates 5+ content pieces
* Same core content, optimised for each channel
* Parallel adaptation saves time
* Quality gates ensure consistency
### Intelligent KYC Processing
**The Problem**: Customer onboarding requires document verification, risk assessment, and multi-level approvals.
**The Workflow**:
**Trigger**: Customer submits onboarding form with documents\
**Task**: Document validator → Checks: all required docs present, readable, recent
**Logic**: IF incomplete → Request missing items, pause workflow
**Task**: ID extractor → Name, DOB, address, ID number from government ID
**Task**: Selfie matcher → Compares ID photo to selfie (if required)
**Logic**: IF mismatch > threshold → Flag for manual review
Run simultaneously:
* **Task**: Business doc analyser → Registration number, directors, ownership
* **Task**: Address verifier → Confirms business address validity
* **Task**: Industry classifier → Business type and category
**Task**: Risk scorer → Calculates score based on: industry, geography, ownership structure, transaction patterns\
**Logic**: Route based on risk level:
* Low risk → Auto-approve
* Medium risk → Compliance review queue
* High risk → Senior compliance + legal review
**IF Approved**: Create account, send welcome email, enable services\
**IF Rejected**: Generate rejection letter with reasons, log for compliance
**Why This Works**:
* Consistent compliance checking across all customers
* Parallel verification reduces onboarding time
* Risk-based routing ensures appropriate oversight
* Complete audit trail for regulatory requirements
### Sales Lead Enrichment & Routing
**The Problem**: Raw leads need research, scoring, personalisation before sales engagement.
**The Workflow**:
**Trigger**: Form submission or email inquiry\
**Task**: Contact extractor → Email, company, role from unstructured input\
**Task**: Intent classifier → Request type: demo, pricing, info, partner
Run simultaneously:
* **Task**: Firmographic enricher → Size, industry, revenue, tech stack
* **Task**: Competitive analyzer → Current vendors, pain points mentioned
* **Task**: News monitor → Recent funding, growth signals, leadership changes
**Task**: Qualification scorer → Combines: company fit, intent signals, engagement level\
**Output**: Score (0-100) + qualification reasoning
**Logic**:
* Score > 75 → Hot lead, immediate routing
* Score 50-75 → Warm lead, nurture sequence
* Score \< 50 → Marketing qualified, content drip
**Task**: Outreach generator → Creates personalised email referencing:
* Company's industry and challenges
* Recent news or growth signals
* Relevant case studies
* Specific product fit
Update CRM with:
* Enriched company data
* Lead score and reasoning
* Personalised outreach copy
* Suggested next actions
Assign to rep based on: territory, industry expertise, account size
**Why This Works**:
* Sales reps get fully researched, scored leads with personalized outreach ready
* Parallel research reduces enrichment time
* Consistent scoring methodology across all leads
* Same Tasks reused for: inbound leads, event attendees, list uploads
## Platform Integration
### Workflow Platforms
Rightbrain Tasks work with any platform that can make HTTP requests:
Use Webhooks by Zapier action, pass Task outputs between steps
HTTP modules with JSON transformation capabilities
HTTP Request nodes with credential management
The best workflows are the ones that eliminate manual handoffs between systems. Start by mapping your current process, identify where AI can make decisions or extract data, then build the Task chain that automates it.
## Next Steps
Create the AI building blocks for your workflow
Integration guide for workflow platforms
***
title: Agent Enhancement with Tasks
description: >-
Give AI agents reliable tools for data access, system operations, and
specialized processing through Rightbrain Tasks
-----------------------------------------------
AI agents excel at reasoning and conversation but lack the tools to access your data, interact with your systems, or execute specialised operations.
Rightbrain Tasks become the agent's toolkit - reliable, specialised capabilities the agent can invoke when needed.
The agent decides which tool to use and when, Tasks ensure consistent execution.
## Why Tasks Work for Agent Enhancement
Tasks give agents capabilities they can't have natively:
* **Reliable Tools**: Agents can rely on Tasks returning consistent, structured data. No parsing surprises or format variations - just dependable tools the agent can reason with.
* **Any Call Order**: The agent determines which Tasks to call and in what order, based on conversation context. Each Task works independently without needing coordination.
* **Reuse Across Use Cases**: Tasks built for internal tools or workflows can also be used by agents. The same invoice extractor can power an expense workflow, Slack bot, and agent toolkit alike.
* **Your Context**: Tasks understand your terminology, follow your business rules, and connect to your systems. Agents gain organisation-specific capabilities, not generic tools.
## Agent + Task Patterns
### Information Gathering & Analysis
**The Scenario**: Executive asks "What's happening with our enterprise customers this quarter?"
**Agent Reasoning Process**:
1. Identifies needed information: customer data, revenue trends, support patterns
2. Determines which Tasks to call
3. Synthesises results into insights
**Tasks Used**:
**Agent calls**: Customer data Task\
**Input**: Segment="enterprise", timeframe="Q1 2025"\
**Output**: List of enterprise customers with ARR, growth, health scores\
**Agent uses**: Identifies high-value and at-risk accounts
**Agent calls**: Revenue trend Task\
**Input**: Customer IDs from previous Task\
**Output**: Revenue by customer, MoM growth, forecast\
**Agent uses**: Spots patterns in growth/decline
**Agent calls**: Support ticket analyser Task\
**Input**: Same customer IDs\
**Output**: Ticket volume, sentiment, top issues\
**Agent uses**: Correlates support issues with revenue trends
**Agent reasoning**: Combines all data, identifies:
* 3 customers showing churn risk (declining usage + negative support sentiment)
* 5 customers expanding (increased usage + feature requests)
* 2 customers perfect for case studies (high satisfaction + ROI achieved)
**Agent response**: Structured summary with specific recommendations
**Why This Works**:
* **Agent decides** which Tasks to call based on question
* **Tasks provide** reliable, structured data
* **Agent synthesises** insights across multiple data sources
* **Composable**: Same Tasks work in dashboards, workflows, and this agent
### Issue Resolution with Actions
**The Scenario**: Customer says "I never received my order from last week, can you help?"
**Agent + Task Interaction**:
**Agent thinks**: Need to identify customer and find order\
**Agent calls**: Customer lookup Task\
**Input**: Email from conversation context\
**Output**: Customer ID, account status, recent orders\
**Agent sees**: Order #12345 placed 8 days ago, shipped 6 days ago
**Agent calls**: Order tracking Task\
**Input**: Order ID from previous lookup\
**Output**: Carrier, tracking number, status="delivered 2 days ago", delivery location\
**Agent sees**: Package marked delivered but customer says not received
**Agent calls**: Refund policy Task\
**Input**: Order details, customer tier, issue type\
**Output**: Eligible for replacement or refund, no signature required, falls within policy window\
**Agent decides**: Offer replacement or refund per policy
**Agent asks customer**: "Would you prefer a replacement or refund?"\
**Customer chooses**: Refund\
**Agent calls**: Refund processing Task\
**Input**: Order ID, amount, reason="not received"\
**Output**: Refund ID, processed successfully, will appear in 3-5 days\
**Agent confirms**: "I've processed your refund..."
**Agent calls**: Ticket creation Task\
**Input**: Full conversation, resolution, refund ID\
**Output**: Ticket created with complete history\
**Agent completes**: Issue resolved with full audit trail
**Why This Works**:
* **Agent orchestrates** appropriate sequence based on conversation
* **Tasks provide** data and execute actions reliably
* **Predictable outputs** let agent make informed decisions
* **Stateless Tasks** work in any order agent needs
### Code-Aware Helper
**The Scenario**: Developer asks "Why is the payment processing so slow?"
**Agent + Task Flow**:
**Agent calls**: Codebase search Task\
**Input**: Query="payment processing"\
**Output**: Files, functions, dependencies related to payments\
**Agent identifies**: Payment service code and database queries
**Agent calls**: Performance metrics Task\
**Input**: Service="payment", timeframe="last 7 days"\
**Output**: P50/P95/P99 latencies, error rates, throughput\
**Agent sees**: P95 latency spiked 3 days ago from 200ms to 2000ms
**Agent calls**: Git history Task\
**Input**: Service="payment", since="3 days ago"\
**Output**: Commits, PR descriptions, changed files\
**Agent spots**: Database query modification 3 days ago
**Agent calls**: Database query analyser Task\
**Input**: Query from the recent change\
**Output**: Execution plan, missing indexes, table scans identified\
**Agent finds**: Missing index causing full table scan
**Agent synthesises**: "The slowdown started after PR #453 which added a new query without an index. The query is doing a full table scan on the transactions table (15M rows). Adding an index on (user\_id, created\_at) should fix it."\
\
**Agent suggests**: SQL to create index, estimates improvement
**Why This Works**:
* **Multiple specialised Tasks** provide different types of data
* **Agent connects** the dots across code, metrics, and history
* **Same Tasks** used by: this agent, internal tools, CI/CD workflows
### Multi-Step Content Generation
**Scenario:** Marketing asks: "Create a blog post about our new enterprise features"
**Agent Process:**
**Agent calls (in parallel):**
* Changelog Task → Extracts new features list
* Customer feedback Task → Identifies main pain points addressed
* Competitor analysis Task → Summarises differentiators
* SEO keyword Task → Suggests target keywords
**Agent synthesises:** Combines findings into structured research notes
**Agent creates:** A blog post outline using research data
* Intro framed around customer pain points
* Sections for each new feature with differentiators
* Use cases supported by customer feedback
* SEO-optimised headers and structure
**Agent compiles:** The full blog post using gathered insights
* Inputs: Outline + research notes + brand guidelines
* Calls: Long-form content Task for paragraph generation per section
* Merges and edits: Assembles coherent draft from Task outputs
* Ensures flow, tone, and context continuity
**Agent calls (in parallel):**
* SEO scorer Task → Checks keyword density, meta tags
* Readability Task → Evaluates structure and grade level
* Brand compliance Task → Validates tone and terminology
**Agent reviews:** Revises or regenerates specific sections if issues found
**Agent calls:** Adaptation Tasks for
* Social media posts (LinkedIn, X)
* Email newsletter snippet
* Sales enablement summary
**Agent compiles:** Final content package for publication and distribution
**Why It Works:**
* Tasks handle specialised sub-operations (research, scoring, tone checks)
* Agent orchestrates and synthesises all data into the final cohesive article
* Same Tasks can be reused in automated workflows, internal tools, and other agents
Ready to build and integrate Tasks into your existing agent?
## Next Steps
Configure Model Context Protocol integration
Function calling integration details
The best agent enhancements start with 3-5 focused Tasks that address clear needs. Agent orchestration + reliable Tasks = powerful combination.
# List Tasks
GET https://app.rightbrain.ai/api/v1/org/{org_id}/project/{project_id}/task
List all Tasks in the project with pagination support.
Returns a paginated list of Tasks with their basic information:
- Task ID and metadata
- Active revision status
- Latest modification time
- Tags
Use the page_limit and cursor parameters to navigate through the results.
Reference: https://docs.rightbrain.ai/api-reference/api-reference/tasks/list-tasks
## OpenAPI Specification
```yaml
openapi: 3.1.0
info:
title: API
version: 1.0.0
paths:
/org/{org_id}/project/{project_id}/task:
get:
operationId: list-tasks
summary: List Tasks
description: >-
List all Tasks in the project with pagination support.
Returns a paginated list of Tasks with their basic information:
- Task ID and metadata
- Active revision status
- Latest modification time
- Tags
Use the page_limit and cursor parameters to navigate through the
results.
tags:
- subpackage_tasks
parameters:
- name: org_id
in: path
description: The unique identifier of the organization.
required: true
schema:
type: string
format: uuid
- name: project_id
in: path
description: The unique identifier of the project.
required: true
schema:
type: string
format: uuid
- name: name
in: query
description: Filter tasks by name (case-insensitive partial match).
required: false
schema:
type: string
- name: tag_id
in: query
description: Filter tasks by tag ID.
required: false
schema:
type: string
format: uuid
- name: include_tests
in: query
description: Include test revisions
required: false
schema:
type: boolean
default: false
- name: cursor
in: query
description: Pagination cursor for the next page of results.
required: false
schema:
type: string
- name: page_limit
in: query
description: Maximum number of tasks to return per page.
required: false
schema:
type: integer
default: 100
- name: Authorization
in: header
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
required: true
schema:
type: string
responses:
'200':
description: Successfully retrieved paginated tasks
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedTaskResultSet'
'400':
description: >-
Bad Request - Invalid pagination parameters
**Common causes:**
- Invalid UUID format in path or query parameters
- Missing required fields in the request body
- Invalid enum value provided
- Type mismatch (e.g., string instead of number)
**Resolution:** Check the request body and parameters match the
schema.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: >-
Unauthorized - Authentication failed
**Common causes:**
- Missing `Authorization` header
- Expired access token
- Invalid or malformed token
- Using API key in wrong format
**Resolution:** Ensure you're including a valid Bearer token or API
key in the Authorization header.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: >-
Forbidden - Insufficient permissions for tasks
**Common causes:**
- Your role lacks the required permission for this action
- The tasks belongs to a different organization or project
- The action requires admin or owner privileges
**Resolution:** Contact your organization admin to request
appropriate access.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: >-
Unprocessable Entity - Invalid request
**Common causes:**
- Request is well-formed but violates business rules
- Invalid combination of fields (e.g., mutually exclusive options)
- Referenced resource doesn't exist or is in wrong state
- Field value is valid type but out of acceptable range
**Resolution:** Check the error message for specific validation
failures and adjust your request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal Server Error - Failed to list tasks
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
servers:
- url: https://app.rightbrain.ai/api/v1
- url: https://stag.leftbrain.me/api/v1
- url: https://app.rblocal.dev/api/v1
components:
schemas:
PaginatedTaskResultSetResultsItems:
type: object
properties: {}
description: Task object
title: PaginatedTaskResultSetResultsItems
PaginationInfo:
type: object
properties:
has_next:
type: boolean
description: Indicates if more results are available
next_cursor:
type:
- string
- 'null'
format: uuid
description: Cursor for fetching the next page
page_limit:
type: integer
default: 20
description: Maximum items per page
total_count:
type:
- integer
- 'null'
description: Total number of items (if available)
required:
- has_next
- page_limit
description: Pagination metadata for navigating large result sets
title: PaginationInfo
PaginatedTaskResultSet:
type: object
properties:
results:
type: array
items:
$ref: '#/components/schemas/PaginatedTaskResultSetResultsItems'
description: The task results for this page
pagination:
$ref: '#/components/schemas/PaginationInfo'
description: Pagination metadata
required:
- results
- pagination
description: Paginated result set for tasks
title: PaginatedTaskResultSet
ErrorResponseDetailOneOf1Items:
type: object
properties:
loc:
type: array
items:
type: string
description: Path to the error location
msg:
type: string
description: Human-readable error message
type:
type: string
description: Error type identifier
required:
- msg
- type
title: ErrorResponseDetailOneOf1Items
ErrorResponseDetail1:
type: array
items:
$ref: '#/components/schemas/ErrorResponseDetailOneOf1Items'
description: Detailed validation errors
title: ErrorResponseDetail1
ErrorResponseDetail:
oneOf:
- type: string
- $ref: '#/components/schemas/ErrorResponseDetail1'
title: ErrorResponseDetail
ErrorResponseType:
type: string
enum:
- validation_error
- authorization_error
- resource_error
- server_error
description: Error category
title: ErrorResponseType
ErrorResponse:
type: object
properties:
detail:
$ref: '#/components/schemas/ErrorResponseDetail'
type:
$ref: '#/components/schemas/ErrorResponseType'
description: Error category
msg:
type: string
description: Error summary
required:
- detail
description: Standardized error response format used across all endpoints
title: ErrorResponse
securitySchemes:
HTTPBearer:
type: http
scheme: bearer
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
```
## SDK Code Examples
```python
import requests
url = "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task"
headers = {"Authorization": "Bearer "}
response = requests.get(url, headers=headers)
print(response.json())
```
```javascript
const url = 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task';
const options = {method: 'GET', headers: {Authorization: 'Bearer '}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer ")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer '
response = http.request(request)
puts response.read_body
```
```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.get("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task")
.header("Authorization", "Bearer ")
.asString();
```
```php
request('GET', 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task', [
'headers' => [
'Authorization' => 'Bearer ',
],
]);
echo $response->getBody();
```
```csharp
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer ");
IRestResponse response = client.Execute(request);
```
```swift
import Foundation
let headers = ["Authorization": "Bearer "]
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
# Create a New Task
POST https://app.rightbrain.ai/api/v1/org/{org_id}/project/{project_id}/task
Content-Type: application/json
Create a new Task with specified prompts, model configuration, and output format.
Tasks are the core building blocks that define how the LLM processes inputs and generates structured outputs. Each Task includes:
- System and user prompts that guide the LLM's behavior
- Input parameters that can be dynamically provided when running the Task
- Output format specification that ensures consistent, structured responses
- Output modality supporting multiple formats:
- `json`: Structured JSON responses (default)
- `image`: AI-generated images (requires image-capable model)
- `audio`: Voice/audio responses
- `pdf`: Formatted PDF documents
- `text`: Plain text output
- `csv`: Structured CSV data tables
- Optional fallback model for improved reliability when primary model fails
- Optional task run visibility controls for managing access to task execution history
- Optional image processing capabilities
- Optional RAG (Retrieval Augmented Generation) for domain-specific knowledge
**LLM Configuration (`llm_config`):**
Model-specific configuration options. Common parameters include:
- `temperature` (0.0-2.0): Controls randomness. Lower = more focused, higher = more creative
- `top_p` (0.0-1.0): Nucleus sampling. Use either temperature OR top_p, not both
- `max_tokens`: Maximum tokens in the response
- `quality` (for image models): "standard" or "hd"
- `size` (for image models): e.g., "1024x1024", "1792x1024"
**Output Format (`output_format`):**
Define the structure of task outputs. Two syntaxes are supported:
*Shorthand syntax* (simple fields):
```json
{"field_name": "str", "count": "int", "items": "array"}
```
*Object syntax* (with descriptions and constraints):
```json
{
"field_name": {
"type": "str",
"description": "What this field contains",
"options": ["option1", "option2"]
}
}
```
Supported types: `str`/`string`, `int`/`integer`, `number`, `bool`/`boolean`, `array`, `object`
**Task Run Visibility:**
- `owner_only` (default): Only task owners can view all task runs
- `editors_and_owners`: Task editors and owners can view all task runs
- `all_viewers`: All users with view permission can see all task runs
**Common Use Cases:**
*Structured Data Extraction:*
Create tasks with JSON output to extract structured data from unstructured text (e.g., invoice parsing, contact extraction).
*Image Generation:*
Set `output_modality: "image"` with DALL-E or similar models to generate images from text prompts.
*Document Analysis with Vision:*
Enable `vision_enabled: true` with a vision-capable model to analyze uploaded images or documents.
*Knowledge Base Q&A (RAG):*
Configure `rag` with collection IDs to ground responses in your organization's documents and knowledge.
*Automated Reports:*
Use `output_modality: "pdf"` to generate formatted reports that can be downloaded or emailed.
The Task will be created with an initial revision that becomes automatically active.
Reference: https://docs.rightbrain.ai/api-reference/api-reference/tasks/create-task
## OpenAPI Specification
```yaml
openapi: 3.1.0
info:
title: API
version: 1.0.0
paths:
/org/{org_id}/project/{project_id}/task:
post:
operationId: create-task
summary: Create a New Task
description: >-
Create a new Task with specified prompts, model configuration, and
output format.
Tasks are the core building blocks that define how the LLM processes
inputs and generates structured outputs. Each Task includes:
- System and user prompts that guide the LLM's behavior
- Input parameters that can be dynamically provided when running the
Task
- Output format specification that ensures consistent, structured
responses
- Output modality supporting multiple formats:
- `json`: Structured JSON responses (default)
- `image`: AI-generated images (requires image-capable model)
- `audio`: Voice/audio responses
- `pdf`: Formatted PDF documents
- `text`: Plain text output
- `csv`: Structured CSV data tables
- Optional fallback model for improved reliability when primary model
fails
- Optional task run visibility controls for managing access to task
execution history
- Optional image processing capabilities
- Optional RAG (Retrieval Augmented Generation) for domain-specific
knowledge
**LLM Configuration (`llm_config`):**
Model-specific configuration options. Common parameters include:
- `temperature` (0.0-2.0): Controls randomness. Lower = more focused,
higher = more creative
- `top_p` (0.0-1.0): Nucleus sampling. Use either temperature OR top_p,
not both
- `max_tokens`: Maximum tokens in the response
- `quality` (for image models): "standard" or "hd"
- `size` (for image models): e.g., "1024x1024", "1792x1024"
**Output Format (`output_format`):**
Define the structure of task outputs. Two syntaxes are supported:
*Shorthand syntax* (simple fields):
```json
{"field_name": "str", "count": "int", "items": "array"}
```
*Object syntax* (with descriptions and constraints):
```json
{
"field_name": {
"type": "str",
"description": "What this field contains",
"options": ["option1", "option2"]
}
}
```
Supported types: `str`/`string`, `int`/`integer`, `number`,
`bool`/`boolean`, `array`, `object`
**Task Run Visibility:**
- `owner_only` (default): Only task owners can view all task runs
- `editors_and_owners`: Task editors and owners can view all task runs
- `all_viewers`: All users with view permission can see all task runs
**Common Use Cases:**
*Structured Data Extraction:*
Create tasks with JSON output to extract structured data from
unstructured text (e.g., invoice parsing, contact extraction).
*Image Generation:*
Set `output_modality: "image"` with DALL-E or similar models to generate
images from text prompts.
*Document Analysis with Vision:*
Enable `vision_enabled: true` with a vision-capable model to analyze
uploaded images or documents.
*Knowledge Base Q&A (RAG):*
Configure `rag` with collection IDs to ground responses in your
organization's documents and knowledge.
*Automated Reports:*
Use `output_modality: "pdf"` to generate formatted reports that can be
downloaded or emailed.
The Task will be created with an initial revision that becomes
automatically active.
tags:
- subpackage_tasks
parameters:
- name: org_id
in: path
description: The unique identifier of the organization.
required: true
schema:
type: string
format: uuid
- name: project_id
in: path
description: The unique identifier of the project.
required: true
schema:
type: string
format: uuid
- name: Authorization
in: header
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
required: true
schema:
type: string
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/Task'
'400':
description: >-
Bad Request - Invalid task configuration
**Common causes:**
- Invalid UUID format in path or query parameters
- Missing required fields in the request body
- Invalid enum value provided
- Type mismatch (e.g., string instead of number)
**Resolution:** Check the request body and parameters match the
schema.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: >-
Unauthorized - Authentication failed
**Common causes:**
- Missing `Authorization` header
- Expired access token
- Invalid or malformed token
- Using API key in wrong format
**Resolution:** Ensure you're including a valid Bearer token or API
key in the Authorization header.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: >-
Forbidden - Insufficient permissions for tasks
**Common causes:**
- Your role lacks the required permission for this action
- The tasks belongs to a different organization or project
- The action requires admin or owner privileges
**Resolution:** Contact your organization admin to request
appropriate access.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: >-
Unprocessable Entity - Invalid request
**Common causes:**
- Request is well-formed but violates business rules
- Invalid combination of fields (e.g., mutually exclusive options)
- Referenced resource doesn't exist or is in wrong state
- Field value is valid type but out of acceptable range
**Resolution:** Check the error message for specific validation
failures and adjust your request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal Server Error - Failed to create task
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TaskCreate'
servers:
- url: https://app.rightbrain.ai/api/v1
- url: https://stag.leftbrain.me/api/v1
- url: https://app.rblocal.dev/api/v1
components:
schemas:
TagOutputFormatInputType:
type: string
enum:
- str
- string
- boolean
- bool
- int
- integer
- list
- object
- number
description: The desired output type from the LLM.
title: TagOutputFormatInputType
TagOutputFormatInputNestedStructure1:
type: string
enum:
- str
- string
- boolean
- bool
- int
- integer
- list
- object
- number
title: TagOutputFormatInputNestedStructure1
TagOutputFormatInputNestedStructure:
oneOf:
- $ref: '#/components/schemas/TagOutputFormat-Input'
- $ref: '#/components/schemas/TagOutputFormatInputNestedStructure1'
title: TagOutputFormatInputNestedStructure
TagOutputFormatInputItemType:
type: string
enum:
- str
- string
- boolean
- bool
- int
- integer
- list
- object
- number
description: For lists, the type of items within the list.
title: TagOutputFormatInputItemType
TagOutputFormat-Input:
type: object
properties:
type:
$ref: '#/components/schemas/TagOutputFormatInputType'
description: The desired output type from the LLM.
description:
type:
- string
- 'null'
description: A description of the desired content.
nested_structure:
type:
- object
- 'null'
additionalProperties:
$ref: '#/components/schemas/TagOutputFormatInputNestedStructure'
description: For lists optionally define the list structure.
options:
type:
- array
- 'null'
items:
type: string
description: Options to constrain the response to a specific set of values.
item_type:
oneOf:
- $ref: '#/components/schemas/TagOutputFormatInputItemType'
- type: 'null'
description: For lists, the type of items within the list.
required:
- type
title: TagOutputFormat-Input
TaskCreateOutputFormat1:
type: string
enum:
- str
- string
- boolean
- bool
- int
- integer
- list
- object
- number
title: TaskCreateOutputFormat1
TaskCreateOutputFormat:
oneOf:
- $ref: '#/components/schemas/TagOutputFormat-Input'
- $ref: '#/components/schemas/TaskCreateOutputFormat1'
title: TaskCreateOutputFormat
TaskRAG:
type: object
properties:
collection_id:
type: string
format: uuid
rag_param:
type: string
required:
- collection_id
- rag_param
title: TaskRAG
TaskInputProcessor:
type: object
properties:
param_name:
type: string
input_processor:
type: string
config:
type:
- object
- 'null'
additionalProperties:
description: Any type
required:
- param_name
- input_processor
title: TaskInputProcessor
OutputModality:
type: string
enum:
- json
- image
- audio
- pdf
- text
- csv
description: Output modality types for tasks.
title: OutputModality
TaskCreateTaskRunVisibility:
type: string
enum:
- owner_only
- editors_and_owners
- all_viewers
default: owner_only
description: >-
Controls who can view all task runs. 'owner_only' - only task owners see
all runs (default), 'editors_and_owners' - task editors and owners see
all runs, 'all_viewers' - all users with view permission see all runs.
title: TaskCreateTaskRunVisibility
TaskCreate:
type: object
properties:
system_prompt:
type: string
description: The system prompt that is used to set the LLM context.
user_prompt:
type: string
description: >-
The description of the Task. It is not required to mention the
outputs in the prompt, but it can help the model to understand the
context better. Any input strings should be referenced with the
dynamic `{...}` syntax, this informs the model to look for those
values in the input data.
llm_model_id:
type: string
format: uuid
description: The LLM model to use for the Task.
llm_config:
type: object
additionalProperties:
description: Any type
description: Specific configuration parameters for the LLM model.
output_format:
type:
- object
- 'null'
additionalProperties:
$ref: '#/components/schemas/TaskCreateOutputFormat'
description: >-
This gives control over the structure of how the Task responds.
Supports shorthand notation or an object with `type` can be
specified for each attribute. In most instances, the LLM will be
able to generate the desired output into the relevant property, but
an optional `description` can be passed to provide it with
additional context.
task_forwarder_id:
type:
- string
- 'null'
format: uuid
description: >-
The unique identifier for a valid Task Forwarder. It is used to
forward the Task output to another system or service.
rag:
oneOf:
- $ref: '#/components/schemas/TaskRAG'
- type: 'null'
description: >-
**Note: This is a Paid Tier feature.** Provide additional domain
specific input to the LLM so that it is able to reference user
specific information when executing the Task. Examples of this could
be a product catalogue, terms and conditions or a user manual.
image_required:
type: boolean
default: false
description: When `true` it requires an image to be sent in the Task Run request.
optimise_images:
type: boolean
default: true
description: >-
When `true` (default) images will be automatically optimised before
processing. Set to `false` to disable lossy image optimisation.
test:
type: boolean
default: false
description: >-
True if revision is a test revision. Test revisions cannot be live
and are used for rapid Task testing/iteration.
input_processors:
type: array
items:
$ref: '#/components/schemas/TaskInputProcessor'
annotation:
type:
- string
- 'null'
description: >-
Optional note or comment about this revision. Useful for tracking
changes, experiments, or the purpose of test revisions.
fallback_llm_model_id:
type:
- string
- 'null'
format: uuid
description: The LLM model to use as fallback if the primary model fails.
fallback_llm_config:
type:
- object
- 'null'
additionalProperties:
description: Any type
description: Specific configuration parameters for the fallback LLM model.
name:
type: string
description: A name or reference for the Task.
description:
type:
- string
- 'null'
description: A longer description of the Task for internal reference.
enabled:
type: boolean
description: >-
When `true` the Task is active and callable. `false` denotes the
Task is not yet operational.
public:
type: boolean
default: false
description: When `true` the Task is public and can be accessed by any User.
exposed_to_agents:
type: boolean
default: false
description: >-
When `true` the Task is accessible to agents through the
unauthenticated agent endpoint.
output_modality:
$ref: '#/components/schemas/OutputModality'
description: >-
Specifies the output modality of the task. Can be 'json', 'image',
'audio', 'pdf', 'text', or 'csv'. Defaults to 'json'.
task_run_visibility:
$ref: '#/components/schemas/TaskCreateTaskRunVisibility'
description: >-
Controls who can view all task runs. 'owner_only' - only task owners
see all runs (default), 'editors_and_owners' - task editors and
owners see all runs, 'all_viewers' - all users with view permission
see all runs.
required:
- system_prompt
- user_prompt
- llm_model_id
- name
- enabled
title: TaskCreate
TaskTaskRunVisibility:
type: string
enum:
- owner_only
- editors_and_owners
- all_viewers
default: owner_only
description: >-
Controls who can view all task runs. 'owner_only' - only task owners see
all runs (default), 'editors_and_owners' - task editors and owners see
all runs, 'all_viewers' - all users with view permission see all runs.
title: TaskTaskRunVisibility
TagOutputFormat-Output:
type: object
additionalProperties:
description: Any type
title: TagOutputFormat-Output
TaskRevisionOutputFormat1:
type: string
enum:
- str
- string
- boolean
- bool
- int
- integer
- list
- object
- number
title: TaskRevisionOutputFormat1
TaskRevisionOutputFormat:
oneOf:
- $ref: '#/components/schemas/TagOutputFormat-Output'
- $ref: '#/components/schemas/TaskRevisionOutputFormat1'
title: TaskRevisionOutputFormat
TagEntityType:
type: string
enum:
- task
- task_revision
description: The type of entity this tag applies to (task or task_revision)
title: TagEntityType
Tag:
type: object
properties:
name:
type: string
description: >-
Alphanumeric name for the tag (max 15 characters). Used to organize
and filter Tasks and Task Revisions.
parent_id:
type:
- string
- 'null'
format: uuid
description: >-
Optional UUID of a parent tag. Used to create hierarchical tag
structures (e.g., staging under production).
entity_type:
$ref: '#/components/schemas/TagEntityType'
description: The type of entity this tag applies to (task or task_revision)
id:
type: string
format: uuid
description: Unique identifier for the tag.
project_id:
type: string
format: uuid
description: Project this tag belongs to.
created_at:
type: string
description: ISO 8601 timestamp when the tag was created.
children:
type: array
items:
$ref: '#/components/schemas/Tag'
description: >-
List of child tags if this tag is used as a parent in a hierarchical
structure.
is_project_tag:
type: boolean
description: >-
When true, indicates this is a project-level tag that can be used
across multiple entity types.
tagged_entities:
type: array
items:
type: string
format: uuid
description: List of entity IDs this tag is associated with.
required:
- name
- entity_type
- id
- project_id
- created_at
- is_project_tag
title: Tag
LLMModelComment:
type: object
properties:
title:
type: string
description: Brief title for the comment.
description:
type: string
description: Detailed description of the comment or observation.
active:
type: boolean
default: true
description: Whether this comment is currently active/relevant.
created:
type:
- string
- 'null'
description: When this comment was created.
modified:
type:
- string
- 'null'
description: When this comment was last modified.
id:
type: string
format: uuid
llm_model_id:
type: string
format: uuid
required:
- title
- description
- id
- llm_model_id
title: LLMModelComment
LLMModel:
type: object
properties:
provider:
type: string
description: The company that produces the LLM (e.g., OpenAI, Anthropic, Meta).
vendor:
type: string
description: >-
The service provider or platform hosting the model (e.g., OpenAI,
Azure, Groq).
name:
type: string
description: The model's reference name used for API calls.
alias:
type: string
description: Human-readable name for the model.
description:
type: string
description: >-
Detailed description of the model's capabilities, context window,
and knowledge cutoff.
supports_vision:
type: boolean
description: Whether the model can process and analyze images.
supports_image_output:
type: boolean
default: false
description: Whether the model can generate images as output.
max_context_window:
type: integer
description: Maximum number of tokens the model can process in a single request.
model_params:
type:
- object
- 'null'
additionalProperties:
description: Any type
description: >-
JSON Schema defining allowed model parameters for this model. Each
parameter name maps to a JSON Schema specification defining its
type, constraints, and validation rules.
created:
type:
- string
- 'null'
modified:
type:
- string
- 'null'
id:
type: string
format: uuid
replaced_by:
type:
- string
- 'null'
format: uuid
retired:
type:
- string
- 'null'
llm_model_comments:
type: array
items:
$ref: '#/components/schemas/LLMModelComment'
required:
- provider
- vendor
- name
- alias
- description
- supports_vision
- max_context_window
- id
title: LLMModel
TaskRevision:
type: object
properties:
system_prompt:
type: string
description: The system prompt that is used to set the LLM context.
user_prompt:
type: string
description: >-
The description of the Task. It is not required to mention the
outputs in the prompt, but it can help the model to understand the
context better. Any input strings should be referenced with the
dynamic `{...}` syntax, this informs the model to look for those
values in the input data.
llm_model_id:
type: string
format: uuid
description: The LLM model to use for the Task.
llm_config:
type: object
additionalProperties:
description: Any type
description: Specific configuration parameters for the LLM model.
output_format:
type:
- object
- 'null'
additionalProperties:
$ref: '#/components/schemas/TaskRevisionOutputFormat'
description: >-
This gives control over the structure of how the Task responds.
Supports shorthand notation or an object with `type` can be
specified for each attribute. In most instances, the LLM will be
able to generate the desired output into the relevant property, but
an optional `description` can be passed to provide it with
additional context.
task_forwarder_id:
type:
- string
- 'null'
format: uuid
description: >-
The unique identifier for a valid Task Forwarder. It is used to
forward the Task output to another system or service.
rag:
oneOf:
- $ref: '#/components/schemas/TaskRAG'
- type: 'null'
description: >-
**Note: This is a Paid Tier feature.** Provide additional domain
specific input to the LLM so that it is able to reference user
specific information when executing the Task. Examples of this could
be a product catalogue, terms and conditions or a user manual.
image_required:
type: boolean
default: false
description: When `true` it requires an image to be sent in the Task Run request.
optimise_images:
type: boolean
default: true
description: >-
When `true` (default) images will be automatically optimised before
processing. Set to `false` to disable lossy image optimisation.
test:
type: boolean
default: false
description: >-
True if revision is a test revision. Test revisions cannot be live
and are used for rapid Task testing/iteration.
input_processors:
type: array
items:
$ref: '#/components/schemas/TaskInputProcessor'
annotation:
type:
- string
- 'null'
description: >-
Optional note or comment about this revision. Useful for tracking
changes, experiments, or the purpose of test revisions.
fallback_llm_model_id:
type:
- string
- 'null'
format: uuid
description: The LLM model to use as fallback if the primary model fails.
fallback_llm_config:
type:
- object
- 'null'
additionalProperties:
description: Any type
description: Specific configuration parameters for the fallback LLM model.
id:
type: string
format: uuid
description: The unique identifier of the Revision.
created:
type: string
description: When the Task was created.
modified:
type:
- string
- 'null'
description: When the Task was last updated.
active:
type: boolean
default: false
description: >-
When `true` the Revision is the currently active version and will be
activated when the Task Run is executed.
tags:
type: array
items:
$ref: '#/components/schemas/Tag'
llm_model:
$ref: '#/components/schemas/LLMModel'
fallback_llm_model:
oneOf:
- $ref: '#/components/schemas/LLMModel'
- type: 'null'
input_params:
type: array
items:
type: string
description: >-
A list of all the dynamic input parameters that are detected from
the user prompt.
required:
- system_prompt
- user_prompt
- llm_model_id
- id
- created
- modified
- llm_model
- input_params
title: TaskRevision
TaskActiveRevision:
type: object
properties:
task_revision_id:
type: string
format: uuid
description: >-
The unique identifier of the Task Revision to activate. Each Task
can have multiple revisions, but only active ones will be used for
execution.
weight:
type:
- number
- 'null'
format: double
default: 1
description: >-
The traffic weight for this revision (between 0 and 1). When
multiple revisions are active, weights determine the proportion of
traffic each receives. Must sum to 1.0 across all active revisions.
required:
- task_revision_id
title: TaskActiveRevision
Task:
type: object
properties:
name:
type: string
description: A name or reference for the Task.
description:
type:
- string
- 'null'
description: A longer description of the Task for internal reference.
enabled:
type: boolean
description: >-
When `true` the Task is active and callable. `false` denotes the
Task is not yet operational.
public:
type: boolean
default: false
description: When `true` the Task is public and can be accessed by any User.
exposed_to_agents:
type: boolean
default: false
description: >-
When `true` the Task is accessible to agents through the
unauthenticated agent endpoint.
output_modality:
$ref: '#/components/schemas/OutputModality'
description: >-
Specifies the output modality of the task. Can be 'json', 'image',
'audio', 'pdf', 'text', or 'csv'. Defaults to 'json'.
task_run_visibility:
$ref: '#/components/schemas/TaskTaskRunVisibility'
description: >-
Controls who can view all task runs. 'owner_only' - only task owners
see all runs (default), 'editors_and_owners' - task editors and
owners see all runs, 'all_viewers' - all users with view permission
see all runs.
id:
type: string
format: uuid
description: The unique identifier of the Task.
project_id:
type: string
format: uuid
description: The Project that the Task belongs to.
created:
type: string
description: When the Task was created.
modified:
type:
- string
- 'null'
description: When the Task was last updated.
deleted:
type:
- string
- 'null'
description: Timestamp when the task was deleted, if applicable.
revisions:
type: array
items:
$ref: '#/components/schemas/TaskRevision'
description: >-
Each update to a Task results in a new Revision being created. Task
Revisions are a powerful concept that can be used to assist with A/B
testing, comparing responses from different LLM's, etc.
access_token:
type:
- string
- 'null'
description: >-
Task specific Bearer token that can be used to authenticated when
executing this Task.
active_revisions:
type: array
items:
$ref: '#/components/schemas/TaskActiveRevision'
description: The revision currently active for this Task.
cloned_from_task_revision_id:
type:
- string
- 'null'
format: uuid
description: >-
The unique identifier of the task revision this task was cloned
from, if applicable.
tags:
type: array
items:
$ref: '#/components/schemas/Tag'
required:
- name
- enabled
- id
- project_id
- created
- access_token
- active_revisions
title: Task
ErrorResponseDetailOneOf1Items:
type: object
properties:
loc:
type: array
items:
type: string
description: Path to the error location
msg:
type: string
description: Human-readable error message
type:
type: string
description: Error type identifier
required:
- msg
- type
title: ErrorResponseDetailOneOf1Items
ErrorResponseDetail1:
type: array
items:
$ref: '#/components/schemas/ErrorResponseDetailOneOf1Items'
description: Detailed validation errors
title: ErrorResponseDetail1
ErrorResponseDetail:
oneOf:
- type: string
- $ref: '#/components/schemas/ErrorResponseDetail1'
title: ErrorResponseDetail
ErrorResponseType:
type: string
enum:
- validation_error
- authorization_error
- resource_error
- server_error
description: Error category
title: ErrorResponseType
ErrorResponse:
type: object
properties:
detail:
$ref: '#/components/schemas/ErrorResponseDetail'
type:
$ref: '#/components/schemas/ErrorResponseType'
description: Error category
msg:
type: string
description: Error summary
required:
- detail
description: Standardized error response format used across all endpoints
title: ErrorResponse
securitySchemes:
HTTPBearer:
type: http
scheme: bearer
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
```
## SDK Code Examples
```python Tasks_createTask_example
import requests
url = "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task"
headers = {
"Authorization": "Bearer ",
"Content-Type": "application/json"
}
response = requests.post(url, headers=headers)
print(response.json())
```
```javascript Tasks_createTask_example
const url = 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'},
body: undefined
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go Tasks_createTask_example
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer ")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby Tasks_createTask_example
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer '
request["Content-Type"] = 'application/json'
response = http.request(request)
puts response.read_body
```
```java Tasks_createTask_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.post("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task")
.header("Authorization", "Bearer ")
.header("Content-Type", "application/json")
.asString();
```
```php Tasks_createTask_example
request('POST', 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task', [
'headers' => [
'Authorization' => 'Bearer ',
'Content-Type' => 'application/json',
],
]);
echo $response->getBody();
```
```csharp Tasks_createTask_example
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer ");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```
```swift Tasks_createTask_example
import Foundation
let headers = [
"Authorization": "Bearer ",
"Content-Type": "application/json"
]
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
```python Non-JSON output modalities (image/audio/pdf/text/csv)
import requests
url = "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task"
payload = {
"system_prompt": "You are an AI that generates logo descriptions for image generation.",
"user_prompt": "Create a logo for: {{company_description}}",
"llm_model_id": "string",
"name": "Logo Generator",
"enabled": True,
"llm_config": {
"quality": "standard",
"size": "1024x1024"
},
"description": "Generates logos based on description",
"output_modality": "image",
"llm_model": "c3847a5f-8b2e-4f8a-b1c9-d238e4a5f3b2"
}
headers = {
"Authorization": "Bearer ",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
```
```javascript Non-JSON output modalities (image/audio/pdf/text/csv)
const url = 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'},
body: '{"system_prompt":"You are an AI that generates logo descriptions for image generation.","user_prompt":"Create a logo for: {{company_description}}","llm_model_id":"string","name":"Logo Generator","enabled":true,"llm_config":{"quality":"standard","size":"1024x1024"},"description":"Generates logos based on description","output_modality":"image","llm_model":"c3847a5f-8b2e-4f8a-b1c9-d238e4a5f3b2"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go Non-JSON output modalities (image/audio/pdf/text/csv)
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task"
payload := strings.NewReader("{\n \"system_prompt\": \"You are an AI that generates logo descriptions for image generation.\",\n \"user_prompt\": \"Create a logo for: {{company_description}}\",\n \"llm_model_id\": \"string\",\n \"name\": \"Logo Generator\",\n \"enabled\": true,\n \"llm_config\": {\n \"quality\": \"standard\",\n \"size\": \"1024x1024\"\n },\n \"description\": \"Generates logos based on description\",\n \"output_modality\": \"image\",\n \"llm_model\": \"c3847a5f-8b2e-4f8a-b1c9-d238e4a5f3b2\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer ")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby Non-JSON output modalities (image/audio/pdf/text/csv)
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer '
request["Content-Type"] = 'application/json'
request.body = "{\n \"system_prompt\": \"You are an AI that generates logo descriptions for image generation.\",\n \"user_prompt\": \"Create a logo for: {{company_description}}\",\n \"llm_model_id\": \"string\",\n \"name\": \"Logo Generator\",\n \"enabled\": true,\n \"llm_config\": {\n \"quality\": \"standard\",\n \"size\": \"1024x1024\"\n },\n \"description\": \"Generates logos based on description\",\n \"output_modality\": \"image\",\n \"llm_model\": \"c3847a5f-8b2e-4f8a-b1c9-d238e4a5f3b2\"\n}"
response = http.request(request)
puts response.read_body
```
```java Non-JSON output modalities (image/audio/pdf/text/csv)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.post("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task")
.header("Authorization", "Bearer ")
.header("Content-Type", "application/json")
.body("{\n \"system_prompt\": \"You are an AI that generates logo descriptions for image generation.\",\n \"user_prompt\": \"Create a logo for: {{company_description}}\",\n \"llm_model_id\": \"string\",\n \"name\": \"Logo Generator\",\n \"enabled\": true,\n \"llm_config\": {\n \"quality\": \"standard\",\n \"size\": \"1024x1024\"\n },\n \"description\": \"Generates logos based on description\",\n \"output_modality\": \"image\",\n \"llm_model\": \"c3847a5f-8b2e-4f8a-b1c9-d238e4a5f3b2\"\n}")
.asString();
```
```php Non-JSON output modalities (image/audio/pdf/text/csv)
request('POST', 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task', [
'body' => '{
"system_prompt": "You are an AI that generates logo descriptions for image generation.",
"user_prompt": "Create a logo for: {{company_description}}",
"llm_model_id": "string",
"name": "Logo Generator",
"enabled": true,
"llm_config": {
"quality": "standard",
"size": "1024x1024"
},
"description": "Generates logos based on description",
"output_modality": "image",
"llm_model": "c3847a5f-8b2e-4f8a-b1c9-d238e4a5f3b2"
}',
'headers' => [
'Authorization' => 'Bearer ',
'Content-Type' => 'application/json',
],
]);
echo $response->getBody();
```
```csharp Non-JSON output modalities (image/audio/pdf/text/csv)
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer ");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"system_prompt\": \"You are an AI that generates logo descriptions for image generation.\",\n \"user_prompt\": \"Create a logo for: {{company_description}}\",\n \"llm_model_id\": \"string\",\n \"name\": \"Logo Generator\",\n \"enabled\": true,\n \"llm_config\": {\n \"quality\": \"standard\",\n \"size\": \"1024x1024\"\n },\n \"description\": \"Generates logos based on description\",\n \"output_modality\": \"image\",\n \"llm_model\": \"c3847a5f-8b2e-4f8a-b1c9-d238e4a5f3b2\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```
```swift Non-JSON output modalities (image/audio/pdf/text/csv)
import Foundation
let headers = [
"Authorization": "Bearer ",
"Content-Type": "application/json"
]
let parameters = [
"system_prompt": "You are an AI that generates logo descriptions for image generation.",
"user_prompt": "Create a logo for: {{company_description}}",
"llm_model_id": "string",
"name": "Logo Generator",
"enabled": true,
"llm_config": [
"quality": "standard",
"size": "1024x1024"
],
"description": "Generates logos based on description",
"output_modality": "image",
"llm_model": "c3847a5f-8b2e-4f8a-b1c9-d238e4a5f3b2"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
```python Task with RAG enabled
import requests
url = "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task"
payload = {
"system_prompt": "You are a helpful assistant. Use the provided context to answer questions.",
"user_prompt": "Context: {{context}}
Question: {{question}}",
"llm_model_id": "string",
"name": "Knowledge Q&A",
"enabled": True,
"output_format": [
{
"name": "answer",
"description": "Answer to the question"
},
{
"name": "confidence",
"description": "Confidence score",
"type": "number"
}
],
"rag": {
"collection_id": "01908843-1234-5678-9abc-def012345678",
"rag_param": "string",
"topK": 5,
"filters": { "category": "technical" }
},
"description": "Answers questions using knowledge base",
"exposed_to_agents": True,
"output_modality": "json",
"input_params": [
{
"name": "question",
"description": "User's question"
}
],
"output_format_type": "json",
"llm_model": "ec217e75-72ea-4281-a1b8-cb7bd0ef9f41"
}
headers = {
"Authorization": "Bearer ",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
```
```javascript Task with RAG enabled
const url = 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'},
body: '{"system_prompt":"You are a helpful assistant. Use the provided context to answer questions.","user_prompt":"Context: {{context}}\n\nQuestion: {{question}}","llm_model_id":"string","name":"Knowledge Q&A","enabled":true,"output_format":[{"name":"answer","description":"Answer to the question"},{"name":"confidence","description":"Confidence score","type":"number"}],"rag":{"collection_id":"01908843-1234-5678-9abc-def012345678","rag_param":"string","topK":5,"filters":{"category":"technical"}},"description":"Answers questions using knowledge base","exposed_to_agents":true,"output_modality":"json","input_params":[{"name":"question","description":"User\'s question"}],"output_format_type":"json","llm_model":"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go Task with RAG enabled
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task"
payload := strings.NewReader("{\n \"system_prompt\": \"You are a helpful assistant. Use the provided context to answer questions.\",\n \"user_prompt\": \"Context: {{context}}\\n\\nQuestion: {{question}}\",\n \"llm_model_id\": \"string\",\n \"name\": \"Knowledge Q&A\",\n \"enabled\": true,\n \"output_format\": [\n {\n \"name\": \"answer\",\n \"description\": \"Answer to the question\"\n },\n {\n \"name\": \"confidence\",\n \"description\": \"Confidence score\",\n \"type\": \"number\"\n }\n ],\n \"rag\": {\n \"collection_id\": \"01908843-1234-5678-9abc-def012345678\",\n \"rag_param\": \"string\",\n \"topK\": 5,\n \"filters\": {\n \"category\": \"technical\"\n }\n },\n \"description\": \"Answers questions using knowledge base\",\n \"exposed_to_agents\": true,\n \"output_modality\": \"json\",\n \"input_params\": [\n {\n \"name\": \"question\",\n \"description\": \"User's question\"\n }\n ],\n \"output_format_type\": \"json\",\n \"llm_model\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer ")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby Task with RAG enabled
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer '
request["Content-Type"] = 'application/json'
request.body = "{\n \"system_prompt\": \"You are a helpful assistant. Use the provided context to answer questions.\",\n \"user_prompt\": \"Context: {{context}}\\n\\nQuestion: {{question}}\",\n \"llm_model_id\": \"string\",\n \"name\": \"Knowledge Q&A\",\n \"enabled\": true,\n \"output_format\": [\n {\n \"name\": \"answer\",\n \"description\": \"Answer to the question\"\n },\n {\n \"name\": \"confidence\",\n \"description\": \"Confidence score\",\n \"type\": \"number\"\n }\n ],\n \"rag\": {\n \"collection_id\": \"01908843-1234-5678-9abc-def012345678\",\n \"rag_param\": \"string\",\n \"topK\": 5,\n \"filters\": {\n \"category\": \"technical\"\n }\n },\n \"description\": \"Answers questions using knowledge base\",\n \"exposed_to_agents\": true,\n \"output_modality\": \"json\",\n \"input_params\": [\n {\n \"name\": \"question\",\n \"description\": \"User's question\"\n }\n ],\n \"output_format_type\": \"json\",\n \"llm_model\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\"\n}"
response = http.request(request)
puts response.read_body
```
```java Task with RAG enabled
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.post("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task")
.header("Authorization", "Bearer ")
.header("Content-Type", "application/json")
.body("{\n \"system_prompt\": \"You are a helpful assistant. Use the provided context to answer questions.\",\n \"user_prompt\": \"Context: {{context}}\\n\\nQuestion: {{question}}\",\n \"llm_model_id\": \"string\",\n \"name\": \"Knowledge Q&A\",\n \"enabled\": true,\n \"output_format\": [\n {\n \"name\": \"answer\",\n \"description\": \"Answer to the question\"\n },\n {\n \"name\": \"confidence\",\n \"description\": \"Confidence score\",\n \"type\": \"number\"\n }\n ],\n \"rag\": {\n \"collection_id\": \"01908843-1234-5678-9abc-def012345678\",\n \"rag_param\": \"string\",\n \"topK\": 5,\n \"filters\": {\n \"category\": \"technical\"\n }\n },\n \"description\": \"Answers questions using knowledge base\",\n \"exposed_to_agents\": true,\n \"output_modality\": \"json\",\n \"input_params\": [\n {\n \"name\": \"question\",\n \"description\": \"User's question\"\n }\n ],\n \"output_format_type\": \"json\",\n \"llm_model\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\"\n}")
.asString();
```
```php Task with RAG enabled
request('POST', 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task', [
'body' => '{
"system_prompt": "You are a helpful assistant. Use the provided context to answer questions.",
"user_prompt": "Context: {{context}}\\n\\nQuestion: {{question}}",
"llm_model_id": "string",
"name": "Knowledge Q&A",
"enabled": true,
"output_format": [
{
"name": "answer",
"description": "Answer to the question"
},
{
"name": "confidence",
"description": "Confidence score",
"type": "number"
}
],
"rag": {
"collection_id": "01908843-1234-5678-9abc-def012345678",
"rag_param": "string",
"topK": 5,
"filters": {
"category": "technical"
}
},
"description": "Answers questions using knowledge base",
"exposed_to_agents": true,
"output_modality": "json",
"input_params": [
{
"name": "question",
"description": "User\'s question"
}
],
"output_format_type": "json",
"llm_model": "ec217e75-72ea-4281-a1b8-cb7bd0ef9f41"
}',
'headers' => [
'Authorization' => 'Bearer ',
'Content-Type' => 'application/json',
],
]);
echo $response->getBody();
```
```csharp Task with RAG enabled
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer ");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"system_prompt\": \"You are a helpful assistant. Use the provided context to answer questions.\",\n \"user_prompt\": \"Context: {{context}}\\n\\nQuestion: {{question}}\",\n \"llm_model_id\": \"string\",\n \"name\": \"Knowledge Q&A\",\n \"enabled\": true,\n \"output_format\": [\n {\n \"name\": \"answer\",\n \"description\": \"Answer to the question\"\n },\n {\n \"name\": \"confidence\",\n \"description\": \"Confidence score\",\n \"type\": \"number\"\n }\n ],\n \"rag\": {\n \"collection_id\": \"01908843-1234-5678-9abc-def012345678\",\n \"rag_param\": \"string\",\n \"topK\": 5,\n \"filters\": {\n \"category\": \"technical\"\n }\n },\n \"description\": \"Answers questions using knowledge base\",\n \"exposed_to_agents\": true,\n \"output_modality\": \"json\",\n \"input_params\": [\n {\n \"name\": \"question\",\n \"description\": \"User's question\"\n }\n ],\n \"output_format_type\": \"json\",\n \"llm_model\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```
```swift Task with RAG enabled
import Foundation
let headers = [
"Authorization": "Bearer ",
"Content-Type": "application/json"
]
let parameters = [
"system_prompt": "You are a helpful assistant. Use the provided context to answer questions.",
"user_prompt": "Context: {{context}}
Question: {{question}}",
"llm_model_id": "string",
"name": "Knowledge Q&A",
"enabled": true,
"output_format": [
[
"name": "answer",
"description": "Answer to the question"
],
[
"name": "confidence",
"description": "Confidence score",
"type": "number"
]
],
"rag": [
"collection_id": "01908843-1234-5678-9abc-def012345678",
"rag_param": "string",
"topK": 5,
"filters": ["category": "technical"]
],
"description": "Answers questions using knowledge base",
"exposed_to_agents": true,
"output_modality": "json",
"input_params": [
[
"name": "question",
"description": "User's question"
]
],
"output_format_type": "json",
"llm_model": "ec217e75-72ea-4281-a1b8-cb7bd0ef9f41"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
```python Task with image support
import requests
url = "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task"
payload = {
"system_prompt": "You are an image analysis expert.",
"user_prompt": "Analyze this image and describe: {{description_type}}",
"llm_model_id": "string",
"name": "Image Analyzer",
"enabled": True,
"output_format": [
{
"name": "description",
"description": "Image description"
},
{
"name": "objects",
"description": "Detected objects",
"type": "array"
}
],
"image_required": True,
"optimise_images": True,
"description": "Analyzes and describes images",
"input_params": [
{
"name": "description_type",
"description": "What to focus on"
}
],
"output_format_type": "json",
"llm_model": "ec217e75-72ea-4281-a1b8-cb7bd0ef9f41"
}
headers = {
"Authorization": "Bearer ",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
```
```javascript Task with image support
const url = 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'},
body: '{"system_prompt":"You are an image analysis expert.","user_prompt":"Analyze this image and describe: {{description_type}}","llm_model_id":"string","name":"Image Analyzer","enabled":true,"output_format":[{"name":"description","description":"Image description"},{"name":"objects","description":"Detected objects","type":"array"}],"image_required":true,"optimise_images":true,"description":"Analyzes and describes images","input_params":[{"name":"description_type","description":"What to focus on"}],"output_format_type":"json","llm_model":"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go Task with image support
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task"
payload := strings.NewReader("{\n \"system_prompt\": \"You are an image analysis expert.\",\n \"user_prompt\": \"Analyze this image and describe: {{description_type}}\",\n \"llm_model_id\": \"string\",\n \"name\": \"Image Analyzer\",\n \"enabled\": true,\n \"output_format\": [\n {\n \"name\": \"description\",\n \"description\": \"Image description\"\n },\n {\n \"name\": \"objects\",\n \"description\": \"Detected objects\",\n \"type\": \"array\"\n }\n ],\n \"image_required\": true,\n \"optimise_images\": true,\n \"description\": \"Analyzes and describes images\",\n \"input_params\": [\n {\n \"name\": \"description_type\",\n \"description\": \"What to focus on\"\n }\n ],\n \"output_format_type\": \"json\",\n \"llm_model\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer ")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby Task with image support
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer '
request["Content-Type"] = 'application/json'
request.body = "{\n \"system_prompt\": \"You are an image analysis expert.\",\n \"user_prompt\": \"Analyze this image and describe: {{description_type}}\",\n \"llm_model_id\": \"string\",\n \"name\": \"Image Analyzer\",\n \"enabled\": true,\n \"output_format\": [\n {\n \"name\": \"description\",\n \"description\": \"Image description\"\n },\n {\n \"name\": \"objects\",\n \"description\": \"Detected objects\",\n \"type\": \"array\"\n }\n ],\n \"image_required\": true,\n \"optimise_images\": true,\n \"description\": \"Analyzes and describes images\",\n \"input_params\": [\n {\n \"name\": \"description_type\",\n \"description\": \"What to focus on\"\n }\n ],\n \"output_format_type\": \"json\",\n \"llm_model\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\"\n}"
response = http.request(request)
puts response.read_body
```
```java Task with image support
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.post("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task")
.header("Authorization", "Bearer ")
.header("Content-Type", "application/json")
.body("{\n \"system_prompt\": \"You are an image analysis expert.\",\n \"user_prompt\": \"Analyze this image and describe: {{description_type}}\",\n \"llm_model_id\": \"string\",\n \"name\": \"Image Analyzer\",\n \"enabled\": true,\n \"output_format\": [\n {\n \"name\": \"description\",\n \"description\": \"Image description\"\n },\n {\n \"name\": \"objects\",\n \"description\": \"Detected objects\",\n \"type\": \"array\"\n }\n ],\n \"image_required\": true,\n \"optimise_images\": true,\n \"description\": \"Analyzes and describes images\",\n \"input_params\": [\n {\n \"name\": \"description_type\",\n \"description\": \"What to focus on\"\n }\n ],\n \"output_format_type\": \"json\",\n \"llm_model\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\"\n}")
.asString();
```
```php Task with image support
request('POST', 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task', [
'body' => '{
"system_prompt": "You are an image analysis expert.",
"user_prompt": "Analyze this image and describe: {{description_type}}",
"llm_model_id": "string",
"name": "Image Analyzer",
"enabled": true,
"output_format": [
{
"name": "description",
"description": "Image description"
},
{
"name": "objects",
"description": "Detected objects",
"type": "array"
}
],
"image_required": true,
"optimise_images": true,
"description": "Analyzes and describes images",
"input_params": [
{
"name": "description_type",
"description": "What to focus on"
}
],
"output_format_type": "json",
"llm_model": "ec217e75-72ea-4281-a1b8-cb7bd0ef9f41"
}',
'headers' => [
'Authorization' => 'Bearer ',
'Content-Type' => 'application/json',
],
]);
echo $response->getBody();
```
```csharp Task with image support
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer ");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"system_prompt\": \"You are an image analysis expert.\",\n \"user_prompt\": \"Analyze this image and describe: {{description_type}}\",\n \"llm_model_id\": \"string\",\n \"name\": \"Image Analyzer\",\n \"enabled\": true,\n \"output_format\": [\n {\n \"name\": \"description\",\n \"description\": \"Image description\"\n },\n {\n \"name\": \"objects\",\n \"description\": \"Detected objects\",\n \"type\": \"array\"\n }\n ],\n \"image_required\": true,\n \"optimise_images\": true,\n \"description\": \"Analyzes and describes images\",\n \"input_params\": [\n {\n \"name\": \"description_type\",\n \"description\": \"What to focus on\"\n }\n ],\n \"output_format_type\": \"json\",\n \"llm_model\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```
```swift Task with image support
import Foundation
let headers = [
"Authorization": "Bearer ",
"Content-Type": "application/json"
]
let parameters = [
"system_prompt": "You are an image analysis expert.",
"user_prompt": "Analyze this image and describe: {{description_type}}",
"llm_model_id": "string",
"name": "Image Analyzer",
"enabled": true,
"output_format": [
[
"name": "description",
"description": "Image description"
],
[
"name": "objects",
"description": "Detected objects",
"type": "array"
]
],
"image_required": true,
"optimise_images": true,
"description": "Analyzes and describes images",
"input_params": [
[
"name": "description_type",
"description": "What to focus on"
]
],
"output_format_type": "json",
"llm_model": "ec217e75-72ea-4281-a1b8-cb7bd0ef9f41"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
```python Task with input processors
import requests
url = "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task"
payload = {
"system_prompt": "You are a content analyzer.",
"user_prompt": "Analyze this content: {{url}}",
"llm_model_id": "string",
"name": "URL Content Analyzer",
"enabled": True,
"output_format": {
"summary": "str",
"sentiment": {
"type": "str",
"options": ["positive", "negative", "neutral"]
}
},
"input_processors": [
{
"param_name": "url",
"input_processor": "url_fetcher",
"config": { "timeout": 30 }
}
],
"annotation": "Testing URL content analysis with input processors",
"description": "Analyzes content from URLs",
"exposed_to_agents": True,
"llm_model": "ec217e75-72ea-4281-a1b8-cb7bd0ef9f41"
}
headers = {
"Authorization": "Bearer ",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
```
```javascript Task with input processors
const url = 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'},
body: '{"system_prompt":"You are a content analyzer.","user_prompt":"Analyze this content: {{url}}","llm_model_id":"string","name":"URL Content Analyzer","enabled":true,"output_format":{"summary":"str","sentiment":{"type":"str","options":["positive","negative","neutral"]}},"input_processors":[{"param_name":"url","input_processor":"url_fetcher","config":{"timeout":30}}],"annotation":"Testing URL content analysis with input processors","description":"Analyzes content from URLs","exposed_to_agents":true,"llm_model":"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go Task with input processors
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task"
payload := strings.NewReader("{\n \"system_prompt\": \"You are a content analyzer.\",\n \"user_prompt\": \"Analyze this content: {{url}}\",\n \"llm_model_id\": \"string\",\n \"name\": \"URL Content Analyzer\",\n \"enabled\": true,\n \"output_format\": {\n \"summary\": \"str\",\n \"sentiment\": {\n \"type\": \"str\",\n \"options\": [\n \"positive\",\n \"negative\",\n \"neutral\"\n ]\n }\n },\n \"input_processors\": [\n {\n \"param_name\": \"url\",\n \"input_processor\": \"url_fetcher\",\n \"config\": {\n \"timeout\": 30\n }\n }\n ],\n \"annotation\": \"Testing URL content analysis with input processors\",\n \"description\": \"Analyzes content from URLs\",\n \"exposed_to_agents\": true,\n \"llm_model\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer ")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby Task with input processors
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer '
request["Content-Type"] = 'application/json'
request.body = "{\n \"system_prompt\": \"You are a content analyzer.\",\n \"user_prompt\": \"Analyze this content: {{url}}\",\n \"llm_model_id\": \"string\",\n \"name\": \"URL Content Analyzer\",\n \"enabled\": true,\n \"output_format\": {\n \"summary\": \"str\",\n \"sentiment\": {\n \"type\": \"str\",\n \"options\": [\n \"positive\",\n \"negative\",\n \"neutral\"\n ]\n }\n },\n \"input_processors\": [\n {\n \"param_name\": \"url\",\n \"input_processor\": \"url_fetcher\",\n \"config\": {\n \"timeout\": 30\n }\n }\n ],\n \"annotation\": \"Testing URL content analysis with input processors\",\n \"description\": \"Analyzes content from URLs\",\n \"exposed_to_agents\": true,\n \"llm_model\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\"\n}"
response = http.request(request)
puts response.read_body
```
```java Task with input processors
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.post("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task")
.header("Authorization", "Bearer ")
.header("Content-Type", "application/json")
.body("{\n \"system_prompt\": \"You are a content analyzer.\",\n \"user_prompt\": \"Analyze this content: {{url}}\",\n \"llm_model_id\": \"string\",\n \"name\": \"URL Content Analyzer\",\n \"enabled\": true,\n \"output_format\": {\n \"summary\": \"str\",\n \"sentiment\": {\n \"type\": \"str\",\n \"options\": [\n \"positive\",\n \"negative\",\n \"neutral\"\n ]\n }\n },\n \"input_processors\": [\n {\n \"param_name\": \"url\",\n \"input_processor\": \"url_fetcher\",\n \"config\": {\n \"timeout\": 30\n }\n }\n ],\n \"annotation\": \"Testing URL content analysis with input processors\",\n \"description\": \"Analyzes content from URLs\",\n \"exposed_to_agents\": true,\n \"llm_model\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\"\n}")
.asString();
```
```php Task with input processors
request('POST', 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task', [
'body' => '{
"system_prompt": "You are a content analyzer.",
"user_prompt": "Analyze this content: {{url}}",
"llm_model_id": "string",
"name": "URL Content Analyzer",
"enabled": true,
"output_format": {
"summary": "str",
"sentiment": {
"type": "str",
"options": [
"positive",
"negative",
"neutral"
]
}
},
"input_processors": [
{
"param_name": "url",
"input_processor": "url_fetcher",
"config": {
"timeout": 30
}
}
],
"annotation": "Testing URL content analysis with input processors",
"description": "Analyzes content from URLs",
"exposed_to_agents": true,
"llm_model": "ec217e75-72ea-4281-a1b8-cb7bd0ef9f41"
}',
'headers' => [
'Authorization' => 'Bearer ',
'Content-Type' => 'application/json',
],
]);
echo $response->getBody();
```
```csharp Task with input processors
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer ");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"system_prompt\": \"You are a content analyzer.\",\n \"user_prompt\": \"Analyze this content: {{url}}\",\n \"llm_model_id\": \"string\",\n \"name\": \"URL Content Analyzer\",\n \"enabled\": true,\n \"output_format\": {\n \"summary\": \"str\",\n \"sentiment\": {\n \"type\": \"str\",\n \"options\": [\n \"positive\",\n \"negative\",\n \"neutral\"\n ]\n }\n },\n \"input_processors\": [\n {\n \"param_name\": \"url\",\n \"input_processor\": \"url_fetcher\",\n \"config\": {\n \"timeout\": 30\n }\n }\n ],\n \"annotation\": \"Testing URL content analysis with input processors\",\n \"description\": \"Analyzes content from URLs\",\n \"exposed_to_agents\": true,\n \"llm_model\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```
```swift Task with input processors
import Foundation
let headers = [
"Authorization": "Bearer ",
"Content-Type": "application/json"
]
let parameters = [
"system_prompt": "You are a content analyzer.",
"user_prompt": "Analyze this content: {{url}}",
"llm_model_id": "string",
"name": "URL Content Analyzer",
"enabled": true,
"output_format": [
"summary": "str",
"sentiment": [
"type": "str",
"options": ["positive", "negative", "neutral"]
]
],
"input_processors": [
[
"param_name": "url",
"input_processor": "url_fetcher",
"config": ["timeout": 30]
]
],
"annotation": "Testing URL content analysis with input processors",
"description": "Analyzes content from URLs",
"exposed_to_agents": true,
"llm_model": "ec217e75-72ea-4281-a1b8-cb7bd0ef9f41"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
```python Fallback model + visibility settings
import requests
url = "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task"
payload = {
"system_prompt": "You are a helpful assistant.",
"user_prompt": "Process: {{input}}",
"llm_model_id": "string",
"name": "Reliable Team Task",
"enabled": True,
"output_format": [
{
"name": "result",
"description": "Processed result"
}
],
"fallback_llm_model_id": "af2a9bbf-5f36-4b12-bd3f-92c57be96dec",
"fallback_llm_config": { "temperature": 0.5 },
"description": "Task with fallback model and collaborative visibility",
"public": False,
"task_run_visibility": "editors_and_owners",
"input_params": [
{
"name": "input",
"description": "Input to process"
}
],
"output_format_type": "json",
"llm_model": "ec217e75-72ea-4281-a1b8-cb7bd0ef9f41"
}
headers = {
"Authorization": "Bearer ",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
```
```javascript Fallback model + visibility settings
const url = 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'},
body: '{"system_prompt":"You are a helpful assistant.","user_prompt":"Process: {{input}}","llm_model_id":"string","name":"Reliable Team Task","enabled":true,"output_format":[{"name":"result","description":"Processed result"}],"fallback_llm_model_id":"af2a9bbf-5f36-4b12-bd3f-92c57be96dec","fallback_llm_config":{"temperature":0.5},"description":"Task with fallback model and collaborative visibility","public":false,"task_run_visibility":"editors_and_owners","input_params":[{"name":"input","description":"Input to process"}],"output_format_type":"json","llm_model":"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go Fallback model + visibility settings
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task"
payload := strings.NewReader("{\n \"system_prompt\": \"You are a helpful assistant.\",\n \"user_prompt\": \"Process: {{input}}\",\n \"llm_model_id\": \"string\",\n \"name\": \"Reliable Team Task\",\n \"enabled\": true,\n \"output_format\": [\n {\n \"name\": \"result\",\n \"description\": \"Processed result\"\n }\n ],\n \"fallback_llm_model_id\": \"af2a9bbf-5f36-4b12-bd3f-92c57be96dec\",\n \"fallback_llm_config\": {\n \"temperature\": 0.5\n },\n \"description\": \"Task with fallback model and collaborative visibility\",\n \"public\": false,\n \"task_run_visibility\": \"editors_and_owners\",\n \"input_params\": [\n {\n \"name\": \"input\",\n \"description\": \"Input to process\"\n }\n ],\n \"output_format_type\": \"json\",\n \"llm_model\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer ")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby Fallback model + visibility settings
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer '
request["Content-Type"] = 'application/json'
request.body = "{\n \"system_prompt\": \"You are a helpful assistant.\",\n \"user_prompt\": \"Process: {{input}}\",\n \"llm_model_id\": \"string\",\n \"name\": \"Reliable Team Task\",\n \"enabled\": true,\n \"output_format\": [\n {\n \"name\": \"result\",\n \"description\": \"Processed result\"\n }\n ],\n \"fallback_llm_model_id\": \"af2a9bbf-5f36-4b12-bd3f-92c57be96dec\",\n \"fallback_llm_config\": {\n \"temperature\": 0.5\n },\n \"description\": \"Task with fallback model and collaborative visibility\",\n \"public\": false,\n \"task_run_visibility\": \"editors_and_owners\",\n \"input_params\": [\n {\n \"name\": \"input\",\n \"description\": \"Input to process\"\n }\n ],\n \"output_format_type\": \"json\",\n \"llm_model\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\"\n}"
response = http.request(request)
puts response.read_body
```
```java Fallback model + visibility settings
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.post("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task")
.header("Authorization", "Bearer ")
.header("Content-Type", "application/json")
.body("{\n \"system_prompt\": \"You are a helpful assistant.\",\n \"user_prompt\": \"Process: {{input}}\",\n \"llm_model_id\": \"string\",\n \"name\": \"Reliable Team Task\",\n \"enabled\": true,\n \"output_format\": [\n {\n \"name\": \"result\",\n \"description\": \"Processed result\"\n }\n ],\n \"fallback_llm_model_id\": \"af2a9bbf-5f36-4b12-bd3f-92c57be96dec\",\n \"fallback_llm_config\": {\n \"temperature\": 0.5\n },\n \"description\": \"Task with fallback model and collaborative visibility\",\n \"public\": false,\n \"task_run_visibility\": \"editors_and_owners\",\n \"input_params\": [\n {\n \"name\": \"input\",\n \"description\": \"Input to process\"\n }\n ],\n \"output_format_type\": \"json\",\n \"llm_model\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\"\n}")
.asString();
```
```php Fallback model + visibility settings
request('POST', 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task', [
'body' => '{
"system_prompt": "You are a helpful assistant.",
"user_prompt": "Process: {{input}}",
"llm_model_id": "string",
"name": "Reliable Team Task",
"enabled": true,
"output_format": [
{
"name": "result",
"description": "Processed result"
}
],
"fallback_llm_model_id": "af2a9bbf-5f36-4b12-bd3f-92c57be96dec",
"fallback_llm_config": {
"temperature": 0.5
},
"description": "Task with fallback model and collaborative visibility",
"public": false,
"task_run_visibility": "editors_and_owners",
"input_params": [
{
"name": "input",
"description": "Input to process"
}
],
"output_format_type": "json",
"llm_model": "ec217e75-72ea-4281-a1b8-cb7bd0ef9f41"
}',
'headers' => [
'Authorization' => 'Bearer ',
'Content-Type' => 'application/json',
],
]);
echo $response->getBody();
```
```csharp Fallback model + visibility settings
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer ");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"system_prompt\": \"You are a helpful assistant.\",\n \"user_prompt\": \"Process: {{input}}\",\n \"llm_model_id\": \"string\",\n \"name\": \"Reliable Team Task\",\n \"enabled\": true,\n \"output_format\": [\n {\n \"name\": \"result\",\n \"description\": \"Processed result\"\n }\n ],\n \"fallback_llm_model_id\": \"af2a9bbf-5f36-4b12-bd3f-92c57be96dec\",\n \"fallback_llm_config\": {\n \"temperature\": 0.5\n },\n \"description\": \"Task with fallback model and collaborative visibility\",\n \"public\": false,\n \"task_run_visibility\": \"editors_and_owners\",\n \"input_params\": [\n {\n \"name\": \"input\",\n \"description\": \"Input to process\"\n }\n ],\n \"output_format_type\": \"json\",\n \"llm_model\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```
```swift Fallback model + visibility settings
import Foundation
let headers = [
"Authorization": "Bearer ",
"Content-Type": "application/json"
]
let parameters = [
"system_prompt": "You are a helpful assistant.",
"user_prompt": "Process: {{input}}",
"llm_model_id": "string",
"name": "Reliable Team Task",
"enabled": true,
"output_format": [
[
"name": "result",
"description": "Processed result"
]
],
"fallback_llm_model_id": "af2a9bbf-5f36-4b12-bd3f-92c57be96dec",
"fallback_llm_config": ["temperature": 0.5],
"description": "Task with fallback model and collaborative visibility",
"public": false,
"task_run_visibility": "editors_and_owners",
"input_params": [
[
"name": "input",
"description": "Input to process"
]
],
"output_format_type": "json",
"llm_model": "ec217e75-72ea-4281-a1b8-cb7bd0ef9f41"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
```python
import requests
url = "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task"
payload = {
"system_prompt": "You are a helpful assistant that creates concise summaries.",
"user_prompt": "Please summarize the following text: {{text}}",
"llm_model_id": "string",
"name": "Text Summarizer",
"enabled": True,
"output_format": [
{
"name": "summary",
"description": "Brief summary of the text"
},
{
"name": "key_points",
"description": "List of key points",
"type": "array"
}
],
"input_processors": [],
"annotation": "Initial version for text summarization",
"description": "Summarizes long text into key points",
"public": False,
"exposed_to_agents": False,
"output_modality": "json",
"input_params": [
{
"name": "text",
"description": "Text to summarize"
}
],
"output_format_type": "json",
"llm_model": "ec217e75-72ea-4281-a1b8-cb7bd0ef9f41"
}
headers = {
"Authorization": "Bearer ",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
```
```javascript
const url = 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'},
body: '{"system_prompt":"You are a helpful assistant that creates concise summaries.","user_prompt":"Please summarize the following text: {{text}}","llm_model_id":"string","name":"Text Summarizer","enabled":true,"output_format":[{"name":"summary","description":"Brief summary of the text"},{"name":"key_points","description":"List of key points","type":"array"}],"input_processors":[],"annotation":"Initial version for text summarization","description":"Summarizes long text into key points","public":false,"exposed_to_agents":false,"output_modality":"json","input_params":[{"name":"text","description":"Text to summarize"}],"output_format_type":"json","llm_model":"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task"
payload := strings.NewReader("{\n \"system_prompt\": \"You are a helpful assistant that creates concise summaries.\",\n \"user_prompt\": \"Please summarize the following text: {{text}}\",\n \"llm_model_id\": \"string\",\n \"name\": \"Text Summarizer\",\n \"enabled\": true,\n \"output_format\": [\n {\n \"name\": \"summary\",\n \"description\": \"Brief summary of the text\"\n },\n {\n \"name\": \"key_points\",\n \"description\": \"List of key points\",\n \"type\": \"array\"\n }\n ],\n \"input_processors\": [],\n \"annotation\": \"Initial version for text summarization\",\n \"description\": \"Summarizes long text into key points\",\n \"public\": false,\n \"exposed_to_agents\": false,\n \"output_modality\": \"json\",\n \"input_params\": [\n {\n \"name\": \"text\",\n \"description\": \"Text to summarize\"\n }\n ],\n \"output_format_type\": \"json\",\n \"llm_model\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer ")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer '
request["Content-Type"] = 'application/json'
request.body = "{\n \"system_prompt\": \"You are a helpful assistant that creates concise summaries.\",\n \"user_prompt\": \"Please summarize the following text: {{text}}\",\n \"llm_model_id\": \"string\",\n \"name\": \"Text Summarizer\",\n \"enabled\": true,\n \"output_format\": [\n {\n \"name\": \"summary\",\n \"description\": \"Brief summary of the text\"\n },\n {\n \"name\": \"key_points\",\n \"description\": \"List of key points\",\n \"type\": \"array\"\n }\n ],\n \"input_processors\": [],\n \"annotation\": \"Initial version for text summarization\",\n \"description\": \"Summarizes long text into key points\",\n \"public\": false,\n \"exposed_to_agents\": false,\n \"output_modality\": \"json\",\n \"input_params\": [\n {\n \"name\": \"text\",\n \"description\": \"Text to summarize\"\n }\n ],\n \"output_format_type\": \"json\",\n \"llm_model\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\"\n}"
response = http.request(request)
puts response.read_body
```
```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.post("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task")
.header("Authorization", "Bearer ")
.header("Content-Type", "application/json")
.body("{\n \"system_prompt\": \"You are a helpful assistant that creates concise summaries.\",\n \"user_prompt\": \"Please summarize the following text: {{text}}\",\n \"llm_model_id\": \"string\",\n \"name\": \"Text Summarizer\",\n \"enabled\": true,\n \"output_format\": [\n {\n \"name\": \"summary\",\n \"description\": \"Brief summary of the text\"\n },\n {\n \"name\": \"key_points\",\n \"description\": \"List of key points\",\n \"type\": \"array\"\n }\n ],\n \"input_processors\": [],\n \"annotation\": \"Initial version for text summarization\",\n \"description\": \"Summarizes long text into key points\",\n \"public\": false,\n \"exposed_to_agents\": false,\n \"output_modality\": \"json\",\n \"input_params\": [\n {\n \"name\": \"text\",\n \"description\": \"Text to summarize\"\n }\n ],\n \"output_format_type\": \"json\",\n \"llm_model\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\"\n}")
.asString();
```
```php
request('POST', 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task', [
'body' => '{
"system_prompt": "You are a helpful assistant that creates concise summaries.",
"user_prompt": "Please summarize the following text: {{text}}",
"llm_model_id": "string",
"name": "Text Summarizer",
"enabled": true,
"output_format": [
{
"name": "summary",
"description": "Brief summary of the text"
},
{
"name": "key_points",
"description": "List of key points",
"type": "array"
}
],
"input_processors": [],
"annotation": "Initial version for text summarization",
"description": "Summarizes long text into key points",
"public": false,
"exposed_to_agents": false,
"output_modality": "json",
"input_params": [
{
"name": "text",
"description": "Text to summarize"
}
],
"output_format_type": "json",
"llm_model": "ec217e75-72ea-4281-a1b8-cb7bd0ef9f41"
}',
'headers' => [
'Authorization' => 'Bearer ',
'Content-Type' => 'application/json',
],
]);
echo $response->getBody();
```
```csharp
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer ");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"system_prompt\": \"You are a helpful assistant that creates concise summaries.\",\n \"user_prompt\": \"Please summarize the following text: {{text}}\",\n \"llm_model_id\": \"string\",\n \"name\": \"Text Summarizer\",\n \"enabled\": true,\n \"output_format\": [\n {\n \"name\": \"summary\",\n \"description\": \"Brief summary of the text\"\n },\n {\n \"name\": \"key_points\",\n \"description\": \"List of key points\",\n \"type\": \"array\"\n }\n ],\n \"input_processors\": [],\n \"annotation\": \"Initial version for text summarization\",\n \"description\": \"Summarizes long text into key points\",\n \"public\": false,\n \"exposed_to_agents\": false,\n \"output_modality\": \"json\",\n \"input_params\": [\n {\n \"name\": \"text\",\n \"description\": \"Text to summarize\"\n }\n ],\n \"output_format_type\": \"json\",\n \"llm_model\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```
```swift
import Foundation
let headers = [
"Authorization": "Bearer ",
"Content-Type": "application/json"
]
let parameters = [
"system_prompt": "You are a helpful assistant that creates concise summaries.",
"user_prompt": "Please summarize the following text: {{text}}",
"llm_model_id": "string",
"name": "Text Summarizer",
"enabled": true,
"output_format": [
[
"name": "summary",
"description": "Brief summary of the text"
],
[
"name": "key_points",
"description": "List of key points",
"type": "array"
]
],
"input_processors": [],
"annotation": "Initial version for text summarization",
"description": "Summarizes long text into key points",
"public": false,
"exposed_to_agents": false,
"output_modality": "json",
"input_params": [
[
"name": "text",
"description": "Text to summarize"
]
],
"output_format_type": "json",
"llm_model": "ec217e75-72ea-4281-a1b8-cb7bd0ef9f41"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
# Get Task Details
GET https://app.rightbrain.ai/api/v1/org/{org_id}/project/{project_id}/task/{task_id}
Retrieve detailed information about a specific Task.
Returns the complete Task configuration including:
- Basic properties (name, description, enabled status)
- All revisions with their prompts and configurations
- Currently active revisions and their traffic weights
- Associated tags and metadata
Reference: https://docs.rightbrain.ai/api-reference/api-reference/tasks/get-task
## OpenAPI Specification
```yaml
openapi: 3.1.0
info:
title: API
version: 1.0.0
paths:
/org/{org_id}/project/{project_id}/task/{task_id}:
get:
operationId: get-task
summary: Get Task Details
description: |-
Retrieve detailed information about a specific Task.
Returns the complete Task configuration including:
- Basic properties (name, description, enabled status)
- All revisions with their prompts and configurations
- Currently active revisions and their traffic weights
- Associated tags and metadata
tags:
- subpackage_tasks
parameters:
- name: org_id
in: path
description: The unique identifier of the organization.
required: true
schema:
type: string
format: uuid
- name: project_id
in: path
description: The unique identifier of the project.
required: true
schema:
type: string
format: uuid
- name: task_id
in: path
description: The specific Task to reference.
required: true
schema:
type: string
format: uuid
- name: revision_tag_id
in: query
description: Filter task_revisions by tag ID.
required: false
schema:
type: string
format: uuid
- name: include_tests
in: query
description: Include test revisions
required: false
schema:
type: boolean
default: false
- name: Authorization
in: header
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
required: true
schema:
type: string
responses:
'200':
description: Task details retrieved successfully
content:
application/json:
schema:
$ref: '#/components/schemas/Task'
'400':
description: >-
Bad Request - Invalid task ID format
**Common causes:**
- Invalid UUID format in path or query parameters
- Missing required fields in the request body
- Invalid enum value provided
- Type mismatch (e.g., string instead of number)
**Resolution:** Check the request body and parameters match the
schema.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: >-
Unauthorized - Authentication failed
**Common causes:**
- Missing `Authorization` header
- Expired access token
- Invalid or malformed token
- Using API key in wrong format
**Resolution:** Ensure you're including a valid Bearer token or API
key in the Authorization header.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: >-
Forbidden - Insufficient permissions for task
**Common causes:**
- Your role lacks the required permission for this action
- The task belongs to a different organization or project
- The action requires admin or owner privileges
**Resolution:** Contact your organization admin to request
appropriate access.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Task not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: >-
Unprocessable Entity - Invalid request
**Common causes:**
- Request is well-formed but violates business rules
- Invalid combination of fields (e.g., mutually exclusive options)
- Referenced resource doesn't exist or is in wrong state
- Field value is valid type but out of acceptable range
**Resolution:** Check the error message for specific validation
failures and adjust your request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal Server Error - Failed to retrieve task
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
servers:
- url: https://app.rightbrain.ai/api/v1
- url: https://stag.leftbrain.me/api/v1
- url: https://app.rblocal.dev/api/v1
components:
schemas:
OutputModality:
type: string
enum:
- json
- image
- audio
- pdf
- text
- csv
description: Output modality types for tasks.
title: OutputModality
TaskTaskRunVisibility:
type: string
enum:
- owner_only
- editors_and_owners
- all_viewers
default: owner_only
description: >-
Controls who can view all task runs. 'owner_only' - only task owners see
all runs (default), 'editors_and_owners' - task editors and owners see
all runs, 'all_viewers' - all users with view permission see all runs.
title: TaskTaskRunVisibility
TagOutputFormat-Output:
type: object
additionalProperties:
description: Any type
title: TagOutputFormat-Output
TaskRevisionOutputFormat1:
type: string
enum:
- str
- string
- boolean
- bool
- int
- integer
- list
- object
- number
title: TaskRevisionOutputFormat1
TaskRevisionOutputFormat:
oneOf:
- $ref: '#/components/schemas/TagOutputFormat-Output'
- $ref: '#/components/schemas/TaskRevisionOutputFormat1'
title: TaskRevisionOutputFormat
TaskRAG:
type: object
properties:
collection_id:
type: string
format: uuid
rag_param:
type: string
required:
- collection_id
- rag_param
title: TaskRAG
TaskInputProcessor:
type: object
properties:
param_name:
type: string
input_processor:
type: string
config:
type:
- object
- 'null'
additionalProperties:
description: Any type
required:
- param_name
- input_processor
title: TaskInputProcessor
TagEntityType:
type: string
enum:
- task
- task_revision
description: The type of entity this tag applies to (task or task_revision)
title: TagEntityType
Tag:
type: object
properties:
name:
type: string
description: >-
Alphanumeric name for the tag (max 15 characters). Used to organize
and filter Tasks and Task Revisions.
parent_id:
type:
- string
- 'null'
format: uuid
description: >-
Optional UUID of a parent tag. Used to create hierarchical tag
structures (e.g., staging under production).
entity_type:
$ref: '#/components/schemas/TagEntityType'
description: The type of entity this tag applies to (task or task_revision)
id:
type: string
format: uuid
description: Unique identifier for the tag.
project_id:
type: string
format: uuid
description: Project this tag belongs to.
created_at:
type: string
description: ISO 8601 timestamp when the tag was created.
children:
type: array
items:
$ref: '#/components/schemas/Tag'
description: >-
List of child tags if this tag is used as a parent in a hierarchical
structure.
is_project_tag:
type: boolean
description: >-
When true, indicates this is a project-level tag that can be used
across multiple entity types.
tagged_entities:
type: array
items:
type: string
format: uuid
description: List of entity IDs this tag is associated with.
required:
- name
- entity_type
- id
- project_id
- created_at
- is_project_tag
title: Tag
LLMModelComment:
type: object
properties:
title:
type: string
description: Brief title for the comment.
description:
type: string
description: Detailed description of the comment or observation.
active:
type: boolean
default: true
description: Whether this comment is currently active/relevant.
created:
type:
- string
- 'null'
description: When this comment was created.
modified:
type:
- string
- 'null'
description: When this comment was last modified.
id:
type: string
format: uuid
llm_model_id:
type: string
format: uuid
required:
- title
- description
- id
- llm_model_id
title: LLMModelComment
LLMModel:
type: object
properties:
provider:
type: string
description: The company that produces the LLM (e.g., OpenAI, Anthropic, Meta).
vendor:
type: string
description: >-
The service provider or platform hosting the model (e.g., OpenAI,
Azure, Groq).
name:
type: string
description: The model's reference name used for API calls.
alias:
type: string
description: Human-readable name for the model.
description:
type: string
description: >-
Detailed description of the model's capabilities, context window,
and knowledge cutoff.
supports_vision:
type: boolean
description: Whether the model can process and analyze images.
supports_image_output:
type: boolean
default: false
description: Whether the model can generate images as output.
max_context_window:
type: integer
description: Maximum number of tokens the model can process in a single request.
model_params:
type:
- object
- 'null'
additionalProperties:
description: Any type
description: >-
JSON Schema defining allowed model parameters for this model. Each
parameter name maps to a JSON Schema specification defining its
type, constraints, and validation rules.
created:
type:
- string
- 'null'
modified:
type:
- string
- 'null'
id:
type: string
format: uuid
replaced_by:
type:
- string
- 'null'
format: uuid
retired:
type:
- string
- 'null'
llm_model_comments:
type: array
items:
$ref: '#/components/schemas/LLMModelComment'
required:
- provider
- vendor
- name
- alias
- description
- supports_vision
- max_context_window
- id
title: LLMModel
TaskRevision:
type: object
properties:
system_prompt:
type: string
description: The system prompt that is used to set the LLM context.
user_prompt:
type: string
description: >-
The description of the Task. It is not required to mention the
outputs in the prompt, but it can help the model to understand the
context better. Any input strings should be referenced with the
dynamic `{...}` syntax, this informs the model to look for those
values in the input data.
llm_model_id:
type: string
format: uuid
description: The LLM model to use for the Task.
llm_config:
type: object
additionalProperties:
description: Any type
description: Specific configuration parameters for the LLM model.
output_format:
type:
- object
- 'null'
additionalProperties:
$ref: '#/components/schemas/TaskRevisionOutputFormat'
description: >-
This gives control over the structure of how the Task responds.
Supports shorthand notation or an object with `type` can be
specified for each attribute. In most instances, the LLM will be
able to generate the desired output into the relevant property, but
an optional `description` can be passed to provide it with
additional context.
task_forwarder_id:
type:
- string
- 'null'
format: uuid
description: >-
The unique identifier for a valid Task Forwarder. It is used to
forward the Task output to another system or service.
rag:
oneOf:
- $ref: '#/components/schemas/TaskRAG'
- type: 'null'
description: >-
**Note: This is a Paid Tier feature.** Provide additional domain
specific input to the LLM so that it is able to reference user
specific information when executing the Task. Examples of this could
be a product catalogue, terms and conditions or a user manual.
image_required:
type: boolean
default: false
description: When `true` it requires an image to be sent in the Task Run request.
optimise_images:
type: boolean
default: true
description: >-
When `true` (default) images will be automatically optimised before
processing. Set to `false` to disable lossy image optimisation.
test:
type: boolean
default: false
description: >-
True if revision is a test revision. Test revisions cannot be live
and are used for rapid Task testing/iteration.
input_processors:
type: array
items:
$ref: '#/components/schemas/TaskInputProcessor'
annotation:
type:
- string
- 'null'
description: >-
Optional note or comment about this revision. Useful for tracking
changes, experiments, or the purpose of test revisions.
fallback_llm_model_id:
type:
- string
- 'null'
format: uuid
description: The LLM model to use as fallback if the primary model fails.
fallback_llm_config:
type:
- object
- 'null'
additionalProperties:
description: Any type
description: Specific configuration parameters for the fallback LLM model.
id:
type: string
format: uuid
description: The unique identifier of the Revision.
created:
type: string
description: When the Task was created.
modified:
type:
- string
- 'null'
description: When the Task was last updated.
active:
type: boolean
default: false
description: >-
When `true` the Revision is the currently active version and will be
activated when the Task Run is executed.
tags:
type: array
items:
$ref: '#/components/schemas/Tag'
llm_model:
$ref: '#/components/schemas/LLMModel'
fallback_llm_model:
oneOf:
- $ref: '#/components/schemas/LLMModel'
- type: 'null'
input_params:
type: array
items:
type: string
description: >-
A list of all the dynamic input parameters that are detected from
the user prompt.
required:
- system_prompt
- user_prompt
- llm_model_id
- id
- created
- modified
- llm_model
- input_params
title: TaskRevision
TaskActiveRevision:
type: object
properties:
task_revision_id:
type: string
format: uuid
description: >-
The unique identifier of the Task Revision to activate. Each Task
can have multiple revisions, but only active ones will be used for
execution.
weight:
type:
- number
- 'null'
format: double
default: 1
description: >-
The traffic weight for this revision (between 0 and 1). When
multiple revisions are active, weights determine the proportion of
traffic each receives. Must sum to 1.0 across all active revisions.
required:
- task_revision_id
title: TaskActiveRevision
Task:
type: object
properties:
name:
type: string
description: A name or reference for the Task.
description:
type:
- string
- 'null'
description: A longer description of the Task for internal reference.
enabled:
type: boolean
description: >-
When `true` the Task is active and callable. `false` denotes the
Task is not yet operational.
public:
type: boolean
default: false
description: When `true` the Task is public and can be accessed by any User.
exposed_to_agents:
type: boolean
default: false
description: >-
When `true` the Task is accessible to agents through the
unauthenticated agent endpoint.
output_modality:
$ref: '#/components/schemas/OutputModality'
description: >-
Specifies the output modality of the task. Can be 'json', 'image',
'audio', 'pdf', 'text', or 'csv'. Defaults to 'json'.
task_run_visibility:
$ref: '#/components/schemas/TaskTaskRunVisibility'
description: >-
Controls who can view all task runs. 'owner_only' - only task owners
see all runs (default), 'editors_and_owners' - task editors and
owners see all runs, 'all_viewers' - all users with view permission
see all runs.
id:
type: string
format: uuid
description: The unique identifier of the Task.
project_id:
type: string
format: uuid
description: The Project that the Task belongs to.
created:
type: string
description: When the Task was created.
modified:
type:
- string
- 'null'
description: When the Task was last updated.
deleted:
type:
- string
- 'null'
description: Timestamp when the task was deleted, if applicable.
revisions:
type: array
items:
$ref: '#/components/schemas/TaskRevision'
description: >-
Each update to a Task results in a new Revision being created. Task
Revisions are a powerful concept that can be used to assist with A/B
testing, comparing responses from different LLM's, etc.
access_token:
type:
- string
- 'null'
description: >-
Task specific Bearer token that can be used to authenticated when
executing this Task.
active_revisions:
type: array
items:
$ref: '#/components/schemas/TaskActiveRevision'
description: The revision currently active for this Task.
cloned_from_task_revision_id:
type:
- string
- 'null'
format: uuid
description: >-
The unique identifier of the task revision this task was cloned
from, if applicable.
tags:
type: array
items:
$ref: '#/components/schemas/Tag'
required:
- name
- enabled
- id
- project_id
- created
- access_token
- active_revisions
title: Task
ErrorResponseDetailOneOf1Items:
type: object
properties:
loc:
type: array
items:
type: string
description: Path to the error location
msg:
type: string
description: Human-readable error message
type:
type: string
description: Error type identifier
required:
- msg
- type
title: ErrorResponseDetailOneOf1Items
ErrorResponseDetail1:
type: array
items:
$ref: '#/components/schemas/ErrorResponseDetailOneOf1Items'
description: Detailed validation errors
title: ErrorResponseDetail1
ErrorResponseDetail:
oneOf:
- type: string
- $ref: '#/components/schemas/ErrorResponseDetail1'
title: ErrorResponseDetail
ErrorResponseType:
type: string
enum:
- validation_error
- authorization_error
- resource_error
- server_error
description: Error category
title: ErrorResponseType
ErrorResponse:
type: object
properties:
detail:
$ref: '#/components/schemas/ErrorResponseDetail'
type:
$ref: '#/components/schemas/ErrorResponseType'
description: Error category
msg:
type: string
description: Error summary
required:
- detail
description: Standardized error response format used across all endpoints
title: ErrorResponse
securitySchemes:
HTTPBearer:
type: http
scheme: bearer
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
```
## SDK Code Examples
```python
import requests
url = "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74"
headers = {"Authorization": "Bearer "}
response = requests.get(url, headers=headers)
print(response.json())
```
```javascript
const url = 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74';
const options = {method: 'GET', headers: {Authorization: 'Bearer '}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer ")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer '
response = http.request(request)
puts response.read_body
```
```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.get("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74")
.header("Authorization", "Bearer ")
.asString();
```
```php
request('GET', 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74', [
'headers' => [
'Authorization' => 'Bearer ',
],
]);
echo $response->getBody();
```
```csharp
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer ");
IRestResponse response = client.Execute(request);
```
```swift
import Foundation
let headers = ["Authorization": "Bearer "]
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
# Update a Task
POST https://app.rightbrain.ai/api/v1/org/{org_id}/project/{project_id}/task/{task_id}
Content-Type: application/json
Update an existing Task with new configuration or create a new revision.
When updating a Task, you can:
1. Modify basic Task properties (name, description, enabled status, task_run_visibility)
2. Create a new revision with updated prompts, models, and configuration (including fallback models)
3. Manage active revisions and their traffic weights for A/B testing
4. Update tags for the Task or specific revisions
Task Run Visibility Control:
- Update `task_run_visibility` to control who can view all task runs
- Options: `owner_only`, `editors_and_owners`, `all_viewers`
Fallback Model Support:
- Configure `fallback_llm_model_id` and `fallback_llm_config` for automatic failover
- Improves reliability when primary model encounters errors or rate limits
Note: Creating a new revision does not automatically make it active. Use the active_revisions field to control which revisions receive traffic.
Reference: https://docs.rightbrain.ai/api-reference/api-reference/tasks/update-task
## OpenAPI Specification
```yaml
openapi: 3.1.0
info:
title: API
version: 1.0.0
paths:
/org/{org_id}/project/{project_id}/task/{task_id}:
post:
operationId: update-task
summary: Update a Task
description: >-
Update an existing Task with new configuration or create a new revision.
When updating a Task, you can:
1. Modify basic Task properties (name, description, enabled status,
task_run_visibility)
2. Create a new revision with updated prompts, models, and configuration
(including fallback models)
3. Manage active revisions and their traffic weights for A/B testing
4. Update tags for the Task or specific revisions
Task Run Visibility Control:
- Update `task_run_visibility` to control who can view all task runs
- Options: `owner_only`, `editors_and_owners`, `all_viewers`
Fallback Model Support:
- Configure `fallback_llm_model_id` and `fallback_llm_config` for
automatic failover
- Improves reliability when primary model encounters errors or rate
limits
Note: Creating a new revision does not automatically make it active. Use
the active_revisions field to control which revisions receive traffic.
tags:
- subpackage_tasks
parameters:
- name: org_id
in: path
description: The unique identifier of the organization.
required: true
schema:
type: string
format: uuid
- name: project_id
in: path
description: The unique identifier of the project.
required: true
schema:
type: string
format: uuid
- name: task_id
in: path
description: The specific Task to reference.
required: true
schema:
type: string
format: uuid
- name: Authorization
in: header
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
required: true
schema:
type: string
responses:
'200':
description: Task updated successfully
content:
application/json:
schema:
$ref: '#/components/schemas/Task'
'400':
description: >-
Bad Request - Invalid task configuration
**Common causes:**
- Invalid UUID format in path or query parameters
- Missing required fields in the request body
- Invalid enum value provided
- Type mismatch (e.g., string instead of number)
**Resolution:** Check the request body and parameters match the
schema.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: >-
Unauthorized - Authentication failed
**Common causes:**
- Missing `Authorization` header
- Expired access token
- Invalid or malformed token
- Using API key in wrong format
**Resolution:** Ensure you're including a valid Bearer token or API
key in the Authorization header.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: >-
Forbidden - Insufficient permissions for tasks
**Common causes:**
- Your role lacks the required permission for this action
- The tasks belongs to a different organization or project
- The action requires admin or owner privileges
**Resolution:** Contact your organization admin to request
appropriate access.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Task or referenced resource not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: >-
Unprocessable Entity - Invalid request
**Common causes:**
- Request is well-formed but violates business rules
- Invalid combination of fields (e.g., mutually exclusive options)
- Referenced resource doesn't exist or is in wrong state
- Field value is valid type but out of acceptable range
**Resolution:** Check the error message for specific validation
failures and adjust your request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal Server Error - Failed to update task
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TaskUpdate'
servers:
- url: https://app.rightbrain.ai/api/v1
- url: https://stag.leftbrain.me/api/v1
- url: https://app.rblocal.dev/api/v1
components:
schemas:
TagOutputFormatInputType:
type: string
enum:
- str
- string
- boolean
- bool
- int
- integer
- list
- object
- number
description: The desired output type from the LLM.
title: TagOutputFormatInputType
TagOutputFormatInputNestedStructure1:
type: string
enum:
- str
- string
- boolean
- bool
- int
- integer
- list
- object
- number
title: TagOutputFormatInputNestedStructure1
TagOutputFormatInputNestedStructure:
oneOf:
- $ref: '#/components/schemas/TagOutputFormat-Input'
- $ref: '#/components/schemas/TagOutputFormatInputNestedStructure1'
title: TagOutputFormatInputNestedStructure
TagOutputFormatInputItemType:
type: string
enum:
- str
- string
- boolean
- bool
- int
- integer
- list
- object
- number
description: For lists, the type of items within the list.
title: TagOutputFormatInputItemType
TagOutputFormat-Input:
type: object
properties:
type:
$ref: '#/components/schemas/TagOutputFormatInputType'
description: The desired output type from the LLM.
description:
type:
- string
- 'null'
description: A description of the desired content.
nested_structure:
type:
- object
- 'null'
additionalProperties:
$ref: '#/components/schemas/TagOutputFormatInputNestedStructure'
description: For lists optionally define the list structure.
options:
type:
- array
- 'null'
items:
type: string
description: Options to constrain the response to a specific set of values.
item_type:
oneOf:
- $ref: '#/components/schemas/TagOutputFormatInputItemType'
- type: 'null'
description: For lists, the type of items within the list.
required:
- type
title: TagOutputFormat-Input
TaskUpdateOutputFormat1:
type: string
enum:
- str
- string
- boolean
- bool
- int
- integer
- list
- object
- number
title: TaskUpdateOutputFormat1
TaskUpdateOutputFormat:
oneOf:
- $ref: '#/components/schemas/TagOutputFormat-Input'
- $ref: '#/components/schemas/TaskUpdateOutputFormat1'
title: TaskUpdateOutputFormat
TaskRAG:
type: object
properties:
collection_id:
type: string
format: uuid
rag_param:
type: string
required:
- collection_id
- rag_param
title: TaskRAG
TaskInputProcessor:
type: object
properties:
param_name:
type: string
input_processor:
type: string
config:
type:
- object
- 'null'
additionalProperties:
description: Any type
required:
- param_name
- input_processor
title: TaskInputProcessor
TaskUpdateTaskRunVisibility:
type: string
enum:
- owner_only
- editors_and_owners
- all_viewers
description: >-
Controls who can view all task runs. 'owner_only' - only task owners see
all runs (default), 'editors_and_owners' - task editors and owners see
all runs, 'all_viewers' - all users with view permission see all runs.
title: TaskUpdateTaskRunVisibility
TaskActiveRevision:
type: object
properties:
task_revision_id:
type: string
format: uuid
description: >-
The unique identifier of the Task Revision to activate. Each Task
can have multiple revisions, but only active ones will be used for
execution.
weight:
type:
- number
- 'null'
format: double
default: 1
description: >-
The traffic weight for this revision (between 0 and 1). When
multiple revisions are active, weights determine the proportion of
traffic each receives. Must sum to 1.0 across all active revisions.
required:
- task_revision_id
title: TaskActiveRevision
TaskUpdate:
type: object
properties:
system_prompt:
type:
- string
- 'null'
description: The system prompt that is used to set the LLM context.
user_prompt:
type:
- string
- 'null'
description: >-
The description of the Task. It is not required to mention the
outputs in the prompt, but it can help the model to understand the
context better. Any input strings should be referenced with the
dynamic `{...}` syntax, this informs the model to look for those
values in the input data.
llm_model_id:
type:
- string
- 'null'
format: uuid
description: The LLM model to use for the Task.
llm_config:
type:
- object
- 'null'
additionalProperties:
description: Any type
description: Specific configuration parameters for the LLM model.
output_format:
type:
- object
- 'null'
additionalProperties:
$ref: '#/components/schemas/TaskUpdateOutputFormat'
description: >-
This gives control over the structure of how the Task responds.
Supports shorthand notation or an object with `type` can be
specified for each attribute. In most instances, the LLM will be
able to generate the desired output into the relevant property, but
an optional `description` can be passed to provide it with
additional context.
task_forwarder_id:
type:
- string
- 'null'
format: uuid
description: >-
The unique identifier for a valid Task Forwarder. It is used to
forward the Task output to another system or service.
rag:
oneOf:
- $ref: '#/components/schemas/TaskRAG'
- type: 'null'
description: >-
**Note: This is a Paid Tier feature.** Provide additional domain
specific input to the LLM so that it is able to reference user
specific information when executing the Task. Examples of this could
be a product catalogue, terms and conditions or a user manual.
image_required:
type:
- boolean
- 'null'
description: When `true` it requires an image to be sent in the Task Run request.
annotation:
type:
- string
- 'null'
test:
type: boolean
default: false
description: >-
True if revision is a test revision. Test revisions cannot be live
and are used for rapid Task testing/iteration.
input_processors:
type: array
items:
$ref: '#/components/schemas/TaskInputProcessor'
optimise_images:
type:
- boolean
- 'null'
default: true
description: >-
When `true` (default) images will be automatically optimised before
processing. Set to `false` to disable lossy image optimisation.
fallback_llm_model_id:
type:
- string
- 'null'
format: uuid
description: The LLM model to use as fallback if the primary model fails.
fallback_llm_config:
type:
- object
- 'null'
additionalProperties:
description: Any type
description: Specific configuration parameters for the fallback LLM model.
name:
type:
- string
- 'null'
description: A name or reference for the Task.
description:
type:
- string
- 'null'
description: A longer description of the Task for internal reference.
enabled:
type:
- boolean
- 'null'
description: >-
When `true` the Task is active and callable. `false` denotes the
Task is not yet operational.
exposed_to_agents:
type:
- boolean
- 'null'
description: >-
When `true` the Task is accessible to agents through the
unauthenticated agent endpoint.
task_run_visibility:
oneOf:
- $ref: '#/components/schemas/TaskUpdateTaskRunVisibility'
- type: 'null'
description: >-
Controls who can view all task runs. 'owner_only' - only task owners
see all runs (default), 'editors_and_owners' - task editors and
owners see all runs, 'all_viewers' - all users with view permission
see all runs.
active_revisions:
type:
- array
- 'null'
items:
$ref: '#/components/schemas/TaskActiveRevision'
description: The revision currently active for this Task.
tags:
type:
- array
- 'null'
items:
type: string
format: uuid
revision_tags:
type:
- array
- 'null'
items:
type: string
format: uuid
title: TaskUpdate
OutputModality:
type: string
enum:
- json
- image
- audio
- pdf
- text
- csv
description: Output modality types for tasks.
title: OutputModality
TaskTaskRunVisibility:
type: string
enum:
- owner_only
- editors_and_owners
- all_viewers
default: owner_only
description: >-
Controls who can view all task runs. 'owner_only' - only task owners see
all runs (default), 'editors_and_owners' - task editors and owners see
all runs, 'all_viewers' - all users with view permission see all runs.
title: TaskTaskRunVisibility
TagOutputFormat-Output:
type: object
additionalProperties:
description: Any type
title: TagOutputFormat-Output
TaskRevisionOutputFormat1:
type: string
enum:
- str
- string
- boolean
- bool
- int
- integer
- list
- object
- number
title: TaskRevisionOutputFormat1
TaskRevisionOutputFormat:
oneOf:
- $ref: '#/components/schemas/TagOutputFormat-Output'
- $ref: '#/components/schemas/TaskRevisionOutputFormat1'
title: TaskRevisionOutputFormat
TagEntityType:
type: string
enum:
- task
- task_revision
description: The type of entity this tag applies to (task or task_revision)
title: TagEntityType
Tag:
type: object
properties:
name:
type: string
description: >-
Alphanumeric name for the tag (max 15 characters). Used to organize
and filter Tasks and Task Revisions.
parent_id:
type:
- string
- 'null'
format: uuid
description: >-
Optional UUID of a parent tag. Used to create hierarchical tag
structures (e.g., staging under production).
entity_type:
$ref: '#/components/schemas/TagEntityType'
description: The type of entity this tag applies to (task or task_revision)
id:
type: string
format: uuid
description: Unique identifier for the tag.
project_id:
type: string
format: uuid
description: Project this tag belongs to.
created_at:
type: string
description: ISO 8601 timestamp when the tag was created.
children:
type: array
items:
$ref: '#/components/schemas/Tag'
description: >-
List of child tags if this tag is used as a parent in a hierarchical
structure.
is_project_tag:
type: boolean
description: >-
When true, indicates this is a project-level tag that can be used
across multiple entity types.
tagged_entities:
type: array
items:
type: string
format: uuid
description: List of entity IDs this tag is associated with.
required:
- name
- entity_type
- id
- project_id
- created_at
- is_project_tag
title: Tag
LLMModelComment:
type: object
properties:
title:
type: string
description: Brief title for the comment.
description:
type: string
description: Detailed description of the comment or observation.
active:
type: boolean
default: true
description: Whether this comment is currently active/relevant.
created:
type:
- string
- 'null'
description: When this comment was created.
modified:
type:
- string
- 'null'
description: When this comment was last modified.
id:
type: string
format: uuid
llm_model_id:
type: string
format: uuid
required:
- title
- description
- id
- llm_model_id
title: LLMModelComment
LLMModel:
type: object
properties:
provider:
type: string
description: The company that produces the LLM (e.g., OpenAI, Anthropic, Meta).
vendor:
type: string
description: >-
The service provider or platform hosting the model (e.g., OpenAI,
Azure, Groq).
name:
type: string
description: The model's reference name used for API calls.
alias:
type: string
description: Human-readable name for the model.
description:
type: string
description: >-
Detailed description of the model's capabilities, context window,
and knowledge cutoff.
supports_vision:
type: boolean
description: Whether the model can process and analyze images.
supports_image_output:
type: boolean
default: false
description: Whether the model can generate images as output.
max_context_window:
type: integer
description: Maximum number of tokens the model can process in a single request.
model_params:
type:
- object
- 'null'
additionalProperties:
description: Any type
description: >-
JSON Schema defining allowed model parameters for this model. Each
parameter name maps to a JSON Schema specification defining its
type, constraints, and validation rules.
created:
type:
- string
- 'null'
modified:
type:
- string
- 'null'
id:
type: string
format: uuid
replaced_by:
type:
- string
- 'null'
format: uuid
retired:
type:
- string
- 'null'
llm_model_comments:
type: array
items:
$ref: '#/components/schemas/LLMModelComment'
required:
- provider
- vendor
- name
- alias
- description
- supports_vision
- max_context_window
- id
title: LLMModel
TaskRevision:
type: object
properties:
system_prompt:
type: string
description: The system prompt that is used to set the LLM context.
user_prompt:
type: string
description: >-
The description of the Task. It is not required to mention the
outputs in the prompt, but it can help the model to understand the
context better. Any input strings should be referenced with the
dynamic `{...}` syntax, this informs the model to look for those
values in the input data.
llm_model_id:
type: string
format: uuid
description: The LLM model to use for the Task.
llm_config:
type: object
additionalProperties:
description: Any type
description: Specific configuration parameters for the LLM model.
output_format:
type:
- object
- 'null'
additionalProperties:
$ref: '#/components/schemas/TaskRevisionOutputFormat'
description: >-
This gives control over the structure of how the Task responds.
Supports shorthand notation or an object with `type` can be
specified for each attribute. In most instances, the LLM will be
able to generate the desired output into the relevant property, but
an optional `description` can be passed to provide it with
additional context.
task_forwarder_id:
type:
- string
- 'null'
format: uuid
description: >-
The unique identifier for a valid Task Forwarder. It is used to
forward the Task output to another system or service.
rag:
oneOf:
- $ref: '#/components/schemas/TaskRAG'
- type: 'null'
description: >-
**Note: This is a Paid Tier feature.** Provide additional domain
specific input to the LLM so that it is able to reference user
specific information when executing the Task. Examples of this could
be a product catalogue, terms and conditions or a user manual.
image_required:
type: boolean
default: false
description: When `true` it requires an image to be sent in the Task Run request.
optimise_images:
type: boolean
default: true
description: >-
When `true` (default) images will be automatically optimised before
processing. Set to `false` to disable lossy image optimisation.
test:
type: boolean
default: false
description: >-
True if revision is a test revision. Test revisions cannot be live
and are used for rapid Task testing/iteration.
input_processors:
type: array
items:
$ref: '#/components/schemas/TaskInputProcessor'
annotation:
type:
- string
- 'null'
description: >-
Optional note or comment about this revision. Useful for tracking
changes, experiments, or the purpose of test revisions.
fallback_llm_model_id:
type:
- string
- 'null'
format: uuid
description: The LLM model to use as fallback if the primary model fails.
fallback_llm_config:
type:
- object
- 'null'
additionalProperties:
description: Any type
description: Specific configuration parameters for the fallback LLM model.
id:
type: string
format: uuid
description: The unique identifier of the Revision.
created:
type: string
description: When the Task was created.
modified:
type:
- string
- 'null'
description: When the Task was last updated.
active:
type: boolean
default: false
description: >-
When `true` the Revision is the currently active version and will be
activated when the Task Run is executed.
tags:
type: array
items:
$ref: '#/components/schemas/Tag'
llm_model:
$ref: '#/components/schemas/LLMModel'
fallback_llm_model:
oneOf:
- $ref: '#/components/schemas/LLMModel'
- type: 'null'
input_params:
type: array
items:
type: string
description: >-
A list of all the dynamic input parameters that are detected from
the user prompt.
required:
- system_prompt
- user_prompt
- llm_model_id
- id
- created
- modified
- llm_model
- input_params
title: TaskRevision
Task:
type: object
properties:
name:
type: string
description: A name or reference for the Task.
description:
type:
- string
- 'null'
description: A longer description of the Task for internal reference.
enabled:
type: boolean
description: >-
When `true` the Task is active and callable. `false` denotes the
Task is not yet operational.
public:
type: boolean
default: false
description: When `true` the Task is public and can be accessed by any User.
exposed_to_agents:
type: boolean
default: false
description: >-
When `true` the Task is accessible to agents through the
unauthenticated agent endpoint.
output_modality:
$ref: '#/components/schemas/OutputModality'
description: >-
Specifies the output modality of the task. Can be 'json', 'image',
'audio', 'pdf', 'text', or 'csv'. Defaults to 'json'.
task_run_visibility:
$ref: '#/components/schemas/TaskTaskRunVisibility'
description: >-
Controls who can view all task runs. 'owner_only' - only task owners
see all runs (default), 'editors_and_owners' - task editors and
owners see all runs, 'all_viewers' - all users with view permission
see all runs.
id:
type: string
format: uuid
description: The unique identifier of the Task.
project_id:
type: string
format: uuid
description: The Project that the Task belongs to.
created:
type: string
description: When the Task was created.
modified:
type:
- string
- 'null'
description: When the Task was last updated.
deleted:
type:
- string
- 'null'
description: Timestamp when the task was deleted, if applicable.
revisions:
type: array
items:
$ref: '#/components/schemas/TaskRevision'
description: >-
Each update to a Task results in a new Revision being created. Task
Revisions are a powerful concept that can be used to assist with A/B
testing, comparing responses from different LLM's, etc.
access_token:
type:
- string
- 'null'
description: >-
Task specific Bearer token that can be used to authenticated when
executing this Task.
active_revisions:
type: array
items:
$ref: '#/components/schemas/TaskActiveRevision'
description: The revision currently active for this Task.
cloned_from_task_revision_id:
type:
- string
- 'null'
format: uuid
description: >-
The unique identifier of the task revision this task was cloned
from, if applicable.
tags:
type: array
items:
$ref: '#/components/schemas/Tag'
required:
- name
- enabled
- id
- project_id
- created
- access_token
- active_revisions
title: Task
ErrorResponseDetailOneOf1Items:
type: object
properties:
loc:
type: array
items:
type: string
description: Path to the error location
msg:
type: string
description: Human-readable error message
type:
type: string
description: Error type identifier
required:
- msg
- type
title: ErrorResponseDetailOneOf1Items
ErrorResponseDetail1:
type: array
items:
$ref: '#/components/schemas/ErrorResponseDetailOneOf1Items'
description: Detailed validation errors
title: ErrorResponseDetail1
ErrorResponseDetail:
oneOf:
- type: string
- $ref: '#/components/schemas/ErrorResponseDetail1'
title: ErrorResponseDetail
ErrorResponseType:
type: string
enum:
- validation_error
- authorization_error
- resource_error
- server_error
description: Error category
title: ErrorResponseType
ErrorResponse:
type: object
properties:
detail:
$ref: '#/components/schemas/ErrorResponseDetail'
type:
$ref: '#/components/schemas/ErrorResponseType'
description: Error category
msg:
type: string
description: Error summary
required:
- detail
description: Standardized error response format used across all endpoints
title: ErrorResponse
securitySchemes:
HTTPBearer:
type: http
scheme: bearer
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
```
## SDK Code Examples
```python Create new revision
import requests
url = "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74"
payload = {
"system_prompt": "You are an updated assistant.",
"user_prompt": "Updated prompt: {{input}}",
"llm_model_id": "ec217e75-72ea-4281-a1b8-cb7bd0ef9f41",
"output_format": { "response": {
"type": "str",
"description": "Updated response"
} },
"annotation": "Version 2 with improved prompts",
"test": False,
"name": "My Task v2"
}
headers = {
"Authorization": "Bearer ",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
```
```javascript Create new revision
const url = 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'},
body: '{"system_prompt":"You are an updated assistant.","user_prompt":"Updated prompt: {{input}}","llm_model_id":"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41","output_format":{"response":{"type":"str","description":"Updated response"}},"annotation":"Version 2 with improved prompts","test":false,"name":"My Task v2"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go Create new revision
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74"
payload := strings.NewReader("{\n \"system_prompt\": \"You are an updated assistant.\",\n \"user_prompt\": \"Updated prompt: {{input}}\",\n \"llm_model_id\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\",\n \"output_format\": {\n \"response\": {\n \"type\": \"str\",\n \"description\": \"Updated response\"\n }\n },\n \"annotation\": \"Version 2 with improved prompts\",\n \"test\": false,\n \"name\": \"My Task v2\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer ")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby Create new revision
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer '
request["Content-Type"] = 'application/json'
request.body = "{\n \"system_prompt\": \"You are an updated assistant.\",\n \"user_prompt\": \"Updated prompt: {{input}}\",\n \"llm_model_id\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\",\n \"output_format\": {\n \"response\": {\n \"type\": \"str\",\n \"description\": \"Updated response\"\n }\n },\n \"annotation\": \"Version 2 with improved prompts\",\n \"test\": false,\n \"name\": \"My Task v2\"\n}"
response = http.request(request)
puts response.read_body
```
```java Create new revision
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.post("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74")
.header("Authorization", "Bearer ")
.header("Content-Type", "application/json")
.body("{\n \"system_prompt\": \"You are an updated assistant.\",\n \"user_prompt\": \"Updated prompt: {{input}}\",\n \"llm_model_id\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\",\n \"output_format\": {\n \"response\": {\n \"type\": \"str\",\n \"description\": \"Updated response\"\n }\n },\n \"annotation\": \"Version 2 with improved prompts\",\n \"test\": false,\n \"name\": \"My Task v2\"\n}")
.asString();
```
```php Create new revision
request('POST', 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74', [
'body' => '{
"system_prompt": "You are an updated assistant.",
"user_prompt": "Updated prompt: {{input}}",
"llm_model_id": "ec217e75-72ea-4281-a1b8-cb7bd0ef9f41",
"output_format": {
"response": {
"type": "str",
"description": "Updated response"
}
},
"annotation": "Version 2 with improved prompts",
"test": false,
"name": "My Task v2"
}',
'headers' => [
'Authorization' => 'Bearer ',
'Content-Type' => 'application/json',
],
]);
echo $response->getBody();
```
```csharp Create new revision
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer ");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"system_prompt\": \"You are an updated assistant.\",\n \"user_prompt\": \"Updated prompt: {{input}}\",\n \"llm_model_id\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\",\n \"output_format\": {\n \"response\": {\n \"type\": \"str\",\n \"description\": \"Updated response\"\n }\n },\n \"annotation\": \"Version 2 with improved prompts\",\n \"test\": false,\n \"name\": \"My Task v2\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```
```swift Create new revision
import Foundation
let headers = [
"Authorization": "Bearer ",
"Content-Type": "application/json"
]
let parameters = [
"system_prompt": "You are an updated assistant.",
"user_prompt": "Updated prompt: {{input}}",
"llm_model_id": "ec217e75-72ea-4281-a1b8-cb7bd0ef9f41",
"output_format": ["response": [
"type": "str",
"description": "Updated response"
]],
"annotation": "Version 2 with improved prompts",
"test": false,
"name": "My Task v2"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
```python Update task visibility
import requests
url = "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74"
payload = {
"enabled": True,
"exposed_to_agents": True,
"public": True
}
headers = {
"Authorization": "Bearer ",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
```
```javascript Update task visibility
const url = 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'},
body: '{"enabled":true,"exposed_to_agents":true,"public":true}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go Update task visibility
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74"
payload := strings.NewReader("{\n \"enabled\": true,\n \"exposed_to_agents\": true,\n \"public\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer ")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby Update task visibility
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer '
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true,\n \"exposed_to_agents\": true,\n \"public\": true\n}"
response = http.request(request)
puts response.read_body
```
```java Update task visibility
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.post("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74")
.header("Authorization", "Bearer ")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"exposed_to_agents\": true,\n \"public\": true\n}")
.asString();
```
```php Update task visibility
request('POST', 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74', [
'body' => '{
"enabled": true,
"exposed_to_agents": true,
"public": true
}',
'headers' => [
'Authorization' => 'Bearer ',
'Content-Type' => 'application/json',
],
]);
echo $response->getBody();
```
```csharp Update task visibility
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer ");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"enabled\": true,\n \"exposed_to_agents\": true,\n \"public\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```
```swift Update task visibility
import Foundation
let headers = [
"Authorization": "Bearer ",
"Content-Type": "application/json"
]
let parameters = [
"enabled": true,
"exposed_to_agents": true,
"public": true
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
```python Create test revision
import requests
url = "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74"
payload = {
"system_prompt": "Test prompt",
"user_prompt": "Test: {{input}}",
"llm_model_id": "ec217e75-72ea-4281-a1b8-cb7bd0ef9f41",
"annotation": "Testing new approach",
"test": True,
"optimise_images": False
}
headers = {
"Authorization": "Bearer ",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
```
```javascript Create test revision
const url = 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'},
body: '{"system_prompt":"Test prompt","user_prompt":"Test: {{input}}","llm_model_id":"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41","annotation":"Testing new approach","test":true,"optimise_images":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go Create test revision
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74"
payload := strings.NewReader("{\n \"system_prompt\": \"Test prompt\",\n \"user_prompt\": \"Test: {{input}}\",\n \"llm_model_id\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\",\n \"annotation\": \"Testing new approach\",\n \"test\": true,\n \"optimise_images\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer ")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby Create test revision
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer '
request["Content-Type"] = 'application/json'
request.body = "{\n \"system_prompt\": \"Test prompt\",\n \"user_prompt\": \"Test: {{input}}\",\n \"llm_model_id\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\",\n \"annotation\": \"Testing new approach\",\n \"test\": true,\n \"optimise_images\": false\n}"
response = http.request(request)
puts response.read_body
```
```java Create test revision
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.post("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74")
.header("Authorization", "Bearer ")
.header("Content-Type", "application/json")
.body("{\n \"system_prompt\": \"Test prompt\",\n \"user_prompt\": \"Test: {{input}}\",\n \"llm_model_id\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\",\n \"annotation\": \"Testing new approach\",\n \"test\": true,\n \"optimise_images\": false\n}")
.asString();
```
```php Create test revision
request('POST', 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74', [
'body' => '{
"system_prompt": "Test prompt",
"user_prompt": "Test: {{input}}",
"llm_model_id": "ec217e75-72ea-4281-a1b8-cb7bd0ef9f41",
"annotation": "Testing new approach",
"test": true,
"optimise_images": false
}',
'headers' => [
'Authorization' => 'Bearer ',
'Content-Type' => 'application/json',
],
]);
echo $response->getBody();
```
```csharp Create test revision
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer ");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"system_prompt\": \"Test prompt\",\n \"user_prompt\": \"Test: {{input}}\",\n \"llm_model_id\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\",\n \"annotation\": \"Testing new approach\",\n \"test\": true,\n \"optimise_images\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```
```swift Create test revision
import Foundation
let headers = [
"Authorization": "Bearer ",
"Content-Type": "application/json"
]
let parameters = [
"system_prompt": "Test prompt",
"user_prompt": "Test: {{input}}",
"llm_model_id": "ec217e75-72ea-4281-a1b8-cb7bd0ef9f41",
"annotation": "Testing new approach",
"test": true,
"optimise_images": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
```python Update with fallback model
import requests
url = "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74"
payload = {
"system_prompt": "You are a reliable assistant.",
"user_prompt": "Process: {{input}}",
"llm_model_id": "ec217e75-72ea-4281-a1b8-cb7bd0ef9f41",
"annotation": "Added fallback for reliability",
"fallback_llm_model_id": "af2a9bbf-5f36-4b12-bd3f-92c57be96dec"
}
headers = {
"Authorization": "Bearer ",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
```
```javascript Update with fallback model
const url = 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'},
body: '{"system_prompt":"You are a reliable assistant.","user_prompt":"Process: {{input}}","llm_model_id":"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41","annotation":"Added fallback for reliability","fallback_llm_model_id":"af2a9bbf-5f36-4b12-bd3f-92c57be96dec"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go Update with fallback model
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74"
payload := strings.NewReader("{\n \"system_prompt\": \"You are a reliable assistant.\",\n \"user_prompt\": \"Process: {{input}}\",\n \"llm_model_id\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\",\n \"annotation\": \"Added fallback for reliability\",\n \"fallback_llm_model_id\": \"af2a9bbf-5f36-4b12-bd3f-92c57be96dec\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer ")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby Update with fallback model
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer '
request["Content-Type"] = 'application/json'
request.body = "{\n \"system_prompt\": \"You are a reliable assistant.\",\n \"user_prompt\": \"Process: {{input}}\",\n \"llm_model_id\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\",\n \"annotation\": \"Added fallback for reliability\",\n \"fallback_llm_model_id\": \"af2a9bbf-5f36-4b12-bd3f-92c57be96dec\"\n}"
response = http.request(request)
puts response.read_body
```
```java Update with fallback model
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.post("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74")
.header("Authorization", "Bearer ")
.header("Content-Type", "application/json")
.body("{\n \"system_prompt\": \"You are a reliable assistant.\",\n \"user_prompt\": \"Process: {{input}}\",\n \"llm_model_id\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\",\n \"annotation\": \"Added fallback for reliability\",\n \"fallback_llm_model_id\": \"af2a9bbf-5f36-4b12-bd3f-92c57be96dec\"\n}")
.asString();
```
```php Update with fallback model
request('POST', 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74', [
'body' => '{
"system_prompt": "You are a reliable assistant.",
"user_prompt": "Process: {{input}}",
"llm_model_id": "ec217e75-72ea-4281-a1b8-cb7bd0ef9f41",
"annotation": "Added fallback for reliability",
"fallback_llm_model_id": "af2a9bbf-5f36-4b12-bd3f-92c57be96dec"
}',
'headers' => [
'Authorization' => 'Bearer ',
'Content-Type' => 'application/json',
],
]);
echo $response->getBody();
```
```csharp Update with fallback model
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer ");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"system_prompt\": \"You are a reliable assistant.\",\n \"user_prompt\": \"Process: {{input}}\",\n \"llm_model_id\": \"ec217e75-72ea-4281-a1b8-cb7bd0ef9f41\",\n \"annotation\": \"Added fallback for reliability\",\n \"fallback_llm_model_id\": \"af2a9bbf-5f36-4b12-bd3f-92c57be96dec\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```
```swift Update with fallback model
import Foundation
let headers = [
"Authorization": "Bearer ",
"Content-Type": "application/json"
]
let parameters = [
"system_prompt": "You are a reliable assistant.",
"user_prompt": "Process: {{input}}",
"llm_model_id": "ec217e75-72ea-4281-a1b8-cb7bd0ef9f41",
"annotation": "Added fallback for reliability",
"fallback_llm_model_id": "af2a9bbf-5f36-4b12-bd3f-92c57be96dec"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
```python
import requests
url = "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74"
payload = {
"name": "Updated Task Name",
"description": "Updated description"
}
headers = {
"Authorization": "Bearer ",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
```
```javascript
const url = 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'},
body: '{"name":"Updated Task Name","description":"Updated description"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74"
payload := strings.NewReader("{\n \"name\": \"Updated Task Name\",\n \"description\": \"Updated description\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer ")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer '
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Updated Task Name\",\n \"description\": \"Updated description\"\n}"
response = http.request(request)
puts response.read_body
```
```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.post("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74")
.header("Authorization", "Bearer ")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Updated Task Name\",\n \"description\": \"Updated description\"\n}")
.asString();
```
```php
request('POST', 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74', [
'body' => '{
"name": "Updated Task Name",
"description": "Updated description"
}',
'headers' => [
'Authorization' => 'Bearer ',
'Content-Type' => 'application/json',
],
]);
echo $response->getBody();
```
```csharp
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer ");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"name\": \"Updated Task Name\",\n \"description\": \"Updated description\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```
```swift
import Foundation
let headers = [
"Authorization": "Bearer ",
"Content-Type": "application/json"
]
let parameters = [
"name": "Updated Task Name",
"description": "Updated description"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
# Delete Task
DELETE https://app.rightbrain.ai/api/v1/org/{org_id}/project/{project_id}/task/{task_id}
Delete a task and all its associated data.
This operation will permanently remove:
- The task configuration
- All task runs and their outputs
- Associated documents and files
- Task history and analytics
The deletion is irreversible. Ensure you have exported any important data before deletion.
**Note**: You must have edit permission on the task to delete it.
Reference: https://docs.rightbrain.ai/api-reference/api-reference/tasks/delete-task
## OpenAPI Specification
```yaml
openapi: 3.1.0
info:
title: API
version: 1.0.0
paths:
/org/{org_id}/project/{project_id}/task/{task_id}:
delete:
operationId: delete-task
summary: Delete Task
description: >-
Delete a task and all its associated data.
This operation will permanently remove:
- The task configuration
- All task runs and their outputs
- Associated documents and files
- Task history and analytics
The deletion is irreversible. Ensure you have exported any important
data before deletion.
**Note**: You must have edit permission on the task to delete it.
tags:
- subpackage_tasks
parameters:
- name: org_id
in: path
description: The unique identifier of the organization.
required: true
schema:
type: string
format: uuid
- name: project_id
in: path
description: The unique identifier of the project.
required: true
schema:
type: string
format: uuid
- name: task_id
in: path
description: The specific Task to reference.
required: true
schema:
type: string
format: uuid
- name: Authorization
in: header
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
required: true
schema:
type: string
responses:
'200':
description: Successful Response
content:
application/json:
schema:
description: Any type
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/MalformedResourceIdentifierErrorResponse'
'403':
description: >-
Forbidden - Insufficient permissions for task
**Common causes:**
- Your role lacks the required permission for this action
- The task belongs to a different organization or project
- The action requires admin or owner privileges
**Resolution:** Contact your organization admin to request
appropriate access.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Task not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
servers:
- url: https://app.rightbrain.ai/api/v1
- url: https://stag.leftbrain.me/api/v1
- url: https://app.rblocal.dev/api/v1
components:
schemas:
MalformedResourceIdentifierErrorResponseReason:
type: string
enum:
- MALFORMED_RESOURCE_IDENTIFIER
description: The machine-readable error reason.
title: MalformedResourceIdentifierErrorResponseReason
MalformedResourceIdentifierErrorDetails:
type: object
properties:
field:
type: string
value:
description: Any type
expected_format:
type: string
required:
- field
- value
- expected_format
title: MalformedResourceIdentifierErrorDetails
MalformedResourceIdentifierErrorResponse:
type: object
properties:
message:
type: string
description: Human readable representation of the error
reason:
$ref: '#/components/schemas/MalformedResourceIdentifierErrorResponseReason'
description: The machine-readable error reason.
malformedResourceIdentifierError:
$ref: '#/components/schemas/MalformedResourceIdentifierErrorDetails'
description: Metadata detailing more information about the error.
required:
- message
- reason
- malformedResourceIdentifierError
title: MalformedResourceIdentifierErrorResponse
ErrorResponseDetailOneOf1Items:
type: object
properties:
loc:
type: array
items:
type: string
description: Path to the error location
msg:
type: string
description: Human-readable error message
type:
type: string
description: Error type identifier
required:
- msg
- type
title: ErrorResponseDetailOneOf1Items
ErrorResponseDetail1:
type: array
items:
$ref: '#/components/schemas/ErrorResponseDetailOneOf1Items'
description: Detailed validation errors
title: ErrorResponseDetail1
ErrorResponseDetail:
oneOf:
- type: string
- $ref: '#/components/schemas/ErrorResponseDetail1'
title: ErrorResponseDetail
ErrorResponseType:
type: string
enum:
- validation_error
- authorization_error
- resource_error
- server_error
description: Error category
title: ErrorResponseType
ErrorResponse:
type: object
properties:
detail:
$ref: '#/components/schemas/ErrorResponseDetail'
type:
$ref: '#/components/schemas/ErrorResponseType'
description: Error category
msg:
type: string
description: Error summary
required:
- detail
description: Standardized error response format used across all endpoints
title: ErrorResponse
ValidationErrorLocItems:
oneOf:
- type: string
- type: integer
title: ValidationErrorLocItems
ValidationError:
type: object
properties:
loc:
type: array
items:
$ref: '#/components/schemas/ValidationErrorLocItems'
msg:
type: string
type:
type: string
required:
- loc
- msg
- type
title: ValidationError
HTTPValidationError:
type: object
properties:
detail:
type: array
items:
$ref: '#/components/schemas/ValidationError'
title: HTTPValidationError
securitySchemes:
HTTPBearer:
type: http
scheme: bearer
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
```
## SDK Code Examples
```python
import requests
url = "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74"
headers = {"Authorization": "Bearer "}
response = requests.delete(url, headers=headers)
print(response.json())
```
```javascript
const url = 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer '}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer ")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer '
response = http.request(request)
puts response.read_body
```
```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.delete("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74")
.header("Authorization", "Bearer ")
.asString();
```
```php
request('DELETE', 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74', [
'headers' => [
'Authorization' => 'Bearer ',
],
]);
echo $response->getBody();
```
```csharp
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Bearer ");
IRestResponse response = client.Execute(request);
```
```swift
import Foundation
let headers = ["Authorization": "Bearer "]
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
```python
import requests
url = "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74"
headers = {"Authorization": "Bearer "}
response = requests.delete(url, headers=headers)
print(response.json())
```
```javascript
const url = 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer '}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer ")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer '
response = http.request(request)
puts response.read_body
```
```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.delete("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74")
.header("Authorization", "Bearer ")
.asString();
```
```php
request('DELETE', 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74', [
'headers' => [
'Authorization' => 'Bearer ',
],
]);
echo $response->getBody();
```
```csharp
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Bearer ");
IRestResponse response = client.Execute(request);
```
```swift
import Foundation
let headers = ["Authorization": "Bearer "]
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
# Fetch Token Report
GET https://app.rightbrain.ai/api/v1/org/{org_id}/project/{project_id}/task/{task_id}/token_report
Retrieve detailed token usage statistics for a specific task.
This endpoint provides comprehensive token consumption data, including:
- Total tokens used across all task runs
- Token usage breakdown by time period
- Average tokens per request
- Usage patterns and trends
Parameters:
- start_date: Filter data from this date onward (supports both absolute dates and relative times)
- end_date: Filter data up to this date (supports both absolute dates and relative times)
Date Format Options:
1. Absolute dates: 'YYYY-MM-DD' (e.g., '2024-01-15')
2. Relative times:
- 'now', 'today', 'yesterday'
- 'X hours/days/weeks ago' (e.g., '24 hours ago', '7 days ago')
- 'last week', 'last month'
Common Use Cases:
1. Monitoring token consumption trends
2. Cost analysis and budgeting
3. Usage pattern analysis
4. Resource allocation planning
Reference: https://docs.rightbrain.ai/api-reference/api-reference/tasks/get-task-token-report
## OpenAPI Specification
```yaml
openapi: 3.1.0
info:
title: API
version: 1.0.0
paths:
/org/{org_id}/project/{project_id}/task/{task_id}/token_report:
get:
operationId: get-task-token-report
summary: Fetch Token Report
description: >-
Retrieve detailed token usage statistics for a specific task.
This endpoint provides comprehensive token consumption data, including:
- Total tokens used across all task runs
- Token usage breakdown by time period
- Average tokens per request
- Usage patterns and trends
Parameters:
- start_date: Filter data from this date onward (supports both absolute
dates and relative times)
- end_date: Filter data up to this date (supports both absolute dates
and relative times)
Date Format Options:
1. Absolute dates: 'YYYY-MM-DD' (e.g., '2024-01-15')
2. Relative times:
- 'now', 'today', 'yesterday'
- 'X hours/days/weeks ago' (e.g., '24 hours ago', '7 days ago')
- 'last week', 'last month'
Common Use Cases:
1. Monitoring token consumption trends
2. Cost analysis and budgeting
3. Usage pattern analysis
4. Resource allocation planning
tags:
- subpackage_tasks
parameters:
- name: org_id
in: path
description: The unique identifier of the organization.
required: true
schema:
type: string
format: uuid
- name: project_id
in: path
description: The unique identifier of the project.
required: true
schema:
type: string
format: uuid
- name: task_id
in: path
description: The specific Task to reference.
required: true
schema:
type: string
format: uuid
- name: start_date
in: query
description: >-
Start date for the report (e.g., '2023-06-01', '24 hours ago',
'yesterday').
required: false
schema:
type: string
- name: end_date
in: query
description: End date for the report (e.g., '2023-06-30', 'now', 'today').
required: false
schema:
type: string
- name: show_reporting_group
in: query
description: If true, include reporting group in the report.
required: false
schema:
type: boolean
default: false
- name: Authorization
in: header
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
required: true
schema:
type: string
responses:
'200':
description: Successfully retrieved token usage report
content:
application/json:
schema:
$ref: '#/components/schemas/TaskRunTokenReport'
'400':
description: >-
Bad Request - Invalid date format or range
**Common causes:**
- Invalid UUID format in path or query parameters
- Missing required fields in the request body
- Invalid enum value provided
- Type mismatch (e.g., string instead of number)
**Resolution:** Check the request body and parameters match the
schema.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: >-
Unauthorized - Authentication failed
**Common causes:**
- Missing `Authorization` header
- Expired access token
- Invalid or malformed token
- Using API key in wrong format
**Resolution:** Ensure you're including a valid Bearer token or API
key in the Authorization header.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: >-
Forbidden - Insufficient permissions for token usage data
**Common causes:**
- Your role lacks the required permission for this action
- The token usage data belongs to a different organization or
project
- The action requires admin or owner privileges
**Resolution:** Contact your organization admin to request
appropriate access.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Task not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: >-
Unprocessable Entity - Invalid request
**Common causes:**
- Request is well-formed but violates business rules
- Invalid combination of fields (e.g., mutually exclusive options)
- Referenced resource doesn't exist or is in wrong state
- Field value is valid type but out of acceptable range
**Resolution:** Check the error message for specific validation
failures and adjust your request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal Server Error - Failed to retrieve token usage data
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
servers:
- url: https://app.rightbrain.ai/api/v1
- url: https://stag.leftbrain.me/api/v1
- url: https://app.rblocal.dev/api/v1
components:
schemas:
TaskRunRevisionTokenReportTaskRevisionId:
oneOf:
- type: string
format: uuid
- type: string
description: Unique identifier of the task revision, or 'test' for test revisions
title: TaskRunRevisionTokenReportTaskRevisionId
TaskRunRevisionTokenReport:
type: object
properties:
task_revision_id:
$ref: '#/components/schemas/TaskRunRevisionTokenReportTaskRevisionId'
description: Unique identifier of the task revision, or 'test' for test revisions
reporting_group:
type:
- string
- 'null'
description: >-
The name of the reporting group, or None if no reporting group is
assigned. Only present when grouping by reporting groups.
total_input_tokens:
type: integer
description: >-
Total number of input tokens consumed by this revision during the
reporting period
total_output_tokens:
type: integer
description: >-
Total number of output tokens generated by this revision during the
reporting period
total_tokens:
type: integer
description: Combined total of input and output tokens for this revision
total_task_runs:
type: integer
description: >-
Number of times this revision was executed during the reporting
period
required:
- task_revision_id
- total_input_tokens
- total_output_tokens
- total_tokens
- total_task_runs
description: >-
Token usage report for a specific task revision.
This model represents detailed token consumption statistics for a single
task revision,
including input, output, and total token counts along with execution
counts.
title: TaskRunRevisionTokenReport
TaskRunTokenReport:
type: object
properties:
task_id:
type: string
format: uuid
description: Unique identifier of the task
date_range:
type: object
additionalProperties:
type: string
description: Time period covered by the report, with start and end timestamps
total_input_tokens:
type: integer
description: Total number of input tokens consumed across all revisions and runs
total_output_tokens:
type: integer
description: >-
Total number of output tokens generated across all revisions and
runs
total_tokens:
type: integer
description: Combined total of input and output tokens across all revisions
total_task_runs:
type: integer
description: Total number of task executions across all revisions
task_revisions:
type: array
items:
$ref: '#/components/schemas/TaskRunRevisionTokenReport'
description: >-
Token usage breakdown by task revision, showing detailed statistics
for each active revision
required:
- task_id
- date_range
- total_input_tokens
- total_output_tokens
- total_tokens
- total_task_runs
- task_revisions
description: >-
Comprehensive token usage report for a task.
This model provides a detailed breakdown of token consumption across all
revisions
of a task, including aggregated totals and per-revision statistics.
title: TaskRunTokenReport
ErrorResponseDetailOneOf1Items:
type: object
properties:
loc:
type: array
items:
type: string
description: Path to the error location
msg:
type: string
description: Human-readable error message
type:
type: string
description: Error type identifier
required:
- msg
- type
title: ErrorResponseDetailOneOf1Items
ErrorResponseDetail1:
type: array
items:
$ref: '#/components/schemas/ErrorResponseDetailOneOf1Items'
description: Detailed validation errors
title: ErrorResponseDetail1
ErrorResponseDetail:
oneOf:
- type: string
- $ref: '#/components/schemas/ErrorResponseDetail1'
title: ErrorResponseDetail
ErrorResponseType:
type: string
enum:
- validation_error
- authorization_error
- resource_error
- server_error
description: Error category
title: ErrorResponseType
ErrorResponse:
type: object
properties:
detail:
$ref: '#/components/schemas/ErrorResponseDetail'
type:
$ref: '#/components/schemas/ErrorResponseType'
description: Error category
msg:
type: string
description: Error summary
required:
- detail
description: Standardized error response format used across all endpoints
title: ErrorResponse
securitySchemes:
HTTPBearer:
type: http
scheme: bearer
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
```
## SDK Code Examples
```python
import requests
url = "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/token_report"
headers = {"Authorization": "Bearer "}
response = requests.get(url, headers=headers)
print(response.json())
```
```javascript
const url = 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/token_report';
const options = {method: 'GET', headers: {Authorization: 'Bearer '}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/token_report"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer ")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/token_report")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer '
response = http.request(request)
puts response.read_body
```
```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.get("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/token_report")
.header("Authorization", "Bearer ")
.asString();
```
```php
request('GET', 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/token_report', [
'headers' => [
'Authorization' => 'Bearer ',
],
]);
echo $response->getBody();
```
```csharp
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/token_report");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer ");
IRestResponse response = client.Execute(request);
```
```swift
import Foundation
let headers = ["Authorization": "Bearer "]
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/token_report")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
# Fetch Usage Report
GET https://app.rightbrain.ai/api/v1/org/{org_id}/project/{project_id}/task/{task_id}/usage_report
Retrieve usage statistics for task executions.
This endpoint provides detailed usage data about task runs, including:
- Number of executions over time
- Success and failure rates
- Usage patterns by time period
- Aggregated metrics by day or week
Use this data to:
1. Monitor task usage patterns
2. Track execution success rates
3. Analyze usage trends
4. Plan capacity and scaling
Reference: https://docs.rightbrain.ai/api-reference/api-reference/tasks/get-task-usage-report
## OpenAPI Specification
```yaml
openapi: 3.1.0
info:
title: API
version: 1.0.0
paths:
/org/{org_id}/project/{project_id}/task/{task_id}/usage_report:
get:
operationId: get-task-usage-report
summary: Fetch Usage Report
description: |-
Retrieve usage statistics for task executions.
This endpoint provides detailed usage data about task runs, including:
- Number of executions over time
- Success and failure rates
- Usage patterns by time period
- Aggregated metrics by day or week
Use this data to:
1. Monitor task usage patterns
2. Track execution success rates
3. Analyze usage trends
4. Plan capacity and scaling
tags:
- subpackage_tasks
parameters:
- name: org_id
in: path
description: The unique identifier of the organization.
required: true
schema:
type: string
format: uuid
- name: project_id
in: path
description: The unique identifier of the project.
required: true
schema:
type: string
format: uuid
- name: task_id
in: path
description: The specific Task to reference.
required: true
schema:
type: string
format: uuid
- name: aggregation
in: query
description: The aggregation level for the report. Can be either 'day' or 'week'.
required: false
schema:
$ref: >-
#/components/schemas/OrgOrgIdProjectProjectIdTaskTaskIdUsageReportGetParametersAggregation
- name: errors_only
in: query
description: If true, only include invocations with errors in the report.
required: false
schema:
type: boolean
default: false
- name: Authorization
in: header
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
required: true
schema:
type: string
responses:
'200':
description: Usage report retrieved successfully
content:
application/json:
schema:
$ref: '#/components/schemas/TaskRunUsageReport'
'400':
description: >-
Bad Request - Invalid aggregation parameter
**Common causes:**
- Invalid UUID format in path or query parameters
- Missing required fields in the request body
- Invalid enum value provided
- Type mismatch (e.g., string instead of number)
**Resolution:** Check the request body and parameters match the
schema.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: >-
Unauthorized - Authentication failed
**Common causes:**
- Missing `Authorization` header
- Expired access token
- Invalid or malformed token
- Using API key in wrong format
**Resolution:** Ensure you're including a valid Bearer token or API
key in the Authorization header.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: >-
Forbidden - Insufficient permissions for task usage data
**Common causes:**
- Your role lacks the required permission for this action
- The task usage data belongs to a different organization or project
- The action requires admin or owner privileges
**Resolution:** Contact your organization admin to request
appropriate access.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Task not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: >-
Unprocessable Entity - Invalid request
**Common causes:**
- Request is well-formed but violates business rules
- Invalid combination of fields (e.g., mutually exclusive options)
- Referenced resource doesn't exist or is in wrong state
- Field value is valid type but out of acceptable range
**Resolution:** Check the error message for specific validation
failures and adjust your request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal Server Error - Failed to process usage data
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
servers:
- url: https://app.rightbrain.ai/api/v1
- url: https://stag.leftbrain.me/api/v1
- url: https://app.rblocal.dev/api/v1
components:
schemas:
OrgOrgIdProjectProjectIdTaskTaskIdUsageReportGetParametersAggregation:
type: string
enum:
- day
- week
default: day
title: OrgOrgIdProjectProjectIdTaskTaskIdUsageReportGetParametersAggregation
TaskRunUsageReportAggregation:
type: string
enum:
- day
- week
description: >-
The time interval for data aggregation. 'day' shows last 24 hours in
hourly blocks, 'week' shows last 7 days in daily blocks.
title: TaskRunUsageReportAggregation
TaskRunRevisionUsageReportTaskRevisionId:
oneOf:
- type: string
format: uuid
- type: string
description: >-
The unique identifier of the Task Revision, or 'test' for test
revisions.
title: TaskRunRevisionUsageReportTaskRevisionId
TaskRunRevisionUsageReport:
type: object
properties:
task_revision_id:
$ref: '#/components/schemas/TaskRunRevisionUsageReportTaskRevisionId'
description: >-
The unique identifier of the Task Revision, or 'test' for test
revisions.
data:
type: object
additionalProperties:
type: integer
description: Usage counts for each time interval.
required:
- task_revision_id
- data
title: TaskRunRevisionUsageReport
TaskRunUsageReport:
type: object
properties:
task_id:
type: string
format: uuid
description: The unique identifier of the Task.
date_range:
type: object
additionalProperties:
description: Any type
description: The time range for the report, with start and end timestamps.
aggregation:
$ref: '#/components/schemas/TaskRunUsageReportAggregation'
description: >-
The time interval for data aggregation. 'day' shows last 24 hours in
hourly blocks, 'week' shows last 7 days in daily blocks.
task_revisions:
type: array
items:
$ref: '#/components/schemas/TaskRunRevisionUsageReport'
description: >-
Usage data broken down by task revision, showing invocation counts
for each active revision.
total_counts:
type: object
additionalProperties:
type: integer
description: >-
Total number of task invocations for each time interval across all
revisions.
required:
- task_id
- date_range
- aggregation
- task_revisions
- total_counts
title: TaskRunUsageReport
ErrorResponseDetailOneOf1Items:
type: object
properties:
loc:
type: array
items:
type: string
description: Path to the error location
msg:
type: string
description: Human-readable error message
type:
type: string
description: Error type identifier
required:
- msg
- type
title: ErrorResponseDetailOneOf1Items
ErrorResponseDetail1:
type: array
items:
$ref: '#/components/schemas/ErrorResponseDetailOneOf1Items'
description: Detailed validation errors
title: ErrorResponseDetail1
ErrorResponseDetail:
oneOf:
- type: string
- $ref: '#/components/schemas/ErrorResponseDetail1'
title: ErrorResponseDetail
ErrorResponseType:
type: string
enum:
- validation_error
- authorization_error
- resource_error
- server_error
description: Error category
title: ErrorResponseType
ErrorResponse:
type: object
properties:
detail:
$ref: '#/components/schemas/ErrorResponseDetail'
type:
$ref: '#/components/schemas/ErrorResponseType'
description: Error category
msg:
type: string
description: Error summary
required:
- detail
description: Standardized error response format used across all endpoints
title: ErrorResponse
securitySchemes:
HTTPBearer:
type: http
scheme: bearer
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
```
## SDK Code Examples
```python
import requests
url = "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/usage_report"
headers = {"Authorization": "Bearer "}
response = requests.get(url, headers=headers)
print(response.json())
```
```javascript
const url = 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/usage_report';
const options = {method: 'GET', headers: {Authorization: 'Bearer '}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/usage_report"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer ")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/usage_report")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer '
response = http.request(request)
puts response.read_body
```
```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.get("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/usage_report")
.header("Authorization", "Bearer ")
.asString();
```
```php
request('GET', 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/usage_report', [
'headers' => [
'Authorization' => 'Bearer ',
],
]);
echo $response->getBody();
```
```csharp
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/usage_report");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer ");
IRestResponse response = client.Execute(request);
```
```swift
import Foundation
let headers = ["Authorization": "Bearer "]
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/usage_report")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
# Fetch Timing Report
GET https://app.rightbrain.ai/api/v1/org/{org_id}/project/{project_id}/task/{task_id}/timing_report
Retrieve timing metrics for task executions.
This endpoint provides detailed timing data about task runs, including:
- Average response times
- Processing durations
- LLM call latencies
- Aggregated metrics by hour or day
Use this data to:
1. Monitor task performance
2. Identify performance bottlenecks
3. Track timing trends over time
4. Optimize task configurations
Reference: https://docs.rightbrain.ai/api-reference/api-reference/tasks/get-task-timing-report
## OpenAPI Specification
```yaml
openapi: 3.1.0
info:
title: API
version: 1.0.0
paths:
/org/{org_id}/project/{project_id}/task/{task_id}/timing_report:
get:
operationId: get-task-timing-report
summary: Fetch Timing Report
description: |-
Retrieve timing metrics for task executions.
This endpoint provides detailed timing data about task runs, including:
- Average response times
- Processing durations
- LLM call latencies
- Aggregated metrics by hour or day
Use this data to:
1. Monitor task performance
2. Identify performance bottlenecks
3. Track timing trends over time
4. Optimize task configurations
tags:
- subpackage_tasks
parameters:
- name: org_id
in: path
description: The unique identifier of the organization.
required: true
schema:
type: string
format: uuid
- name: project_id
in: path
description: The unique identifier of the project.
required: true
schema:
type: string
format: uuid
- name: task_id
in: path
description: The specific Task to reference.
required: true
schema:
type: string
format: uuid
- name: start_date
in: query
description: >-
Start date for the report (e.g., '2023-06-01', '24 hours ago',
'yesterday').
required: false
schema:
type: string
- name: end_date
in: query
description: End date for the report (e.g., '2023-06-30', 'now', 'today').
required: false
schema:
type: string
- name: aggregation
in: query
description: The aggregation level for the report. Can be either 'hour' or 'day'
required: false
schema:
$ref: >-
#/components/schemas/OrgOrgIdProjectProjectIdTaskTaskIdTimingReportGetParametersAggregation
- name: Authorization
in: header
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
required: true
schema:
type: string
responses:
'200':
description: Timing report retrieved successfully
content:
application/json:
schema:
$ref: '#/components/schemas/TaskRunTimingReport'
'400':
description: >-
Bad Request - Invalid date format or range
**Common causes:**
- Invalid UUID format in path or query parameters
- Missing required fields in the request body
- Invalid enum value provided
- Type mismatch (e.g., string instead of number)
**Resolution:** Check the request body and parameters match the
schema.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: >-
Unauthorized - Authentication failed
**Common causes:**
- Missing `Authorization` header
- Expired access token
- Invalid or malformed token
- Using API key in wrong format
**Resolution:** Ensure you're including a valid Bearer token or API
key in the Authorization header.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: >-
Forbidden - Insufficient permissions for task timing data
**Common causes:**
- Your role lacks the required permission for this action
- The task timing data belongs to a different organization or
project
- The action requires admin or owner privileges
**Resolution:** Contact your organization admin to request
appropriate access.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Task not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: >-
Unprocessable Entity - Invalid request
**Common causes:**
- Request is well-formed but violates business rules
- Invalid combination of fields (e.g., mutually exclusive options)
- Referenced resource doesn't exist or is in wrong state
- Field value is valid type but out of acceptable range
**Resolution:** Check the error message for specific validation
failures and adjust your request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal Server Error - Failed to process timing data
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
servers:
- url: https://app.rightbrain.ai/api/v1
- url: https://stag.leftbrain.me/api/v1
- url: https://app.rblocal.dev/api/v1
components:
schemas:
OrgOrgIdProjectProjectIdTaskTaskIdTimingReportGetParametersAggregation:
type: string
enum:
- hour
- day
default: hour
title: OrgOrgIdProjectProjectIdTaskTaskIdTimingReportGetParametersAggregation
TaskRunTimingReportAggregation:
type: string
enum:
- hour
- day
description: >-
The time interval for data aggregation. 'hour' shows last 24 hours in
hourly blocks, 'day' shows last 7 days in daily blocks.
title: TaskRunTimingReportAggregation
TaskRunRevisionTimingReportTaskRevisionId:
oneOf:
- type: string
format: uuid
- type: string
description: >-
The unique identifier of the Task Revision, or 'test' for test
revisions.
title: TaskRunRevisionTimingReportTaskRevisionId
TaskRunRevisionTimingReport:
type: object
properties:
task_revision_id:
$ref: '#/components/schemas/TaskRunRevisionTimingReportTaskRevisionId'
description: >-
The unique identifier of the Task Revision, or 'test' for test
revisions.
data:
type: object
additionalProperties:
description: Any type
description: >-
Timing data for each time interval, containing average LLM call
timing and total task runs.
required:
- task_revision_id
- data
title: TaskRunRevisionTimingReport
TaskRunTimingReport:
type: object
properties:
task_id:
type: string
format: uuid
description: The unique identifier of the Task.
date_range:
type: object
additionalProperties:
type: string
description: The time range for the report, with start and end timestamps.
aggregation:
$ref: '#/components/schemas/TaskRunTimingReportAggregation'
description: >-
The time interval for data aggregation. 'hour' shows last 24 hours
in hourly blocks, 'day' shows last 7 days in daily blocks.
total_task_runs:
type: object
additionalProperties:
type: integer
description: Total number of task runs for each time interval.
task_revisions:
type: array
items:
$ref: '#/components/schemas/TaskRunRevisionTimingReport'
description: >-
Timing data broken down by task revision, showing performance
metrics for each active revision.
required:
- task_id
- date_range
- aggregation
- total_task_runs
- task_revisions
title: TaskRunTimingReport
ErrorResponseDetailOneOf1Items:
type: object
properties:
loc:
type: array
items:
type: string
description: Path to the error location
msg:
type: string
description: Human-readable error message
type:
type: string
description: Error type identifier
required:
- msg
- type
title: ErrorResponseDetailOneOf1Items
ErrorResponseDetail1:
type: array
items:
$ref: '#/components/schemas/ErrorResponseDetailOneOf1Items'
description: Detailed validation errors
title: ErrorResponseDetail1
ErrorResponseDetail:
oneOf:
- type: string
- $ref: '#/components/schemas/ErrorResponseDetail1'
title: ErrorResponseDetail
ErrorResponseType:
type: string
enum:
- validation_error
- authorization_error
- resource_error
- server_error
description: Error category
title: ErrorResponseType
ErrorResponse:
type: object
properties:
detail:
$ref: '#/components/schemas/ErrorResponseDetail'
type:
$ref: '#/components/schemas/ErrorResponseType'
description: Error category
msg:
type: string
description: Error summary
required:
- detail
description: Standardized error response format used across all endpoints
title: ErrorResponse
securitySchemes:
HTTPBearer:
type: http
scheme: bearer
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
```
## SDK Code Examples
```python
import requests
url = "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/timing_report"
headers = {"Authorization": "Bearer "}
response = requests.get(url, headers=headers)
print(response.json())
```
```javascript
const url = 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/timing_report';
const options = {method: 'GET', headers: {Authorization: 'Bearer '}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/timing_report"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer ")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/timing_report")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer '
response = http.request(request)
puts response.read_body
```
```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.get("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/timing_report")
.header("Authorization", "Bearer ")
.asString();
```
```php
request('GET', 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/timing_report', [
'headers' => [
'Authorization' => 'Bearer ',
],
]);
echo $response->getBody();
```
```csharp
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/timing_report");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer ");
IRestResponse response = client.Execute(request);
```
```swift
import Foundation
let headers = ["Authorization": "Bearer "]
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/timing_report")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
# Fetch Credit Report
GET https://app.rightbrain.ai/api/v1/org/{org_id}/project/{project_id}/task/{task_id}/credit_report
Retrieve detailed credit usage statistics for a specific task.
Reference: https://docs.rightbrain.ai/api-reference/api-reference/tasks/get-task-credit-report
## OpenAPI Specification
```yaml
openapi: 3.1.0
info:
title: API
version: 1.0.0
paths:
/org/{org_id}/project/{project_id}/task/{task_id}/credit_report:
get:
operationId: get-task-credit-report
summary: Fetch Credit Report
description: Retrieve detailed credit usage statistics for a specific task.
tags:
- subpackage_tasks
parameters:
- name: org_id
in: path
description: The unique identifier of the organization.
required: true
schema:
type: string
format: uuid
- name: project_id
in: path
description: The unique identifier of the project.
required: true
schema:
type: string
format: uuid
- name: task_id
in: path
description: The specific Task to reference.
required: true
schema:
type: string
format: uuid
- name: start_date
in: query
description: >-
Start date for the report (e.g., '2023-06-01', '24 hours ago',
'yesterday').
required: false
schema:
type: string
- name: end_date
in: query
description: End date for the report (e.g., '2023-06-30', 'now', 'today').
required: false
schema:
type: string
- name: show_reporting_group
in: query
description: If true, include reporting group in the report.
required: false
schema:
type: boolean
default: false
- name: Authorization
in: header
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
required: true
schema:
type: string
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/TaskRunCreditReport'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/MalformedResourceIdentifierErrorResponse'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/GetTaskCreditReportRequestForbiddenError'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
servers:
- url: https://app.rightbrain.ai/api/v1
- url: https://stag.leftbrain.me/api/v1
- url: https://app.rblocal.dev/api/v1
components:
schemas:
TaskRunRevisionCreditReportTaskRevisionId:
oneOf:
- type: string
format: uuid
- type: string
description: >-
The unique identifier of the Task Revision, or 'test' for test
revisions.
title: TaskRunRevisionCreditReportTaskRevisionId
TaskRunRevisionCreditReport:
type: object
properties:
task_revision_id:
$ref: '#/components/schemas/TaskRunRevisionCreditReportTaskRevisionId'
description: >-
The unique identifier of the Task Revision, or 'test' for test
revisions.
reporting_group:
type:
- string
- 'null'
description: >-
The name of the reporting group, or 'ungrouped' if no reporting
group is assigned. Only present when grouping by reporting groups.
total_credits:
type: string
description: Total credits charged for the Task Revision.
total_task_runs:
type: integer
description: Total number of task runs for this revision.
required:
- task_revision_id
- total_credits
- total_task_runs
title: TaskRunRevisionCreditReport
TaskRunCreditReport:
type: object
properties:
task_id:
type: string
format: uuid
description: The unique identifier of the Task.
task_revisions:
type: array
items:
$ref: '#/components/schemas/TaskRunRevisionCreditReport'
description: >-
Timing data broken down by task revision, showing performance
metrics for each active revision.
total_credits:
type: string
description: Total credits charged for the Task.
total_task_runs:
type: integer
description: Total number of task runs for each time interval.
date_range:
type: object
additionalProperties:
type: string
description: The time range for the report, with start and end timestamps.
required:
- task_id
- task_revisions
- total_credits
- total_task_runs
- date_range
title: TaskRunCreditReport
MalformedResourceIdentifierErrorResponseReason:
type: string
enum:
- MALFORMED_RESOURCE_IDENTIFIER
description: The machine-readable error reason.
title: MalformedResourceIdentifierErrorResponseReason
MalformedResourceIdentifierErrorDetails:
type: object
properties:
field:
type: string
value:
description: Any type
expected_format:
type: string
required:
- field
- value
- expected_format
title: MalformedResourceIdentifierErrorDetails
MalformedResourceIdentifierErrorResponse:
type: object
properties:
message:
type: string
description: Human readable representation of the error
reason:
$ref: '#/components/schemas/MalformedResourceIdentifierErrorResponseReason'
description: The machine-readable error reason.
malformedResourceIdentifierError:
$ref: '#/components/schemas/MalformedResourceIdentifierErrorDetails'
description: Metadata detailing more information about the error.
required:
- message
- reason
- malformedResourceIdentifierError
title: MalformedResourceIdentifierErrorResponse
MissingAuthenticationErrorResponseReason:
type: string
enum:
- MISSING_AUTHENTICATION
description: The machine-readable error reason.
title: MissingAuthenticationErrorResponseReason
EmptyErrorDetails:
type: object
properties: {}
title: EmptyErrorDetails
MissingAuthenticationErrorResponse:
type: object
properties:
message:
type: string
description: Human readable representation of the error
reason:
$ref: '#/components/schemas/MissingAuthenticationErrorResponseReason'
description: The machine-readable error reason.
missingAuthenticationError:
$ref: '#/components/schemas/EmptyErrorDetails'
description: Metadata detailing more information about the error.
required:
- message
- reason
- missingAuthenticationError
title: MissingAuthenticationErrorResponse
PermissionCheckFailedErrorResponseReason:
type: string
enum:
- PERMISSION_CHECK_FAILED
description: The machine-readable error reason.
title: PermissionCheckFailedErrorResponseReason
IAMObjectErrorDetails:
type: object
properties:
type:
type: string
id:
type:
- string
- 'null'
required:
- type
title: IAMObjectErrorDetails
PermissionCheckFailedErrorDetails:
type: object
properties:
subject:
oneOf:
- $ref: '#/components/schemas/IAMObjectErrorDetails'
- type: 'null'
resource:
oneOf:
- $ref: '#/components/schemas/IAMObjectErrorDetails'
- type: 'null'
permission:
type: string
required:
- permission
title: PermissionCheckFailedErrorDetails
PermissionCheckFailedErrorResponse:
type: object
properties:
message:
type: string
description: Human readable representation of the error
reason:
$ref: '#/components/schemas/PermissionCheckFailedErrorResponseReason'
description: The machine-readable error reason.
permissionCheckFailedError:
$ref: '#/components/schemas/PermissionCheckFailedErrorDetails'
description: Metadata detailing more information about the error.
required:
- message
- reason
- permissionCheckFailedError
title: PermissionCheckFailedErrorResponse
GetTaskCreditReportRequestForbiddenError:
oneOf:
- $ref: '#/components/schemas/MissingAuthenticationErrorResponse'
- $ref: '#/components/schemas/PermissionCheckFailedErrorResponse'
title: GetTaskCreditReportRequestForbiddenError
ValidationErrorLocItems:
oneOf:
- type: string
- type: integer
title: ValidationErrorLocItems
ValidationError:
type: object
properties:
loc:
type: array
items:
$ref: '#/components/schemas/ValidationErrorLocItems'
msg:
type: string
type:
type: string
required:
- loc
- msg
- type
title: ValidationError
HTTPValidationError:
type: object
properties:
detail:
type: array
items:
$ref: '#/components/schemas/ValidationError'
title: HTTPValidationError
securitySchemes:
HTTPBearer:
type: http
scheme: bearer
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
```
## SDK Code Examples
```python
import requests
url = "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/credit_report"
headers = {"Authorization": "Bearer "}
response = requests.get(url, headers=headers)
print(response.json())
```
```javascript
const url = 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/credit_report';
const options = {method: 'GET', headers: {Authorization: 'Bearer '}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/credit_report"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer ")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/credit_report")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer '
response = http.request(request)
puts response.read_body
```
```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.get("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/credit_report")
.header("Authorization", "Bearer ")
.asString();
```
```php
request('GET', 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/credit_report', [
'headers' => [
'Authorization' => 'Bearer ',
],
]);
echo $response->getBody();
```
```csharp
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/credit_report");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer ");
IRestResponse response = client.Execute(request);
```
```swift
import Foundation
let headers = ["Authorization": "Bearer "]
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/credit_report")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
# List Task Runs
GET https://app.rightbrain.ai/api/v1/org/{org_id}/project/{project_id}/task/{task_id}/run
Retrieve a paginated list of task runs for a specific task.
Task runs provide an audit trail of all task executions, including:
- Input parameters used
- Execution status and timing
- Resource usage metrics (tokens, credits)
- Output results
- Error information for failed runs
- Fallback model usage information
This endpoint supports:
- Pagination using cursor-based navigation
- Filtering by task revision
- Sorting by creation time (newest first)
Common use cases:
1. Monitoring task execution history
2. Auditing task usage and performance
3. Debugging task behavior across multiple runs
4. Analyzing task output patterns
5. Tracking fallback model usage and reliability
Reference: https://docs.rightbrain.ai/api-reference/api-reference/tasks/get-task-runs
## OpenAPI Specification
```yaml
openapi: 3.1.0
info:
title: API
version: 1.0.0
paths:
/org/{org_id}/project/{project_id}/task/{task_id}/run:
get:
operationId: get-task-runs
summary: List Task Runs
description: |-
Retrieve a paginated list of task runs for a specific task.
Task runs provide an audit trail of all task executions, including:
- Input parameters used
- Execution status and timing
- Resource usage metrics (tokens, credits)
- Output results
- Error information for failed runs
- Fallback model usage information
This endpoint supports:
- Pagination using cursor-based navigation
- Filtering by task revision
- Sorting by creation time (newest first)
Common use cases:
1. Monitoring task execution history
2. Auditing task usage and performance
3. Debugging task behavior across multiple runs
4. Analyzing task output patterns
5. Tracking fallback model usage and reliability
tags:
- subpackage_tasks
parameters:
- name: org_id
in: path
description: The unique identifier of the organization.
required: true
schema:
type: string
format: uuid
- name: project_id
in: path
description: The unique identifier of the project.
required: true
schema:
type: string
format: uuid
- name: task_id
in: path
description: The specific Task to reference.
required: true
schema:
type: string
format: uuid
- name: page_limit
in: query
description: >-
The maximum number of items to return per page. Defaults to `100` if
not specified.
required: false
schema:
type: integer
default: 100
- name: cursor
in: query
description: >-
A cursor for pagination. Use the `next_cursor` value from the
previous response to get the next page of results.
required: false
schema:
type: string
format: uuid
- name: status
in: query
description: Filter by task run status
required: false
schema:
$ref: >-
#/components/schemas/OrgOrgIdProjectProjectIdTaskTaskIdRunGetParametersStatus
- name: task_revision_id
in: query
description: Filter task runs by revision ID
required: false
schema:
type: string
format: uuid
- name: Authorization
in: header
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
required: true
schema:
type: string
responses:
'200':
description: Successfully retrieved task runs
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedResultSet_TaskRun_'
'400':
description: >-
Bad Request - Invalid parameters
**Common causes:**
- Invalid UUID format in path or query parameters
- Missing required fields in the request body
- Invalid enum value provided
- Type mismatch (e.g., string instead of number)
**Resolution:** Check the request body and parameters match the
schema.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: >-
Unauthorized - Authentication failed
**Common causes:**
- Missing `Authorization` header
- Expired access token
- Invalid or malformed token
- Using API key in wrong format
**Resolution:** Ensure you're including a valid Bearer token or API
key in the Authorization header.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: >-
Forbidden - Insufficient permissions for task runs
**Common causes:**
- Your role lacks the required permission for this action
- The task runs belongs to a different organization or project
- The action requires admin or owner privileges
**Resolution:** Contact your organization admin to request
appropriate access.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Task or revision not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: >-
Unprocessable Entity - Invalid request parameters
**Common causes:**
- Request is well-formed but violates business rules
- Invalid combination of fields (e.g., mutually exclusive options)
- Referenced resource doesn't exist or is in wrong state
- Field value is valid type but out of acceptable range
**Resolution:** Check the error message for specific validation
failures and adjust your request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal Server Error - Failed to retrieve task runs
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
servers:
- url: https://app.rightbrain.ai/api/v1
- url: https://stag.leftbrain.me/api/v1
- url: https://app.rblocal.dev/api/v1
components:
schemas:
OrgOrgIdProjectProjectIdTaskTaskIdRunGetParametersStatus:
type: string
enum:
- success
- error
title: OrgOrgIdProjectProjectIdTaskTaskIdRunGetParametersStatus
PaginationDetails:
type: object
properties:
next_cursor:
type:
- string
- 'null'
description: >-
A token used to retrieve the next page of results. If `null`, there
are no more results.
has_next:
type:
- boolean
- 'null'
default: false
description: Indicates whether there are more results available in the next page.
page_limit:
type:
- integer
- 'null'
default: 0
description: The maximum number of items returned per page.
title: PaginationDetails
TaskRunResponse:
oneOf:
- type: string
- type: object
additionalProperties:
description: Any type
description: The structured response from the Task execution.
title: TaskRunResponse
TaskRunRunDataSubmitted:
type: object
properties: {}
description: The input parameters provided when executing the Task.
title: TaskRunRunDataSubmitted
TaskRunRunData:
type: object
properties:
submitted:
$ref: '#/components/schemas/TaskRunRunDataSubmitted'
description: The input parameters provided when executing the Task.
required:
- submitted
description: Additional data about the Task execution, including submitted inputs.
title: TaskRunRunData
TaskRunFileMetadata:
type: object
properties:
original_filename:
type: string
description: The original filename as submitted by the user
stored_filename:
type: string
description: The generated filename used for storage
content_type:
type: string
description: MIME type of the file
download_url:
type:
- string
- 'null'
description: >-
Relative URL to download the file (generated dynamically, not stored
in database)
size_bytes:
type:
- integer
- 'null'
description: File size in bytes (if available)
required:
- original_filename
- stored_filename
- content_type
description: Metadata for files submitted/generated during task execution.
title: TaskRunFileMetadata
ReportingGroup:
type: object
properties:
name:
type: string
description: Name of the reporting group
description:
type:
- string
- 'null'
description: Optional description
id:
type: string
format: uuid
project_id:
type: string
format: uuid
created:
type: string
modified:
type: string
required:
- name
- id
- project_id
- created
- modified
description: Schema for reporting group responses.
title: ReportingGroup
TaskRun:
type: object
properties:
task_id:
type: string
format: uuid
description: The unique identifier of the Task associated with this run.
task_revision_id:
type: string
format: uuid
description: The unique identifier of the Task Revision associated with this run.
response:
$ref: '#/components/schemas/TaskRunResponse'
description: The structured response from the Task execution.
run_data:
$ref: '#/components/schemas/TaskRunRunData'
description: >-
Additional data about the Task execution, including submitted
inputs.
files:
type: array
items:
$ref: '#/components/schemas/TaskRunFileMetadata'
description: >-
List of file metadata objects with enriched information including
download URLs.
is_error:
type: boolean
default: false
llm_retries:
type: integer
default: 0
description: Number of retry attempts made during LLM execution.
used_fallback_model:
type: boolean
default: false
description: Whether the fallback model was used
primary_failure_reason:
type:
- string
- 'null'
description: Reason the primary model failed
fallback_llm_model_id:
type:
- string
- 'null'
format: uuid
description: Fallback model that was used
user_id:
type:
- string
- 'null'
format: uuid
description: The unique identifier of the User who executed the task.
reporting_group_id:
type:
- string
- 'null'
format: uuid
description: The ID of the reporting group to associate with this task run
reference:
type:
- string
- 'null'
description: An optional reference identifier for this task run
context_id:
type:
- string
- 'null'
description: An optional context ID for grouping related task runs
id:
type: string
format: uuid
description: The unique identifier of the Task Run.
created:
type: string
description: The timestamp when the Task Run was created.
input_tokens:
type: integer
description: The number of tokens submit as input to the model.
output_tokens:
type: integer
description: The number of tokens generated and output by the model.
total_tokens:
type: integer
description: The total token usage for the TaskRun.
input_processor_timing:
type:
- number
- 'null'
format: double
description: The execution time for the TaskRun in seconds.
llm_call_timing:
type:
- number
- 'null'
format: double
description: The execution time for the TaskRun in seconds.
charged_credits:
type:
- string
- 'null'
description: The total credits charged for the TaskRun.
reporting_group:
oneOf:
- $ref: '#/components/schemas/ReportingGroup'
- type: 'null'
description: The reporting group associated with this task run
required:
- task_id
- task_revision_id
- response
- run_data
- id
- created
- input_tokens
- output_tokens
- total_tokens
- input_processor_timing
- llm_call_timing
- charged_credits
title: TaskRun
PaginatedResultSet_TaskRun_:
type: object
properties:
pagination:
oneOf:
- $ref: '#/components/schemas/PaginationDetails'
- type: 'null'
description: Contains pagination information for the result set.
results:
type: array
items:
$ref: '#/components/schemas/TaskRun'
description: The list of items returned for the current page.
required:
- results
title: PaginatedResultSet_TaskRun_
ErrorResponseDetailOneOf1Items:
type: object
properties:
loc:
type: array
items:
type: string
description: Path to the error location
msg:
type: string
description: Human-readable error message
type:
type: string
description: Error type identifier
required:
- msg
- type
title: ErrorResponseDetailOneOf1Items
ErrorResponseDetail1:
type: array
items:
$ref: '#/components/schemas/ErrorResponseDetailOneOf1Items'
description: Detailed validation errors
title: ErrorResponseDetail1
ErrorResponseDetail:
oneOf:
- type: string
- $ref: '#/components/schemas/ErrorResponseDetail1'
title: ErrorResponseDetail
ErrorResponseType:
type: string
enum:
- validation_error
- authorization_error
- resource_error
- server_error
description: Error category
title: ErrorResponseType
ErrorResponse:
type: object
properties:
detail:
$ref: '#/components/schemas/ErrorResponseDetail'
type:
$ref: '#/components/schemas/ErrorResponseType'
description: Error category
msg:
type: string
description: Error summary
required:
- detail
description: Standardized error response format used across all endpoints
title: ErrorResponse
securitySchemes:
HTTPBearer:
type: http
scheme: bearer
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
```
## SDK Code Examples
```python
import requests
url = "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run"
headers = {"Authorization": "Bearer "}
response = requests.get(url, headers=headers)
print(response.json())
```
```javascript
const url = 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run';
const options = {method: 'GET', headers: {Authorization: 'Bearer '}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer ")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer '
response = http.request(request)
puts response.read_body
```
```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.get("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run")
.header("Authorization", "Bearer ")
.asString();
```
```php
request('GET', 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run', [
'headers' => [
'Authorization' => 'Bearer ',
],
]);
echo $response->getBody();
```
```csharp
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer ");
IRestResponse response = client.Execute(request);
```
```swift
import Foundation
let headers = ["Authorization": "Bearer "]
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
# Run Task
POST https://app.rightbrain.ai/api/v1/org/{org_id}/project/{project_id}/task/{task_id}/run
Content-Type: application/json
Run a task with the specified inputs and receive structured output.
This endpoint executes the task using its active revision(s) and returns the results. Key features:
1. Automatic revision selection based on traffic weights
2. Structured output matching the task's output modality:
- `json`: Structured JSON responses
- `image`: Generated image files (PNG, JPEG)
- `audio`: Generated audio files
- `pdf`: Formatted PDF documents
- `text`: Plain text responses
- `csv`: CSV data files
3. Execution metadata (tokens, timing, credits charged)
4. Support for file uploads when required
5. Automatic fallback to backup model on primary model failures
6. Optional manual fallback model triggering
7. Reporting group tracking for analytics and billing
**Request Body:**
⚠️ **IMPORTANT**: The request body must use the `task_input` field (not `input_params`):
```json
{
"task_input": {
"variable_name": "value to substitute in user_prompt"
}
}
```
The keys in `task_input` should match the `{{variable}}` placeholders defined in your task's `user_prompt`. For example, if your prompt contains `{{text}}` and `{{language}}`, your request should be:
```json
{
"task_input": {
"text": "Hello world",
"language": "Spanish"
}
}
```
**Required:**
- `task_input` object with parameters matching the task's prompt variables
- Image file if task has `image_required=true`
**Optional Query Parameters:**
- `revision_id` or `revision_tag` for testing or comparison
- `reporting_group` name for segmented analytics
- `use_fallback_model` flag to manually trigger fallback
The response includes:
- Structured output matching the task's output_format
- Execution metadata (tokens used, timing, credits charged)
- Fallback model usage information if applicable
- Input data for audit purposes
- References to any processed files
**Common Use Cases:**
*A/B Testing Revisions:*
Compare different prompt versions by explicitly specifying `revision_id` or `revision_tag` for each request, then analyze results.
*Gradual Rollouts:*
Configure traffic weights on revisions to gradually shift traffic from an old prompt to a new one while monitoring performance.
*Fallback Model Strategy:*
Use `use_fallback_model=true` to manually switch to the backup model during known primary model outages or rate limits.
*Analytics Segmentation:*
Pass `reporting_group` to track metrics by customer, feature, or experiment cohort for billing and performance analysis.
Reference: https://docs.rightbrain.ai/api-reference/api-reference/tasks/run-task
## OpenAPI Specification
```yaml
openapi: 3.1.0
info:
title: API
version: 1.0.0
paths:
/org/{org_id}/project/{project_id}/task/{task_id}/run:
post:
operationId: run-task
summary: Run Task
description: >-
Run a task with the specified inputs and receive structured output.
This endpoint executes the task using its active revision(s) and returns
the results. Key features:
1. Automatic revision selection based on traffic weights
2. Structured output matching the task's output modality:
- `json`: Structured JSON responses
- `image`: Generated image files (PNG, JPEG)
- `audio`: Generated audio files
- `pdf`: Formatted PDF documents
- `text`: Plain text responses
- `csv`: CSV data files
3. Execution metadata (tokens, timing, credits charged)
4. Support for file uploads when required
5. Automatic fallback to backup model on primary model failures
6. Optional manual fallback model triggering
7. Reporting group tracking for analytics and billing
**Request Body:**
⚠️ **IMPORTANT**: The request body must use the `task_input` field (not
`input_params`):
```json
{
"task_input": {
"variable_name": "value to substitute in user_prompt"
}
}
```
The keys in `task_input` should match the `{{variable}}` placeholders
defined in your task's `user_prompt`. For example, if your prompt
contains `{{text}}` and `{{language}}`, your request should be:
```json
{
"task_input": {
"text": "Hello world",
"language": "Spanish"
}
}
```
**Required:**
- `task_input` object with parameters matching the task's prompt
variables
- Image file if task has `image_required=true`
**Optional Query Parameters:**
- `revision_id` or `revision_tag` for testing or comparison
- `reporting_group` name for segmented analytics
- `use_fallback_model` flag to manually trigger fallback
The response includes:
- Structured output matching the task's output_format
- Execution metadata (tokens used, timing, credits charged)
- Fallback model usage information if applicable
- Input data for audit purposes
- References to any processed files
**Common Use Cases:**
*A/B Testing Revisions:*
Compare different prompt versions by explicitly specifying `revision_id`
or `revision_tag` for each request, then analyze results.
*Gradual Rollouts:*
Configure traffic weights on revisions to gradually shift traffic from
an old prompt to a new one while monitoring performance.
*Fallback Model Strategy:*
Use `use_fallback_model=true` to manually switch to the backup model
during known primary model outages or rate limits.
*Analytics Segmentation:*
Pass `reporting_group` to track metrics by customer, feature, or
experiment cohort for billing and performance analysis.
tags:
- subpackage_tasks
parameters:
- name: org_id
in: path
description: The unique identifier of the organization.
required: true
schema:
type: string
format: uuid
- name: project_id
in: path
description: The unique identifier of the project.
required: true
schema:
type: string
format: uuid
- name: task_id
in: path
description: The specific Task to reference.
required: true
schema:
type: string
format: uuid
- name: revision_id
in: query
description: >-
Optional Task Revision ID to use for execution. If not provided, an
active revision will be selected based on traffic weights.
required: false
schema:
type: string
format: uuid
- name: revision_tag
in: query
description: >-
Optional Task Revision Tag to use for execution. If not provided, an
active revision will be selected based on traffic weights.
required: false
schema:
type: string
- name: reporting_group
in: query
description: Optional reporting group name to associate with this task run
required: false
schema:
type: string
- name: use_fallback_model
in: query
description: >-
If true, immediately use the fallback model instead of the primary
model. Requires the task to have a fallback model configured.
required: false
schema:
type: boolean
default: false
- name: Authorization
in: header
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
required: true
schema:
type: string
responses:
'200':
description: Task executed successfully
content:
application/json:
schema:
$ref: '#/components/schemas/TaskRun'
'400':
description: >-
Bad Request - Invalid task input format
**Common causes:**
- Invalid UUID format in path or query parameters
- Missing required fields in the request body
- Invalid enum value provided
- Type mismatch (e.g., string instead of number)
**Resolution:** Check the request body and parameters match the
schema.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: >-
Unauthorized - Authentication failed
**Common causes:**
- Missing `Authorization` header
- Expired access token
- Invalid or malformed token
- Using API key in wrong format
**Resolution:** Ensure you're including a valid Bearer token or API
key in the Authorization header.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: >-
Forbidden - Insufficient permissions for task
**Common causes:**
- Your role lacks the required permission for this action
- The task belongs to a different organization or project
- The action requires admin or owner privileges
**Resolution:** Contact your organization admin to request
appropriate access.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Task or revision not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: >-
Unprocessable Entity - Invalid task input parameters
**Common causes:**
- Request is well-formed but violates business rules
- Invalid combination of fields (e.g., mutually exclusive options)
- Referenced resource doesn't exist or is in wrong state
- Field value is valid type but out of acceptable range
**Resolution:** Check the error message for specific validation
failures and adjust your request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal Server Error - Failed to execute task
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
requestBody:
content:
application/json:
schema:
type: object
properties:
task_input:
type: object
additionalProperties:
description: Any type
description: >-
Key-value pairs mapping variable names to their values. Keys
must match the variable placeholders in your task's
user_prompt.
task_files:
type: array
items:
$ref: >-
#/components/schemas/OrgOrgIdProjectProjectIdTaskTaskIdRunPostRequestBodyContentApplicationJsonSchemaTaskFilesItems
description: Optional base64-encoded files to include with the task run
task_reference:
type: string
description: Optional reference ID for tracking this task run
required:
- task_input
servers:
- url: https://app.rightbrain.ai/api/v1
- url: https://stag.leftbrain.me/api/v1
- url: https://app.rblocal.dev/api/v1
components:
schemas:
OrgOrgIdProjectProjectIdTaskTaskIdRunPostRequestBodyContentApplicationJsonSchemaTaskFilesItems:
type: object
properties:
filename:
type: string
content:
type: string
format: byte
title: >-
OrgOrgIdProjectProjectIdTaskTaskIdRunPostRequestBodyContentApplicationJsonSchemaTaskFilesItems
TaskRunResponse:
oneOf:
- type: string
- type: object
additionalProperties:
description: Any type
description: The structured response from the Task execution.
title: TaskRunResponse
TaskRunRunDataSubmitted:
type: object
properties: {}
description: The input parameters provided when executing the Task.
title: TaskRunRunDataSubmitted
TaskRunRunData:
type: object
properties:
submitted:
$ref: '#/components/schemas/TaskRunRunDataSubmitted'
description: The input parameters provided when executing the Task.
required:
- submitted
description: Additional data about the Task execution, including submitted inputs.
title: TaskRunRunData
TaskRunFileMetadata:
type: object
properties:
original_filename:
type: string
description: The original filename as submitted by the user
stored_filename:
type: string
description: The generated filename used for storage
content_type:
type: string
description: MIME type of the file
download_url:
type:
- string
- 'null'
description: >-
Relative URL to download the file (generated dynamically, not stored
in database)
size_bytes:
type:
- integer
- 'null'
description: File size in bytes (if available)
required:
- original_filename
- stored_filename
- content_type
description: Metadata for files submitted/generated during task execution.
title: TaskRunFileMetadata
ReportingGroup:
type: object
properties:
name:
type: string
description: Name of the reporting group
description:
type:
- string
- 'null'
description: Optional description
id:
type: string
format: uuid
project_id:
type: string
format: uuid
created:
type: string
modified:
type: string
required:
- name
- id
- project_id
- created
- modified
description: Schema for reporting group responses.
title: ReportingGroup
TaskRun:
type: object
properties:
task_id:
type: string
format: uuid
description: The unique identifier of the Task associated with this run.
task_revision_id:
type: string
format: uuid
description: The unique identifier of the Task Revision associated with this run.
response:
$ref: '#/components/schemas/TaskRunResponse'
description: The structured response from the Task execution.
run_data:
$ref: '#/components/schemas/TaskRunRunData'
description: >-
Additional data about the Task execution, including submitted
inputs.
files:
type: array
items:
$ref: '#/components/schemas/TaskRunFileMetadata'
description: >-
List of file metadata objects with enriched information including
download URLs.
is_error:
type: boolean
default: false
llm_retries:
type: integer
default: 0
description: Number of retry attempts made during LLM execution.
used_fallback_model:
type: boolean
default: false
description: Whether the fallback model was used
primary_failure_reason:
type:
- string
- 'null'
description: Reason the primary model failed
fallback_llm_model_id:
type:
- string
- 'null'
format: uuid
description: Fallback model that was used
user_id:
type:
- string
- 'null'
format: uuid
description: The unique identifier of the User who executed the task.
reporting_group_id:
type:
- string
- 'null'
format: uuid
description: The ID of the reporting group to associate with this task run
reference:
type:
- string
- 'null'
description: An optional reference identifier for this task run
context_id:
type:
- string
- 'null'
description: An optional context ID for grouping related task runs
id:
type: string
format: uuid
description: The unique identifier of the Task Run.
created:
type: string
description: The timestamp when the Task Run was created.
input_tokens:
type: integer
description: The number of tokens submit as input to the model.
output_tokens:
type: integer
description: The number of tokens generated and output by the model.
total_tokens:
type: integer
description: The total token usage for the TaskRun.
input_processor_timing:
type:
- number
- 'null'
format: double
description: The execution time for the TaskRun in seconds.
llm_call_timing:
type:
- number
- 'null'
format: double
description: The execution time for the TaskRun in seconds.
charged_credits:
type:
- string
- 'null'
description: The total credits charged for the TaskRun.
reporting_group:
oneOf:
- $ref: '#/components/schemas/ReportingGroup'
- type: 'null'
description: The reporting group associated with this task run
required:
- task_id
- task_revision_id
- response
- run_data
- id
- created
- input_tokens
- output_tokens
- total_tokens
- input_processor_timing
- llm_call_timing
- charged_credits
title: TaskRun
ErrorResponseDetailOneOf1Items:
type: object
properties:
loc:
type: array
items:
type: string
description: Path to the error location
msg:
type: string
description: Human-readable error message
type:
type: string
description: Error type identifier
required:
- msg
- type
title: ErrorResponseDetailOneOf1Items
ErrorResponseDetail1:
type: array
items:
$ref: '#/components/schemas/ErrorResponseDetailOneOf1Items'
description: Detailed validation errors
title: ErrorResponseDetail1
ErrorResponseDetail:
oneOf:
- type: string
- $ref: '#/components/schemas/ErrorResponseDetail1'
title: ErrorResponseDetail
ErrorResponseType:
type: string
enum:
- validation_error
- authorization_error
- resource_error
- server_error
description: Error category
title: ErrorResponseType
ErrorResponse:
type: object
properties:
detail:
$ref: '#/components/schemas/ErrorResponseDetail'
type:
$ref: '#/components/schemas/ErrorResponseType'
description: Error category
msg:
type: string
description: Error summary
required:
- detail
description: Standardized error response format used across all endpoints
title: ErrorResponse
securitySchemes:
HTTPBearer:
type: http
scheme: bearer
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
```
## SDK Code Examples
```python Multiple input variables
import requests
url = "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run"
payload = { "task_input": {
"customer_message": "I can't login to my account",
"customer_name": "Jane Doe",
"priority": "high"
} }
headers = {
"Authorization": "Bearer ",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
```
```javascript Multiple input variables
const url = 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'},
body: '{"task_input":{"customer_message":"I can\'t login to my account","customer_name":"Jane Doe","priority":"high"}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go Multiple input variables
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run"
payload := strings.NewReader("{\n \"task_input\": {\n \"customer_message\": \"I can't login to my account\",\n \"customer_name\": \"Jane Doe\",\n \"priority\": \"high\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer ")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby Multiple input variables
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer '
request["Content-Type"] = 'application/json'
request.body = "{\n \"task_input\": {\n \"customer_message\": \"I can't login to my account\",\n \"customer_name\": \"Jane Doe\",\n \"priority\": \"high\"\n }\n}"
response = http.request(request)
puts response.read_body
```
```java Multiple input variables
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.post("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run")
.header("Authorization", "Bearer ")
.header("Content-Type", "application/json")
.body("{\n \"task_input\": {\n \"customer_message\": \"I can't login to my account\",\n \"customer_name\": \"Jane Doe\",\n \"priority\": \"high\"\n }\n}")
.asString();
```
```php Multiple input variables
request('POST', 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run', [
'body' => '{
"task_input": {
"customer_message": "I can\'t login to my account",
"customer_name": "Jane Doe",
"priority": "high"
}
}',
'headers' => [
'Authorization' => 'Bearer ',
'Content-Type' => 'application/json',
],
]);
echo $response->getBody();
```
```csharp Multiple input variables
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer ");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"task_input\": {\n \"customer_message\": \"I can't login to my account\",\n \"customer_name\": \"Jane Doe\",\n \"priority\": \"high\"\n }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```
```swift Multiple input variables
import Foundation
let headers = [
"Authorization": "Bearer ",
"Content-Type": "application/json"
]
let parameters = ["task_input": [
"customer_message": "I can't login to my account",
"customer_name": "Jane Doe",
"priority": "high"
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
```python With context_id for tracking
import requests
url = "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run"
payload = {
"task_input": { "question": "What is the refund policy?" },
"context_id": "conversation-12345"
}
headers = {
"Authorization": "Bearer ",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
```
```javascript With context_id for tracking
const url = 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'},
body: '{"task_input":{"question":"What is the refund policy?"},"context_id":"conversation-12345"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go With context_id for tracking
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run"
payload := strings.NewReader("{\n \"task_input\": {\n \"question\": \"What is the refund policy?\"\n },\n \"context_id\": \"conversation-12345\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer ")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby With context_id for tracking
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer '
request["Content-Type"] = 'application/json'
request.body = "{\n \"task_input\": {\n \"question\": \"What is the refund policy?\"\n },\n \"context_id\": \"conversation-12345\"\n}"
response = http.request(request)
puts response.read_body
```
```java With context_id for tracking
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.post("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run")
.header("Authorization", "Bearer ")
.header("Content-Type", "application/json")
.body("{\n \"task_input\": {\n \"question\": \"What is the refund policy?\"\n },\n \"context_id\": \"conversation-12345\"\n}")
.asString();
```
```php With context_id for tracking
request('POST', 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run', [
'body' => '{
"task_input": {
"question": "What is the refund policy?"
},
"context_id": "conversation-12345"
}',
'headers' => [
'Authorization' => 'Bearer ',
'Content-Type' => 'application/json',
],
]);
echo $response->getBody();
```
```csharp With context_id for tracking
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer ");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"task_input\": {\n \"question\": \"What is the refund policy?\"\n },\n \"context_id\": \"conversation-12345\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```
```swift With context_id for tracking
import Foundation
let headers = [
"Authorization": "Bearer ",
"Content-Type": "application/json"
]
let parameters = [
"task_input": ["question": "What is the refund policy?"],
"context_id": "conversation-12345"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
```python
import requests
url = "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run"
payload = { "task_input": { "text": "The quick brown fox jumps over the lazy dog." } }
headers = {
"Authorization": "Bearer ",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
```
```javascript
const url = 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'},
body: '{"task_input":{"text":"The quick brown fox jumps over the lazy dog."}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run"
payload := strings.NewReader("{\n \"task_input\": {\n \"text\": \"The quick brown fox jumps over the lazy dog.\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer ")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer '
request["Content-Type"] = 'application/json'
request.body = "{\n \"task_input\": {\n \"text\": \"The quick brown fox jumps over the lazy dog.\"\n }\n}"
response = http.request(request)
puts response.read_body
```
```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.post("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run")
.header("Authorization", "Bearer ")
.header("Content-Type", "application/json")
.body("{\n \"task_input\": {\n \"text\": \"The quick brown fox jumps over the lazy dog.\"\n }\n}")
.asString();
```
```php
request('POST', 'https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run', [
'body' => '{
"task_input": {
"text": "The quick brown fox jumps over the lazy dog."
}
}',
'headers' => [
'Authorization' => 'Bearer ',
'Content-Type' => 'application/json',
],
]);
echo $response->getBody();
```
```csharp
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer ");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"task_input\": {\n \"text\": \"The quick brown fox jumps over the lazy dog.\"\n }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```
```swift
import Foundation
let headers = [
"Authorization": "Bearer ",
"Content-Type": "application/json"
]
let parameters = ["task_input": ["text": "The quick brown fox jumps over the lazy dog."]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/123e4567-e89b-12d3-a456-426614174000/project/123e4567-e89b-12d3-a456-426614174001/task/01909843-3596-da54-4756-28af46917e74/run")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
# IAM - List Task Members
GET https://app.rightbrain.ai/api/v1/org/{org_id}/project/{project_id}/task/{task_id}/iam/members
Lists all members that have been granted direct access to the task.
Reference: https://docs.rightbrain.ai/api-reference/api-reference/tasks/task-iam-org-org-id-project-project-id-task-task-id-iam-list-members
## OpenAPI Specification
```yaml
openapi: 3.1.0
info:
title: API
version: 1.0.0
paths:
/org/{org_id}/project/{project_id}/task/{task_id}/iam/members:
get:
operationId: task-iam-org-org-id-project-project-id-task-task-id-iam-list-members
summary: IAM - List Task Members
description: Lists all members that have been granted direct access to the task.
tags:
- subpackage_tasks
parameters:
- name: task_id
in: path
required: true
schema:
type: string
format: uuid
- name: org_id
in: path
description: The org id
required: true
schema:
type: string
format: uuid
- name: project_id
in: path
description: The project id
required: true
schema:
type: string
format: uuid
- name: type
in: query
required: false
schema:
$ref: >-
#/components/schemas/OrgOrgIdProjectProjectIdTaskTaskIdIamMembersGetParametersType
- name: Authorization
in: header
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
required: true
schema:
type: string
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedResultSet_IAMMember_'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/MalformedResourceIdentifierErrorResponse'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: >-
#/components/schemas/Task_iam_org_org_id_project_project_id_task_task_id_iam_list_membersRequestForbiddenError
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
servers:
- url: https://app.rightbrain.ai/api/v1
- url: https://stag.leftbrain.me/api/v1
- url: https://app.rblocal.dev/api/v1
components:
schemas:
OrgOrgIdProjectProjectIdTaskTaskIdIamMembersGetParametersType:
type: string
enum:
- user
- organization
- project
title: OrgOrgIdProjectProjectIdTaskTaskIdIamMembersGetParametersType
PaginationDetails:
type: object
properties:
next_cursor:
type:
- string
- 'null'
description: >-
A token used to retrieve the next page of results. If `null`, there
are no more results.
has_next:
type:
- boolean
- 'null'
default: false
description: Indicates whether there are more results available in the next page.
page_limit:
type:
- integer
- 'null'
default: 0
description: The maximum number of items returned per page.
title: PaginationDetails
IAMMember:
type: object
properties:
member:
type: string
description: >-
The member identifier string, the format of which is
':'
roles:
type: array
items:
type: string
description: >-
A list of roles that the member holds on an entity.
Some entities, such as Organizations, may contain members that exist
without any roles.
name:
type:
- string
- 'null'
description: The name of the member.
avatar_url:
type:
- string
- 'null'
description: If avatar of the member, if it is supported by their subject type.
total_subjects:
type: integer
default: 1
description: >-
The total number of subjects that the member represents, which may
be a value other than `1` if the member is not a User.
required:
- member
title: IAMMember
PaginatedResultSet_IAMMember_:
type: object
properties:
pagination:
oneOf:
- $ref: '#/components/schemas/PaginationDetails'
- type: 'null'
description: Contains pagination information for the result set.
results:
type: array
items:
$ref: '#/components/schemas/IAMMember'
description: The list of items returned for the current page.
required:
- results
title: PaginatedResultSet_IAMMember_
MalformedResourceIdentifierErrorResponseReason:
type: string
enum:
- MALFORMED_RESOURCE_IDENTIFIER
description: The machine-readable error reason.
title: MalformedResourceIdentifierErrorResponseReason
MalformedResourceIdentifierErrorDetails:
type: object
properties:
field:
type: string
value:
description: Any type
expected_format:
type: string
required:
- field
- value
- expected_format
title: MalformedResourceIdentifierErrorDetails
MalformedResourceIdentifierErrorResponse:
type: object
properties:
message:
type: string
description: Human readable representation of the error
reason:
$ref: '#/components/schemas/MalformedResourceIdentifierErrorResponseReason'
description: The machine-readable error reason.
malformedResourceIdentifierError:
$ref: '#/components/schemas/MalformedResourceIdentifierErrorDetails'
description: Metadata detailing more information about the error.
required:
- message
- reason
- malformedResourceIdentifierError
title: MalformedResourceIdentifierErrorResponse
MissingAuthenticationErrorResponseReason:
type: string
enum:
- MISSING_AUTHENTICATION
description: The machine-readable error reason.
title: MissingAuthenticationErrorResponseReason
EmptyErrorDetails:
type: object
properties: {}
title: EmptyErrorDetails
MissingAuthenticationErrorResponse:
type: object
properties:
message:
type: string
description: Human readable representation of the error
reason:
$ref: '#/components/schemas/MissingAuthenticationErrorResponseReason'
description: The machine-readable error reason.
missingAuthenticationError:
$ref: '#/components/schemas/EmptyErrorDetails'
description: Metadata detailing more information about the error.
required:
- message
- reason
- missingAuthenticationError
title: MissingAuthenticationErrorResponse
PermissionCheckFailedErrorResponseReason:
type: string
enum:
- PERMISSION_CHECK_FAILED
description: The machine-readable error reason.
title: PermissionCheckFailedErrorResponseReason
IAMObjectErrorDetails:
type: object
properties:
type:
type: string
id:
type:
- string
- 'null'
required:
- type
title: IAMObjectErrorDetails
PermissionCheckFailedErrorDetails:
type: object
properties:
subject:
oneOf:
- $ref: '#/components/schemas/IAMObjectErrorDetails'
- type: 'null'
resource:
oneOf:
- $ref: '#/components/schemas/IAMObjectErrorDetails'
- type: 'null'
permission:
type: string
required:
- permission
title: PermissionCheckFailedErrorDetails
PermissionCheckFailedErrorResponse:
type: object
properties:
message:
type: string
description: Human readable representation of the error
reason:
$ref: '#/components/schemas/PermissionCheckFailedErrorResponseReason'
description: The machine-readable error reason.
permissionCheckFailedError:
$ref: '#/components/schemas/PermissionCheckFailedErrorDetails'
description: Metadata detailing more information about the error.
required:
- message
- reason
- permissionCheckFailedError
title: PermissionCheckFailedErrorResponse
Task_iam_org_org_id_project_project_id_task_task_id_iam_list_membersRequestForbiddenError:
oneOf:
- $ref: '#/components/schemas/MissingAuthenticationErrorResponse'
- $ref: '#/components/schemas/PermissionCheckFailedErrorResponse'
title: >-
Task_iam_org_org_id_project_project_id_task_task_id_iam_list_membersRequestForbiddenError
ValidationErrorLocItems:
oneOf:
- type: string
- type: integer
title: ValidationErrorLocItems
ValidationError:
type: object
properties:
loc:
type: array
items:
$ref: '#/components/schemas/ValidationErrorLocItems'
msg:
type: string
type:
type: string
required:
- loc
- msg
- type
title: ValidationError
HTTPValidationError:
type: object
properties:
detail:
type: array
items:
$ref: '#/components/schemas/ValidationError'
title: HTTPValidationError
securitySchemes:
HTTPBearer:
type: http
scheme: bearer
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
```
## SDK Code Examples
```python
import requests
url = "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/members"
headers = {"Authorization": "Bearer "}
response = requests.get(url, headers=headers)
print(response.json())
```
```javascript
const url = 'https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/members';
const options = {method: 'GET', headers: {Authorization: 'Bearer '}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/members"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer ")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/members")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer '
response = http.request(request)
puts response.read_body
```
```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.get("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/members")
.header("Authorization", "Bearer ")
.asString();
```
```php
request('GET', 'https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/members', [
'headers' => [
'Authorization' => 'Bearer ',
],
]);
echo $response->getBody();
```
```csharp
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/members");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer ");
IRestResponse response = client.Execute(request);
```
```swift
import Foundation
let headers = ["Authorization": "Bearer "]
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/members")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
# IAM - Lookup Task Member
GET https://app.rightbrain.ai/api/v1/org/{org_id}/project/{project_id}/task/{task_id}/iam/members/{member}
Retrieve a specific member that has been granted direct access to the task.
Reference: https://docs.rightbrain.ai/api-reference/api-reference/tasks/task-iam-org-org-id-project-project-id-task-task-id-iam-get-member
## OpenAPI Specification
```yaml
openapi: 3.1.0
info:
title: API
version: 1.0.0
paths:
/org/{org_id}/project/{project_id}/task/{task_id}/iam/members/{member}:
get:
operationId: task-iam-org-org-id-project-project-id-task-task-id-iam-get-member
summary: IAM - Lookup Task Member
description: >-
Retrieve a specific member that has been granted direct access to the
task.
tags:
- subpackage_tasks
parameters:
- name: task_id
in: path
required: true
schema:
type: string
format: uuid
- name: member
in: path
required: true
schema:
type: string
- name: org_id
in: path
description: The org id
required: true
schema:
type: string
format: uuid
- name: project_id
in: path
description: The project id
required: true
schema:
type: string
format: uuid
- name: Authorization
in: header
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
required: true
schema:
type: string
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/IAMMember'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/MalformedResourceIdentifierErrorResponse'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: >-
#/components/schemas/Task_iam_org_org_id_project_project_id_task_task_id_iam_get_memberRequestForbiddenError
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
servers:
- url: https://app.rightbrain.ai/api/v1
- url: https://stag.leftbrain.me/api/v1
- url: https://app.rblocal.dev/api/v1
components:
schemas:
IAMMember:
type: object
properties:
member:
type: string
description: >-
The member identifier string, the format of which is
':'
roles:
type: array
items:
type: string
description: >-
A list of roles that the member holds on an entity.
Some entities, such as Organizations, may contain members that exist
without any roles.
name:
type:
- string
- 'null'
description: The name of the member.
avatar_url:
type:
- string
- 'null'
description: If avatar of the member, if it is supported by their subject type.
total_subjects:
type: integer
default: 1
description: >-
The total number of subjects that the member represents, which may
be a value other than `1` if the member is not a User.
required:
- member
title: IAMMember
MalformedResourceIdentifierErrorResponseReason:
type: string
enum:
- MALFORMED_RESOURCE_IDENTIFIER
description: The machine-readable error reason.
title: MalformedResourceIdentifierErrorResponseReason
MalformedResourceIdentifierErrorDetails:
type: object
properties:
field:
type: string
value:
description: Any type
expected_format:
type: string
required:
- field
- value
- expected_format
title: MalformedResourceIdentifierErrorDetails
MalformedResourceIdentifierErrorResponse:
type: object
properties:
message:
type: string
description: Human readable representation of the error
reason:
$ref: '#/components/schemas/MalformedResourceIdentifierErrorResponseReason'
description: The machine-readable error reason.
malformedResourceIdentifierError:
$ref: '#/components/schemas/MalformedResourceIdentifierErrorDetails'
description: Metadata detailing more information about the error.
required:
- message
- reason
- malformedResourceIdentifierError
title: MalformedResourceIdentifierErrorResponse
MissingAuthenticationErrorResponseReason:
type: string
enum:
- MISSING_AUTHENTICATION
description: The machine-readable error reason.
title: MissingAuthenticationErrorResponseReason
EmptyErrorDetails:
type: object
properties: {}
title: EmptyErrorDetails
MissingAuthenticationErrorResponse:
type: object
properties:
message:
type: string
description: Human readable representation of the error
reason:
$ref: '#/components/schemas/MissingAuthenticationErrorResponseReason'
description: The machine-readable error reason.
missingAuthenticationError:
$ref: '#/components/schemas/EmptyErrorDetails'
description: Metadata detailing more information about the error.
required:
- message
- reason
- missingAuthenticationError
title: MissingAuthenticationErrorResponse
PermissionCheckFailedErrorResponseReason:
type: string
enum:
- PERMISSION_CHECK_FAILED
description: The machine-readable error reason.
title: PermissionCheckFailedErrorResponseReason
IAMObjectErrorDetails:
type: object
properties:
type:
type: string
id:
type:
- string
- 'null'
required:
- type
title: IAMObjectErrorDetails
PermissionCheckFailedErrorDetails:
type: object
properties:
subject:
oneOf:
- $ref: '#/components/schemas/IAMObjectErrorDetails'
- type: 'null'
resource:
oneOf:
- $ref: '#/components/schemas/IAMObjectErrorDetails'
- type: 'null'
permission:
type: string
required:
- permission
title: PermissionCheckFailedErrorDetails
PermissionCheckFailedErrorResponse:
type: object
properties:
message:
type: string
description: Human readable representation of the error
reason:
$ref: '#/components/schemas/PermissionCheckFailedErrorResponseReason'
description: The machine-readable error reason.
permissionCheckFailedError:
$ref: '#/components/schemas/PermissionCheckFailedErrorDetails'
description: Metadata detailing more information about the error.
required:
- message
- reason
- permissionCheckFailedError
title: PermissionCheckFailedErrorResponse
Task_iam_org_org_id_project_project_id_task_task_id_iam_get_memberRequestForbiddenError:
oneOf:
- $ref: '#/components/schemas/MissingAuthenticationErrorResponse'
- $ref: '#/components/schemas/PermissionCheckFailedErrorResponse'
title: >-
Task_iam_org_org_id_project_project_id_task_task_id_iam_get_memberRequestForbiddenError
ValidationErrorLocItems:
oneOf:
- type: string
- type: integer
title: ValidationErrorLocItems
ValidationError:
type: object
properties:
loc:
type: array
items:
$ref: '#/components/schemas/ValidationErrorLocItems'
msg:
type: string
type:
type: string
required:
- loc
- msg
- type
title: ValidationError
HTTPValidationError:
type: object
properties:
detail:
type: array
items:
$ref: '#/components/schemas/ValidationError'
title: HTTPValidationError
securitySchemes:
HTTPBearer:
type: http
scheme: bearer
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
```
## SDK Code Examples
```python
import requests
url = "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/members/member"
headers = {"Authorization": "Bearer "}
response = requests.get(url, headers=headers)
print(response.json())
```
```javascript
const url = 'https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/members/member';
const options = {method: 'GET', headers: {Authorization: 'Bearer '}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/members/member"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer ")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/members/member")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer '
response = http.request(request)
puts response.read_body
```
```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.get("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/members/member")
.header("Authorization", "Bearer ")
.asString();
```
```php
request('GET', 'https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/members/member', [
'headers' => [
'Authorization' => 'Bearer ',
],
]);
echo $response->getBody();
```
```csharp
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/members/member");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer ");
IRestResponse response = client.Execute(request);
```
```swift
import Foundation
let headers = ["Authorization": "Bearer "]
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/members/member")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
# IAM - Update Task Member
POST https://app.rightbrain.ai/api/v1/org/{org_id}/project/{project_id}/task/{task_id}/iam/members/{member}
Content-Type: application/json
Update the roles that a member holds on the task.
Reference: https://docs.rightbrain.ai/api-reference/api-reference/tasks/task-iam-org-org-id-project-project-id-task-task-id-iam-update-member-roles
## OpenAPI Specification
```yaml
openapi: 3.1.0
info:
title: API
version: 1.0.0
paths:
/org/{org_id}/project/{project_id}/task/{task_id}/iam/members/{member}:
post:
operationId: >-
task-iam-org-org-id-project-project-id-task-task-id-iam-update-member-roles
summary: IAM - Update Task Member
description: Update the roles that a member holds on the task.
tags:
- subpackage_tasks
parameters:
- name: task_id
in: path
required: true
schema:
type: string
format: uuid
- name: member
in: path
required: true
schema:
type: string
- name: org_id
in: path
description: The org id
required: true
schema:
type: string
format: uuid
- name: project_id
in: path
description: The project id
required: true
schema:
type: string
format: uuid
- name: Authorization
in: header
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
required: true
schema:
type: string
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/IAMMember'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: >-
#/components/schemas/Task_iam_org_org_id_project_project_id_task_task_id_iam_update_member_rolesRequestBadRequestError
'403':
description: Forbidden
content:
application/json:
schema:
$ref: >-
#/components/schemas/Task_iam_org_org_id_project_project_id_task_task_id_iam_update_member_rolesRequestForbiddenError
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/InvalidMemberErrorResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TaskIAMMemberRoleUpdate'
servers:
- url: https://app.rightbrain.ai/api/v1
- url: https://stag.leftbrain.me/api/v1
- url: https://app.rblocal.dev/api/v1
components:
schemas:
TaskIamMemberRoleUpdateAddItems:
type: string
enum:
- editor
- owner
- viewer
title: TaskIamMemberRoleUpdateAddItems
TaskIamMemberRoleUpdateRemoveItems:
type: string
enum:
- editor
- owner
- viewer
title: TaskIamMemberRoleUpdateRemoveItems
TaskIAMMemberRoleUpdate:
type: object
properties:
add:
type: array
items:
$ref: '#/components/schemas/TaskIamMemberRoleUpdateAddItems'
description: >-
A list of task roles to grant to the member.
Roles in this list are applied to the member AFTER any removals
specified in `remove`.
This may be combined with `remove_all` to replace the member's
entire role list.
remove:
type: array
items:
$ref: '#/components/schemas/TaskIamMemberRoleUpdateRemoveItems'
description: A list of task roles to revoke from the member.
remove_all:
type:
- boolean
- 'null'
default: false
description: >-
Removes all existing roles from the member. This may be combined
with `add` to replace all existing roles that the member holds.
title: TaskIAMMemberRoleUpdate
IAMMember:
type: object
properties:
member:
type: string
description: >-
The member identifier string, the format of which is
':'
roles:
type: array
items:
type: string
description: >-
A list of roles that the member holds on an entity.
Some entities, such as Organizations, may contain members that exist
without any roles.
name:
type:
- string
- 'null'
description: The name of the member.
avatar_url:
type:
- string
- 'null'
description: If avatar of the member, if it is supported by their subject type.
total_subjects:
type: integer
default: 1
description: >-
The total number of subjects that the member represents, which may
be a value other than `1` if the member is not a User.
required:
- member
title: IAMMember
InvalidMemberErrorResponseReason:
type: string
enum:
- INVALID_MEMBER
description: The machine-readable error reason.
title: InvalidMemberErrorResponseReason
IAMObjectErrorDetails:
type: object
properties:
type:
type: string
id:
type:
- string
- 'null'
required:
- type
title: IAMObjectErrorDetails
InvalidMemberErrorDetails:
type: object
properties:
resource:
oneOf:
- $ref: '#/components/schemas/IAMObjectErrorDetails'
- type: 'null'
subject:
oneOf:
- $ref: '#/components/schemas/IAMObjectErrorDetails'
- type: 'null'
title: InvalidMemberErrorDetails
InvalidMemberErrorResponse:
type: object
properties:
message:
type: string
description: Human readable representation of the error
reason:
$ref: '#/components/schemas/InvalidMemberErrorResponseReason'
description: The machine-readable error reason.
invalidMemberError:
$ref: '#/components/schemas/InvalidMemberErrorDetails'
description: Metadata detailing more information about the error.
required:
- message
- reason
- invalidMemberError
title: InvalidMemberErrorResponse
MalformedResourceIdentifierErrorResponseReason:
type: string
enum:
- MALFORMED_RESOURCE_IDENTIFIER
description: The machine-readable error reason.
title: MalformedResourceIdentifierErrorResponseReason
MalformedResourceIdentifierErrorDetails:
type: object
properties:
field:
type: string
value:
description: Any type
expected_format:
type: string
required:
- field
- value
- expected_format
title: MalformedResourceIdentifierErrorDetails
MalformedResourceIdentifierErrorResponse:
type: object
properties:
message:
type: string
description: Human readable representation of the error
reason:
$ref: '#/components/schemas/MalformedResourceIdentifierErrorResponseReason'
description: The machine-readable error reason.
malformedResourceIdentifierError:
$ref: '#/components/schemas/MalformedResourceIdentifierErrorDetails'
description: Metadata detailing more information about the error.
required:
- message
- reason
- malformedResourceIdentifierError
title: MalformedResourceIdentifierErrorResponse
InvalidSubjectTypeErrorResponseReason:
type: string
enum:
- INVALID_SUBJECT_TYPE
description: The machine-readable error reason.
title: InvalidSubjectTypeErrorResponseReason
InvalidSubjectTypeErrorDetails:
type: object
properties:
subject:
oneOf:
- $ref: '#/components/schemas/IAMObjectErrorDetails'
- type: 'null'
title: InvalidSubjectTypeErrorDetails
InvalidSubjectTypeErrorResponse:
type: object
properties:
message:
type: string
description: Human readable representation of the error
reason:
$ref: '#/components/schemas/InvalidSubjectTypeErrorResponseReason'
description: The machine-readable error reason.
invalidSubjectTypeError:
$ref: '#/components/schemas/InvalidSubjectTypeErrorDetails'
description: Metadata detailing more information about the error.
required:
- message
- reason
- invalidSubjectTypeError
title: InvalidSubjectTypeErrorResponse
InvalidRoleErrorResponseReason:
type: string
enum:
- INVALID_ROLE
description: The machine-readable error reason.
title: InvalidRoleErrorResponseReason
InvalidRoleErrorDetails:
type: object
properties:
resource:
oneOf:
- $ref: '#/components/schemas/IAMObjectErrorDetails'
- type: 'null'
role:
type: string
required:
- role
title: InvalidRoleErrorDetails
InvalidRoleErrorResponse:
type: object
properties:
message:
type: string
description: Human readable representation of the error
reason:
$ref: '#/components/schemas/InvalidRoleErrorResponseReason'
description: The machine-readable error reason.
invalidRoleError:
$ref: '#/components/schemas/InvalidRoleErrorDetails'
description: Metadata detailing more information about the error.
required:
- message
- reason
- invalidRoleError
title: InvalidRoleErrorResponse
MultipleRolesNotAllowedErrorResponseReason:
type: string
enum:
- MULTIPLE_ROLES_NOT_ALLOWED
description: The machine-readable error reason.
title: MultipleRolesNotAllowedErrorResponseReason
MultipleRolesNotAllowedErrorDetails:
type: object
properties:
resource:
oneOf:
- $ref: '#/components/schemas/IAMObjectErrorDetails'
- type: 'null'
roles:
type: array
items:
type: string
required:
- roles
title: MultipleRolesNotAllowedErrorDetails
MultipleRolesNotAllowedErrorResponse:
type: object
properties:
message:
type: string
description: Human readable representation of the error
reason:
$ref: '#/components/schemas/MultipleRolesNotAllowedErrorResponseReason'
description: The machine-readable error reason.
multipleRolesNotAllowedError:
$ref: '#/components/schemas/MultipleRolesNotAllowedErrorDetails'
description: Metadata detailing more information about the error.
required:
- message
- reason
- multipleRolesNotAllowedError
title: MultipleRolesNotAllowedErrorResponse
Task_iam_org_org_id_project_project_id_task_task_id_iam_update_member_rolesRequestBadRequestError:
oneOf:
- $ref: '#/components/schemas/InvalidMemberErrorResponse'
- $ref: '#/components/schemas/MalformedResourceIdentifierErrorResponse'
- $ref: '#/components/schemas/InvalidSubjectTypeErrorResponse'
- $ref: '#/components/schemas/InvalidRoleErrorResponse'
- $ref: '#/components/schemas/MultipleRolesNotAllowedErrorResponse'
title: >-
Task_iam_org_org_id_project_project_id_task_task_id_iam_update_member_rolesRequestBadRequestError
PermissionCheckFailedErrorResponseReason:
type: string
enum:
- PERMISSION_CHECK_FAILED
description: The machine-readable error reason.
title: PermissionCheckFailedErrorResponseReason
PermissionCheckFailedErrorDetails:
type: object
properties:
subject:
oneOf:
- $ref: '#/components/schemas/IAMObjectErrorDetails'
- type: 'null'
resource:
oneOf:
- $ref: '#/components/schemas/IAMObjectErrorDetails'
- type: 'null'
permission:
type: string
required:
- permission
title: PermissionCheckFailedErrorDetails
PermissionCheckFailedErrorResponse:
type: object
properties:
message:
type: string
description: Human readable representation of the error
reason:
$ref: '#/components/schemas/PermissionCheckFailedErrorResponseReason'
description: The machine-readable error reason.
permissionCheckFailedError:
$ref: '#/components/schemas/PermissionCheckFailedErrorDetails'
description: Metadata detailing more information about the error.
required:
- message
- reason
- permissionCheckFailedError
title: PermissionCheckFailedErrorResponse
MissingAuthenticationErrorResponseReason:
type: string
enum:
- MISSING_AUTHENTICATION
description: The machine-readable error reason.
title: MissingAuthenticationErrorResponseReason
EmptyErrorDetails:
type: object
properties: {}
title: EmptyErrorDetails
MissingAuthenticationErrorResponse:
type: object
properties:
message:
type: string
description: Human readable representation of the error
reason:
$ref: '#/components/schemas/MissingAuthenticationErrorResponseReason'
description: The machine-readable error reason.
missingAuthenticationError:
$ref: '#/components/schemas/EmptyErrorDetails'
description: Metadata detailing more information about the error.
required:
- message
- reason
- missingAuthenticationError
title: MissingAuthenticationErrorResponse
Task_iam_org_org_id_project_project_id_task_task_id_iam_update_member_rolesRequestForbiddenError:
oneOf:
- $ref: '#/components/schemas/PermissionCheckFailedErrorResponse'
- $ref: '#/components/schemas/MissingAuthenticationErrorResponse'
title: >-
Task_iam_org_org_id_project_project_id_task_task_id_iam_update_member_rolesRequestForbiddenError
ValidationErrorLocItems:
oneOf:
- type: string
- type: integer
title: ValidationErrorLocItems
ValidationError:
type: object
properties:
loc:
type: array
items:
$ref: '#/components/schemas/ValidationErrorLocItems'
msg:
type: string
type:
type: string
required:
- loc
- msg
- type
title: ValidationError
HTTPValidationError:
type: object
properties:
detail:
type: array
items:
$ref: '#/components/schemas/ValidationError'
title: HTTPValidationError
securitySchemes:
HTTPBearer:
type: http
scheme: bearer
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
```
## SDK Code Examples
```python
import requests
url = "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/members/member"
payload = {}
headers = {
"Authorization": "Bearer ",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
```
```javascript
const url = 'https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/members/member';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'},
body: '{}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/members/member"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer ")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/members/member")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer '
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body
```
```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.post("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/members/member")
.header("Authorization", "Bearer ")
.header("Content-Type", "application/json")
.body("{}")
.asString();
```
```php
request('POST', 'https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/members/member', [
'body' => '{}',
'headers' => [
'Authorization' => 'Bearer ',
'Content-Type' => 'application/json',
],
]);
echo $response->getBody();
```
```csharp
using RestSharp;
var client = new RestClient("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/members/member");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer ");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```
```swift
import Foundation
let headers = [
"Authorization": "Bearer ",
"Content-Type": "application/json"
]
let parameters = [] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/members/member")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
```
# IAM - Test Task Permissions
POST https://app.rightbrain.ai/api/v1/org/{org_id}/project/{project_id}/task/{task_id}/iam/test
Content-Type: application/json
Test the permissions that the caller (or another subject) holds on the task.
Reference: https://docs.rightbrain.ai/api-reference/api-reference/tasks/task-iam-org-org-id-project-project-id-task-task-id-iam-test-permissions
## OpenAPI Specification
```yaml
openapi: 3.1.0
info:
title: API
version: 1.0.0
paths:
/org/{org_id}/project/{project_id}/task/{task_id}/iam/test:
post:
operationId: task-iam-org-org-id-project-project-id-task-task-id-iam-test-permissions
summary: IAM - Test Task Permissions
description: >-
Test the permissions that the caller (or another subject) holds on the
task.
tags:
- subpackage_tasks
parameters:
- name: task_id
in: path
required: true
schema:
type: string
format: uuid
- name: org_id
in: path
description: The org id
required: true
schema:
type: string
format: uuid
- name: project_id
in: path
description: The project id
required: true
schema:
type: string
format: uuid
- name: Authorization
in: header
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
required: true
schema:
type: string
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/IAMPermissionTest'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: >-
#/components/schemas/Task_iam_org_org_id_project_project_id_task_task_id_iam_test_permissionsRequestBadRequestError
'403':
description: Forbidden
content:
application/json:
schema:
$ref: >-
#/components/schemas/Task_iam_org_org_id_project_project_id_task_task_id_iam_test_permissionsRequestForbiddenError
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/InvalidMemberErrorResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TaskIAMPermissionTest'
servers:
- url: https://app.rightbrain.ai/api/v1
- url: https://stag.leftbrain.me/api/v1
- url: https://app.rblocal.dev/api/v1
components:
schemas:
TaskIamPermissionTestPermissionsItems:
type: string
enum:
- add_editor
- add_member
- add_owner
- edit
- remove_editor
- remove_member
- remove_owner
- run_task
- view
- view_members
title: TaskIamPermissionTestPermissionsItems
TaskIAMPermissionTest:
type: object
properties:
permissions:
type: array
items:
$ref: '#/components/schemas/TaskIamPermissionTestPermissionsItems'
description: A list of permissions to test on the task.
member:
type:
- string
- 'null'
required:
- permissions
title: TaskIAMPermissionTest
IAMPermissionTest:
type: object
properties:
permissions:
type: array
items:
type: string
member:
type:
- string
- 'null'
required:
- permissions
title: IAMPermissionTest
InvalidMemberErrorResponseReason:
type: string
enum:
- INVALID_MEMBER
description: The machine-readable error reason.
title: InvalidMemberErrorResponseReason
IAMObjectErrorDetails:
type: object
properties:
type:
type: string
id:
type:
- string
- 'null'
required:
- type
title: IAMObjectErrorDetails
InvalidMemberErrorDetails:
type: object
properties:
resource:
oneOf:
- $ref: '#/components/schemas/IAMObjectErrorDetails'
- type: 'null'
subject:
oneOf:
- $ref: '#/components/schemas/IAMObjectErrorDetails'
- type: 'null'
title: InvalidMemberErrorDetails
InvalidMemberErrorResponse:
type: object
properties:
message:
type: string
description: Human readable representation of the error
reason:
$ref: '#/components/schemas/InvalidMemberErrorResponseReason'
description: The machine-readable error reason.
invalidMemberError:
$ref: '#/components/schemas/InvalidMemberErrorDetails'
description: Metadata detailing more information about the error.
required:
- message
- reason
- invalidMemberError
title: InvalidMemberErrorResponse
InvalidSubjectTypeErrorResponseReason:
type: string
enum:
- INVALID_SUBJECT_TYPE
description: The machine-readable error reason.
title: InvalidSubjectTypeErrorResponseReason
InvalidSubjectTypeErrorDetails:
type: object
properties:
subject:
oneOf:
- $ref: '#/components/schemas/IAMObjectErrorDetails'
- type: 'null'
title: InvalidSubjectTypeErrorDetails
InvalidSubjectTypeErrorResponse:
type: object
properties:
message:
type: string
description: Human readable representation of the error
reason:
$ref: '#/components/schemas/InvalidSubjectTypeErrorResponseReason'
description: The machine-readable error reason.
invalidSubjectTypeError:
$ref: '#/components/schemas/InvalidSubjectTypeErrorDetails'
description: Metadata detailing more information about the error.
required:
- message
- reason
- invalidSubjectTypeError
title: InvalidSubjectTypeErrorResponse
InvalidRoleErrorResponseReason:
type: string
enum:
- INVALID_ROLE
description: The machine-readable error reason.
title: InvalidRoleErrorResponseReason
InvalidRoleErrorDetails:
type: object
properties:
resource:
oneOf:
- $ref: '#/components/schemas/IAMObjectErrorDetails'
- type: 'null'
role:
type: string
required:
- role
title: InvalidRoleErrorDetails
InvalidRoleErrorResponse:
type: object
properties:
message:
type: string
description: Human readable representation of the error
reason:
$ref: '#/components/schemas/InvalidRoleErrorResponseReason'
description: The machine-readable error reason.
invalidRoleError:
$ref: '#/components/schemas/InvalidRoleErrorDetails'
description: Metadata detailing more information about the error.
required:
- message
- reason
- invalidRoleError
title: InvalidRoleErrorResponse
MalformedResourceIdentifierErrorResponseReason:
type: string
enum:
- MALFORMED_RESOURCE_IDENTIFIER
description: The machine-readable error reason.
title: MalformedResourceIdentifierErrorResponseReason
MalformedResourceIdentifierErrorDetails:
type: object
properties:
field:
type: string
value:
description: Any type
expected_format:
type: string
required:
- field
- value
- expected_format
title: MalformedResourceIdentifierErrorDetails
MalformedResourceIdentifierErrorResponse:
type: object
properties:
message:
type: string
description: Human readable representation of the error
reason:
$ref: '#/components/schemas/MalformedResourceIdentifierErrorResponseReason'
description: The machine-readable error reason.
malformedResourceIdentifierError:
$ref: '#/components/schemas/MalformedResourceIdentifierErrorDetails'
description: Metadata detailing more information about the error.
required:
- message
- reason
- malformedResourceIdentifierError
title: MalformedResourceIdentifierErrorResponse
Task_iam_org_org_id_project_project_id_task_task_id_iam_test_permissionsRequestBadRequestError:
oneOf:
- $ref: '#/components/schemas/InvalidMemberErrorResponse'
- $ref: '#/components/schemas/InvalidSubjectTypeErrorResponse'
- $ref: '#/components/schemas/InvalidRoleErrorResponse'
- $ref: '#/components/schemas/MalformedResourceIdentifierErrorResponse'
title: >-
Task_iam_org_org_id_project_project_id_task_task_id_iam_test_permissionsRequestBadRequestError
PermissionCheckFailedErrorResponseReason:
type: string
enum:
- PERMISSION_CHECK_FAILED
description: The machine-readable error reason.
title: PermissionCheckFailedErrorResponseReason
PermissionCheckFailedErrorDetails:
type: object
properties:
subject:
oneOf:
- $ref: '#/components/schemas/IAMObjectErrorDetails'
- type: 'null'
resource:
oneOf:
- $ref: '#/components/schemas/IAMObjectErrorDetails'
- type: 'null'
permission:
type: string
required:
- permission
title: PermissionCheckFailedErrorDetails
PermissionCheckFailedErrorResponse:
type: object
properties:
message:
type: string
description: Human readable representation of the error
reason:
$ref: '#/components/schemas/PermissionCheckFailedErrorResponseReason'
description: The machine-readable error reason.
permissionCheckFailedError:
$ref: '#/components/schemas/PermissionCheckFailedErrorDetails'
description: Metadata detailing more information about the error.
required:
- message
- reason
- permissionCheckFailedError
title: PermissionCheckFailedErrorResponse
MissingAuthenticationErrorResponseReason:
type: string
enum:
- MISSING_AUTHENTICATION
description: The machine-readable error reason.
title: MissingAuthenticationErrorResponseReason
EmptyErrorDetails:
type: object
properties: {}
title: EmptyErrorDetails
MissingAuthenticationErrorResponse:
type: object
properties:
message:
type: string
description: Human readable representation of the error
reason:
$ref: '#/components/schemas/MissingAuthenticationErrorResponseReason'
description: The machine-readable error reason.
missingAuthenticationError:
$ref: '#/components/schemas/EmptyErrorDetails'
description: Metadata detailing more information about the error.
required:
- message
- reason
- missingAuthenticationError
title: MissingAuthenticationErrorResponse
Task_iam_org_org_id_project_project_id_task_task_id_iam_test_permissionsRequestForbiddenError:
oneOf:
- $ref: '#/components/schemas/PermissionCheckFailedErrorResponse'
- $ref: '#/components/schemas/MissingAuthenticationErrorResponse'
title: >-
Task_iam_org_org_id_project_project_id_task_task_id_iam_test_permissionsRequestForbiddenError
ValidationErrorLocItems:
oneOf:
- type: string
- type: integer
title: ValidationErrorLocItems
ValidationError:
type: object
properties:
loc:
type: array
items:
$ref: '#/components/schemas/ValidationErrorLocItems'
msg:
type: string
type:
type: string
required:
- loc
- msg
- type
title: ValidationError
HTTPValidationError:
type: object
properties:
detail:
type: array
items:
$ref: '#/components/schemas/ValidationError'
title: HTTPValidationError
securitySchemes:
HTTPBearer:
type: http
scheme: bearer
description: Bearer token authentication using JWT tokens from Ory Kratos/Hydra
```
## SDK Code Examples
```python
import requests
url = "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/test"
payload = { "permissions": ["add_editor"] }
headers = {
"Authorization": "Bearer ",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
```
```javascript
const url = 'https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/test';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'},
body: '{"permissions":["add_editor"]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
```
```go
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/test"
payload := strings.NewReader("{\n \"permissions\": [\n \"add_editor\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer ")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
```
```ruby
require 'uri'
require 'net/http'
url = URI("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/test")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer '
request["Content-Type"] = 'application/json'
request.body = "{\n \"permissions\": [\n \"add_editor\"\n ]\n}"
response = http.request(request)
puts response.read_body
```
```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse response = Unirest.post("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task/task_id/iam/test")
.header("Authorization", "Bearer