curl -X POST "https://api.hookpulse.io/v1/api/add_solar_schedule/" \
-H "x-hookpulse-api-key: {{x-hookpulse-api-key}}" \
-H "x-brand-uuid: {{x-brand-uuid}}" \
-H "Content-Type: application/json" \
-d '{
"solar_event": "sunrise",
"solar_lat": "{{solar_lat}}",
"solar_long": "{{solar_long}}",
"solar_offset_seconds": 5,
"is_one_off_task": false,
"schedule_to": "webhook",
"model_to_schedule_uuid": "{{model_to_schedule_uuid}}",
"initial_context_template": {
"key": "value"
}
}'
const response = await fetch('https://api.hookpulse.io/v1/api/add_solar_schedule/', {
method: 'POST',
headers: {
'x-hookpulse-api-key': '{{x-hookpulse-api-key}}',
'x-brand-uuid': '{{x-brand-uuid}}',
'Content-Type': 'application/json'
},
body: JSON.stringify({
solar_event: 'sunrise',
solar_lat: '{{solar_lat}}',
solar_long: '{{solar_long}}',
solar_offset_seconds: 5,
is_one_off_task: false,
schedule_to: 'webhook',
model_to_schedule_uuid: '{{model_to_schedule_uuid}}',
initial_context_template: {
key: 'value'
}
})
});
const data = await response.json();
console.log(data);
import requests
url = 'https://api.hookpulse.io/v1/api/add_solar_schedule/'
headers = {
'x-hookpulse-api-key': '{{x-hookpulse-api-key}}',
'x-brand-uuid': '{{x-brand-uuid}}',
'Content-Type': 'application/json'
}
payload = {
'solar_event': 'sunrise',
'solar_lat': '{{solar_lat}}',
'solar_long': '{{solar_long}}',
'solar_offset_seconds': 5,
'is_one_off_task': False,
'schedule_to': 'webhook',
'model_to_schedule_uuid': '{{model_to_schedule_uuid}}',
'initial_context_template': {
'key': 'value'
}
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://api.hookpulse.io/v1/api/add_solar_schedule/')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['x-hookpulse-api-key'] = '{{x-hookpulse-api-key}}'
request['x-brand-uuid'] = '{{x-brand-uuid}}'
request['Content-Type'] = 'application/json'
request.body = {
solar_event: 'sunrise',
solar_lat: '{{solar_lat}}',
solar_long: '{{solar_long}}',
solar_offset_seconds: 5,
is_one_off_task: false,
schedule_to: 'webhook',
model_to_schedule_uuid: '{{model_to_schedule_uuid}}',
initial_context_template: {
key: 'value'
}
}.to_json
response = http.request(request)
puts JSON.parse(response.body)
<?php
$url = "https://api.hookpulse.io/v1/api/add_solar_schedule/";
$data = [
'solar_event' => 'sunrise',
'solar_lat' => '{{solar_lat}}',
'solar_long' => '{{solar_long}}',
'solar_offset_seconds' => 5,
'is_one_off_task' => false,
'schedule_to' => 'webhook',
'model_to_schedule_uuid' => '{{model_to_schedule_uuid}}',
'initial_context_template' => [
'key' => 'value'
]
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-hookpulse-api-key: {{x-hookpulse-api-key}}',
'x-brand-uuid: {{x-brand-uuid}}',
'Content-Type: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
{
"success": true,
"details": "Schedule added successfully"
}
Scheduling
Add Schedule (Solar)
Create a solar event-based schedule that executes a webhook or workflow based on sunrise, sunset, or other solar events
POST
/
v1
/
api
/
add_solar_schedule
/
curl -X POST "https://api.hookpulse.io/v1/api/add_solar_schedule/" \
-H "x-hookpulse-api-key: {{x-hookpulse-api-key}}" \
-H "x-brand-uuid: {{x-brand-uuid}}" \
-H "Content-Type: application/json" \
-d '{
"solar_event": "sunrise",
"solar_lat": "{{solar_lat}}",
"solar_long": "{{solar_long}}",
"solar_offset_seconds": 5,
"is_one_off_task": false,
"schedule_to": "webhook",
"model_to_schedule_uuid": "{{model_to_schedule_uuid}}",
"initial_context_template": {
"key": "value"
}
}'
const response = await fetch('https://api.hookpulse.io/v1/api/add_solar_schedule/', {
method: 'POST',
headers: {
'x-hookpulse-api-key': '{{x-hookpulse-api-key}}',
'x-brand-uuid': '{{x-brand-uuid}}',
'Content-Type': 'application/json'
},
body: JSON.stringify({
solar_event: 'sunrise',
solar_lat: '{{solar_lat}}',
solar_long: '{{solar_long}}',
solar_offset_seconds: 5,
is_one_off_task: false,
schedule_to: 'webhook',
model_to_schedule_uuid: '{{model_to_schedule_uuid}}',
initial_context_template: {
key: 'value'
}
})
});
const data = await response.json();
console.log(data);
import requests
url = 'https://api.hookpulse.io/v1/api/add_solar_schedule/'
headers = {
'x-hookpulse-api-key': '{{x-hookpulse-api-key}}',
'x-brand-uuid': '{{x-brand-uuid}}',
'Content-Type': 'application/json'
}
payload = {
'solar_event': 'sunrise',
'solar_lat': '{{solar_lat}}',
'solar_long': '{{solar_long}}',
'solar_offset_seconds': 5,
'is_one_off_task': False,
'schedule_to': 'webhook',
'model_to_schedule_uuid': '{{model_to_schedule_uuid}}',
'initial_context_template': {
'key': 'value'
}
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://api.hookpulse.io/v1/api/add_solar_schedule/')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['x-hookpulse-api-key'] = '{{x-hookpulse-api-key}}'
request['x-brand-uuid'] = '{{x-brand-uuid}}'
request['Content-Type'] = 'application/json'
request.body = {
solar_event: 'sunrise',
solar_lat: '{{solar_lat}}',
solar_long: '{{solar_long}}',
solar_offset_seconds: 5,
is_one_off_task: false,
schedule_to: 'webhook',
model_to_schedule_uuid: '{{model_to_schedule_uuid}}',
initial_context_template: {
key: 'value'
}
}.to_json
response = http.request(request)
puts JSON.parse(response.body)
<?php
$url = "https://api.hookpulse.io/v1/api/add_solar_schedule/";
$data = [
'solar_event' => 'sunrise',
'solar_lat' => '{{solar_lat}}',
'solar_long' => '{{solar_long}}',
'solar_offset_seconds' => 5,
'is_one_off_task' => false,
'schedule_to' => 'webhook',
'model_to_schedule_uuid' => '{{model_to_schedule_uuid}}',
'initial_context_template' => [
'key' => 'value'
]
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-hookpulse-api-key: {{x-hookpulse-api-key}}',
'x-brand-uuid: {{x-brand-uuid}}',
'Content-Type: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
{
"success": true,
"details": "Schedule added successfully"
}
Create a solar event-based schedule that executes a webhook or workflow based on sunrise, sunset, or other solar events at specific geographic coordinates.
Base URL
All API requests should be made to:https://api.hookpulse.io
Example request
curl -X POST "https://api.hookpulse.io/v1/api/add_solar_schedule/" \
-H "x-hookpulse-api-key: {{x-hookpulse-api-key}}" \
-H "x-brand-uuid: {{x-brand-uuid}}" \
-H "Content-Type: application/json" \
-d '{
"solar_event": "sunrise",
"solar_lat": "{{solar_lat}}",
"solar_long": "{{solar_long}}",
"solar_offset_seconds": 5,
"is_one_off_task": false,
"schedule_to": "webhook",
"model_to_schedule_uuid": "{{model_to_schedule_uuid}}",
"initial_context_template": {
"key": "value"
}
}'
const response = await fetch('https://api.hookpulse.io/v1/api/add_solar_schedule/', {
method: 'POST',
headers: {
'x-hookpulse-api-key': '{{x-hookpulse-api-key}}',
'x-brand-uuid': '{{x-brand-uuid}}',
'Content-Type': 'application/json'
},
body: JSON.stringify({
solar_event: 'sunrise',
solar_lat: '{{solar_lat}}',
solar_long: '{{solar_long}}',
solar_offset_seconds: 5,
is_one_off_task: false,
schedule_to: 'webhook',
model_to_schedule_uuid: '{{model_to_schedule_uuid}}',
initial_context_template: {
key: 'value'
}
})
});
const data = await response.json();
console.log(data);
import requests
url = 'https://api.hookpulse.io/v1/api/add_solar_schedule/'
headers = {
'x-hookpulse-api-key': '{{x-hookpulse-api-key}}',
'x-brand-uuid': '{{x-brand-uuid}}',
'Content-Type': 'application/json'
}
payload = {
'solar_event': 'sunrise',
'solar_lat': '{{solar_lat}}',
'solar_long': '{{solar_long}}',
'solar_offset_seconds': 5,
'is_one_off_task': False,
'schedule_to': 'webhook',
'model_to_schedule_uuid': '{{model_to_schedule_uuid}}',
'initial_context_template': {
'key': 'value'
}
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://api.hookpulse.io/v1/api/add_solar_schedule/')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['x-hookpulse-api-key'] = '{{x-hookpulse-api-key}}'
request['x-brand-uuid'] = '{{x-brand-uuid}}'
request['Content-Type'] = 'application/json'
request.body = {
solar_event: 'sunrise',
solar_lat: '{{solar_lat}}',
solar_long: '{{solar_long}}',
solar_offset_seconds: 5,
is_one_off_task: false,
schedule_to: 'webhook',
model_to_schedule_uuid: '{{model_to_schedule_uuid}}',
initial_context_template: {
key: 'value'
}
}.to_json
response = http.request(request)
puts JSON.parse(response.body)
<?php
$url = "https://api.hookpulse.io/v1/api/add_solar_schedule/";
$data = [
'solar_event' => 'sunrise',
'solar_lat' => '{{solar_lat}}',
'solar_long' => '{{solar_long}}',
'solar_offset_seconds' => 5,
'is_one_off_task' => false,
'schedule_to' => 'webhook',
'model_to_schedule_uuid' => '{{model_to_schedule_uuid}}',
'initial_context_template' => [
'key' => 'value'
]
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-hookpulse-api-key: {{x-hookpulse-api-key}}',
'x-brand-uuid: {{x-brand-uuid}}',
'Content-Type: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
Request body
| Field | Type | Required | Description |
|---|---|---|---|
solar_event | string | Yes | Solar event type: "sunrise", "sunset", "civil_dawn", "civil_dusk", "nautical_dawn", "nautical_dusk", "astronomical_dawn", "astronomical_dusk" |
solar_lat | string | Yes | Latitude in decimal degrees (e.g., "40.7128" for New York) |
solar_long | string | Yes | Longitude in decimal degrees (e.g., "-74.0060" for New York) |
solar_offset_seconds | integer | No | Offset in seconds to adjust timing (e.g., 5 for 5 seconds after, -300 for 5 minutes before) |
is_one_off_task | boolean | Yes | Set to true if the schedule should run only once, false for recurring execution |
schedule_to | string | Yes | Target type: "webhook" or "workflow" |
model_to_schedule_uuid | string | Yes | UUID of the webhook or workflow template to schedule (as per schedule_to) |
initial_context_template | object | No | Key-value pairs passed as {{ initial.key }} variables to the webhook/workflow |
Example response
{
"success": true,
"details": "Schedule added successfully"
}
Response fields
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates if the schedule was created successfully |
details | string | Success message |
Solar Event Types
| Event | Description |
|---|---|
"sunrise" | When the sun appears above the horizon |
"sunset" | When the sun disappears below the horizon |
"civil_dawn" | Morning when the sun is 6° below the horizon (bright enough for most activities) |
"civil_dusk" | Evening when the sun is 6° below the horizon (still bright enough for most activities) |
"nautical_dawn" | Morning when the sun is 12° below the horizon (horizon visible at sea) |
"nautical_dusk" | Evening when the sun is 12° below the horizon (horizon visible at sea) |
"astronomical_dawn" | Morning when the sun is 18° below the horizon (dark enough for astronomical observations) |
"astronomical_dusk" | Evening when the sun is 18° below the horizon (dark enough for astronomical observations) |
Geographic Coordinates
Provide latitude and longitude as decimal degrees:- Latitude: Range from -90 to +90 (negative for Southern Hemisphere)
- Longitude: Range from -180 to +180 (negative for Western Hemisphere)
- Format: String representation of decimal number (e.g.,
"40.7128","-74.0060")
Example Coordinates
| Location | Latitude | Longitude |
|---|---|---|
| New York, USA | 40.7128 | -74.0060 |
| London, UK | 51.5074 | -0.1278 |
| Tokyo, Japan | 35.6762 | 139.6503 |
| Mumbai, India | 19.0760 | 72.8777 |
| Sydney, Australia | -33.8688 | 151.2093 |
Solar Offset
Thesolar_offset_seconds field allows you to adjust the execution time relative to the solar event:
- Positive values: Execute after the event (e.g.,
1800= 30 minutes after sunrise) - Negative values: Execute before the event (e.g.,
-300= 5 minutes before sunset) - Zero or omitted: Execute exactly at the solar event time
Initial Context Template
Theinitial_context_template object allows you to pass variables to your webhook or workflow that can be accessed using {{ initial.key }} syntax:
- In request body:
{{ initial.key }}will be replaced with the value - In headers:
{{ initial.key }}can be used in header values - In query params:
{{ initial.key }}can be used in query parameters - In path:
{{ initial.key }}can be used in URL paths
- System secrets:
{{ #secret_key }}for vault secrets - Workflow step responses:
{{ step.response.variable }}in workflows
Use Cases
- Outdoor Lighting: Turn lights on at sunset and off at sunrise
- Solar Panel Management: Optimize solar panel operations based on sun position
- Agricultural Systems: Schedule irrigation or operations based on daylight
- Weather-Dependent Operations: Trigger operations based on natural light
- Location-Based Automation: Automate based on solar events at specific locations
- Smart Home: Control devices based on natural light cycles
Examples
Sunrise Trigger - Recurring
{
"solar_event": "sunrise",
"solar_lat": "{{solar_lat}}",
"solar_long": "{{solar_long}}",
"solar_offset_seconds": 0,
"is_one_off_task": false,
"schedule_to": "webhook",
"model_to_schedule_uuid": "{{model_to_schedule_uuid}}"
}
Sunset with 30-Minute Offset - Recurring
{
"solar_event": "sunset",
"solar_lat": "{{solar_lat}}",
"solar_long": "{{solar_long}}",
"solar_offset_seconds": 1800,
"is_one_off_task": false,
"schedule_to": "webhook",
"model_to_schedule_uuid": "{{model_to_schedule_uuid}}"
}
Civil Dawn for Outdoor Operations - Recurring
{
"solar_event": "civil_dawn",
"solar_lat": "{{solar_lat}}",
"solar_long": "{{solar_long}}",
"solar_offset_seconds": 0,
"is_one_off_task": false,
"schedule_to": "workflow",
"model_to_schedule_uuid": "{{model_to_schedule_uuid}}",
"initial_context_template": {
"location": "London",
"operation": "outdoor_lighting"
}
}
One-Time Solar Event Trigger
{
"solar_event": "sunrise",
"solar_lat": "{{solar_lat}}",
"solar_long": "{{solar_long}}",
"solar_offset_seconds": 0,
"is_one_off_task": true,
"schedule_to": "webhook",
"model_to_schedule_uuid": "{{model_to_schedule_uuid}}"
}
Related Documentation
- Scheduling Overview - Learn about all scheduling types and solar windows
- Get Timezone Options - Get list of available timezones
- Add Interval Schedule - Create interval-based schedules
Authorizations
API key for authentication. Get this from your dashboard by selecting a brand and going to API Keys section.
Brand UUID for authentication. Get this from your dashboard after adding a brand - it will be displayed in the UI.
Body
application/json
Solar schedule configuration
Solar event type
Available options:
sunrise, sunset, civil_dawn, civil_dusk, nautical_dawn, nautical_dusk, astronomical_dawn, astronomical_dusk Latitude in decimal degrees
Longitude in decimal degrees
Target type: 'webhook' or 'workflow'
Available options:
webhook, workflow UUID of the webhook or workflow template to schedule
Offset in seconds to adjust timing (e.g., 5 for 5 seconds after, -300 for 5 minutes before)
Key-value pairs passed as {{ initial.key }} variables to the webhook/workflow

