---
title: "Get a presigned URL for downloading a test file"
method: POST
path: "/api/v2/synthetics/tests/{public_id}/files/download"
tags: ["Synthetics"]
---

# Get a presigned URL for downloading a test file

`POST /api/v2/synthetics/tests/{public_id}/files/download`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/synthetics/tests/{public_id}/files/download`
- 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: `synthetics_read`

Get a presigned URL to download a file attached to a Synthetic test.
The returned URL is temporary and expires after a short period.

## Path parameters

- `public_id` string, required

## Request body

- SyntheticsTestFileDownloadRequest: Request body for getting a presigned download URL for a test file.
  - `bucketKey` string, required: The bucket key referencing the file to download.

## Response `200`

OK

- SyntheticsTestFileDownloadResponse: Response containing a presigned URL for downloading a test file.
  - `url` string: A presigned URL to download the file. The URL expires after a short period.

## Other responses

- `400`: API error response.
- `403`: Forbidden.
- `404`: API error response.
- `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)
