

# CreateBatchSegmentJob


Creates a batch segment job. The operation can handle up to 50 million records and the input file must be in JSON format. For more information, see [Getting batch recommendations and user segments](https://docs.aws.amazon.com/personalize/latest/dg/recommendations-batch.html).

## Request Syntax


```
{
   "filterArn": "string",
   "jobInput": { 
      "s3DataSource": { 
         "kmsKeyArn": "string",
         "path": "string"
      }
   },
   "jobName": "string",
   "jobOutput": { 
      "s3DataDestination": { 
         "kmsKeyArn": "string",
         "path": "string"
      }
   },
   "numResults": number,
   "roleArn": "string",
   "solutionVersionArn": "string",
   "tags": [ 
      { 
         "tagKey": "string",
         "tagValue": "string"
      }
   ]
}
```

## Request Parameters


The request accepts the following data in JSON format.

 ** [filterArn](#API_CreateBatchSegmentJob_RequestSyntax) **   <a name="personalize-CreateBatchSegmentJob-request-filterArn"></a>
The ARN of the filter to apply to the batch segment job. For more information on using filters, see [Filtering batch recommendations](https://docs.aws.amazon.com/personalize/latest/dg/filter-batch.html).  
Type: String  
Length Constraints: Maximum length of 256.  
Pattern: `arn:([a-z\d-]+):personalize:.*:.*:.+`   
Required: No

 ** [jobInput](#API_CreateBatchSegmentJob_RequestSyntax) **   <a name="personalize-CreateBatchSegmentJob-request-jobInput"></a>
The Amazon S3 path for the input data used to generate the batch segment job.  
Type: [BatchSegmentJobInput](API_BatchSegmentJobInput.md) object  
Required: Yes

 ** [jobName](#API_CreateBatchSegmentJob_RequestSyntax) **   <a name="personalize-CreateBatchSegmentJob-request-jobName"></a>
The name of the batch segment job to create.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 63.  
Pattern: `^[a-zA-Z0-9][a-zA-Z0-9\-_]*`   
Required: Yes

 ** [jobOutput](#API_CreateBatchSegmentJob_RequestSyntax) **   <a name="personalize-CreateBatchSegmentJob-request-jobOutput"></a>
The Amazon S3 path for the bucket where the job's output will be stored.  
Type: [BatchSegmentJobOutput](API_BatchSegmentJobOutput.md) object  
Required: Yes

 ** [numResults](#API_CreateBatchSegmentJob_RequestSyntax) **   <a name="personalize-CreateBatchSegmentJob-request-numResults"></a>
The number of predicted users generated by the batch segment job for each line of input data. The maximum number of users per segment is 5 million.  
Type: Integer  
Required: No

 ** [roleArn](#API_CreateBatchSegmentJob_RequestSyntax) **   <a name="personalize-CreateBatchSegmentJob-request-roleArn"></a>
The ARN of the Amazon Identity and Access Management role that has permissions to read and write to your input and output Amazon S3 buckets respectively.  
Type: String  
Length Constraints: Maximum length of 256.  
Pattern: `arn:([a-z\d-]+):iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+`   
Required: Yes

 ** [solutionVersionArn](#API_CreateBatchSegmentJob_RequestSyntax) **   <a name="personalize-CreateBatchSegmentJob-request-solutionVersionArn"></a>
The Amazon Resource Name (ARN) of the solution version you want the batch segment job to use to generate batch segments.  
Type: String  
Length Constraints: Maximum length of 256.  
Pattern: `arn:([a-z\d-]+):personalize:.*:.*:.+`   
Required: Yes

 ** [tags](#API_CreateBatchSegmentJob_RequestSyntax) **   <a name="personalize-CreateBatchSegmentJob-request-tags"></a>
A list of [tags](https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html) to apply to the batch segment job.  
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 200 items.  
Required: No

## Response Syntax


```
{
   "batchSegmentJobArn": "string"
}
```

## Response Elements


If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [batchSegmentJobArn](#API_CreateBatchSegmentJob_ResponseSyntax) **   <a name="personalize-CreateBatchSegmentJob-response-batchSegmentJobArn"></a>
The ARN of the batch segment job.  
Type: String  
Length Constraints: Maximum length of 256.  
Pattern: `arn:([a-z\d-]+):personalize:.*:.*:.+` 

## Errors


 ** InvalidInputException **   
Provide a valid value for the field or parameter.  
HTTP Status Code: 400

 ** LimitExceededException **   
The limit on the number of requests per second has been exceeded.  
HTTP Status Code: 400

 ** ResourceAlreadyExistsException **   
The specified resource already exists.  
HTTP Status Code: 400

 ** ResourceInUseException **   
The specified resource is in use.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
Could not find the specified resource.  
HTTP Status Code: 400

 ** TooManyTagsException **   
You have exceeded the maximum number of tags you can apply to this resource.   
HTTP Status Code: 400

## See Also


For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/personalize-2018-05-22/CreateBatchSegmentJob) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/personalize-2018-05-22/CreateBatchSegmentJob) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/personalize-2018-05-22/CreateBatchSegmentJob) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/personalize-2018-05-22/CreateBatchSegmentJob) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/personalize-2018-05-22/CreateBatchSegmentJob) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/personalize-2018-05-22/CreateBatchSegmentJob) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/personalize-2018-05-22/CreateBatchSegmentJob) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/personalize-2018-05-22/CreateBatchSegmentJob) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/personalize-2018-05-22/CreateBatchSegmentJob) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/personalize-2018-05-22/CreateBatchSegmentJob) 