Create a schedule
curl --request POST \
--url https://api.peel.sh/v1/schedules \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"api_id": "<string>",
"endpoint_name": "<string>",
"every_minutes": 5070,
"params": {},
"shape": {}
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
api_id: '<string>',
endpoint_name: '<string>',
every_minutes: 5070,
params: {},
shape: {}
})
};
fetch('https://api.peel.sh/v1/schedules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.peel.sh/v1/schedules"
payload = {
"api_id": "<string>",
"endpoint_name": "<string>",
"every_minutes": 5070,
"params": {},
"shape": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"schedule": {
"id": "<string>",
"api_id": "<string>",
"endpoint_name": "<string>",
"params": {},
"shape": {},
"every_minutes": 5070,
"next_run_at": "2023-11-07T05:31:56Z",
"last_run_at": "2023-11-07T05:31:56Z",
"last_outcome": "first",
"last_error": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"retry": "same_key",
"docs_url": "<string>",
"details": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"retry": "same_key",
"docs_url": "<string>",
"details": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"retry": "same_key",
"docs_url": "<string>",
"details": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"retry": "same_key",
"docs_url": "<string>",
"details": {}
}Schedules
Create a schedule
Runs a data endpoint that needs no sign-in every 60 to 10080 minutes, first within a minute. Each run counts as a call. When an answer differs from the one before, Peel sends the schedule.changed webhook with the new data (omitted above 64 KB); a failed run sends schedule.failed. Needs run access.
POST
/
v1
/
schedules
Create a schedule
curl --request POST \
--url https://api.peel.sh/v1/schedules \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"api_id": "<string>",
"endpoint_name": "<string>",
"every_minutes": 5070,
"params": {},
"shape": {}
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
api_id: '<string>',
endpoint_name: '<string>',
every_minutes: 5070,
params: {},
shape: {}
})
};
fetch('https://api.peel.sh/v1/schedules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.peel.sh/v1/schedules"
payload = {
"api_id": "<string>",
"endpoint_name": "<string>",
"every_minutes": 5070,
"params": {},
"shape": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"schedule": {
"id": "<string>",
"api_id": "<string>",
"endpoint_name": "<string>",
"params": {},
"shape": {},
"every_minutes": 5070,
"next_run_at": "2023-11-07T05:31:56Z",
"last_run_at": "2023-11-07T05:31:56Z",
"last_outcome": "first",
"last_error": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"retry": "same_key",
"docs_url": "<string>",
"details": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"retry": "same_key",
"docs_url": "<string>",
"details": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"retry": "same_key",
"docs_url": "<string>",
"details": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"retry": "same_key",
"docs_url": "<string>",
"details": {}
}Body
application/json
⌘I