Skip to main content
POST
/
v1
/
tasks
Task
curl --request POST \
  --url https://api.example.com/v1/tasks
import 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_body

Create 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

ParameterTypeRequiredDescription
titlestringYesTask title
descriptionstringNoTask description
notesstringNoAdditional notes
lead_iduuidNoLink task to a lead
user_iduuidNoAssign task to a specific user
due_datestringNoDue date (YYYY-MM-DD)
due_timestringNoDue time (HH:MM)
prioritystringNoPriority: 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

{
  "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"
  }
}