package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.nex.ai/api/developers/v1/tasks"
payload := strings.NewReader("{\n \"title\": \"Follow up with client\",\n \"description\": \"Discuss contract renewal\",\n \"priority\": \"high\",\n \"due_date\": \"2026-03-01T09:00:00Z\",\n \"entity_ids\": [\n \"1001\",\n \"1002\"\n ],\n \"assignee_ids\": [\n \"50\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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))
}