# Calls # SFU ## List apps `client.calls.sfu.list(SFUListParamsparams, RequestOptionsoptions?): SinglePage` **get** `/accounts/{account_id}/calls/apps` Lists all apps in the Cloudflare account ### Parameters - `params: SFUListParams` - `account_id: string` The account identifier tag. ### Returns - `SFUListResponse` - `created?: string` The date and time the item was created. - `modified?: string` The date and time the item was last modified. - `name?: string` A short description of Calls app, not shown to end users. - `uid?: string` A Cloudflare-generated unique identifier for a item. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const sfuListResponse of client.calls.sfu.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(sfuListResponse.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 app details `client.calls.sfu.get(stringappId, SFUGetParamsparams, RequestOptionsoptions?): SFUGetResponse` **get** `/accounts/{account_id}/calls/apps/{app_id}` Fetches details for a single Calls app. ### Parameters - `appId: string` A Cloudflare-generated unique identifier for a item. - `params: SFUGetParams` - `account_id: string` The account identifier tag. ### Returns - `SFUGetResponse` - `created?: string` The date and time the item was created. - `modified?: string` The date and time the item was last modified. - `name?: string` A short description of Calls app, not shown to end users. - `uid?: string` A Cloudflare-generated unique identifier for a item. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const sfu = await client.calls.sfu.get('2a95132c15732412d22c1476fa83f27a', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(sfu.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 app `client.calls.sfu.create(SFUCreateParamsparams, RequestOptionsoptions?): SFUCreateResponse` **post** `/accounts/{account_id}/calls/apps` Creates a new Cloudflare calls app. An app is an unique enviroment where each Session can access all Tracks within the app. ### Parameters - `params: SFUCreateParams` - `account_id: string` Path param: The account identifier tag. - `name?: string` Body param: A short description of Calls app, not shown to end users. ### Returns - `SFUCreateResponse` - `created?: string` The date and time the item was created. - `modified?: string` The date and time the item was last modified. - `name?: string` A short description of Calls app, not shown to end users. - `secret?: string` Bearer token - `uid?: string` A Cloudflare-generated unique identifier for a item. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const sfu = await client.calls.sfu.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); console.log(sfu.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", "secret": "66bcf64aa8907b9f9d90ac17746a77ce394c393b92b3916633dc02846e608ad4", "uid": "2a95132c15732412d22c1476fa83f27a" } } ``` ## Edit app details `client.calls.sfu.update(stringappId, SFUUpdateParamsparams, RequestOptionsoptions?): SFUUpdateResponse` **put** `/accounts/{account_id}/calls/apps/{app_id}` Edit details for a single app. ### Parameters - `appId: string` A Cloudflare-generated unique identifier for a item. - `params: SFUUpdateParams` - `account_id: string` Path param: The account identifier tag. - `name?: string` Body param: A short description of Calls app, not shown to end users. ### Returns - `SFUUpdateResponse` - `created?: string` The date and time the item was created. - `modified?: string` The date and time the item was last modified. - `name?: string` A short description of Calls app, not shown to end users. - `uid?: string` A Cloudflare-generated unique identifier for a item. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const sfu = await client.calls.sfu.update('2a95132c15732412d22c1476fa83f27a', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(sfu.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 app `client.calls.sfu.delete(stringappId, SFUDeleteParamsparams, RequestOptionsoptions?): SFUDeleteResponse` **delete** `/accounts/{account_id}/calls/apps/{app_id}` Deletes an app from Cloudflare Calls ### Parameters - `appId: string` A Cloudflare-generated unique identifier for a item. - `params: SFUDeleteParams` - `account_id: string` The account identifier tag. ### Returns - `SFUDeleteResponse` - `created?: string` The date and time the item was created. - `modified?: string` The date and time the item was last modified. - `name?: string` A short description of Calls app, not shown to end users. - `uid?: string` A Cloudflare-generated unique identifier for a item. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const sfu = await client.calls.sfu.delete('2a95132c15732412d22c1476fa83f27a', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(sfu.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 ### SFU List Response - `SFUListResponse` - `created?: string` The date and time the item was created. - `modified?: string` The date and time the item was last modified. - `name?: string` A short description of Calls app, not shown to end users. - `uid?: string` A Cloudflare-generated unique identifier for a item. ### SFU Get Response - `SFUGetResponse` - `created?: string` The date and time the item was created. - `modified?: string` The date and time the item was last modified. - `name?: string` A short description of Calls app, not shown to end users. - `uid?: string` A Cloudflare-generated unique identifier for a item. ### SFU Create Response - `SFUCreateResponse` - `created?: string` The date and time the item was created. - `modified?: string` The date and time the item was last modified. - `name?: string` A short description of Calls app, not shown to end users. - `secret?: string` Bearer token - `uid?: string` A Cloudflare-generated unique identifier for a item. ### SFU Update Response - `SFUUpdateResponse` - `created?: string` The date and time the item was created. - `modified?: string` The date and time the item was last modified. - `name?: string` A short description of Calls app, not shown to end users. - `uid?: string` A Cloudflare-generated unique identifier for a item. ### SFU Delete Response - `SFUDeleteResponse` - `created?: string` The date and time the item was created. - `modified?: string` The date and time the item was last modified. - `name?: string` A short description of Calls app, not shown to end users. - `uid?: string` A Cloudflare-generated unique identifier for a item. # TURN ## List TURN Keys `client.calls.turn.list(TURNListParamsparams, RequestOptionsoptions?): SinglePage` **get** `/accounts/{account_id}/calls/turn_keys` Lists all TURN keys in the Cloudflare account ### Parameters - `params: TURNListParams` - `account_id: string` The account identifier tag. ### Returns - `TURNListResponse` - `created?: string` The date and time the item was created. - `modified?: string` The date and time the item was last modified. - `name?: string` A short description of Calls app, not shown to end users. - `uid?: string` A Cloudflare-generated unique identifier for a item. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const turnListResponse of client.calls.turn.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(turnListResponse.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 `client.calls.turn.get(stringkeyId, TURNGetParamsparams, RequestOptionsoptions?): TURNGetResponse` **get** `/accounts/{account_id}/calls/turn_keys/{key_id}` Fetches details for a single TURN key. ### Parameters - `keyId: string` A Cloudflare-generated unique identifier for a item. - `params: TURNGetParams` - `account_id: string` The account identifier tag. ### Returns - `TURNGetResponse` - `created?: string` The date and time the item was created. - `modified?: string` The date and time the item was last modified. - `name?: string` A short description of Calls app, not shown to end users. - `uid?: string` A Cloudflare-generated unique identifier for a item. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const turn = await client.calls.turn.get('2a95132c15732412d22c1476fa83f27a', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(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 `client.calls.turn.create(TURNCreateParamsparams, RequestOptionsoptions?): TURNCreateResponse` **post** `/accounts/{account_id}/calls/turn_keys` Creates a new Cloudflare Calls TURN key. ### Parameters - `params: TURNCreateParams` - `account_id: string` Path param: The account identifier tag. - `name?: string` Body param: A short description of a TURN key, not shown to end users. ### Returns - `TURNCreateResponse` - `created?: string` The date and time the item was created. - `key?: string` Bearer token - `modified?: string` The date and time the item was last modified. - `name?: string` A short description of a TURN key, not shown to end users. - `uid?: string` A Cloudflare-generated unique identifier for a item. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const turn = await client.calls.turn.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); console.log(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 `client.calls.turn.update(stringkeyId, TURNUpdateParamsparams, RequestOptionsoptions?): TURNUpdateResponse` **put** `/accounts/{account_id}/calls/turn_keys/{key_id}` Edit details for a single TURN key. ### Parameters - `keyId: string` A Cloudflare-generated unique identifier for a item. - `params: TURNUpdateParams` - `account_id: string` Path param: The account identifier tag. - `name?: string` Body param: A short description of a TURN key, not shown to end users. ### Returns - `TURNUpdateResponse` - `created?: string` The date and time the item was created. - `modified?: string` The date and time the item was last modified. - `name?: string` A short description of Calls app, not shown to end users. - `uid?: string` A Cloudflare-generated unique identifier for a item. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const turn = await client.calls.turn.update('2a95132c15732412d22c1476fa83f27a', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(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 `client.calls.turn.delete(stringkeyId, TURNDeleteParamsparams, RequestOptionsoptions?): TURNDeleteResponse` **delete** `/accounts/{account_id}/calls/turn_keys/{key_id}` Deletes a TURN key from Cloudflare Calls ### Parameters - `keyId: string` A Cloudflare-generated unique identifier for a item. - `params: TURNDeleteParams` - `account_id: string` The account identifier tag. ### Returns - `TURNDeleteResponse` - `created?: string` The date and time the item was created. - `modified?: string` The date and time the item was last modified. - `name?: string` A short description of Calls app, not shown to end users. - `uid?: string` A Cloudflare-generated unique identifier for a item. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const turn = await client.calls.turn.delete('2a95132c15732412d22c1476fa83f27a', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(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 - `TURNListResponse` - `created?: string` The date and time the item was created. - `modified?: string` The date and time the item was last modified. - `name?: string` A short description of Calls app, not shown to end users. - `uid?: string` A Cloudflare-generated unique identifier for a item. ### TURN Get Response - `TURNGetResponse` - `created?: string` The date and time the item was created. - `modified?: string` The date and time the item was last modified. - `name?: string` A short description of Calls app, not shown to end users. - `uid?: string` A Cloudflare-generated unique identifier for a item. ### TURN Create Response - `TURNCreateResponse` - `created?: string` The date and time the item was created. - `key?: string` Bearer token - `modified?: string` The date and time the item was last modified. - `name?: string` A short description of a TURN key, not shown to end users. - `uid?: string` A Cloudflare-generated unique identifier for a item. ### TURN Update Response - `TURNUpdateResponse` - `created?: string` The date and time the item was created. - `modified?: string` The date and time the item was last modified. - `name?: string` A short description of Calls app, not shown to end users. - `uid?: string` A Cloudflare-generated unique identifier for a item. ### TURN Delete Response - `TURNDeleteResponse` - `created?: string` The date and time the item was created. - `modified?: string` The date and time the item was last modified. - `name?: string` A short description of Calls app, not shown to end users. - `uid?: string` A Cloudflare-generated unique identifier for a item.