# Method: projects.locations.deployments.importState

- [HTTP request](https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deployments/importState#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deployments/importState#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deployments/importState#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deployments/importState#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deployments/importState#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deployments/importState#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deployments/importState#body.aspect_1)
- [Try it!](https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deployments/importState#try-it)

Imports Terraform state file in a given deployment. The state file does not take effect until the Deployment has been unlocked.

### HTTP request

`POST https://config.googleapis.com/v1/{parent=projects/*/locations/*/deployments/*}:importState`

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

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The parent in whose context the statefile is listed. The parent value is in the format: 'projects/{projectId}/locations/{location}/deployments/{deployment}'. It takes the form `projects/{project}/locations/{location}/deployments/{deployment}`. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "lockId": string } ``` |

| Fields ||
|---|---|
| `lockId` | `string (https://developers.google.com/discovery/v1/type-format format)` Required. Lock ID of the lock file to verify that the user who is importing the state file previously locked the Deployment. |

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/Statefile`.

### 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:

- `config.googleapis.com/config.deployments.updateState`

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