Events
Create Event
Create a new scheduled event
POST
/
api
/
v1
/
events
TypeScript SDK
import { cuey } from 'cuey';
const event = await cuey.schedule({
webhook_url: 'https://api.example.com/webhook',
method: 'POST',
scheduled_at: '2024-12-31T23:59:59Z',
payload: {
message: 'Hello, Cuey!'
}
});curl --request POST \
--url https://cuey.dev/api/v1/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"webhook_url": "<string>",
"scheduled_at": "2023-11-07T05:31:56Z",
"method": "POST",
"headers": {},
"payload": {},
"retry_config": {
"maxRetries": 5,
"backoffMs": 2550
}
}
'import requests
url = "https://cuey.dev/api/v1/events"
payload = {
"webhook_url": "<string>",
"scheduled_at": "2023-11-07T05:31:56Z",
"method": "POST",
"headers": {},
"payload": {},
"retry_config": {
"maxRetries": 5,
"backoffMs": 2550
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
webhook_url: '<string>',
scheduled_at: '2023-11-07T05:31:56Z',
method: 'POST',
headers: {},
payload: {},
retry_config: {maxRetries: 5, backoffMs: 2550}
})
};
fetch('https://cuey.dev/api/v1/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cuey.dev/api/v1/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'webhook_url' => '<string>',
'scheduled_at' => '2023-11-07T05:31:56Z',
'method' => 'POST',
'headers' => [
],
'payload' => [
],
'retry_config' => [
'maxRetries' => 5,
'backoffMs' => 2550
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://cuey.dev/api/v1/events"
payload := strings.NewReader("{\n \"webhook_url\": \"<string>\",\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"method\": \"POST\",\n \"headers\": {},\n \"payload\": {},\n \"retry_config\": {\n \"maxRetries\": 5,\n \"backoffMs\": 2550\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://cuey.dev/api/v1/events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"webhook_url\": \"<string>\",\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"method\": \"POST\",\n \"headers\": {},\n \"payload\": {},\n \"retry_config\": {\n \"maxRetries\": 5,\n \"backoffMs\": 2550\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cuey.dev/api/v1/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"webhook_url\": \"<string>\",\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"method\": \"POST\",\n \"headers\": {},\n \"payload\": {},\n \"retry_config\": {\n \"maxRetries\": 5,\n \"backoffMs\": 2550\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scheduled_at": "2023-11-07T05:31:56Z",
"webhook_url": "<string>",
"cron_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_of": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"executed_at": "2023-11-07T05:31:56Z",
"headers": {},
"payload": {},
"retry_config": {
"maxRetries": 5,
"backoffMs": 2550
},
"response_status": 123,
"response_headers": {},
"response_body": "<string>",
"response_duration": 123,
"response_error": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": {
"message": "<string>",
"details": {}
}
}Authorizations
API key authentication. Include your API key in the Authorization header as: Bearer
Body
application/json
ISO timestamp, must be in the future
Available options:
GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
Event created
Show child attributes
Show child attributes
⌘I
TypeScript SDK
import { cuey } from 'cuey';
const event = await cuey.schedule({
webhook_url: 'https://api.example.com/webhook',
method: 'POST',
scheduled_at: '2024-12-31T23:59:59Z',
payload: {
message: 'Hello, Cuey!'
}
});curl --request POST \
--url https://cuey.dev/api/v1/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"webhook_url": "<string>",
"scheduled_at": "2023-11-07T05:31:56Z",
"method": "POST",
"headers": {},
"payload": {},
"retry_config": {
"maxRetries": 5,
"backoffMs": 2550
}
}
'import requests
url = "https://cuey.dev/api/v1/events"
payload = {
"webhook_url": "<string>",
"scheduled_at": "2023-11-07T05:31:56Z",
"method": "POST",
"headers": {},
"payload": {},
"retry_config": {
"maxRetries": 5,
"backoffMs": 2550
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
webhook_url: '<string>',
scheduled_at: '2023-11-07T05:31:56Z',
method: 'POST',
headers: {},
payload: {},
retry_config: {maxRetries: 5, backoffMs: 2550}
})
};
fetch('https://cuey.dev/api/v1/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cuey.dev/api/v1/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'webhook_url' => '<string>',
'scheduled_at' => '2023-11-07T05:31:56Z',
'method' => 'POST',
'headers' => [
],
'payload' => [
],
'retry_config' => [
'maxRetries' => 5,
'backoffMs' => 2550
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://cuey.dev/api/v1/events"
payload := strings.NewReader("{\n \"webhook_url\": \"<string>\",\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"method\": \"POST\",\n \"headers\": {},\n \"payload\": {},\n \"retry_config\": {\n \"maxRetries\": 5,\n \"backoffMs\": 2550\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://cuey.dev/api/v1/events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"webhook_url\": \"<string>\",\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"method\": \"POST\",\n \"headers\": {},\n \"payload\": {},\n \"retry_config\": {\n \"maxRetries\": 5,\n \"backoffMs\": 2550\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cuey.dev/api/v1/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"webhook_url\": \"<string>\",\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"method\": \"POST\",\n \"headers\": {},\n \"payload\": {},\n \"retry_config\": {\n \"maxRetries\": 5,\n \"backoffMs\": 2550\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scheduled_at": "2023-11-07T05:31:56Z",
"webhook_url": "<string>",
"cron_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_of": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"executed_at": "2023-11-07T05:31:56Z",
"headers": {},
"payload": {},
"retry_config": {
"maxRetries": 5,
"backoffMs": 2550
},
"response_status": 123,
"response_headers": {},
"response_body": "<string>",
"response_duration": 123,
"response_error": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": {
"message": "<string>",
"details": {}
}
}