github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/website/source/docs/enterprise/api/states.html.md (about) 1 --- 2 layout: "enterprise" 3 page_title: "State - API - Terraform Enterprise" 4 sidebar_current: "docs-enterprise-api-states" 5 description: |- 6 State represents the status of your infrastructure at the last time Terraform was run. 7 --- 8 9 # State API 10 11 State represents the status of your infrastructure at the last time Terraform 12 was run. States can be pushed to Terraform Enterprise from Terraform's CLI after 13 an apply is done locally, or state is automatically stored if the apply is done 14 in Terraform Enterprise. 15 16 ## List of States 17 18 This endpoint gets a list of states accessible to the user corresponding to the 19 provided token. 20 21 | Method | Path | 22 | :----- | :------------- | 23 | `GET` | `/terraform/state` | 24 25 ### Parameters 26 27 - `?username` `(string: "")` - Specifies the organization/username to filter 28 states 29 30 - `?page` `(int: 1)` - Specifies the pagination, which defaults to page 1. 31 32 ### Sample Requests 33 34 ```text 35 $ curl \ 36 --header "X-Atlas-Token: ..." \ 37 https://atlas.hashicorp.com/api/v1/terraform/state 38 ``` 39 40 ```text 41 $ curl \ 42 --header "X-Atlas-Token: ..." \ 43 https://atlas.hashicorp.com/api/v1/terraform/state?username=acme 44 ``` 45 46 ### Sample Response 47 48 ```json 49 { 50 "states": [ 51 { 52 "updated_at": "2017-02-03T19:52:37.693Z", 53 "environment": { 54 "username": "my-organization", 55 "name": "docs-demo-one" 56 } 57 }, 58 { 59 "updated_at": "2017-04-06T15:48:49.677Z", 60 "environment": { 61 "username": "my-organization", 62 "name": "docs-demo-two" 63 } 64 } 65 ] 66 } 67 ```