---
title: "POST /jobs"
method: POST
path: "/jobs"
---

# POST /jobs

`POST /jobs`

Creates and defines the settings for a classification job.

## Request body

- object
  - `allowListIds` String[] — An array of unique identifiers, one for each allow list for the job to use when it analyzes data.
  - `clientToken` string, required — A unique, case-sensitive token that you provide to ensure the idempotency of the request.
  - `customDataIdentifierIds` String[] — An array of unique identifiers, one for each custom data identifier for the job to use when it analyzes data. To use only managed data identifiers, don't specify a value for this property and specify a value other than NONE for the managedDataIdentifierSelector property.
  - `description` string — A custom description of the job. The description can contain as many as 200 characters.
  - `initialRun` boolean — <p>For a recurring job, specifies whether to analyze all existing, eligible objects immediately after the job is created (true). To analyze only those objects that are created or changed after you create the job and before the job's first scheduled run, set this value to false.</p> <p>If you configure the job to run only once, don't specify a value for this property.</p>
  - `jobType` 'ONE_TIME' | 'SCHEDULED', required — The schedule for running a classification job. Valid values are:
  - `managedDataIdentifierIds` String[] — <p>An array of unique identifiers, one for each managed data identifier for the job to include (use) or exclude (not use) when it analyzes data. Inclusion or exclusion depends on the managed data identifier selection type that you specify for the job (managedDataIdentifierSelector).</p> <p>To retrieve a list of valid values for this property, use the ListManagedDataIdentifiers operation.</p>
  - `managedDataIdentifierSelector` 'ALL' | 'EXCLUDE' | 'INCLUDE' | 'NONE' — The selection type that determines which managed data identifiers a classification job uses to analyze data. Valid values are:
  - `name` string, required — A custom name for the job. The name can contain as many as 500 characters.
  - `s3JobDefinition` object, required — Specifies which S3 buckets contain the objects that a classification job analyzes, and the scope of that analysis. The bucket specification can be static (bucketDefinitions) or dynamic (bucketCriteria). If it's static, the job analyzes objects in the same predefined set of buckets each time the job runs. If it's dynamic, the job analyzes objects in any buckets that match the specified criteria each time the job starts to run.
    - `bucketCriteria` object — The property- and tag-based conditions that determine which S3 buckets to include or exclude from the analysis. Each time the job runs, the job uses these criteria to determine which buckets contain objects to analyze. A job's definition can contain a bucketCriteria object or a bucketDefinitions array, not both.
      - `excludes` object — The property- and tag-based conditions that determine which buckets to exclude from the job.
        - `and` CriteriaForJob[] — An array of conditions, one for each condition that determines which buckets to include or exclude from the job. If you specify more than one condition, Amazon Macie uses AND logic to join the conditions.
          - `simpleCriterion` object — A property-based condition that defines a property, operator, and one or more values for including or excluding buckets from the job.
            - `comparator` 'EQ' | 'GT' | 'GTE' | 'LT' | 'LTE' | 'NE' | 'CONTAINS' | 'STARTS_WITH' — The operator to use in the condition. Valid values are EQ (equals) and NE (not equals).
            - `key` 'ACCOUNT_ID' | 'S3_BUCKET_NAME' | 'S3_BUCKET_EFFECTIVE_PERMISSION' | 'S3_BUCKET_SHARED_ACCESS' — The property to use in the condition.
            - `values` String[] — <p>An array that lists one or more values to use in the condition. If you specify multiple values, Amazon Macie uses OR logic to join the values. Valid values for each supported property (key) are:</p> <ul><li><p>ACCOUNT_ID - A string that represents the unique identifier for the Amazon Web Services account that owns the bucket.</p></li> <li><p>S3_BUCKET_EFFECTIVE_PERMISSION - A string that represents an enumerated value that Macie defines for the <a href="https://docs.aws.amazon.com/macie/latest/APIReference/datasources-s3.html#datasources-s3-prop-bucketpublicaccess-effectivepermission">BucketPublicAccess.effectivePermission</a> property of a bucket.</p></li> <li><p>S3_BUCKET_NAME - A string that represents the name of a bucket.</p></li> <li><p>S3_BUCKET_SHARED_ACCESS - A string that represents an enumerated value that Macie defines for the <a href="https://docs.aws.amazon.com/macie/latest/APIReference/datasources-s3.html#datasources-s3-prop-bucketmetadata-sharedaccess">BucketMetadata.sharedAccess</a> property of a bucket.</p></li></ul> <p>Values are case sensitive. Also, Macie doesn't support use of partial values or wildcard characters in these values.</p>
          - `tagCriterion` object — A tag-based condition that defines an operator and tag keys, tag values, or tag key and value pairs for including or excluding buckets from the job.
            - `comparator` 'EQ' | 'GT' | 'GTE' | 'LT' | 'LTE' | 'NE' | 'CONTAINS' | 'STARTS_WITH' — The operator to use in the condition. Valid values are EQ (equals) and NE (not equals).
            - `tagValues` TagCriterionPairForJob[] — The tag keys, tag values, or tag key and value pairs to use in the condition.
              - …
      - `includes` object — The property- and tag-based conditions that determine which buckets to include in the job.
        - `and` CriteriaForJob[] — An array of conditions, one for each condition that determines which buckets to include or exclude from the job. If you specify more than one condition, Amazon Macie uses AND logic to join the conditions.
          - `simpleCriterion` object — A property-based condition that defines a property, operator, and one or more values for including or excluding buckets from the job.
            - `comparator` 'EQ' | 'GT' | 'GTE' | 'LT' | 'LTE' | 'NE' | 'CONTAINS' | 'STARTS_WITH' — The operator to use in the condition. Valid values are EQ (equals) and NE (not equals).
            - `key` 'ACCOUNT_ID' | 'S3_BUCKET_NAME' | 'S3_BUCKET_EFFECTIVE_PERMISSION' | 'S3_BUCKET_SHARED_ACCESS' — The property to use in the condition.
            - `values` String[] — <p>An array that lists one or more values to use in the condition. If you specify multiple values, Amazon Macie uses OR logic to join the values. Valid values for each supported property (key) are:</p> <ul><li><p>ACCOUNT_ID - A string that represents the unique identifier for the Amazon Web Services account that owns the bucket.</p></li> <li><p>S3_BUCKET_EFFECTIVE_PERMISSION - A string that represents an enumerated value that Macie defines for the <a href="https://docs.aws.amazon.com/macie/latest/APIReference/datasources-s3.html#datasources-s3-prop-bucketpublicaccess-effectivepermission">BucketPublicAccess.effectivePermission</a> property of a bucket.</p></li> <li><p>S3_BUCKET_NAME - A string that represents the name of a bucket.</p></li> <li><p>S3_BUCKET_SHARED_ACCESS - A string that represents an enumerated value that Macie defines for the <a href="https://docs.aws.amazon.com/macie/latest/APIReference/datasources-s3.html#datasources-s3-prop-bucketmetadata-sharedaccess">BucketMetadata.sharedAccess</a> property of a bucket.</p></li></ul> <p>Values are case sensitive. Also, Macie doesn't support use of partial values or wildcard characters in these values.</p>
          - `tagCriterion` object — A tag-based condition that defines an operator and tag keys, tag values, or tag key and value pairs for including or excluding buckets from the job.
            - `comparator` 'EQ' | 'GT' | 'GTE' | 'LT' | 'LTE' | 'NE' | 'CONTAINS' | 'STARTS_WITH' — The operator to use in the condition. Valid values are EQ (equals) and NE (not equals).
            - `tagValues` TagCriterionPairForJob[] — The tag keys, tag values, or tag key and value pairs to use in the condition.
              - …
    - `bucketDefinitions` S3BucketDefinitionForJob[] — An array of objects, one for each Amazon Web Services account that owns specific S3 buckets to analyze. Each object specifies the account ID for an account and one or more buckets to analyze for that account. A job's definition can contain a bucketDefinitions array or a bucketCriteria object, not both.
      - `accountId` string, required — The unique identifier for the Amazon Web Services account that owns the buckets.
      - `buckets` String[], required — An array that lists the names of the buckets.
    - `scoping` object — The property- and tag-based conditions that determine which S3 objects to include or exclude from the analysis. Each time the job runs, the job uses these criteria to determine which objects to analyze.
      - `excludes` object — The property- and tag-based conditions that determine which objects to exclude from the analysis.
        - `and` JobScopeTerm[] — An array of conditions, one for each property- or tag-based condition that determines which objects to include or exclude from the job. If you specify more than one condition, Amazon Macie uses AND logic to join the conditions.
          - `simpleScopeTerm` object — A property-based condition that defines a property, operator, and one or more values for including or excluding objects from the job.
            - `comparator` 'EQ' | 'GT' | 'GTE' | 'LT' | 'LTE' | 'NE' | 'CONTAINS' | 'STARTS_WITH' — <p>The operator to use in the condition. Valid values for each supported property (key) are:</p> <ul><li><p>OBJECT_EXTENSION - EQ (equals) or NE (not equals)</p></li> <li><p>OBJECT_KEY - STARTS_WITH</p></li> <li><p>OBJECT_LAST_MODIFIED_DATE - Any operator except CONTAINS</p></li> <li><p>OBJECT_SIZE - Any operator except CONTAINS</p></li></ul>
            - `key` 'OBJECT_EXTENSION' | 'OBJECT_LAST_MODIFIED_DATE' | 'OBJECT_SIZE' | 'OBJECT_KEY' — The object property to use in the condition.
            - `values` String[] — <p>An array that lists the values to use in the condition. If the value for the key property is OBJECT_EXTENSION or OBJECT_KEY, this array can specify multiple values and Amazon Macie uses OR logic to join the values. Otherwise, this array can specify only one value.</p> <p>Valid values for each supported property (key) are:</p> <ul><li><p>OBJECT_EXTENSION - A string that represents the file name extension of an object. For example: docx or pdf</p></li> <li><p>OBJECT_KEY - A string that represents the key prefix (folder name or path) of an object. For example: logs or awslogs/eventlogs. This value applies a condition to objects whose keys (names) begin with the specified value.</p></li> <li><p>OBJECT_LAST_MODIFIED_DATE - The date and time (in UTC and extended ISO 8601 format) when an object was created or last changed, whichever is latest. For example: 2020-09-28T14:31:13Z</p></li> <li><p>OBJECT_SIZE - An integer that represents the storage size (in bytes) of an object.</p></li></ul> <p>Macie doesn't support use of wildcard characters in these values. Also, string values are case sensitive.</p>
          - `tagScopeTerm` object — A tag-based condition that defines the operator and tag keys or tag key and value pairs for including or excluding objects from the job.
            - `comparator` 'EQ' | 'GT' | 'GTE' | 'LT' | 'LTE' | 'NE' | 'CONTAINS' | 'STARTS_WITH' — The operator to use in the condition. Valid values are EQ (equals) or NE (not equals).
            - `key` string — The object property to use in the condition. The only valid value is TAG.
            - `tagValues` TagValuePair[] — The tag keys or tag key and value pairs to use in the condition. To specify only tag keys in a condition, specify the keys in this array and set the value for each associated tag value to an empty string.
              - …
            - `target` 'S3_OBJECT' — The type of object to apply the condition to.
      - `includes` object — The property- and tag-based conditions that determine which objects to include in the analysis.
        - `and` JobScopeTerm[] — An array of conditions, one for each property- or tag-based condition that determines which objects to include or exclude from the job. If you specify more than one condition, Amazon Macie uses AND logic to join the conditions.
          - `simpleScopeTerm` object — A property-based condition that defines a property, operator, and one or more values for including or excluding objects from the job.
            - `comparator` 'EQ' | 'GT' | 'GTE' | 'LT' | 'LTE' | 'NE' | 'CONTAINS' | 'STARTS_WITH' — <p>The operator to use in the condition. Valid values for each supported property (key) are:</p> <ul><li><p>OBJECT_EXTENSION - EQ (equals) or NE (not equals)</p></li> <li><p>OBJECT_KEY - STARTS_WITH</p></li> <li><p>OBJECT_LAST_MODIFIED_DATE - Any operator except CONTAINS</p></li> <li><p>OBJECT_SIZE - Any operator except CONTAINS</p></li></ul>
            - `key` 'OBJECT_EXTENSION' | 'OBJECT_LAST_MODIFIED_DATE' | 'OBJECT_SIZE' | 'OBJECT_KEY' — The object property to use in the condition.
            - `values` String[] — <p>An array that lists the values to use in the condition. If the value for the key property is OBJECT_EXTENSION or OBJECT_KEY, this array can specify multiple values and Amazon Macie uses OR logic to join the values. Otherwise, this array can specify only one value.</p> <p>Valid values for each supported property (key) are:</p> <ul><li><p>OBJECT_EXTENSION - A string that represents the file name extension of an object. For example: docx or pdf</p></li> <li><p>OBJECT_KEY - A string that represents the key prefix (folder name or path) of an object. For example: logs or awslogs/eventlogs. This value applies a condition to objects whose keys (names) begin with the specified value.</p></li> <li><p>OBJECT_LAST_MODIFIED_DATE - The date and time (in UTC and extended ISO 8601 format) when an object was created or last changed, whichever is latest. For example: 2020-09-28T14:31:13Z</p></li> <li><p>OBJECT_SIZE - An integer that represents the storage size (in bytes) of an object.</p></li></ul> <p>Macie doesn't support use of wildcard characters in these values. Also, string values are case sensitive.</p>
          - `tagScopeTerm` object — A tag-based condition that defines the operator and tag keys or tag key and value pairs for including or excluding objects from the job.
            - `comparator` 'EQ' | 'GT' | 'GTE' | 'LT' | 'LTE' | 'NE' | 'CONTAINS' | 'STARTS_WITH' — The operator to use in the condition. Valid values are EQ (equals) or NE (not equals).
            - `key` string — The object property to use in the condition. The only valid value is TAG.
            - `tagValues` TagValuePair[] — The tag keys or tag key and value pairs to use in the condition. To specify only tag keys in a condition, specify the keys in this array and set the value for each associated tag value to an empty string.
              - …
            - `target` 'S3_OBJECT' — The type of object to apply the condition to.
  - `samplingPercentage` integer — The sampling depth, as a percentage, for the job to apply when processing objects. This value determines the percentage of eligible objects that the job analyzes. If this value is less than 100, Amazon Macie selects the objects to analyze at random, up to the specified percentage, and analyzes all the data in those objects.
  - `scheduleFrequency` object — Specifies the recurrence pattern for running a classification job.
    - `dailySchedule` object — Specifies a daily recurrence pattern for running the job.
    - `monthlySchedule` object — Specifies a monthly recurrence pattern for running the job.
      - `dayOfMonth` integer — <p>The numeric day of the month when Amazon Macie runs the job. This value can be an integer from 1 through 31.</p> <p>If this value exceeds the number of days in a certain month, Macie doesn't run the job that month. Macie runs the job only during months that have the specified day. For example, if this value is 31 and a month has only 30 days, Macie doesn't run the job that month. To run the job every month, specify a value that's less than 29.</p>
    - `weeklySchedule` object — Specifies a weekly recurrence pattern for running the job.
      - `dayOfWeek` 'SUNDAY' | 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY' — The day of the week when Amazon Macie runs the job.
  - `tags` object — A string-to-string map of key-value pairs that specifies the tags (keys and values) for an Amazon Macie resource.

## Response `200`

Success

- CreateClassificationJobResponse
  - `jobArn` string — The Amazon Resource Name (ARN) of the job.
  - `jobId` string — The unique identifier for the job.

## Other responses

- `480` — ValidationException
- `481` — InternalServerException
- `482` — ServiceQuotaExceededException
- `483` — AccessDeniedException
- `484` — ResourceNotFoundException
- `485` — ThrottlingException
- `486` — ConflictException

---

[API](https://skmtc.net/aws/apis/macie2.md) · [All operations](https://skmtc.net/aws/apis/macie2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/macie2/versions/6252cf55d8ef/schema)
