Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Taykl12/Classify/llms.txt

Use this file to discover all available pages before exploring further.

The POST /api/tasks endpoint creates a new task and attaches it to the specified project. Under the hood it calls the Supabase RPC function create_tarea_grupo, which validates project membership and inserts the task row atomically. The title is trimmed of leading and trailing whitespace before storage. If no priority is supplied the task is created with a default priority of Media.

Authentication

All requests must include a valid Bearer token in the Authorization header.
Authorization: Bearer <token>

Request

POST /api/tasks
Content-Type: application/json

Request body

projectId
number | string
required
The ID of the project to which the new task will be added. Accepts both numeric and UUID string formats.
title
string
required
Title of the task. Must be non-empty after trimming whitespace.
description
string
Optional longer description providing additional context for the task.
priority
string
default:"Media"
Priority level for the task. Must be one of "Alta", "Media", or "Baja". Defaults to "Media" when omitted.
deadline
string
Optional deadline as an ISO 8601 datetime string (e.g. "2024-09-01T00:00:00.000Z"). Stored in the database as fecha_limite.

Example request body

{
  "projectId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "title": "Design new landing page hero",
  "description": "Must follow the revised brand guidelines approved in June.",
  "priority": "Alta",
  "deadline": "2024-09-01T00:00:00.000Z"
}

Underlying RPC call

The endpoint invokes the following Supabase RPC:
SELECT * FROM create_tarea_grupo(
  p_id_grupo      := <projectId>,
  p_titulo        := <title>,
  p_descripcion   := <description>,
  p_prioridad     := <priority>,
  p_fecha_limite  := <deadline>
);
The function enforces project-membership rules and returns the fully-inserted task row, which is forwarded directly to the caller.

Response

Returns HTTP 201 Created with the newly created task row as returned by Supabase.

Example response

{
  "id": "g7h8i9j0-k1l2-3456-mnop-567890123456",
  "id_grupo": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "titulo": "Design new landing page hero",
  "descripcion": "Must follow the revised brand guidelines approved in June.",
  "prioridad": "Alta",
  "estado": "Pendiente",
  "fecha_limite": "2024-09-01T00:00:00.000Z",
  "created_at": "2024-07-15T10:23:45.000Z"
}

Code examples

curl --request POST \
  --url https://your-app.com/api/tasks \
  --header "Authorization: Bearer <token>" \
  --header "Content-Type: application/json" \
  --data '{
    "projectId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "title": "Design new landing page hero",
    "description": "Must follow the revised brand guidelines approved in June.",
    "priority": "Alta",
    "deadline": "2024-09-01T00:00:00.000Z"
  }'

Error responses

StatusMeaning
400projectId or title is missing or title is empty after trim.
401Missing or invalid Authorization header / token.
500Unexpected server error or RPC failure.

Build docs developers (and LLMs) love