# API post command to schedule scan - 406 response

**URL:** <https://discuss.rapid7.com/t/api-post-command-to-schedule-scan-406-response/4633>\
**Category:** API\
**Created:** [April 27, 2021, 3:06pm UTC](https://discuss.rapid7.com/t/api-post-command-to-schedule-scan-406-response/4633 "2021-04-27T15:06:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhosford\_mhosford](https://discuss.rapid7.com/letter_avatar_proxy/v4/letter/m/779978/32.png) [@mhosford\_mhosford](https://discuss.rapid7.com/u/mhosford_mhosford)\
**Post date:** [April 27, 2021, 3:06pm UTC](https://discuss.rapid7.com/t/api-post-command-to-schedule-scan-406-response/4633/1 "2021-04-27T15:06:03Z")

</div>

Hey all, so I’m new to the Rapid 7 game, but not APIs in general. I find my API responses are hit or miss on this API. All I’m trying to do is schedule a scan through the API, however I’m getting.

**Request Method:** POST  
**Response Time:** 0.482 seconds  
**Response Status:** 406 - Not Acceptable

I have stripped my POST to the bare minimum, all appears to be correct but there is no response. Any ideas what is going on?

Here is my bare min post request:  
{  
“enabled”: true,  
“onScanRepeat”: “resume-scan”,  
“repeat”: {  
“every”: “week”,  
“interval”: 1  
},  
“start”: “2021-05-01T15:20:00Z”  
}

Following the docs here:  
[https://help.rapid7.com/insightvm/en-us/api/index.html#operation/getSiteScanSchedules](https://help.rapid7.com/insightvm/en-us/api/index.html#operation/getSiteScanSchedules)

---

<div class="post-metadata">

**Author:** ![mhosford\_mhosford](https://discuss.rapid7.com/letter_avatar_proxy/v4/letter/m/779978/32.png) [@mhosford\_mhosford](https://discuss.rapid7.com/u/mhosford_mhosford)\
**Post date:** [April 27, 2021, 4:33pm UTC](https://discuss.rapid7.com/t/api-post-command-to-schedule-scan-406-response/4633/2 "2021-04-27T16:33:13Z")

</div>

Found the answer to my own question after more digging:

> [@Unable to schedule scans through API](https://discuss.rapid7.com/t/unable-to-schedule-scans-through-api/275):
>
> Attempting to create a schedule for a site through the API. Have followed the API documentation. However I’m getting an argument error when posting to the API. Python script snippet below. The API and authentication is working. See second snippet. body = [{“enabled”:True, “onScanRepeat”:“restart-scan”, “start”:“2020-03-03T16:00:00-07:00”}] a = requests.put(‘https://\<CONSOLE\_IP\>:3780/api/3/sites/503/scan\_schedules’,json=body,headers=headers) a.text u’{\n “status” : 400,\n “message” : “One …

CURL command works. I’ve been using the Chrome extension YARC to query the API. I guess its buggy at best.
