1. API Operations
  2. Add target

Deprecated

You are viewing a deprecated version of our API Reference. Please visit the up-to-date documentation.

Add target

This operation creates a new target, with an optional description.


Request

Parameters
Parameter
op
Type
string
required
true

Add a new target. The value is "add_target".

Parameter
name
Type
string
required
true

The name of the new target.

Parameter
description
Type
string

Set this description for the new target.

Parameter
workspace_id
Type
integer

Add the target to this workspace.

{
  "op": "add_target",
  "name": "http://demo.pentest-tools.com",
  "workspace_id": 5425246
}

Response

Attributes
Attribute
op_status
Type
string

The status of the operation. The value can be "success" or "fail".

Attribute
target_id
Type
integer

The ID of the newly created target. Returned in case of a successful operation.

Attribute
error
Type
string

Error message. Returned in case of a failed operation. The value can be "invalid target" or "invalid workspace".

Attribute
details
Type
string

Error details. Returned in case of an invalid target error.

{
  "op_status": "success",
  "target_id": 7583
}