---
title: "Create an export job"
method: POST
path: "/v1/export-job"
tags: ["Exports"]
---

# Create an export job

`POST /v1/export-job`

## Request

- Base URL: `https://help.puppet.com/api/public`
- URL: `https://help.puppet.com/api/public/v1/export-job`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/puppet/apis/puppet-comply-api/docs/v1/export-job/post.ts> (a function with typed inputs; its response is checked against the schema)

Create an export job containing the information required to generate an export. The export job will be queued and
subsequently processed by Comply. If the export job finishes successfully, a new export will be available to
download.

To use this endpoint, you must have one of the following roles:
`comply-admin`
`comply-operator`

## Request body

- object
  - `description` string: A description of the export to be generated.
  - `name` string: The name of the export to be generated. If no name is supplied, one will be automatically generated.
  - `node_filters` NodeFilters: NodeFilters represents filters that determine which nodes will be included in the result. Nodes must match all specified filters to be included. If no filters are specified, all nodes will be included. Note that only nodes which have been appropriately classified and synchronized with Comply will be included.
    - `environments` string[], nullable: If specified, only nodes in at least one of the given environments will be included.
    - `name` string[], nullable: If specified, only the node with the given name will be included.
    - `node_groups` string[], nullable: If specified, only nodes in at least one of the given node groups will be included.
    - `operating_systems` string[], nullable: If specified, only nodes of the given operating systems will be included. Each operating system must be specified as a string with the name and version separated by a space.
  - `type` 'compliance_status_detailed' | 'compliance_status_summary', required: The type of export to be generated. `compliance_status_detailed` includes the status of each rule for each node, whereas `compliance_status_summary` includes just the compliance scores for each node.

## Response `201`

CreateExportJobResponse represents the response to a create export job request.

- object
  - `created_at` string, date-time, required: The time at which the export job was created.
  - `description` string, required: A description of the export to be generated.
  - `export_file_location` string, nullable: The location of the generated export file for download, if the export job has finished successfully.
  - `id` integer, required: The ID of the export job.
  - `name` string, required: The name of the export to be generated.
  - `node_filters` NodeFilters, required: NodeFilters represents filters that determine which nodes will be included in the result. Nodes must match all specified filters to be included. If no filters are specified, all nodes will be included. Note that only nodes which have been appropriately classified and synchronized with Comply will be included.
    - `environments` string[], nullable: If specified, only nodes in at least one of the given environments will be included.
    - `name` string[], nullable: If specified, only the node with the given name will be included.
    - `node_groups` string[], nullable: If specified, only nodes in at least one of the given node groups will be included.
    - `operating_systems` string[], nullable: If specified, only nodes of the given operating systems will be included. Each operating system must be specified as a string with the name and version separated by a space.
  - `status` 'queued' | 'processing' | 'successful' | 'failed', required: The status of the export job.
  - `type` 'compliance_status_detailed' | 'compliance_status_summary', required: The type of export to be generated.

## Other responses

- `default`: ErrorResponse is the default error response.

---

[API](https://skmtc.dev/puppet/apis/puppet-comply-api.md) - [All operations](https://skmtc.dev/puppet/apis/puppet-comply-api/llms.txt) - [OpenAPI document](https://skmtc.dev/puppet/apis/puppet-comply-api/revisions/0a7ac90117d7?raw)
