Skip to main content
Retrieve a specific task by its unique identifier with optional analytics data.

Retrieve a Task

const API_KEY = process.env.TELA_API_KEY;
const taskId = 'task_uuid';

// Optional: include analytics
const includeAnalytics = true;

const url = new URL(`https://api.tela.ai/task/${taskId}`);
if (includeAnalytics) {
  url.searchParams.append('includeAnalytics', 'true');
}

const response = await fetch(url, {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${API_KEY}`,
    'Content-Type': 'application/json'
  }
});

const data = await response.json();
console.log(data);

Parameters

NameTypeRequiredDescription
idstringYesThe UUID of the task to retrieve
includeAnalyticsstringNoWhether to include analytics data in the response

Response

The response returns a single task object with the following properties:
FieldTypeDescription
idstringUnique identifier for the task (UUID)
namestringName of the task
statusstringCurrent status of the task
promptApplicationIdstringUUID of the associated prompt application
inputContentobjectInput content for the task
outputContentobject or nullOutput content from the task
rawInputobject or nullRaw input configuration
rawOutputobject or nullRaw output from processing
tagsarrayTags associated with the task
metadataobjectTask metadata
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
approvedAtstring or nullApproval timestamp
completionRunIdstring or nullAssociated completion run ID
workflowRunIdstring or nullAssociated workflow run ID

Example Response

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Document Analysis Task",
  "status": "completed",
  "promptApplicationId": "550e8400-e29b-41d4-a716-446655440001",
  "inputContent": {
    "variables": {
      "document": "Sample document content"
    },
    "messages": [],
    "files": []
  },
  "outputContent": {
    "content": {
      "summary": "This is a summary of the document.",
      "keyPoints": ["Point 1", "Point 2", "Point 3"]
    }
  },
  "rawInput": {
    "application_id": "550e8400-e29b-41d4-a716-446655440001",
    "variables": {
      "document": "Sample document content"
    }
  },
  "rawOutput": {
    "summary": "This is a summary of the document.",
    "keyPoints": ["Point 1", "Point 2", "Point 3"]
  },
  "tags": ["analysis", "documents"],
  "metadata": {
    "source": "workstation"
  },
  "createdAt": "2023-01-01T00:00:00.000Z",
  "updatedAt": "2023-01-02T00:00:00.000Z",
  "approvedAt": "2023-01-02T12:00:00.000Z",
  "completionRunId": "550e8400-e29b-41d4-a716-446655440002",
  "workflowRunId": null
}