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

# POST /CreateAgentSpace

`POST /CreateAgentSpace`

Creates a new agent space. An agent space is a dedicated workspace for securing a specific application.

## Request body

- object
  - `name` string, required — Name of an agent space.
  - `description` string — A description of the agent space.
  - `awsResources` object — The AWS resources associated with an agent space, including VPCs, log groups, S3 buckets, secrets, Lambda functions, and IAM roles.
    - `vpcs` VpcConfig[] — The VPC configurations associated with the agent space.
      - `vpcArn` string — The Amazon Resource Name (ARN) of the VPC.
      - `securityGroupArns` SecurityGroupArn[] — The Amazon Resource Names (ARNs) of the security groups for the VPC configuration.
      - `subnetArns` SubnetArn[] — The Amazon Resource Names (ARNs) of the subnets for the VPC configuration.
    - `logGroups` LogGroupArn[] — The Amazon Resource Names (ARNs) of the CloudWatch log groups associated with the agent space.
    - `s3Buckets` S3BucketArn[] — The Amazon Resource Names (ARNs) of the S3 buckets associated with the agent space.
    - `secretArns` SecretArn[] — The Amazon Resource Names (ARNs) of the Secrets Manager secrets associated with the agent space.
    - `lambdaFunctionArns` LambdaFunctionArn[] — The Amazon Resource Names (ARNs) of the Lambda functions associated with the agent space.
    - `iamRoles` ServiceRole[] — The IAM roles associated with the agent space.
  - `targetDomainIds` String[] — List of target domain IDs.
  - `codeReviewSettings` object — The code review settings for an agent space, controlling which types of scanning are enabled.
    - `controlsScanning` boolean — Indicates whether controls scanning is enabled for code reviews.
    - `generalPurposeScanning` boolean — Indicates whether general-purpose scanning is enabled for code reviews.
  - `kmsKeyId` string — Identifier of a KMS key. Can be a key ID, key ARN, alias name, or alias ARN.
  - `tags` object — Map of tags for a resource.

## Response `200`

Success

- CreateAgentSpaceOutput — Output for the CreateAgentSpace operation.
  - `agentSpaceId` string, required — The unique identifier of the created agent space.
  - `name` string, required — The name of the agent space.
  - `description` string — The description of the agent space.
  - `awsResources` object — The AWS resources associated with the agent space.
    - `vpcs` VpcConfig[] — The VPC configurations associated with the agent space.
      - `vpcArn` string — The Amazon Resource Name (ARN) of the VPC.
      - `securityGroupArns` SecurityGroupArn[] — The Amazon Resource Names (ARNs) of the security groups for the VPC configuration.
      - `subnetArns` SubnetArn[] — The Amazon Resource Names (ARNs) of the subnets for the VPC configuration.
    - `logGroups` LogGroupArn[] — The Amazon Resource Names (ARNs) of the CloudWatch log groups associated with the agent space.
    - `s3Buckets` S3BucketArn[] — The Amazon Resource Names (ARNs) of the S3 buckets associated with the agent space.
    - `secretArns` SecretArn[] — The Amazon Resource Names (ARNs) of the Secrets Manager secrets associated with the agent space.
    - `lambdaFunctionArns` LambdaFunctionArn[] — The Amazon Resource Names (ARNs) of the Lambda functions associated with the agent space.
    - `iamRoles` ServiceRole[] — The IAM roles associated with the agent space.
  - `targetDomainIds` String[] — The list of target domain identifiers associated with the agent space.
  - `codeReviewSettings` object — The code review settings for the agent space.
    - `controlsScanning` boolean, required — Indicates whether controls scanning is enabled for code reviews.
    - `generalPurposeScanning` boolean, required — Indicates whether general-purpose scanning is enabled for code reviews.
  - `kmsKeyId` string — The identifier of the AWS KMS key used to encrypt data in the agent space.
  - `createdAt` string, date-time — The date and time the agent space was created, in UTC format.
  - `updatedAt` string, date-time — The date and time the agent space was last updated, in UTC format.

---

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