curl --request GET \
--url https://api.{environment}.corti.app/agents/{id}/v1/tasks/{taskId} \
--header 'Authorization: Bearer <token>' \
--header 'Tenant-Name: <tenant-name>'import { CortiClient, CortiEnvironment } from "@corti/sdk";
const client = new CortiClient({
environment: CortiEnvironment.Eu,
auth: {
clientId: "YOUR_CLIENT_ID",
clientSecret: "YOUR_CLIENT_SECRET"
},
tenantName: "YOUR_TENANT_NAME"
});
await client.agents.getTask("12345678-90ab-cdef-gh12-34567890abc", "taskId");
using Corti;
var client = new CortiClient(
"TENANT_NAME",
CortiClientEnvironment.Eu,
new CortiClientAuth.ClientCredentials("client_id", "client_secret")
);
await client.Agents.GetTaskAsync(
"12345678-90ab-cdef-gh12-34567890abc",
"taskId",
new AgentsGetTaskRequest()
);
import requests
url = "https://api.{environment}.corti.app/agents/{id}/v1/tasks/{taskId}"
headers = {
"Tenant-Name": "<tenant-name>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.{environment}.corti.app/agents/{id}/v1/tasks/{taskId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Tenant-Name: <tenant-name>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.{environment}.corti.app/agents/{id}/v1/tasks/{taskId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Tenant-Name", "<tenant-name>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.{environment}.corti.app/agents/{id}/v1/tasks/{taskId}")
.header("Tenant-Name", "<tenant-name>")
.header("Authorization", "Bearer <token>")
.asString();{
"id": "<string>",
"contextId": "<string>",
"status": {
"state": "submitted",
"message": {
"role": "user",
"parts": [
{
"kind": "text",
"text": "<string>",
"metadata": {}
}
],
"messageId": "<string>",
"kind": "message",
"metadata": {},
"extensions": [
"<string>"
],
"referenceTaskIds": [
"<string>"
],
"taskId": "<string>",
"contextId": "<string>"
},
"timestamp": "2023-11-07T05:31:56Z"
},
"kind": "task",
"history": [
{
"role": "user",
"parts": [
{
"kind": "text",
"text": "<string>",
"metadata": {}
}
],
"messageId": "<string>",
"kind": "message",
"metadata": {},
"extensions": [
"<string>"
],
"referenceTaskIds": [
"<string>"
],
"taskId": "<string>",
"contextId": "<string>"
}
],
"artifacts": [
{
"artifactId": "<string>",
"parts": [
{
"kind": "text",
"text": "<string>",
"metadata": {}
}
],
"name": "<string>",
"description": "<string>",
"metadata": {},
"extensions": [
"<string>"
]
}
],
"metadata": {}
}{
"code": "<string>",
"description": "<string>",
"howToFix": "<string>",
"details": {},
"cause": {}
}{
"code": "<string>",
"description": "<string>",
"howToFix": "<string>",
"details": {},
"cause": {}
}{
"code": "<string>",
"description": "<string>",
"howToFix": "<string>",
"details": {},
"cause": {}
}{
"code": "<string>",
"description": "<string>",
"howToFix": "<string>",
"details": {},
"cause": {}
}Get Task by ID
This endpoint retrieves the status and details of a specific task associated with the given agent. It provides information about the task’s current state, history, and any artifacts produced during its execution.
curl --request GET \
--url https://api.{environment}.corti.app/agents/{id}/v1/tasks/{taskId} \
--header 'Authorization: Bearer <token>' \
--header 'Tenant-Name: <tenant-name>'import { CortiClient, CortiEnvironment } from "@corti/sdk";
const client = new CortiClient({
environment: CortiEnvironment.Eu,
auth: {
clientId: "YOUR_CLIENT_ID",
clientSecret: "YOUR_CLIENT_SECRET"
},
tenantName: "YOUR_TENANT_NAME"
});
await client.agents.getTask("12345678-90ab-cdef-gh12-34567890abc", "taskId");
using Corti;
var client = new CortiClient(
"TENANT_NAME",
CortiClientEnvironment.Eu,
new CortiClientAuth.ClientCredentials("client_id", "client_secret")
);
await client.Agents.GetTaskAsync(
"12345678-90ab-cdef-gh12-34567890abc",
"taskId",
new AgentsGetTaskRequest()
);
import requests
url = "https://api.{environment}.corti.app/agents/{id}/v1/tasks/{taskId}"
headers = {
"Tenant-Name": "<tenant-name>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.{environment}.corti.app/agents/{id}/v1/tasks/{taskId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Tenant-Name: <tenant-name>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.{environment}.corti.app/agents/{id}/v1/tasks/{taskId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Tenant-Name", "<tenant-name>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.{environment}.corti.app/agents/{id}/v1/tasks/{taskId}")
.header("Tenant-Name", "<tenant-name>")
.header("Authorization", "Bearer <token>")
.asString();{
"id": "<string>",
"contextId": "<string>",
"status": {
"state": "submitted",
"message": {
"role": "user",
"parts": [
{
"kind": "text",
"text": "<string>",
"metadata": {}
}
],
"messageId": "<string>",
"kind": "message",
"metadata": {},
"extensions": [
"<string>"
],
"referenceTaskIds": [
"<string>"
],
"taskId": "<string>",
"contextId": "<string>"
},
"timestamp": "2023-11-07T05:31:56Z"
},
"kind": "task",
"history": [
{
"role": "user",
"parts": [
{
"kind": "text",
"text": "<string>",
"metadata": {}
}
],
"messageId": "<string>",
"kind": "message",
"metadata": {},
"extensions": [
"<string>"
],
"referenceTaskIds": [
"<string>"
],
"taskId": "<string>",
"contextId": "<string>"
}
],
"artifacts": [
{
"artifactId": "<string>",
"parts": [
{
"kind": "text",
"text": "<string>",
"metadata": {}
}
],
"name": "<string>",
"description": "<string>",
"metadata": {},
"extensions": [
"<string>"
]
}
],
"metadata": {}
}{
"code": "<string>",
"description": "<string>",
"howToFix": "<string>",
"details": {},
"cause": {}
}{
"code": "<string>",
"description": "<string>",
"howToFix": "<string>",
"details": {},
"cause": {}
}{
"code": "<string>",
"description": "<string>",
"howToFix": "<string>",
"details": {},
"cause": {}
}{
"code": "<string>",
"description": "<string>",
"howToFix": "<string>",
"details": {},
"cause": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request.
"base"
Path Parameters
The identifier of the agent associated with the context.
"12345678-90ab-cdef-gh12-34567890abc"
The identifier of the task to retrieve.
Query Parameters
The number of previous messages to include in the context for the agent when retrieving this task. Default is all messages.
Response
Task retrieved successfully.
Unique identifier for the task.
Identifier for the context (thread) in which the task is created.
Show child attributes
Show child attributes
The kind of the object, always "task".
task The history of messages associated with the task.
Show child attributes
Show child attributes
The artifacts associated with the task.
Show child attributes
Show child attributes
Additional metadata for the task.
Was this page helpful?