---
title: "List AI tasks for a given space"
method: GET
path: "/accounts/{accountIdentifier}/orgs/{orgIdentifier}/projects/{projectIdentifier}/aitasks"
tags: ["aitasks"]
---

# List AI tasks for a given space

`GET /accounts/{accountIdentifier}/orgs/{orgIdentifier}/projects/{projectIdentifier}/aitasks`

## Path parameters

- `accountIdentifier` string, required
- `orgIdentifier` string, required
- `projectIdentifier` string, required

## Query parameters

- `page` integer
- `limit` integer
- `query` string
- `aitask_states` EnumAITaskState[]
- `aitask_agents` EnumAIAgent[]

## Response `200`

OK

- TypesAITask[]
  - `ai_agent` 'claude-code'
  - `ai_usage_metric` TypesAIUsageMetric
    - `duration_ms` integer
    - `llm_models` string[], nullable
    - `total_cost_usd` number
    - `total_input_tokens` integer
    - `total_output_tokens` integer
  - `api_url` string, nullable
  - `created` integer
  - `display_name` string
  - `error_message` string, nullable
  - `gitspace_config` TypesGitspaceConfig
    - `ai_agents` EnumAIAgent[]
    - `branch` string
    - `branch_url` string
    - `code_repo_is_private` boolean
    - `code_repo_ref` string, nullable
    - `code_repo_type` 'github' | 'gitlab' | 'harness_code' | 'bitbucket' | 'unknown' | 'gitness' | 'gitlab_on_prem' | 'bitbucket_server' | 'github_enterprise'
    - `code_repo_url` string
    - `created` integer
    - `devcontainer_path` string, nullable
    - `ide` 'vs_code' | 'vs_code_web' | 'cursor' | 'windsurf' | 'intellij' | 'pycharm' | 'goland' | 'webstorm' | 'clion' | 'phpstorm' | 'rubymine' | 'rider'
    - `identifier` string
    - `initialize_log_key` string
    - `instance` TypesGitspaceInstance, nullable
      - `access_key` string, nullable
      - `access_key_ref` string, nullable
      - `access_type` 'jwt_token' | 'user_credentials' | 'ssh_key'
      - `active_time_ended` integer, nullable
      - `active_time_started` integer, nullable
      - `created` integer
      - `error_message` string, nullable
      - `has_git_changes` boolean, nullable
      - `identifier` string
      - `last_heartbeat` integer, nullable
      - `last_used` integer, nullable
      - `machine_user` string, nullable
      - `plugin_url` string, nullable
      - `resource_usage` string, nullable
      - `space_path` string
      - `ssh_command` string, nullable
      - `state` 'running' | 'uninitialized' | 'unknown' | 'error' | 'deleted' | 'starting' | 'stopping' | 'cleaning' | 'cleaned' | 'resetting' | 'pending_cleanup'
      - `total_time_used` integer
      - `updated` integer
      - `url` string, nullable
    - `is_marked_for_infra_reset` boolean
    - `is_marked_for_reset` boolean
    - `log_key` string
    - `name` string
    - `resource` TypesInfraProviderResource
      - `config_identifier` string
      - `config_name` string
      - `cpu` string, nullable
      - `created` integer
      - `deleted` integer, nullable
      - `disk` string, nullable
      - `identifier` string
      - `infra_provider_type` 'docker' | 'harness_gcp' | 'harness_cloud' | 'hybrid_vm_gcp' | 'hybrid_vm_aws'
      - `is_deleted` boolean
      - `memory` string, nullable
      - `metadata` object, nullable
      - `name` string
      - `network` string, nullable
      - `region` string
      - `space_path` string
      - `updated` integer
    - `space_path` string
    - `ssh_token_identifier` string
    - `state` 'running' | 'stopped' | 'error' | 'uninitialized' | 'starting' | 'stopping' | 'cleaning'
    - `updated` integer
    - `user_display_name` string
    - `user_email` string
    - `user_id` string
  - `id` integer
  - `identifier` string
  - `initial_prompt` string
  - `output` string, nullable
  - `space_id` integer
  - `state` 'completed' | 'error' | 'running' | 'uninitialized'
  - `updated` integer
  - `user_uid` string

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `500` — Internal Server Error

## Changes

> 19 revisions in range; 1 not diffed.

- **2025-11-19** `15da16b4c3e4` — 2 warning, 6 info
  - removed the optional property `items/gitspace_config_id` from the response with the `200` status
  - removed the optional property `items/gitspace_instance_id` from the response with the `200` status
  - added the new optional `query` request parameter `aitask_agents`
  - added the new optional `query` request parameter `aitask_states`
  - …4 more
- **2025-11-17** `a39dc72168fe` — 1 info
  - endpoint added
- **2024-05-29** `e133a34ecf0b` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/harness/apis/api-specification/changes/accounts/:accountIdentifier/orgs/:orgIdentifier/projects/:projectIdentifier/aitasks/get.md)

---

[API](https://skmtc.dev/harness/apis/api-specification.md) · [All operations](https://skmtc.dev/harness/apis/api-specification/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/harness/api-specification/revisions/3b3bedabcfa7/schema)
