# Flags

Manage flags

## Get flags of the account

> Return the list of the flags of the account

```json
{"openapi":"3.0.0","info":{"title":"Flagship - Remote Control API","version":"1.0"},"tags":[{"name":"Flags","description":"Manage flags"}],"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"}},"_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"},"Flag":{"required":["name","type","source","description"],"properties":{"id":{"description":"ID of the flag","type":"string","readOnly":true},"name":{"description":"Name of the flag","type":"string"},"description":{"description":"Description of the flag","type":"string"},"type":{"description":"Type of the flag","type":"string","enum":["string","boolean","number","array","object"]},"source":{"description":"Source of the flag","type":"string","enum":["manual","cli"]},"default_value":{"description":"Default value of the flag (default value is only supported for string type)","type":"string"},"created_at":{"description":"Creation date of the flag","type":"string","format":"date-time","readOnly":true}},"type":"object"}}},"paths":{"/accounts/{account_id}/flags":{"get":{"tags":["Flags"],"summary":"Get flags of the account","description":"Return the list of the flags of the account","operationId":"2d21ba23be976e0dcafc39818a41067c","parameters":[{"$ref":"#/components/parameters/account_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/Flag"}}},"type":"object"}]}}}},"404":{"description":"Not Found"}}}}}}
```

## Create one/multiple flag(s)

> Create one/multiple flag(s)

```json
{"openapi":"3.0.0","info":{"title":"Flagship - Remote Control API","version":"1.0"},"tags":[{"name":"Flags","description":"Manage flags"}],"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"}}},"schemas":{"FlagWithMultiple":{"allOf":[{"properties":{"flags":{"description":"List of flags (use this if you want to add multiple flags at once)","type":"array","items":{"$ref":"#/components/schemas/Flag"}}},"type":"object"},{"$ref":"#/components/schemas/Flag"}]},"Flag":{"required":["name","type","source","description"],"properties":{"id":{"description":"ID of the flag","type":"string","readOnly":true},"name":{"description":"Name of the flag","type":"string"},"description":{"description":"Description of the flag","type":"string"},"type":{"description":"Type of the flag","type":"string","enum":["string","boolean","number","array","object"]},"source":{"description":"Source of the flag","type":"string","enum":["manual","cli"]},"default_value":{"description":"Default value of the flag (default value is only supported for string type)","type":"string"},"created_at":{"description":"Creation date of the flag","type":"string","format":"date-time","readOnly":true}},"type":"object"}}},"paths":{"/accounts/{account_id}/flags":{"post":{"tags":["Flags"],"summary":"Create one/multiple flag(s)","description":"Create one/multiple flag(s)","operationId":"8246a32042eb3d192ac22194d8b2b5bb","parameters":[{"$ref":"#/components/parameters/account_id"}],"requestBody":{"description":"Informations of the flag","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagWithMultiple"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Flag"}}}},"400":{"description":"Validation errors"}}}}}}
```

## Get flags usages of the account

> Return the list of the flag usages of the account

```json
{"openapi":"3.0.0","info":{"title":"Flagship - Remote Control API","version":"1.0"},"tags":[{"name":"Flags","description":"Manage flags"}],"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"}},"_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"},"FlagUsage":{"properties":{"id":{"description":"ID of the flag usage","type":"string","readOnly":true},"flagKey":{"description":"Key of the flag usage","type":"string"},"filePath":{"description":"File path of the flag usage (in client client)","type":"string"},"lineNumber":{"description":"Line of the flag usage (in client client)","type":"string"},"codeLineHighlight":{"description":"Line of code to highlight for the flag usage (in client client)","type":"string"},"code":{"description":"Code of the flag usage (in client client)","type":"string"}},"type":"object"}}},"paths":{"/accounts/{account_id}/flags/usage":{"get":{"tags":["Flags"],"summary":"Get flags usages of the account","description":"Return the list of the flag usages of the account","operationId":"89a85a94f8e07d1f152595219ea0825c","parameters":[{"$ref":"#/components/parameters/account_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/FlagUsage"}}},"type":"object"}]}}}},"404":{"description":"Not Found"}}}}}}
```

