# 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.