{"type":"api","title":"Set SWG Override Device Settings","meta":{"id":"/apps/pubhub/media/secure-access-for-china/f761bc0f96579628e9acf9bd5ce02d7863efbd30/7e0efc2b-8c6a-374b-ad2f-31007d7fa1b4","info":{"version":"2.0.0","title":"Cisco Secure Access China Secure Web Gateway Device Settings API","description":"Manage the Secure Access Secure Web Gateway (SWG) settings for the devices in an organization.","contact":{"name":"Cloud Security Developer Community"}},"security":[{"oauthFlow":[]}],"tags":[{"name":"SWG Device Settings","description":"Secure Web Gateway (SWG) device settings"},{"name":"Secure Access"}],"x-parser-conf":{"overview":{"markdownPath":"reference/deployments/secure-access-swg-devices-overview.md"}},"openapi":"3.0.1","servers":[{"url":"https://cisco.secureaccesschina.cn/{basePath}","variables":{"basePath":{"default":"deployments/v2"}}}],"securitySchemes":{"oauthFlow":{"type":"oauth2","description":"client credential flow","flows":{"clientCredentials":{"tokenUrl":"https://api.ciscosecureaccess.cn/auth/v2/token","scopes":{"deployments.devices.swg:write":"Write SWG device settings","deployments.devices.swg:read":"Read SWG device settings"}}}}}},"spec":{"summary":"Set SWG Override Device Settings","operationId":"createSecureWebGatewayDeviceSettings","tags":["SWG Device Settings","Secure Access"],"description":"Add a list of origin ID and the Secure Web Gateway (SWG) setting for devices in the organization.\nThe SWG device setting overrides the organization-level SWG setting.\n\n**Note:** Before you can add an SWG override setting to a device, you must register the device as a roaming computer with Secure Access.\nSecure Access applies the SWG override setting to a device using the device's origin ID.\nYou can list the roaming computers in your organization by sending a request to the Secure Access Roaming Computers API.","security":[{"oauthFlow":["deployments.devices.swg:write"]}],"requestBody":{"description":"* Provide a list of origin ID for the devices in the organization. The list can contain 1–100 origin IDs.\n* Provide the Secure Web gateway (SWG) device setting to apply to the devices.","content":{"application/json":{"schema":{"type":"object","description":"The properties of the `originIds` and `value` of the SWG device setting.","required":["value","originIds"],"properties":{"originIds":{"type":"array","description":"The list of origin IDs. The list can contain 1–100 origin IDs.","items":{"description":"The origin ID of the device.","type":"integer","format":"int64","example":12321231,"$$ref":"#/components/schemas/originId"}},"value":{"type":"string","enum":["0","1"],"description":"Specifies whether to enable the Secure Web Gateway (SWG) device settings.\nValid values are: `0` or `1` where `1` indicates enable.","example":"1","$$ref":"#/components/schemas/value"}}},"example":{"value":"1","originIds":[12321231,123134314]}}}},"responses":{"200":{"description":"OK","headers":{"Content-Type":{"schema":{"type":"string"},"description":"The MIME content type of the response body.","example":"application/json","$$ref":"#/components/headers/Content-Type"},"Date":{"schema":{"type":"string","pattern":"^[0-90-90-90-9-0-90-9-0-90-9T0-90-9:0-90-9:0-90-9Z]+$"},"description":"The timestamp of the response.","example":"2023-03-14T18:34:25Z","$$ref":"#/components/headers/Date"}},"content":{"application/json":{"schema":{"type":"object","description":"The information about the Secure Web Gateway (SWG) setting for the devices in the organization.","required":["totalCount","successCount","failCount","items","value"],"properties":{"totalCount":{"type":"integer","description":"The total number of devices that requested to update the device setting."},"successCount":{"type":"integer","description":"The number of devices that successfully changed the device setting."},"failCount":{"type":"integer","description":"The number of devices that failed to change the device setting."},"items":{"type":"array","description":"The list of device setting status properties.","items":{"type":"object","description":"The status and description for the device setting.","required":["originId","code","message"],"properties":{"originId":{"description":"The origin ID of the device.","type":"integer","format":"int64","example":12321231,"$$ref":"#/components/schemas/originId"},"code":{"type":"integer","description":"The status code of the response."},"message":{"type":"string","description":"The description of the response."}}}},"value":{"type":"string","enum":["0","1"],"description":"Specifies whether to enable the Secure Web Gateway (SWG) device settings.\nValid values are: `0` or `1` where `1` indicates enable.","example":"1","$$ref":"#/components/schemas/value"}},"example":{"totalCount":2,"successCount":1,"failCount":1,"items":[{"originId":12321231,"code":200,"message":"success"},{"originId":12313431,"code":404,"message":"The origin ID does not exist."}],"value":"1"},"$$ref":"#/components/schemas/RegisteredSWGDeviceSettings"},"example":{"totalCount":2,"successCount":1,"failCount":1,"items":[{"originId":12321231,"code":200,"message":"success"},{"originId":12313431,"code":404,"message":"The origin ID of the device does not exist."}],"value":"1"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","description":"The information about the error condition.","required":["Error"],"properties":{"Error":{"type":"string","description":"The message associated with the error condition."}}},"example":{"Error":"Invalid request"}}},"$$ref":"#/components/responses/400ErrorSingle"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","description":"The information about the error condition.","properties":{"message":{"type":"string","description":"The message associated with the error condition."},"error":{"type":"string","description":"The status code for the error condition."}},"$$ref":"#/components/schemas/error"},"example":{"message":"Unauthorized request"}}},"$$ref":"#/components/responses/401Error"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","description":"The information about the error condition.","properties":{"message":{"type":"string","description":"The message associated with the error condition."},"error":{"type":"string","description":"The status code for the error condition."}},"$$ref":"#/components/schemas/error"},"example":{"message":"Forbidden"}}},"$$ref":"#/components/responses/403Error"},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","description":"The information about the error condition.","required":["Error"],"properties":{"Error":{"type":"string","description":"The message associated with the error condition."}}},"example":{"Error":"Not Found"}}},"$$ref":"#/components/responses/404ErrorSingle"},"413":{"description":"Content Too Large","content":{"application/json":{"schema":{"type":"object","description":"The list of `originIds` contains more than 100 origin IDs.","required":["Error"],"properties":{"Error":{"type":"string","description":"Invalid Request: orginIds in the request exceeded max limit - 100.","example":"Invalid Request: orginIds in the request exceeded max limit - 100."}}},"example":{"Error":"Invalid Request: orginIds in the request exceeded max limit - 100."}}},"$$ref":"#/components/responses/413ErrorSingle"},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","description":"The information about the error condition.","properties":{"message":{"type":"string","description":"The message associated with the error condition."},"error":{"type":"string","description":"The status code for the error condition."}},"$$ref":"#/components/schemas/error"},"example":{"message":"Too many requests. Retry request."}}},"$$ref":"#/components/responses/429Error"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","description":"The information about the error condition.","required":["Error"],"properties":{"Error":{"type":"string","description":"The message associated with the error condition."}}},"example":{"Error":"Internal server error"}}},"$$ref":"#/components/responses/500ErrorSingle"}},"__originalOperationId":"createSecureWebGatewayDeviceSettings","method":"post","path":"/deviceSettings/SWGEnabled/set"}}