# Method: projects.locations.experiments.create

- [HTTP request](https://docs.cloud.google.com/fault-injection-testing/reference/rest/v1alpha/projects.locations.experiments/create#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/fault-injection-testing/reference/rest/v1alpha/projects.locations.experiments/create#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/fault-injection-testing/reference/rest/v1alpha/projects.locations.experiments/create#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/fault-injection-testing/reference/rest/v1alpha/projects.locations.experiments/create#body.request_body)
- [Response body](https://docs.cloud.google.com/fault-injection-testing/reference/rest/v1alpha/projects.locations.experiments/create#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/fault-injection-testing/reference/rest/v1alpha/projects.locations.experiments/create#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/fault-injection-testing/reference/rest/v1alpha/projects.locations.experiments/create#body.aspect_1)

Creates an `Experiment` and prepares it to run by identifying all cloud resources that will be affected. The `Experiment` starts in the `PREPARING` state and transitions to `PREPARED` once the resources are identified. You can then list these resources using the [`list` method for `AffectedResources`](https://docs.cloud.google.com/fault-injection-testing/reference/rest/v1alpha/projects.locations.experiments/list). To execute the `Experiment`, call [`start`](https://docs.cloud.google.com/fault-injection-testing/reference/rest/v1alpha/projects.locations.experiments/start) on the `Experiment` after it reaches the `PREPARED` state.

### HTTP request

`POST https://faulttesting.googleapis.com/v1alpha/{parent=projects/*/locations/*}/experiments`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The project and location where the experiment will be created. Format: `projects/{projectId}/locations/{location}`. |

### Query parameters

| Parameters ||
|---|---|
| `experimentId` | `string` Optional. The ID to use for the `Experiment`, which will become the final component of the resource name. If not provided, a UUID will be generated. This value should be 4-63 characters, start with a letter or number, end with a letter or number, and contain only lowercase letters, numbers, and hyphens. |

### Request body

The request body contains an instance of `https://docs.cloud.google.com/fault-injection-testing/reference/rest/v1alpha/projects.locations.experiments#Experiment`.

### Response body

If successful, the response body contains a newly created instance of `https://docs.cloud.google.com/fault-injection-testing/reference/rest/v1alpha/projects.locations.experiments#Experiment`.

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `parent` resource:

- `faulttesting.experiments.create`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).