# Cloudforce One # Scans # Results ## Get the Latest Scan Result `client.cloudforceOne.scans.results.get(stringconfigId, ResultGetParamsparams, RequestOptionsoptions?): ResultGetResponse` **get** `/accounts/{account_id}/cloudforce-one/scans/results/{config_id}` Get the Latest Scan Result ### Parameters - `configId: string` Defines the Config ID. - `params: ResultGetParams` - `account_id: string` Defines the Account ID. ### Returns - `ResultGetResponse` - `"1.1.1.1": Array` - `number?: number` - `proto?: string` - `status?: string` ### 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 result = await client.cloudforceOne.scans.results.get('config_id', { account_id: 'account_id', }); console.log(result['1.1.1.1']); ``` #### Response ```json { "errors": [ "string" ], "messages": [ "string" ], "result": { "1.1.1.1": [ { "number": 8080, "proto": "tcp", "status": "open" } ] }, "success": true } ``` ## Domain Types ### Scan Result - `ScanResult` - `number?: number` - `proto?: string` - `status?: string` ### Result Get Response - `ResultGetResponse` - `"1.1.1.1": Array` - `number?: number` - `proto?: string` - `status?: string` # Config ## List Scan Configs `client.cloudforceOne.scans.config.list(ConfigListParamsparams, RequestOptionsoptions?): SinglePage` **get** `/accounts/{account_id}/cloudforce-one/scans/config` List Scan Configs ### Parameters - `params: ConfigListParams` - `account_id: string` Defines the Account ID. ### Returns - `ConfigListResponse` - `id: string` Defines the Config ID. - `account_id: string` - `frequency: number` Defines the number of days between each scan (0 = One-off scan). - `ips: Array` Defines a list of IP addresses or CIDR blocks to scan. The maximum number of total IP addresses allowed is 5000. - `ports: Array` Defines a list of ports to scan. Valid values are:"default", "all", or a comma-separated list of ports or range of ports (e.g. ["1-80", "443"]). "default" scans the 100 most commonly open ports. ### 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 configListResponse of client.cloudforceOne.scans.config.list({ account_id: 'account_id', })) { console.log(configListResponse.id); } ``` #### 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": [ { "id": "uuid", "account_id": "abcd1234abcd1234abcd1234abcd1234", "frequency": 7, "ips": [ "1.1.1.1", "2606:4700:4700::1111" ], "ports": [ "default" ] } ] } ``` ## Create a new Scan Config `client.cloudforceOne.scans.config.create(ConfigCreateParamsparams, RequestOptionsoptions?): ConfigCreateResponse` **post** `/accounts/{account_id}/cloudforce-one/scans/config` Create a new Scan Config ### Parameters - `params: ConfigCreateParams` - `account_id: string` Path param: Defines the Account ID. - `ips: Array` Body param: Defines a list of IP addresses or CIDR blocks to scan. The maximum number of total IP addresses allowed is 5000. - `frequency?: number` Body param: Defines the number of days between each scan (0 = One-off scan). - `ports?: Array` Body param: Defines a list of ports to scan. Valid values are:"default", "all", or a comma-separated list of ports or range of ports (e.g. ["1-80", "443"]). "default" scans the 100 most commonly open ports. ### Returns - `ConfigCreateResponse` - `id: string` Defines the Config ID. - `account_id: string` - `frequency: number` Defines the number of days between each scan (0 = One-off scan). - `ips: Array` Defines a list of IP addresses or CIDR blocks to scan. The maximum number of total IP addresses allowed is 5000. - `ports: Array` Defines a list of ports to scan. Valid values are:"default", "all", or a comma-separated list of ports or range of ports (e.g. ["1-80", "443"]). "default" scans the 100 most commonly open ports. ### 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 config = await client.cloudforceOne.scans.config.create({ account_id: 'account_id', ips: ['1.1.1.1', '2606:4700:4700::1111'], }); console.log(config.id); ``` #### 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": { "id": "uuid", "account_id": "abcd1234abcd1234abcd1234abcd1234", "frequency": 7, "ips": [ "1.1.1.1", "2606:4700:4700::1111" ], "ports": [ "default" ] } } ``` ## Update an existing Scan Config `client.cloudforceOne.scans.config.edit(stringconfigId, ConfigEditParamsparams, RequestOptionsoptions?): ConfigEditResponse` **patch** `/accounts/{account_id}/cloudforce-one/scans/config/{config_id}` Update an existing Scan Config ### Parameters - `configId: string` Defines the Config ID. - `params: ConfigEditParams` - `account_id: string` Path param: Defines the Account ID. - `frequency?: number` Body param: Defines the number of days between each scan (0 = One-off scan). - `ips?: Array` Body param: Defines a list of IP addresses or CIDR blocks to scan. The maximum number of total IP addresses allowed is 5000. - `ports?: Array` Body param: Defines a list of ports to scan. Valid values are:"default", "all", or a comma-separated list of ports or range of ports (e.g. ["1-80", "443"]). "default" scans the 100 most commonly open ports. ### Returns - `ConfigEditResponse` - `id: string` Defines the Config ID. - `account_id: string` - `frequency: number` Defines the number of days between each scan (0 = One-off scan). - `ips: Array` Defines a list of IP addresses or CIDR blocks to scan. The maximum number of total IP addresses allowed is 5000. - `ports: Array` Defines a list of ports to scan. Valid values are:"default", "all", or a comma-separated list of ports or range of ports (e.g. ["1-80", "443"]). "default" scans the 100 most commonly open ports. ### 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 response = await client.cloudforceOne.scans.config.edit('config_id', { account_id: 'account_id', }); console.log(response.id); ``` #### 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": { "id": "uuid", "account_id": "abcd1234abcd1234abcd1234abcd1234", "frequency": 7, "ips": [ "1.1.1.1", "2606:4700:4700::1111" ], "ports": [ "default" ] } } ``` ## Delete a Scan Config `client.cloudforceOne.scans.config.delete(stringconfigId, ConfigDeleteParamsparams, RequestOptionsoptions?): ConfigDeleteResponse` **delete** `/accounts/{account_id}/cloudforce-one/scans/config/{config_id}` Delete a Scan Config ### Parameters - `configId: string` Defines the Config ID. - `params: ConfigDeleteParams` - `account_id: string` Defines the Account ID. ### Returns - `ConfigDeleteResponse = unknown` ### 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 config = await client.cloudforceOne.scans.config.delete('config_id', { account_id: 'account_id', }); console.log(config); ``` #### Response ```json { "errors": [ "string" ], "messages": [ "string" ], "result": {}, "success": true } ``` ## Domain Types ### Config List Response - `ConfigListResponse` - `id: string` Defines the Config ID. - `account_id: string` - `frequency: number` Defines the number of days between each scan (0 = One-off scan). - `ips: Array` Defines a list of IP addresses or CIDR blocks to scan. The maximum number of total IP addresses allowed is 5000. - `ports: Array` Defines a list of ports to scan. Valid values are:"default", "all", or a comma-separated list of ports or range of ports (e.g. ["1-80", "443"]). "default" scans the 100 most commonly open ports. ### Config Create Response - `ConfigCreateResponse` - `id: string` Defines the Config ID. - `account_id: string` - `frequency: number` Defines the number of days between each scan (0 = One-off scan). - `ips: Array` Defines a list of IP addresses or CIDR blocks to scan. The maximum number of total IP addresses allowed is 5000. - `ports: Array` Defines a list of ports to scan. Valid values are:"default", "all", or a comma-separated list of ports or range of ports (e.g. ["1-80", "443"]). "default" scans the 100 most commonly open ports. ### Config Edit Response - `ConfigEditResponse` - `id: string` Defines the Config ID. - `account_id: string` - `frequency: number` Defines the number of days between each scan (0 = One-off scan). - `ips: Array` Defines a list of IP addresses or CIDR blocks to scan. The maximum number of total IP addresses allowed is 5000. - `ports: Array` Defines a list of ports to scan. Valid values are:"default", "all", or a comma-separated list of ports or range of ports (e.g. ["1-80", "443"]). "default" scans the 100 most commonly open ports. ### Config Delete Response - `ConfigDeleteResponse = unknown` # Binary Storage ## Retrieves a file from Binary Storage `client.cloudforceOne.binaryStorage.get(stringhash, BinaryStorageGetParamsparams, RequestOptionsoptions?): void` **get** `/accounts/{account_id}/cloudforce-one/binary/{hash}` Retrieves a file from Binary Storage ### Parameters - `hash: string` hash of the binary - `params: BinaryStorageGetParams` - `account_id: string` Account ID. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); await client.cloudforceOne.binaryStorage.get('hash', { account_id: 'account_id' }); ``` ## Posts a file to Binary Storage `client.cloudforceOne.binaryStorage.create(BinaryStorageCreateParamsparams, RequestOptionsoptions?): BinaryStorageCreateResponse` **post** `/accounts/{account_id}/cloudforce-one/binary` Posts a file to Binary Storage ### Parameters - `params: BinaryStorageCreateParams` - `account_id: string` Path param: Account ID. - `file: Uploadable` Body param: The binary file content to upload. ### Returns - `BinaryStorageCreateResponse` - `content_type: string` - `md5: string` - `sha1: string` - `sha256: string` ### 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 binaryStorage = await client.cloudforceOne.binaryStorage.create({ account_id: 'account_id', file: fs.createReadStream('path/to/file'), }); console.log(binaryStorage.content_type); ``` #### Response ```json { "content_type": "text/plain", "md5": "5d84ade76d2a8387c81175bb0cbe6492", "sha1": "9aff6879626d957eafadda044e4f879aae1e7278", "sha256": "0000a7f2692ef479e2e3d02661568882cadec451cc8a64d4e7faca29810cd626" } ``` ## Domain Types ### Binary Storage Create Response - `BinaryStorageCreateResponse` - `content_type: string` - `md5: string` - `sha1: string` - `sha256: string` # Requests ## List Requests `client.cloudforceOne.requests.list(RequestListParamsparams, RequestOptionsoptions?): SinglePage` **post** `/accounts/{account_id}/cloudforce-one/requests` List Requests ### Parameters - `params: RequestListParams` - `account_id: string` Path param: Identifier. - `page: number` Body param: Page number of results. - `per_page: number` Body param: Number of results per page. - `completed_after?: string` Body param: Retrieve requests completed after this time. - `completed_before?: string` Body param: Retrieve requests completed before this time. - `created_after?: string` Body param: Retrieve requests created after this time. - `created_before?: string` Body param: Retrieve requests created before this time. - `request_type?: string` Body param: Requested information from request. - `sort_by?: string` Body param: Field to sort results by. - `sort_order?: "asc" | "desc"` Body param: Sort order (asc or desc). - `"asc"` - `"desc"` - `status?: "open" | "accepted" | "reported" | 3 more` Body param: Request Status. - `"open"` - `"accepted"` - `"reported"` - `"approved"` - `"completed"` - `"declined"` ### Returns - `ListItem` - `id: string` UUID. - `created: string` Request creation time. - `priority: "routine" | "high" | "urgent"` - `"routine"` - `"high"` - `"urgent"` - `request: string` Requested information from request. - `summary: string` Brief description of the request. - `tlp: "clear" | "amber" | "amber-strict" | 2 more` The CISA defined Traffic Light Protocol (TLP). - `"clear"` - `"amber"` - `"amber-strict"` - `"green"` - `"red"` - `updated: string` Request last updated time. - `completed?: string` Request completion time. - `message_tokens?: number` Tokens for the request messages. - `readable_id?: string` Readable Request ID. - `status?: "open" | "accepted" | "reported" | 3 more` Request Status. - `"open"` - `"accepted"` - `"reported"` - `"approved"` - `"completed"` - `"declined"` - `tokens?: number` Tokens for the request. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const listItem of client.cloudforceOne.requests.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', page: 0, per_page: 10, })) { console.log(listItem.id); } ``` #### 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": [ { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "created": "2022-04-01T00:00:00Z", "priority": "routine", "request": "Victomology", "summary": "DoS attack", "tlp": "clear", "updated": "2022-04-01T00:00:00Z", "completed": "2024-01-01T00:00:00Z", "message_tokens": 16, "readable_id": "RFI-2022-000001", "status": "open", "tokens": 0 } ] } ``` ## Get a Request `client.cloudforceOne.requests.get(stringrequestId, RequestGetParamsparams, RequestOptionsoptions?): Item` **get** `/accounts/{account_id}/cloudforce-one/requests/{request_id}` Get a Request ### Parameters - `requestId: string` UUID. - `params: RequestGetParams` - `account_id: string` Identifier. ### Returns - `Item` - `id: string` UUID. - `content: string` Request content. - `created: string` - `priority: string` - `request: string` Requested information from request. - `summary: string` Brief description of the request. - `tlp: "clear" | "amber" | "amber-strict" | 2 more` The CISA defined Traffic Light Protocol (TLP). - `"clear"` - `"amber"` - `"amber-strict"` - `"green"` - `"red"` - `updated: string` - `completed?: string` - `message_tokens?: number` Tokens for the request messages. - `readable_id?: string` Readable Request ID. - `status?: "open" | "accepted" | "reported" | 3 more` Request Status. - `"open"` - `"accepted"` - `"reported"` - `"approved"` - `"completed"` - `"declined"` - `tokens?: number` Tokens for the request. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted }); const item = await client.cloudforceOne.requests.get('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(item.id); ``` #### 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": { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "content": "What regions were most effected by the recent DoS?", "created": "2022-04-01T05:20:00Z", "priority": "2022-04-01T05:20:00Z", "request": "Victomology", "summary": "DoS attack", "tlp": "clear", "updated": "2022-04-01T05:20:00Z", "completed": "2022-04-01T05:20:00Z", "message_tokens": 1, "readable_id": "RFI-2022-000001", "status": "open", "tokens": 16 } } ``` ## Create a New Request. `client.cloudforceOne.requests.create(RequestCreateParamsparams, RequestOptionsoptions?): Item` **post** `/accounts/{account_id}/cloudforce-one/requests/new` Creating a request adds the request into the Cloudforce One queue for analysis. In addition to the content, a short title, type, priority, and releasability should be provided. If one is not provided, a default will be assigned. ### Parameters - `params: RequestCreateParams` - `account_id: string` Path param: Identifier. - `content?: string` Body param: Request content. - `priority?: string` Body param: Priority for analyzing the request. - `request_type?: string` Body param: Requested information from request. - `summary?: string` Body param: Brief description of the request. - `tlp?: "clear" | "amber" | "amber-strict" | 2 more` Body param: The CISA defined Traffic Light Protocol (TLP). - `"clear"` - `"amber"` - `"amber-strict"` - `"green"` - `"red"` ### Returns - `Item` - `id: string` UUID. - `content: string` Request content. - `created: string` - `priority: string` - `request: string` Requested information from request. - `summary: string` Brief description of the request. - `tlp: "clear" | "amber" | "amber-strict" | 2 more` The CISA defined Traffic Light Protocol (TLP). - `"clear"` - `"amber"` - `"amber-strict"` - `"green"` - `"red"` - `updated: string` - `completed?: string` - `message_tokens?: number` Tokens for the request messages. - `readable_id?: string` Readable Request ID. - `status?: "open" | "accepted" | "reported" | 3 more` Request Status. - `"open"` - `"accepted"` - `"reported"` - `"approved"` - `"completed"` - `"declined"` - `tokens?: number` Tokens for the request. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted }); const item = await client.cloudforceOne.requests.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(item.id); ``` #### 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": { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "content": "What regions were most effected by the recent DoS?", "created": "2022-04-01T05:20:00Z", "priority": "2022-04-01T05:20:00Z", "request": "Victomology", "summary": "DoS attack", "tlp": "clear", "updated": "2022-04-01T05:20:00Z", "completed": "2022-04-01T05:20:00Z", "message_tokens": 1, "readable_id": "RFI-2022-000001", "status": "open", "tokens": 16 } } ``` ## Update a Request `client.cloudforceOne.requests.update(stringrequestId, RequestUpdateParamsparams, RequestOptionsoptions?): Item` **put** `/accounts/{account_id}/cloudforce-one/requests/{request_id}` Updating a request alters the request in the Cloudforce One queue. This API may be used to update any attributes of the request after the initial submission. Only fields that you choose to update need to be add to the request body. ### Parameters - `requestId: string` UUID. - `params: RequestUpdateParams` - `account_id: string` Path param: Identifier. - `content?: string` Body param: Request content. - `priority?: string` Body param: Priority for analyzing the request. - `request_type?: string` Body param: Requested information from request. - `summary?: string` Body param: Brief description of the request. - `tlp?: "clear" | "amber" | "amber-strict" | 2 more` Body param: The CISA defined Traffic Light Protocol (TLP). - `"clear"` - `"amber"` - `"amber-strict"` - `"green"` - `"red"` ### Returns - `Item` - `id: string` UUID. - `content: string` Request content. - `created: string` - `priority: string` - `request: string` Requested information from request. - `summary: string` Brief description of the request. - `tlp: "clear" | "amber" | "amber-strict" | 2 more` The CISA defined Traffic Light Protocol (TLP). - `"clear"` - `"amber"` - `"amber-strict"` - `"green"` - `"red"` - `updated: string` - `completed?: string` - `message_tokens?: number` Tokens for the request messages. - `readable_id?: string` Readable Request ID. - `status?: "open" | "accepted" | "reported" | 3 more` Request Status. - `"open"` - `"accepted"` - `"reported"` - `"approved"` - `"completed"` - `"declined"` - `tokens?: number` Tokens for the request. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted }); const item = await client.cloudforceOne.requests.update('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(item.id); ``` #### 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": { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "content": "What regions were most effected by the recent DoS?", "created": "2022-04-01T05:20:00Z", "priority": "2022-04-01T05:20:00Z", "request": "Victomology", "summary": "DoS attack", "tlp": "clear", "updated": "2022-04-01T05:20:00Z", "completed": "2022-04-01T05:20:00Z", "message_tokens": 1, "readable_id": "RFI-2022-000001", "status": "open", "tokens": 16 } } ``` ## Delete a Request `client.cloudforceOne.requests.delete(stringrequestId, RequestDeleteParamsparams, RequestOptionsoptions?): RequestDeleteResponse` **delete** `/accounts/{account_id}/cloudforce-one/requests/{request_id}` Delete a Request ### Parameters - `requestId: string` UUID. - `params: RequestDeleteParams` - `account_id: string` Identifier. ### Returns - `RequestDeleteResponse` - `errors: Array` - `code: number` - `message: string` - `documentation_url?: string` - `source?: Source` - `pointer?: string` - `messages: Array` - `code: number` - `message: string` - `documentation_url?: string` - `source?: Source` - `pointer?: string` - `success: true` Whether the API call was successful. - `true` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted }); const request = await client.cloudforceOne.requests.delete('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(request.errors); ``` #### 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 } ``` ## Get Request Quota `client.cloudforceOne.requests.quota(RequestQuotaParamsparams, RequestOptionsoptions?): Quota` **get** `/accounts/{account_id}/cloudforce-one/requests/quota` Get Request Quota ### Parameters - `params: RequestQuotaParams` - `account_id: string` Identifier. ### Returns - `Quota` - `anniversary_date?: string` Anniversary date is when annual quota limit is refreshed. - `quarter_anniversary_date?: string` Quarter anniversary date is when quota limit is refreshed each quarter. - `quota?: number` Tokens for the quarter. - `remaining?: number` Tokens remaining for the quarter. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted }); const quota = await client.cloudforceOne.requests.quota({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(quota.anniversary_date); ``` #### 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": { "anniversary_date": "2022-04-01T00:00:00Z", "quarter_anniversary_date": "2022-04-01T00:00:00Z", "quota": 120, "remaining": 64 } } ``` ## Get Request Types `client.cloudforceOne.requests.types(RequestTypesParamsparams, RequestOptionsoptions?): SinglePage` **get** `/accounts/{account_id}/cloudforce-one/requests/types` Get Request Types ### Parameters - `params: RequestTypesParams` - `account_id: string` Identifier. ### Returns - `RequestTypesResponse = string` Request Types. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const requestTypesResponse of client.cloudforceOne.requests.types({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(requestTypesResponse); } ``` #### 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": [ "Indicators of Compromise", "Victomology" ] } ``` ## Get Request Priority, Status, and TLP constants `client.cloudforceOne.requests.constants(RequestConstantsParamsparams, RequestOptionsoptions?): RequestConstants` **get** `/accounts/{account_id}/cloudforce-one/requests/constants` Get Request Priority, Status, and TLP constants ### Parameters - `params: RequestConstantsParams` - `account_id: string` Identifier. ### Returns - `RequestConstants` - `priority?: Array<"routine" | "high" | "urgent">` - `"routine"` - `"high"` - `"urgent"` - `status?: Array<"open" | "accepted" | "reported" | 3 more>` - `"open"` - `"accepted"` - `"reported"` - `"approved"` - `"completed"` - `"declined"` - `tlp?: Array<"clear" | "amber" | "amber-strict" | 2 more>` - `"clear"` - `"amber"` - `"amber-strict"` - `"green"` - `"red"` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted }); const requestConstants = await client.cloudforceOne.requests.constants({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(requestConstants.priority); ``` #### 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": { "priority": [ "routine", "high", "urgent" ], "status": [ "open", "accepted", "reported", "approved", "completed", "declined" ], "tlp": [ "clear", "green", "amber", "amber-strict", "red" ] } } ``` ## Domain Types ### Item - `Item` - `id: string` UUID. - `content: string` Request content. - `created: string` - `priority: string` - `request: string` Requested information from request. - `summary: string` Brief description of the request. - `tlp: "clear" | "amber" | "amber-strict" | 2 more` The CISA defined Traffic Light Protocol (TLP). - `"clear"` - `"amber"` - `"amber-strict"` - `"green"` - `"red"` - `updated: string` - `completed?: string` - `message_tokens?: number` Tokens for the request messages. - `readable_id?: string` Readable Request ID. - `status?: "open" | "accepted" | "reported" | 3 more` Request Status. - `"open"` - `"accepted"` - `"reported"` - `"approved"` - `"completed"` - `"declined"` - `tokens?: number` Tokens for the request. ### List Item - `ListItem` - `id: string` UUID. - `created: string` Request creation time. - `priority: "routine" | "high" | "urgent"` - `"routine"` - `"high"` - `"urgent"` - `request: string` Requested information from request. - `summary: string` Brief description of the request. - `tlp: "clear" | "amber" | "amber-strict" | 2 more` The CISA defined Traffic Light Protocol (TLP). - `"clear"` - `"amber"` - `"amber-strict"` - `"green"` - `"red"` - `updated: string` Request last updated time. - `completed?: string` Request completion time. - `message_tokens?: number` Tokens for the request messages. - `readable_id?: string` Readable Request ID. - `status?: "open" | "accepted" | "reported" | 3 more` Request Status. - `"open"` - `"accepted"` - `"reported"` - `"approved"` - `"completed"` - `"declined"` - `tokens?: number` Tokens for the request. ### Quota - `Quota` - `anniversary_date?: string` Anniversary date is when annual quota limit is refreshed. - `quarter_anniversary_date?: string` Quarter anniversary date is when quota limit is refreshed each quarter. - `quota?: number` Tokens for the quarter. - `remaining?: number` Tokens remaining for the quarter. ### Request Constants - `RequestConstants` - `priority?: Array<"routine" | "high" | "urgent">` - `"routine"` - `"high"` - `"urgent"` - `status?: Array<"open" | "accepted" | "reported" | 3 more>` - `"open"` - `"accepted"` - `"reported"` - `"approved"` - `"completed"` - `"declined"` - `tlp?: Array<"clear" | "amber" | "amber-strict" | 2 more>` - `"clear"` - `"amber"` - `"amber-strict"` - `"green"` - `"red"` ### Request Types - `RequestTypes = Array` ### Request Delete Response - `RequestDeleteResponse` - `errors: Array` - `code: number` - `message: string` - `documentation_url?: string` - `source?: Source` - `pointer?: string` - `messages: Array` - `code: number` - `message: string` - `documentation_url?: string` - `source?: Source` - `pointer?: string` - `success: true` Whether the API call was successful. - `true` ### Request Types Response - `RequestTypesResponse = string` Request Types. # Message ## List Request Messages `client.cloudforceOne.requests.message.get(stringrequestId, MessageGetParamsparams, RequestOptionsoptions?): SinglePage` **post** `/accounts/{account_id}/cloudforce-one/requests/{request_id}/message` List Request Messages ### Parameters - `requestId: string` UUID. - `params: MessageGetParams` - `account_id: string` Path param: Identifier. - `page: number` Body param: Page number of results. - `per_page: number` Body param: Number of results per page. - `after?: string` Body param: Retrieve mes ges created after this time. - `before?: string` Body param: Retrieve messages created before this time. - `sort_by?: string` Body param: Field to sort results by. - `sort_order?: "asc" | "desc"` Body param: Sort order (asc or desc). - `"asc"` - `"desc"` ### Returns - `Message` - `id: number` Message ID. - `author: string` Author of message. - `content: string` Content of message. - `is_follow_on_request: boolean` Whether the message is a follow-on request. - `updated: string` Defines the message last updated time. - `created?: string` Defines the message creation time. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const message of client.cloudforceOne.requests.message.get( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', page: 0, per_page: 10, }, )) { console.log(message.id); } ``` #### 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": [ { "id": 0, "author": "user@domain.com", "content": "Can you elaborate on the type of DoS that occurred?", "is_follow_on_request": true, "updated": "2022-01-01T00:00:00Z", "created": "2022-01-01T00:00:00Z" } ] } ``` ## Create a New Request Message `client.cloudforceOne.requests.message.create(stringrequestId, MessageCreateParamsparams, RequestOptionsoptions?): Message` **post** `/accounts/{account_id}/cloudforce-one/requests/{request_id}/message/new` Create a New Request Message ### Parameters - `requestId: string` UUID. - `params: MessageCreateParams` - `account_id: string` Path param: Identifier. - `content?: string` Body param: Content of message. ### Returns - `Message` - `id: number` Message ID. - `author: string` Author of message. - `content: string` Content of message. - `is_follow_on_request: boolean` Whether the message is a follow-on request. - `updated: string` Defines the message last updated time. - `created?: string` Defines the message creation time. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted }); const message = await client.cloudforceOne.requests.message.create( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(message.id); ``` #### 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": { "id": 0, "author": "user@domain.com", "content": "Can you elaborate on the type of DoS that occurred?", "is_follow_on_request": true, "updated": "2022-01-01T00:00:00Z", "created": "2022-01-01T00:00:00Z" } } ``` ## Update a Request Message `client.cloudforceOne.requests.message.update(stringrequestId, numbermessageId, MessageUpdateParamsparams, RequestOptionsoptions?): Message` **put** `/accounts/{account_id}/cloudforce-one/requests/{request_id}/message/{message_id}` Update a Request Message ### Parameters - `requestId: string` UUID. - `messageId: number` - `params: MessageUpdateParams` - `account_id: string` Path param: Identifier. - `content?: string` Body param: Content of message. ### Returns - `Message` - `id: number` Message ID. - `author: string` Author of message. - `content: string` Content of message. - `is_follow_on_request: boolean` Whether the message is a follow-on request. - `updated: string` Defines the message last updated time. - `created?: string` Defines the message creation time. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted }); const message = await client.cloudforceOne.requests.message.update( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', 0, { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(message.id); ``` #### 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": { "id": 0, "author": "user@domain.com", "content": "Can you elaborate on the type of DoS that occurred?", "is_follow_on_request": true, "updated": "2022-01-01T00:00:00Z", "created": "2022-01-01T00:00:00Z" } } ``` ## Delete a Request Message `client.cloudforceOne.requests.message.delete(stringrequestId, numbermessageId, MessageDeleteParamsparams, RequestOptionsoptions?): MessageDeleteResponse` **delete** `/accounts/{account_id}/cloudforce-one/requests/{request_id}/message/{message_id}` Delete a Request Message ### Parameters - `requestId: string` UUID. - `messageId: number` - `params: MessageDeleteParams` - `account_id: string` Identifier. ### Returns - `MessageDeleteResponse` - `errors: Array` - `code: number` - `message: string` - `documentation_url?: string` - `source?: Source` - `pointer?: string` - `messages: Array` - `code: number` - `message: string` - `documentation_url?: string` - `source?: Source` - `pointer?: string` - `success: true` Whether the API call was successful. - `true` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted }); const message = await client.cloudforceOne.requests.message.delete( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', 0, { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(message.errors); ``` #### 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 } ``` ## Domain Types ### Message - `Message` - `id: number` Message ID. - `author: string` Author of message. - `content: string` Content of message. - `is_follow_on_request: boolean` Whether the message is a follow-on request. - `updated: string` Defines the message last updated time. - `created?: string` Defines the message creation time. ### Message Delete Response - `MessageDeleteResponse` - `errors: Array` - `code: number` - `message: string` - `documentation_url?: string` - `source?: Source` - `pointer?: string` - `messages: Array` - `code: number` - `message: string` - `documentation_url?: string` - `source?: Source` - `pointer?: string` - `success: true` Whether the API call was successful. - `true` # Priority ## Get a Priority Intelligence Requirement `client.cloudforceOne.requests.priority.get(stringpriorityId, PriorityGetParamsparams, RequestOptionsoptions?): Item` **get** `/accounts/{account_id}/cloudforce-one/requests/priority/{priority_id}` Get a Priority Intelligence Requirement ### Parameters - `priorityId: string` UUID. - `params: PriorityGetParams` - `account_id: string` Identifier. ### Returns - `Item` - `id: string` UUID. - `content: string` Request content. - `created: string` - `priority: string` - `request: string` Requested information from request. - `summary: string` Brief description of the request. - `tlp: "clear" | "amber" | "amber-strict" | 2 more` The CISA defined Traffic Light Protocol (TLP). - `"clear"` - `"amber"` - `"amber-strict"` - `"green"` - `"red"` - `updated: string` - `completed?: string` - `message_tokens?: number` Tokens for the request messages. - `readable_id?: string` Readable Request ID. - `status?: "open" | "accepted" | "reported" | 3 more` Request Status. - `"open"` - `"accepted"` - `"reported"` - `"approved"` - `"completed"` - `"declined"` - `tokens?: number` Tokens for the request. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted }); const item = await client.cloudforceOne.requests.priority.get( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(item.id); ``` #### 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": { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "content": "What regions were most effected by the recent DoS?", "created": "2022-04-01T05:20:00Z", "priority": "2022-04-01T05:20:00Z", "request": "Victomology", "summary": "DoS attack", "tlp": "clear", "updated": "2022-04-01T05:20:00Z", "completed": "2022-04-01T05:20:00Z", "message_tokens": 1, "readable_id": "RFI-2022-000001", "status": "open", "tokens": 16 } } ``` ## Create a New Priority Intelligence Requirement `client.cloudforceOne.requests.priority.create(PriorityCreateParamsparams, RequestOptionsoptions?): Priority` **post** `/accounts/{account_id}/cloudforce-one/requests/priority/new` Create a New Priority Intelligence Requirement ### Parameters - `params: PriorityCreateParams` - `account_id: string` Path param: Identifier. - `labels: Array