# Targeting Keys

Manage targeting keys

## Get targeting keys of the account

> Return the list of the targeting keys of the account

```json
{"openapi":"3.0.0","info":{"title":"Flagship - Remote Control API","version":"1.0"},"tags":[{"name":"Targeting Keys","description":"Manage targeting keys"}],"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"},"Key":{"required":["type","name","description"],"properties":{"id":{"description":"ID of the targeting_key","type":"string","readOnly":true},"type":{"description":"Type of the targeting_key","type":"string","enum":["string","boolean","number"]},"name":{"description":"Name of the targeting key","type":"string"},"description":{"description":"Description of the targeting key","type":"string"}},"type":"object"}}},"paths":{"/accounts/{account_id}/targeting_keys":{"get":{"tags":["Targeting Keys"],"summary":"Get targeting keys of the account","description":"Return the list of the targeting keys of the account","operationId":"fe893f1764b5194d312e572c51054f24","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/Key"}}},"type":"object"}]}}}},"404":{"description":"Not Found"}}}}}}
```

## Create one/multiple targeting key(s)

> Create one/multiple targeting key(s)

```json
{"openapi":"3.0.0","info":{"title":"Flagship - Remote Control API","version":"1.0"},"tags":[{"name":"Targeting Keys","description":"Manage targeting keys"}],"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":{"KeyWithMultiple":{"allOf":[{"properties":{"targeting_keys":{"description":"List of targeting keys (use this if you want to add multiple targeting keys at once)","type":"array","items":{"$ref":"#/components/schemas/Key"}}},"type":"object"},{"$ref":"#/components/schemas/Key"}]},"Key":{"required":["type","name","description"],"properties":{"id":{"description":"ID of the targeting_key","type":"string","readOnly":true},"type":{"description":"Type of the targeting_key","type":"string","enum":["string","boolean","number"]},"name":{"description":"Name of the targeting key","type":"string"},"description":{"description":"Description of the targeting key","type":"string"}},"type":"object"}}},"paths":{"/accounts/{account_id}/targeting_keys":{"post":{"tags":["Targeting Keys"],"summary":"Create one/multiple targeting key(s)","description":"Create one/multiple targeting key(s)","operationId":"30ab0a9c107bb0cc8c4a0be7c133e138","parameters":[{"$ref":"#/components/parameters/account_id"}],"requestBody":{"description":"Informations of the targeting key","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyWithMultiple"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Key"}}}},"400":{"description":"Validation errors"}}}}}}
```

## Get one targeting key

> Return one targeting key by its id

```json
{"openapi":"3.0.0","info":{"title":"Flagship - Remote Control API","version":"1.0"},"tags":[{"name":"Targeting Keys","description":"Manage targeting keys"}],"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"}},"targeting_key_id":{"name":"targeting_key_id","in":"path","description":"The ID of the targeting_key","required":true,"schema":{"type":"string"}}},"schemas":{"Key":{"required":["type","name","description"],"properties":{"id":{"description":"ID of the targeting_key","type":"string","readOnly":true},"type":{"description":"Type of the targeting_key","type":"string","enum":["string","boolean","number"]},"name":{"description":"Name of the targeting key","type":"string"},"description":{"description":"Description of the targeting key","type":"string"}},"type":"object"}}},"paths":{"/accounts/{account_id}/targeting_keys/{targeting_key_id}":{"get":{"tags":["Targeting Keys"],"summary":"Get one targeting key","description":"Return one targeting key by its id","operationId":"dd80a3af6eee6e111ede63da242a6202","parameters":[{"$ref":"#/components/parameters/account_id"},{"$ref":"#/components/parameters/targeting_key_id"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Key"}}}},"404":{"description":"Not Found"}}}}}}
```

## Delete a targeting key

> Delete a targeting key by its id.

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

## Update a targeting key

> Update targeting key 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":"Targeting Keys","description":"Manage targeting keys"}],"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"}},"targeting_key_id":{"name":"targeting_key_id","in":"path","description":"The ID of the targeting_key","required":true,"schema":{"type":"string"}}},"schemas":{"Key":{"required":["type","name","description"],"properties":{"id":{"description":"ID of the targeting_key","type":"string","readOnly":true},"type":{"description":"Type of the targeting_key","type":"string","enum":["string","boolean","number"]},"name":{"description":"Name of the targeting key","type":"string"},"description":{"description":"Description of the targeting key","type":"string"}},"type":"object"}}},"paths":{"/accounts/{account_id}/targeting_keys/{targeting_key_id}":{"patch":{"tags":["Targeting Keys"],"summary":"Update a targeting key","description":"Update targeting key informations - You can set only the properies you want to update in the request body.","operationId":"8f512e752e72aa481c7e632f27a2a4f7","parameters":[{"$ref":"#/components/parameters/account_id"},{"$ref":"#/components/parameters/targeting_key_id"}],"requestBody":{"description":"Informations of the targeting key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Key"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Key"}}}},"400":{"description":"Validation errors"}}}}}}
```


---

# 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/targeting-keys.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.
