Skip to main content

Retrieve the target ID

This document explains how to retrieve the target_id for a specific target in the Invicti Platform. The target_id is required when integrating Invicti functionality into your custom applications, scripts, or workflows using the Invicti API.

You can obtain the target_id in two ways:

  1. Through the Invicti Platform UI
  2. By sending a GET request to the Invicti API

Through the Invicti Platform UI

To navigate to the target settings inside the UI and copy the target_id from the URL, follow these steps:

  1. Select Inventory >Targets from the left-side menu.
  2. Find the target for which you want to obtain the target_id.
  3. Click on the target to open its drawer.
  4. The target ID is listed in the Details section.
Target ID in the Details section of the drawer.

By sending a GET request to the Invicti API

Use the provided command to make a GET request to the Invicti Platform API and retrieve a list of targets with a filter applied.

Here is a breakdown of the command:

  • https://platform.invicti.com/api/v1/targets?q=localhost: is the URL to which the GET request is sent. It includes the endpoint /api/v1/targets for retrieving targets and a filter q=localhost to filter the results based on target names or descriptions containing "localhost".
  • -H "Accept: application/json": specifies that the client expects JSON-formatted responses from the server.
  • -H "X-Auth: [API-Key]": provides authentication to the Invicti Platform API using an API key. Replace the [API‑Key] with the actual API key.
curl -i -k -X GET https://platform.invicti.com/api/v1/targets?q=localhost -H "Accept: application/json" -H "X-Auth: [API-Key]"

The provided response includes information about a target, including its target_id. Here is the response with the _target_id highlighted:

Target ID in the API response.

Need help?

Invicti Support team is ready to provide you with technical help. Go to Help Center

Was this page useful?