# TURN ## List TURN Keys `calls.turn.list(TURNListParams**kwargs) -> SyncSinglePage[TURNListResponse]` **get** `/accounts/{account_id}/calls/turn_keys` Lists all TURN keys in the Cloudflare account ### Parameters - `account_id: str` The account identifier tag. ### Returns - `class TURNListResponse: …` - `created: Optional[datetime]` The date and time the item was created. - `modified: Optional[datetime]` The date and time the item was last modified. - `name: Optional[str]` A short description of Calls app, not shown to end users. - `uid: Optional[str]` A Cloudflare-generated unique identifier for a item. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.calls.turn.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) page = page.result[0] print(page.uid) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "created": "2014-01-02T02:20:00Z", "modified": "2014-01-02T02:20:00Z", "name": "production-realtime-app", "uid": "2a95132c15732412d22c1476fa83f27a" } ] } ``` ## Retrieve TURN key details `calls.turn.get(strkey_id, TURNGetParams**kwargs) -> TURNGetResponse` **get** `/accounts/{account_id}/calls/turn_keys/{key_id}` Fetches details for a single TURN key. ### Parameters - `account_id: str` The account identifier tag. - `key_id: str` A Cloudflare-generated unique identifier for a item. ### Returns - `class TURNGetResponse: …` - `created: Optional[datetime]` The date and time the item was created. - `modified: Optional[datetime]` The date and time the item was last modified. - `name: Optional[str]` A short description of Calls app, not shown to end users. - `uid: Optional[str]` A Cloudflare-generated unique identifier for a item. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) turn = client.calls.turn.get( key_id="2a95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(turn.uid) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "created": "2014-01-02T02:20:00Z", "modified": "2014-01-02T02:20:00Z", "name": "production-realtime-app", "uid": "2a95132c15732412d22c1476fa83f27a" } } ``` ## Create a new TURN key `calls.turn.create(TURNCreateParams**kwargs) -> TURNCreateResponse` **post** `/accounts/{account_id}/calls/turn_keys` Creates a new Cloudflare Calls TURN key. ### Parameters - `account_id: str` The account identifier tag. - `name: Optional[str]` A short description of a TURN key, not shown to end users. ### Returns - `class TURNCreateResponse: …` - `created: Optional[datetime]` The date and time the item was created. - `key: Optional[str]` Bearer token - `modified: Optional[datetime]` The date and time the item was last modified. - `name: Optional[str]` A short description of a TURN key, not shown to end users. - `uid: Optional[str]` A Cloudflare-generated unique identifier for a item. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) turn = client.calls.turn.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(turn.uid) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "created": "2014-01-02T02:20:00Z", "key": "66bcf64aa8907b9f9d90ac17746a77ce394c393b92b3916633dc02846e608ad4", "modified": "2014-01-02T02:20:00Z", "name": "my-turn-key", "uid": "2a95132c15732412d22c1476fa83f27a" } } ``` ## Edit TURN key details `calls.turn.update(strkey_id, TURNUpdateParams**kwargs) -> TURNUpdateResponse` **put** `/accounts/{account_id}/calls/turn_keys/{key_id}` Edit details for a single TURN key. ### Parameters - `account_id: str` The account identifier tag. - `key_id: str` A Cloudflare-generated unique identifier for a item. - `name: Optional[str]` A short description of a TURN key, not shown to end users. ### Returns - `class TURNUpdateResponse: …` - `created: Optional[datetime]` The date and time the item was created. - `modified: Optional[datetime]` The date and time the item was last modified. - `name: Optional[str]` A short description of Calls app, not shown to end users. - `uid: Optional[str]` A Cloudflare-generated unique identifier for a item. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) turn = client.calls.turn.update( key_id="2a95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(turn.uid) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "created": "2014-01-02T02:20:00Z", "modified": "2014-01-02T02:20:00Z", "name": "production-realtime-app", "uid": "2a95132c15732412d22c1476fa83f27a" } } ``` ## Delete TURN key `calls.turn.delete(strkey_id, TURNDeleteParams**kwargs) -> TURNDeleteResponse` **delete** `/accounts/{account_id}/calls/turn_keys/{key_id}` Deletes a TURN key from Cloudflare Calls ### Parameters - `account_id: str` The account identifier tag. - `key_id: str` A Cloudflare-generated unique identifier for a item. ### Returns - `class TURNDeleteResponse: …` - `created: Optional[datetime]` The date and time the item was created. - `modified: Optional[datetime]` The date and time the item was last modified. - `name: Optional[str]` A short description of Calls app, not shown to end users. - `uid: Optional[str]` A Cloudflare-generated unique identifier for a item. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) turn = client.calls.turn.delete( key_id="2a95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(turn.uid) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "created": "2014-01-02T02:20:00Z", "modified": "2014-01-02T02:20:00Z", "name": "production-realtime-app", "uid": "2a95132c15732412d22c1476fa83f27a" } } ``` ## Domain Types ### TURN List Response - `class TURNListResponse: …` - `created: Optional[datetime]` The date and time the item was created. - `modified: Optional[datetime]` The date and time the item was last modified. - `name: Optional[str]` A short description of Calls app, not shown to end users. - `uid: Optional[str]` A Cloudflare-generated unique identifier for a item. ### TURN Get Response - `class TURNGetResponse: …` - `created: Optional[datetime]` The date and time the item was created. - `modified: Optional[datetime]` The date and time the item was last modified. - `name: Optional[str]` A short description of Calls app, not shown to end users. - `uid: Optional[str]` A Cloudflare-generated unique identifier for a item. ### TURN Create Response - `class TURNCreateResponse: …` - `created: Optional[datetime]` The date and time the item was created. - `key: Optional[str]` Bearer token - `modified: Optional[datetime]` The date and time the item was last modified. - `name: Optional[str]` A short description of a TURN key, not shown to end users. - `uid: Optional[str]` A Cloudflare-generated unique identifier for a item. ### TURN Update Response - `class TURNUpdateResponse: …` - `created: Optional[datetime]` The date and time the item was created. - `modified: Optional[datetime]` The date and time the item was last modified. - `name: Optional[str]` A short description of Calls app, not shown to end users. - `uid: Optional[str]` A Cloudflare-generated unique identifier for a item. ### TURN Delete Response - `class TURNDeleteResponse: …` - `created: Optional[datetime]` The date and time the item was created. - `modified: Optional[datetime]` The date and time the item was last modified. - `name: Optional[str]` A short description of Calls app, not shown to end users. - `uid: Optional[str]` A Cloudflare-generated unique identifier for a item.