## Get one flag

> Return one flag key by its id

```json
{"openapi":"3.0.0","info":{"title":"Flagship - Remote Control API","version":"1.0"},"tags":[{"name":"Flags","description":"Manage flags"}],"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"}},"flag_id":{"name":"flag_id","in":"path","description":"The ID of the flag","required":true,"schema":{"type":"string"}}},"schemas":{"Flag":{"required":["name","type","source","description"],"properties":{"id":{"description":"ID of the flag","type":"string","readOnly":true},"name":{"description":"Name of the flag","type":"string"},"description":{"description":"Description of the flag","type":"string"},"type":{"description":"Type of the flag","type":"string","enum":["string","boolean","number","array","object"]},"source":{"description":"Source of the flag","type":"string","enum":["manual","cli"]},"default_value":{"description":"Default value of the flag (default value is only supported for string type)","type":"string"},"created_at":{"description":"Creation date of the flag","type":"string","format":"date-time","readOnly":true}},"type":"object"}}},"paths":{"/accounts/{account_id}/flags/{flag_id}":{"get":{"tags":["Flags"],"summary":"Get one flag","description":"Return one flag key by its id","operationId":"71c77e0e9ace49e63771ca88685fb6a7","parameters":[{"$ref":"#/components/parameters/account_id"},{"$ref":"#/components/parameters/flag_id"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Flag"}}}},"404":{"description":"Not Found"}}}}}}
```

## Delete a flag

> Delete a flag by its id.

```json
{"openapi":"3.0.0","info":{"title":"Flagship - Remote Control API","version":"1.0"},"tags":[{"name":"Flags","description":"Manage flags"}],"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"}},"flag_id":{"name":"flag_id","in":"path","description":"The ID of the flag","required":true,"schema":{"type":"string"}}}},"paths":{"/accounts/{account_id}/flags/{flag_id}":{"delete":{"tags":["Flags"],"summary":"Delete a flag","description":"Delete a flag by its id.","operationId":"47fc46969c4b7de919a8d471326d8477","parameters":[{"$ref":"#/components/parameters/account_id"},{"$ref":"#/components/parameters/flag_id"}],"responses":{"204":{"description":"Deleted"},"404":{"description":"Not Found"}}}}}}
```

## Update a flag

> Update flag informations - You can set only the properies you want to update in the request body.

```json
{"openapi":"3.0.0","info":{"title":"Flagship - Remote Control API","version":"1.0"},"tags":[{"name":"Flags","description":"Manage flags"}],"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"}},"flag_id":{"name":"flag_id","in":"path","description":"The ID of the flag","required":true,"schema":{"type":"string"}}},"schemas":{"Flag":{"required":["name","type","source","description"],"properties":{"id":{"description":"ID of the flag","type":"string","readOnly":true},"name":{"description":"Name of the flag","type":"string"},"description":{"description":"Description of the flag","type":"string"},"type":{"description":"Type of the flag","type":"string","enum":["string","boolean","number","array","object"]},"source":{"description":"Source of the flag","type":"string","enum":["manual","cli"]},"default_value":{"description":"Default value of the flag (default value is only supported for string type)","type":"string"},"created_at":{"description":"Creation date of the flag","type":"string","format":"date-time","readOnly":true}},"type":"object"}}},"paths":{"/accounts/{account_id}/flags/{flag_id}":{"patch":{"tags":["Flags"],"summary":"Update a flag","description":"Update flag informations - You can set only the properies you want to update in the request body.","operationId":"2f1a4827ee3d88e73f649900abcacf76","parameters":[{"$ref":"#/components/parameters/account_id"},{"$ref":"#/components/parameters/flag_id"}],"requestBody":{"description":"Informations of the flag","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Flag"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Flag"}}}},"400":{"description":"Validation errors"}}}}}}
```

## Get flag usages of the account environment

> Return the list of the flag usages of the account environment

