Assign Tags

Assign tags to your endpoints.

Synopsis

URI
public_api/v1/tags/agents/assign
HTTP Method
POST
Required License
Cortex XDR Prevent, Cortex XDR Pro per Endpoint, or Cortex XDR Pro per TB

Description

Assign one or more tags to one or more endpoints.

Request Fields

The body of this request contains a JSON object with the following fields:
Field
Description
context
(
Required
) A dictionary containing the tenant ID.
lcaas_id
The tenant ID of the endpoint(s) for which you want to assign the tag.
request_data
(
Required
) A dictionary containing the following API request fields.
filters
Provides an array of filtered fields. Each JSON object must contain the following keyword:
  • field
    String that identifies the field the filter is matching. Filters are based on the following keywords:
    • endpoint_id_list
      —List of endpoint IDs.
    • endpoint_status
      —Status of the endpoint ID.
    • dist_name
      —Distribution / Installation Package name.
    • ip_list
      —List of IP addresses.
    • group_name
      —Group name the agent belongs to.
    • platform
      —Platform name.
    • alias
      —Alias name.
    • isolate
      —If the endpoint was isolated.
    • hostname
      —Hostname
  • operator
    String that identifies the comparison operator you want to use for this filter. Valid keywords and values are:
    in
    • endpoint_id_list
      ,
      dist_name
      ,
      group_name
      ,
      alias
      ,
      hostname
      ,
      username
      —List of strings.
    • endpoint_status
      connected
      or
      disconnected
    • ip_list
      —List of strings, for example
      192.168.5.12
      .
    • platform
      windows
      ,
      linux
      ,
      macos
      ,
      android
    • isolate
      isolated
      or
      unisolated
    • scan_status
      none
      ,
      pending
      ,
      in_progress
      ,
      canceled
      ,
      aborted
      ,
      pending_cancellation
      ,
      success
      , or
      error
    gte
    /
    lte
    • first_seen
      and
      last_seen
      —Integer in timestamp epoch milliseconds.
  • value
    Value that this filter must match. The contents of this field will differ depending on the endpoint field that you specified for this filter:
    • endpoint_id_list
      ,
      distribution_name
      ,
      hostname
      ,
      alias
      ,
      group_name
      —List of strings.
    • endpoint_status
      —Must contain only the following valid values:
      connected
      or
      disconnected
    • ip_list
      —String list of IP addresses.
    • platform
      - Must contain only the following valid values:
      windows
      ,
      linux
      ,
      macos
      , or
      android
      .
    • isolate
      - Must contain only the following valid values:
      isolated
      or
      unisolated
      .
tag
The tag name(s) you want to assign.
Request Example
curl -X POST https://api-{fqdn}/public_api/v1/tags/agents/assign/ \ -H "x-xdr-auth-id:{API_KEY_ID}" \ -H "Authorization:{API_KEY}" \ -H "Content-Type:application/json" \ -d '{ "context": { "lcaas_id": "<tenant_id>" }, "request_data":{ "filters":[ {"field":"endpoint_id_list", "operator":"in", "value":[ "<distribution_id" ] } ], "tag": "<tag_name>" } }'

Success Response

Upon success, the HTTP response code is 200 and the API returns a reply of true.
Field
Description
true
The tag name assigned successfully.

Error Response

Upon error, the reply includes an HTTP response code, an error message, and additional information describing the error. The HTTP response code is one of the following:
Field
Description
400
Bad Request. Got an invalid JSON.
401
Unauthorized access. An issue occurred during authentication. This can indicate an incorrect key, id, or other invalid authentication parameters.
402
Unauthorized access. User does not have the required license type to run this API.
403
Forbidden access. The provided API Key does not have the required RBAC permissions to run this API.
500
Internal server error. A unified status for API communication type errors. For example,
test@test.com is not a valid Cortex XDR email address.
Error Response Format
{"reply": {"err_code": STATUS_CODE, "err_msg": GENERAL_MESSAGE, "err_extra": EXTRA_DATA}}

Recommended For You