Task
curl --request POST \
--url https://api.example.com/v1/tasksimport requests
url = "https://api.example.com/v1/tasks"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/tasks', 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://api.example.com/v1/tasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/tasks"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/tasks")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyTasks
Task
Creates a new task, optionally linked to a lead.
POST
/
v1
/
tasks
Task
curl --request POST \
--url https://api.example.com/v1/tasksimport requests
url = "https://api.example.com/v1/tasks"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/tasks', 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://api.example.com/v1/tasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/tasks"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/tasks")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyCreate a Task
Creates a new task. Optionally link it to a lead or assign it to a specific user.Request
POST /v1/tasks
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Task title |
description | string | No | Task description |
notes | string | No | Additional notes |
lead_id | uuid | No | Link task to a lead |
user_id | uuid | No | Assign task to a specific user |
due_date | string | No | Due date (YYYY-MM-DD) |
due_time | string | No | Due time (HH:MM) |
priority | string | No | Priority: low, medium, or high (default: medium) |
Example
curl -X POST \
"https://kdjmltmhxvvmiuehafgl.supabase.co/functions/v1/api-gateway/v1/tasks" \
-H "Authorization: Bearer rchd_live_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"title": "Follow up with John Doe",
"lead_id": "a1b2c3d4-...",
"due_date": "2026-03-25",
"priority": "high"
}'
const response = await fetch(
"https://kdjmltmhxvvmiuehafgl.supabase.co/functions/v1/api-gateway/v1/tasks",
{
method: "POST",
headers: {
"Authorization": "Bearer rchd_live_xxxxxxxxxxxx",
"Content-Type": "application/json"
},
body: JSON.stringify({
title: "Follow up with John Doe",
lead_id: "a1b2c3d4-...",
due_date: "2026-03-25",
priority: "high"
})
}
);
const data = await response.json();
import requests
response = requests.post(
"https://kdjmltmhxvvmiuehafgl.supabase.co/functions/v1/api-gateway/v1/tasks",
headers={
"Authorization": "Bearer rchd_live_xxxxxxxxxxxx",
"Content-Type": "application/json"
},
json={
"title": "Follow up with John Doe",
"lead_id": "a1b2c3d4-...",
"due_date": "2026-03-25",
"priority": "high"
}
)
data = response.json()
Response
- 201 Created
- 400 Bad Request
{
"data": {
"id": "task-uuid-1",
"title": "Follow up with John Doe",
"lead_id": "a1b2c3d4-...",
"status": "pending",
"priority": "high",
"due_date": "2026-03-25",
"created_at": "2026-03-21T10:00:00.000Z"
}
}
{
"error": {
"code": "bad_request",
"message": "title is required"
}
}
⌘I
.png?fit=max&auto=format&n=PYj-p9lRwfHX4QQS&q=85&s=967f00940a17d1d8cc11bd8995dc98d0)
.png?fit=max&auto=format&n=PYj-p9lRwfHX4QQS&q=85&s=5072033d90dfd5e7cc9349712ea4e145)