---
title: "Get task"
method: GET
path: "/tasks/{id}"
tags: ["Tasks"]
---

# Get task

`GET /tasks/{id}`

## Request

- Base URL: `https://api.crevio.co/v1`
- URL: `https://api.crevio.co/v1/tasks/{id}`
- Auth: API key in header `Authorization`

Returns a specific AI task.

## Path parameters

- `id` string, required

## Response `200`

Task details

- AiTask
  - `id` string, required
  - `object` string, required
  - `name` string, required
  - `description` string, nullable, required
  - `kind` 'agent' | 'script', required
  - `prompt` string, nullable, required
  - `success_criteria` string, nullable, required
  - `trigger_type` 'immediate' | 'cron' | 'interval' | 'once' | 'event', required
  - `cron_expression` string, nullable, required
  - `interval_seconds` integer, nullable, required
  - `scheduled_at` string, date-time, nullable, required
  - `event_conditions` object, nullable, required
  - `condition_script` string, nullable, required
  - `pre_run_script` string, nullable, required
  - `script` string, nullable, required
  - `timezone` string, required
  - `delivery_methods` string[], required
  - `approval_mode` 'autonomous' | 'supervised' | 'read_only', required
  - `model_id` string, nullable, required
  - `agent` 'business' | 'engineering', required
  - `visibility` 'account' | 'personal', required
  - `active` boolean, required
  - `expires_at` string, date-time, nullable, required
  - `next_run_at` string, date-time, nullable, required
  - `last_run_at` string, date-time, nullable, required
  - `total_runs_count` integer, required
  - `consecutive_failure_count` integer, required
  - `total_credits_consumed` integer, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `max_runs_per_day` integer, nullable, required: Event tasks: the most event-started runs per day (account time zone); later events are skipped as `rate_limited`.
  - `min_interval_seconds` integer, nullable, required: Event tasks: the cooldown after an event-started run; events inside it are skipped as `rate_limited`.
  - `site_id` string, nullable, required
  - `source` 'user' | 'agent' | 'system', required: How the task came to exist: `user` (a person made it in the dashboard), `agent` (the agent made it inside the chat `origin_chat_id`, whose person is `created_by_id`), or `system` (a built-in task).
  - `created_by_id` string, nullable, required: The person (`user_...`) who made the task or asked for it. Null for built-in tasks.
  - `created_by_name` string, nullable, required
  - `origin_chat_id` string, nullable, required: The chat (`aichat_...`) the task was set up in. A member's chat opens only for that member.
  - `recent_runs` AiTaskRunSummary[], required: The task's newest executed runs (at most 5, newest first; skipped and test runs excluded).
    - `id` string, required
    - `status` 'pending' | 'running' | 'completed' | 'failed' | 'needs_input' | 'timed_out' | 'unknown' | 'skipped', required
    - `created_at` string, date-time, required
    - `completed_at` string, date-time, nullable, required
    - `error_message` string, nullable, required
    - `chat_id` string, nullable, required

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `403`: Forbidden
- `404`: Resource not found
- `429`: Rate limit exceeded — 600 requests per minute per credential. Retry after the number of seconds in `Retry-After`.
- `500`: Internal server error

---

[API](https://skmtc.dev/crevio/apis/crevio-api-v1.md) · [All operations](https://skmtc.dev/crevio/apis/crevio-api-v1/llms.txt) · [OpenAPI document](https://skmtc.dev/crevio/apis/crevio-api-v1/revisions/2219f18ad651?raw)
