Skip to content

Export - CSV Export

Start, list, and download asynchronous CSV exports of threats and assets via the TAM export API.

Exports run asynchronously. create and create-aggregate enqueue a job and return an id plus a status (e.g. queued). Poll export list until the export reports download_available: true (status completed), then retrieve the file with export download <id> --output-file <path>.

Commands


export list

List export history with optional filtering, sorting, and pagination. Use this to poll the status of a started export until download_available is true.

1
mysecutec export list [flags]

Flags

Flag Type Default Description
--limit int 20 Maximum number of results
--offset int 0 Number of results to skip
--resource-type string Filter by resource type
--status string Filter by status (queued, processing, completed, failed)
--sort strings Sort fields (prefix - for descending)
--created-from string Filter by created date (from)
--created-to string Filter by created date (to)

API

1
GET /tam/v1/exports

Query Parameters:

Parameter Type Description
limit int Max results
offset int Skip results
resource_type string Resource type filter
status string Status filter
sort string Sort fields (repeatable)
created_at_from string Created date range start
created_at_to string Created date range end

Request Example

1
mysecutec export list --resource-type threats --status completed
1
2
3
GET /tam/v1/exports?limit=20&resource_type=threats&status=completed
Authorization: Bearer <token>
Accept: application/json

export filter

Get available filter options for the export history view (resource types and statuses).

1
mysecutec export filter

API

1
GET /tam/v1/exports/filter

Request Example

1
mysecutec export filter
1
2
3
GET /tam/v1/exports/filter
Authorization: Bearer <token>
Accept: application/json

export create

Start an asynchronous CSV export of threats or assets. This is a mutation: it enqueues a job and prompts for confirmation unless -y/--yes is passed. It returns the new export id and status; track progress with export list and retrieve the file with export download <id>.

Flat filters use key=v1,v2; enriched (JSONB) filters use --jsonb "path=v1,v2".

1
mysecutec export create [flags]

Flags

Flag Type Default Description
--resource string Resource type to export (threats or assets)
--columns strings Columns to include (comma-separated)
--filter stringArray Flat filter key=v1,v2 (repeatable)
--jsonb stringArray Enriched filter path=v1,v2 (repeatable)
--search string Search filter
--sort strings Sort fields (prefix - for descending)
-y, --yes bool false Skip the confirmation prompt

API

1
POST /tam/v1/exports

Request Body:

Field Type Description
resource_type string Resource type (threats or assets)
columns []string Columns to include
filters map Filter criteria; flat filters as key: [values], enriched filters under the jsonb_filters key
search string Search filter (optional)
sort []string Sort fields (optional)

Request Example

1
mysecutec export create --resource threats --columns id,name --jsonb data.enriched.breach.category=exposed -y
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
POST /tam/v1/exports
Authorization: Bearer <token>
Content-Type: application/json

{
  "resource_type": "threats",
  "columns": ["id", "name"],
  "filters": {
    "jsonb_filters": [
      { "path": "data.enriched.breach.category", "values": ["exposed"] }
    ]
  }
}

export create-aggregate

Start an asynchronous CSV export of grouped/aggregated data. This is a mutation: it enqueues a job and prompts for confirmation unless -y/--yes is passed. It returns the new export id and status; track progress with export list and retrieve the file with export download <id>.

Group-by and select fields use path[:alias]; filters use path=v1,v2.

1
mysecutec export create-aggregate [flags]

Flags

Flag Type Default Description
--resource string threats Resource type (threats or assets)
--group-by stringArray Group-by field path[:alias] (repeatable)
--select stringArray Select field path[:alias] (repeatable)
--filter stringArray JSONB filter path=v1,v2 (repeatable)
--module strings Filter by license module
-y, --yes bool false Skip the confirmation prompt

API

1
POST /tam/v1/exports/aggregate

Request Body:

Field Type Description
resource_type string Resource type (threats or assets)
spec ThreatAggregateRequest Aggregation spec (group_by, select, filters)

Request Example

1
mysecutec export create-aggregate --resource threats --module lcm --group-by data.enriched.breach.category:category -y
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
POST /tam/v1/exports/aggregate
Authorization: Bearer <token>
Content-Type: application/json

{
  "resource_type": "threats",
  "spec": {
    "group_by": [
      { "path": "data.enriched.breach.category", "alias": "category" }
    ],
    "select": [],
    "filters": {
      "license_module": ["lcm"]
    }
  }
}

export download

Fetch the presigned download URL for a completed export. By default the URL is printed; with --output-file the CSV is downloaded to disk. The export must report download_available: true (run export list first).

1
mysecutec export download <export_id> [flags]

Flags

Flag Type Default Description
-f, --output-file string Write the CSV to this file (default: print the URL)

API

1
GET /tam/v1/exports/{id}/download

Request Example

1
mysecutec export download 1234-5678-abcd --output-file threats.csv
1
2
3
GET /tam/v1/exports/1234-5678-abcd/download
Authorization: Bearer <token>
Accept: application/json