Skip to main content
The Get Task Status endpoint lets you check the status and retrieve the output of any async task created by the LinkedIn API. All LinkedIn API endpoints are asynchronous — they return a task ID immediately, and you poll this endpoint to get results.

Endpoint

GET https://api.outx.ai/linkedin-agent/get-task-status

Headers

HeaderTypeRequiredDescription
x-api-keystringYesYour OutX API key

Query Parameters

ParameterTypeRequiredDescription
api_agent_task_idstringYesThe task ID returned by any LinkedIn API endpoint
GET https://api.outx.ai/linkedin-agent/get-task-status?api_agent_task_id=550e8400-e29b-41d4-a716-446655440000

Response

{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "status": "completed",
    "task_input": {
      "task_type": "agent_profile_fetch",
      "profile_slug": "williamhgates"
    },
    "task_output": {
      "name": "Bill Gates",
      "headline": "Co-chair, Bill & Melinda Gates Foundation"
    }
  }
}
FieldTypeDescription
successbooleanWhether the request was successful
data.idstringThe task ID
data.statusstringCurrent task status: pending or completed
data.task_inputobjectThe original input you provided when creating the task
data.task_outputobject | nullThe task result. null while status is pending, populated when completed

Status Values

StatusDescription
pendingThe task has been created and is waiting to be picked up by the Chrome extension
completedThe task has finished and results are available in task_output

Polling Pattern

Since all LinkedIn API tasks are asynchronous, you need to poll this endpoint to get results. Here is the recommended pattern:
  1. Call a LinkedIn API endpoint (e.g., fetch-profile) to create a task
  2. Receive the api_agent_task_id in the response
  3. Poll get-task-status every 5 seconds
  4. Stop polling when status is completed
  5. Read the results from task_output
We recommend polling every 5 seconds with a maximum of 30 attempts (about 2.5 minutes total). Most tasks complete well within this window.

Code Examples

Basic Polling

# One-time status check
curl -X GET \
  "https://api.outx.ai/linkedin-agent/get-task-status?api_agent_task_id=550e8400-e29b-41d4-a716-446655440000" \
  -H "x-api-key: YOUR_API_KEY"

Polling with Bash Loop

TASK_ID="550e8400-e29b-41d4-a716-446655440000"

for i in $(seq 1 30); do
  RESULT=$(curl -s -X GET \
    "https://api.outx.ai/linkedin-agent/get-task-status?api_agent_task_id=$TASK_ID" \
    -H "x-api-key: YOUR_API_KEY")

  STATUS=$(echo $RESULT | jq -r '.data.status')
  echo "Attempt $i: $STATUS"

  if [ "$STATUS" = "completed" ]; then
    echo "Result:"
    echo $RESULT | jq '.data.task_output'
    exit 0
  fi

  sleep 5
done

echo "Task did not complete in time"
exit 1

Team Scoping

Task status queries are scoped to your team. You can only retrieve the status of tasks that were created with your API key. Attempting to check a task that belongs to a different team will return a 404 error.

Error Responses

StatusErrorDescription
400Missing or invalid 'api_agent_task_id'The api_agent_task_id query parameter is missing or not a string
401Missing API Key / Invalid API KeyAPI key is missing or invalid
403Plugin installation required...No team member has an active Chrome extension. See Authentication
404Agent task not foundThe task ID does not exist or belongs to a different team

FAQ

We recommend polling every 5 seconds. This provides a good balance between responsiveness and avoiding unnecessary requests. Most tasks complete within 10-60 seconds.
In rare cases, a task may remain in pending status if the Chrome extension is not running or encounters an issue. We recommend setting a timeout of 2-3 minutes. If a task has not completed within that window, check that the Chrome extension is active and try creating a new task.
Currently, you can only check one task at a time. If you need to monitor multiple tasks, make separate requests for each task ID.
Task records are persisted in the database. You can check the status of completed tasks at any time to re-read the output.
The task_type field in task_input indicates which endpoint created the task: