import Tembo from '@tembo-io/sdk';
const client = new Tembo({
apiKey: 'My API Key',
});
const task = await client.task.create({
prompt: 'Fix the authentication bug in the login component',
agent: 'claudeCode:claude-opus-4-5',
repositories: [
'https://github.com/org/repo',
'https://gitlab.com/org/repo-2',
],
targetBranch: 'dev',
branchName: "cooper-is-awesome",
});
console.log(task.id);{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"description": "<string>",
"status": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"htmlUrl": "https://app.tembo.io/tasks/123e4567-e89b-12d3-a456-426614174000"
}Create a task for tembo to start working on in the background
import Tembo from '@tembo-io/sdk';
const client = new Tembo({
apiKey: 'My API Key',
});
const task = await client.task.create({
prompt: 'Fix the authentication bug in the login component',
agent: 'claudeCode:claude-opus-4-5',
repositories: [
'https://github.com/org/repo',
'https://gitlab.com/org/repo-2',
],
targetBranch: 'dev',
branchName: "cooper-is-awesome",
});
console.log(task.id);{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"description": "<string>",
"status": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"htmlUrl": "https://app.tembo.io/tasks/123e4567-e89b-12d3-a456-426614174000"
}Task creation payload
Description of the task to be performed. Supports tagging files.
1"Fix the authentication bug in the login component"
Detailed description of the task (alternative to prompt)
1"Users are reporting they cannot log in. JWT token validation appears to be failing."
The agent to use for this task
"claudeCode:claude-opus-4-5"
Array of code repository urls that this task relates to
[
"https://github.com/org/repo",
"https://gitlab.com/org/repo-2"
]Array of Tembo code repository IDs to target directly
[
"cbad4334-c844-4fef-a8da-d08f209f267e",
"6307d53a-b99d-4e90-ab89-f29114f33d53"
]The branch to open the pull request against (e.g. main, develop)
"main"
The branch name to use for the work
"feature/auth-fix"
Whether to immediately queue the task for processing (optional, defaults to true)
false
Task created successfully
URL to view this task in the Tembo web application
"https://app.tembo.io/tasks/123e4567-e89b-12d3-a456-426614174000"
Was this page helpful?