---
title: "Get AWS on demand task"
method: GET
path: "/api/v2/agentless_scanning/ondemand/aws/{task_id}"
tags: ["Agentless Scanning"]
---

# Get AWS on demand task

`GET /api/v2/agentless_scanning/ondemand/aws/{task_id}`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/agentless_scanning/ondemand/aws/{task_id}`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `security_monitoring_findings_read`

Fetch the data of a specific on demand task.

## Path parameters

- `task_id` string, required

## Response `200`

OK.

- AwsOnDemandResponse: Response object that includes an AWS on demand task.
  - `data` AwsOnDemandData: Single AWS on demand task.
    - `attributes` AwsOnDemandAttributes: Attributes for the AWS on demand task.
      - `arn` string: The arn of the resource to scan.
      - `assigned_at` string: Specifies the assignment timestamp if the task has been already assigned to a scanner.
      - `created_at` string: The task submission timestamp.
      - `status` string: Indicates the status of the task. QUEUED: the task has been submitted successfully and the resource has not been assigned to a scanner yet. ASSIGNED: the task has been assigned. ABORTED: the scan has been aborted after a period of time due to technical reasons, such as resource not found, insufficient permissions, or the absence of a configured scanner.
    - `id` string: The UUID of the task.
    - `type` 'aws_resource': The type of the on demand task. The value should always be `aws_resource`.

## Other responses

- `400`: Bad Request
- `403`: Not Authorized
- `404`: Not Found
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/da68bf029e4c?raw)