```json
{"openapi":"3.0.0","info":{"title":"Flagship - Remote Control API","version":"1.0"},"tags":[{"name":"Flags","description":"Manage flags"}],"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"},"FlagUsage":{"properties":{"id":{"description":"ID of the flag usage","type":"string","readOnly":true},"flagKey":{"description":"Key of the flag usage","type":"string"},"filePath":{"description":"File path of the flag usage (in client client)","type":"string"},"lineNumber":{"description":"Line of the flag usage (in client client)","type":"string"},"codeLineHighlight":{"description":"Line of code to highlight for the flag usage (in client client)","type":"string"},"code":{"description":"Code of the flag usage (in client client)","type":"string"}},"type":"object"}}},"paths":{"/accounts/{account_id}/account_environments/{account_environment_id}/flags_usage":{"get":{"tags":["Flags"],"summary":"Get flag usages of the account environment","description":"Return the list of the flag usages of the account environment","operationId":"6ed259609d1b2beff21a3ea34c450596","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/FlagUsage"}}},"type":"object"}]}}}},"404":{"description":"Not Found"}}}}}}
```

## Update flag usages

> Update flag usages

```json
{"openapi":"3.0.0","info":{"title":"Flagship - Remote Control API","version":"1.0"},"tags":[{"name":"Flags","description":"Manage flags"}],"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":{"FlagUsageGroup":{"properties":{"repositoryUrl":{"description":"Git repository url of the flag usage (in client client)","type":"string"},"repositoryBranch":{"description":"Git branch of the flag usage (in client client)","type":"string"},"flags":{"description":"List of flags (array with flagKey, filePath, lineNumber, codeLineHighlight, code. See FlagUsage model)","type":"array","items":{"$ref":"#/components/schemas/FlagUsage"}}},"type":"object"},"FlagUsage":{"properties":{"id":{"description":"ID of the flag usage","type":"string","readOnly":true},"flagKey":{"description":"Key of the flag usage","type":"string"},"filePath":{"description":"File path of the flag usage (in client client)","type":"string"},"lineNumber":{"description":"Line of the flag usage (in client client)","type":"string"},"codeLineHighlight":{"description":"Line of code to highlight for the flag usage (in client client)","type":"string"},"code":{"description":"Code of the flag usage (in client client)","type":"string"}},"type":"object"}}},"paths":{"/accounts/{account_id}/account_environments/{account_environment_id}/flags_usage":{"post":{"tags":["Flags"],"summary":"Update flag usages","description":"Update flag usages","operationId":"45aa2c7d49625ea5736102a7f8d6f1fd","parameters":[{"$ref":"#/components/parameters/account_id"},{"$ref":"#/components/parameters/account_environment_id"}],"requestBody":{"description":"Informations of the flag usages","required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FlagUsageGroup"}}}}},"responses":{"201":{"description":"Created"},"400":{"description":"Validation errors"}}}}}}
```

## Get one flag usage

> Return list of flag usages key by its key

```json
{"openapi":"3.0.0","info":{"title":"Flagship - Remote Control API","version":"1.0"},"tags":[{"name":"Flags","description":"Manage flags"}],"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":{"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"},"FlagUsage":{"properties":{"id":{"description":"ID of the flag usage","type":"string","readOnly":true},"flagKey":{"description":"Key of the flag usage","type":"string"},"filePath":{"description":"File path of the flag usage (in client client)","type":"string"},"lineNumber":{"description":"Line of the flag usage (in client client)","type":"string"},"codeLineHighlight":{"description":"Line of code to highlight for the flag usage (in client client)","type":"string"},"code":{"description":"Code of the flag usage (in client client)","type":"string"}},"type":"object"}}},"paths":{"/accounts/{account_id}/account_environments/{account_environment_id}/flags_usage/{flag_key}":{"get":{"tags":["Flags"],"summary":"Get one flag usage","description":"Return list of flag usages key by its key","operationId":"ac205a33f3649e953329d3f08204049d","parameters":[{"$ref":"#/components/parameters/account_id"},{"$ref":"#/components/parameters/account_environment_id"},{"name":"flag_key","in":"path","description":"The key of the flag","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ItemCollection"},{"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FlagUsage"}}},"type":"object"}]}}}},"404":{"description":"Not Found"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.abtasty.com/server-side/remote-control-api/flags.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
