> ## Documentation Index
> Fetch the complete documentation index at: https://docs.horneross.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Obtener task

> Obtener detalles de una tarea específica.

## Endpoint

```
GET /api/tasks/{id}
```

## Headers

<ParamField header="Authorization" type="string" required>
  Bearer token con tu API key. Formato: `Bearer sk_live_xxx`
</ParamField>

## Path Parameters

<ParamField path="id" type="string" required>
  ID de la tarea
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://app.horneross.com/api/tasks/trigger_abc123" \
    -H "Authorization: Bearer sk_live_xxx"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://app.horneross.com/api/tasks/trigger_abc123',
    {
      headers: {
        'Authorization': 'Bearer sk_live_xxx',
      },
    }
  );

  const { trigger } = await response.json();
  console.log('Task:', trigger.name);
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://app.horneross.com/api/tasks/trigger_abc123',
      headers={'Authorization': 'Bearer sk_live_xxx'}
  )

  trigger = response.json()['trigger']
  print(f'Task: {trigger["name"]}')
  ```
</RequestExample>

## Response

<ResponseField name="trigger" type="object" required>
  Detalles de la tarea

  <Expandable title="Propiedades">
    <ResponseField name="trigger.id" type="string" required>
      ID único
    </ResponseField>

    <ResponseField name="trigger.agentId" type="string" required>
      ID del agente
    </ResponseField>

    <ResponseField name="trigger.type" type="string" required>
      Tipo de trigger
    </ResponseField>

    <ResponseField name="trigger.name" type="string" required>
      Nombre
    </ResponseField>

    <ResponseField name="trigger.description" type="string">
      Descripción
    </ResponseField>

    <ResponseField name="trigger.config" type="object" required>
      Configuración (incluye `prompt`)
    </ResponseField>

    <ResponseField name="trigger.isEnabled" type="boolean" required>
      Estado
    </ResponseField>

    <ResponseField name="trigger.createdAt" type="string" required>
      Fecha de creación
    </ResponseField>

    <ResponseField name="trigger.agent" type="object" required>
      Información del agente
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "trigger": {
      "id": "trigger_abc123",
      "agentId": "agent_xyz",
      "type": "schedule",
      "name": "Resumen diario",
      "description": "Genera resumen cada mañana",
      "config": {
        "prompt": "Genera un resumen de las conversaciones de ayer",
        "cronExpression": "0 9 * * *",
        "timezone": "America/Argentina/Buenos_Aires"
      },
      "isEnabled": true,
      "createdAt": "2024-01-21T10:00:00Z",
      "agent": {
        "id": "agent_xyz",
        "name": "Asistente de Ventas",
        "iconUrl": "https://...",
        "organizationId": "org_123"
      }
    }
  }
  ```

  ```json 404 - Not Found theme={null}
  {
    "error": "Task not found"
  }
  ```
</ResponseExample>
