# Users

Manage users

## Get users of the account environment

> Return the list of the user of the account environment

```json
{"openapi":"3.0.0","info":{"title":"Flagship - Remote Control API","version":"1.0"},"tags":[{"name":"Users","description":"Manage users"}],"servers":[{"url":"https://api.flagship.io/v1"}],"security":[{"token":[]}],"components":{"securitySchemes":{"token":{"type":"apiKey","description":"Prefix the token with 'Bearer ' to indicate it is a bearer token","name":"Authorization","in":"header"}},"parameters":{"account_id":{"name":"account_id","in":"path","description":"The ID of the account","required":true,"schema":{"type":"string"}},"account_environment_id":{"name":"account_environment_id","in":"path","description":"The ID of the environment","required":true,"schema":{"type":"string"}},"_page":{"name":"_page","in":"query","description":"Index of the page","schema":{"type":"integer"}},"_max_per_page":{"name":"_max_per_page","in":"query","description":"Number of items per page","schema":{"type":"integer"}}},"schemas":{"ItemCollection":{"properties":{"current_item_count":{"description":"Returns the number of items in the current page","type":"integer","format":"int"},"current_page":{"description":"Returns the number of the current page","type":"integer","format":"int","default":0},"total_count":{"description":"Returns the number of total items","type":"integer","format":"int"},"items_per_page":{"title":"Items per page","description":"Returns the number of items per page","type":"integer","format":"int","default":10},"last_page":{"title":"Last page","description":"Returns the index of the page","type":"integer","format":"int"}},"type":"object"},"UserList":{"required":["data"],"properties":{"data":{"description":"List of users","type":"array","items":{"$ref":"#/components/schemas/User"}}},"type":"object"},"User":{"required":["email","role"],"properties":{"email":{"description":"Email of the user","type":"string"},"role":{"description":"Role of the user","type":"string","enum":["ACCOUNT_OWNER","SUPER_ADMIN","PROJECT_MANAGER","MEMBER","GUEST"]}},"type":"object"}}},"paths":{"/accounts/{account_id}/account_environments/{account_environment_id}/users":{"get":{"tags":["Users"],"summary":"Get users of the account environment","description":"Return the list of the user of the account environment","operationId":"0aeb678fc30329a5b3f1c04d1d29520b","parameters":[{"$ref":"#/components/parameters/account_id"},{"$ref":"#/components/parameters/account_environment_id"},{"$ref":"#/components/parameters/_page"},{"$ref":"#/components/parameters/_max_per_page"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ItemCollection"},{"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/UserList"}}},"type":"object"}]}}}},"404":{"description":"Not Found"}}}}}}
```

## Update the users of the account environment

> Update the users of the account environment. It will create automatically the users which does not exist.

```json
{"openapi":"3.0.0","info":{"title":"Flagship - Remote Control API","version":"1.0"},"tags":[{"name":"Users","description":"Manage users"}],"servers":[{"url":"https://api.flagship.io/v1"}],"security":[{"token":[]}],"components":{"securitySchemes":{"token":{"type":"apiKey","description":"Prefix the token with 'Bearer ' to indicate it is a bearer token","name":"Authorization","in":"header"}},"parameters":{"account_id":{"name":"account_id","in":"path","description":"The ID of the account","required":true,"schema":{"type":"string"}},"account_environment_id":{"name":"account_environment_id","in":"path","description":"The ID of the environment","required":true,"schema":{"type":"string"}}},"schemas":{"User":{"required":["email","role"],"properties":{"email":{"description":"Email of the user","type":"string"},"role":{"description":"Role of the user","type":"string","enum":["ACCOUNT_OWNER","SUPER_ADMIN","PROJECT_MANAGER","MEMBER","GUEST"]}},"type":"object"}}},"paths":{"/accounts/{account_id}/account_environments/{account_environment_id}/users":{"put":{"tags":["Users"],"summary":"Update the users of the account environment","description":"Update the users of the account environment. It will create automatically the users which does not exist.","operationId":"2dcfe3b154f38137fc43551187695136","parameters":[{"$ref":"#/components/parameters/account_id"},{"$ref":"#/components/parameters/account_environment_id"}],"requestBody":{"description":"Informations of the users","required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/User"}}}}},"responses":{"204":{"description":"Updated"},"404":{"description":"Not Found"}}}}}}
```

## Delete the users of the account environment

> Delete the users of the account environment. You can delete multuple users in the same time.

```json
{"openapi":"3.0.0","info":{"title":"Flagship - Remote Control API","version":"1.0"},"tags":[{"name":"Users","description":"Manage users"}],"servers":[{"url":"https://api.flagship.io/v1"}],"security":[{"token":[]}],"components":{"securitySchemes":{"token":{"type":"apiKey","description":"Prefix the token with 'Bearer ' to indicate it is a bearer token","name":"Authorization","in":"header"}},"parameters":{"account_id":{"name":"account_id","in":"path","description":"The ID of the account","required":true,"schema":{"type":"string"}},"account_environment_id":{"name":"account_environment_id","in":"path","description":"The ID of the environment","required":true,"schema":{"type":"string"}}}},"paths":{"/accounts/{account_id}/account_environments/{account_environment_id}/users":{"delete":{"tags":["Users"],"summary":"Delete the users of the account environment","description":"Delete the users of the account environment. You can delete multuple users in the same time.","operationId":"6b288f6a9df1e400b1aaa4ada1cd4487","parameters":[{"$ref":"#/components/parameters/account_id"},{"$ref":"#/components/parameters/account_environment_id"},{"name":"email[]","in":"query","description":"Email of the user to delete","schema":{"type":"array","items":{"type":"string"}}}],"responses":{"204":{"description":"Deleted"},"404":{"description":"Not Found"}}}}}}
```
