---
title: "Get version history of a test"
method: GET
path: "/api/v2/synthetics/tests/{public_id}/version_history"
tags: ["Synthetics"]
---

# Get version history of a test

`GET /api/v2/synthetics/tests/{public_id}/version_history`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/synthetics/tests/{public_id}/version_history`
- 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 the paginated version history for a Synthetic test.

## Path parameters

- `public_id` string, required

## Query parameters

- `last_version_number` integer
- `limit` integer

## Response `200`

OK

- SyntheticsTestVersionHistoryResponse: Response containing the paginated version history for a Synthetic test.
  - `data` SyntheticsTestVersionChangeData[]: List of version change records.
    - `attributes` SyntheticsTestVersionChangeAttributes: Attributes of a version change record.
      - `author_uuid` string: UUID of the user who created this version.
      - `change_metadata` SyntheticsTestVersionChangeMetadataItem[]: List of metadata describing individual changes in this version.
        - `action` string: The action that was performed (for example, `updated` or `created`).
        - `action_metadata` SyntheticsTestVersionActionMetadata: Object containing metadata about a change action.
          - `after_value` unknown
          - `before_value` unknown
          - `diff_patches` SyntheticsTestVersionDiffPatches[], nullable: List of diff patches for text changes.
            - `diffs` SyntheticsTestVersionDiffPatchDiff[]: List of individual diff operations.
              - …
            - `length1` integer: Length of the original text segment.
            - `length2` integer: Length of the modified text segment.
            - `start1` integer: Start position in the original text.
            - `start2` integer: Start position in the modified text.
          - `property_path` string: The dot-separated path of the property that was changed.
      - `version_number` integer: The sequential version number.
      - `version_payload_created_at` string, date-time: Timestamp of when this version was created.
    - `id` string: UUID of the version change record.
    - `type` 'version_metadata': Type of the version metadata resource.
  - `meta` SyntheticsTestVersionHistoryMeta: Pagination metadata for a version history response.
    - `next_last_version_number` integer, nullable: The version number to use as the `last_version_number` query parameter to fetch the next page. `null` indicates there are no more pages.
    - `retention_period_in_days` integer: The number of days that version history is retained.

## Other responses

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