Skip to main content
POST
/
v2
/
tasks
Create Task
const options = {
  method: 'POST',
  headers: {
    'x-api-key': '<x-api-key>',
    'x-organization-id': '<x-organization-id>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    project_id: '<string>',
    title: '<string>',
    assigned_to: '<string>',
    description: '<string>',
    due_date: '<string>',
    stage: '<string>',
    category: '<string>',
    parent_task_id: '<string>',
    progress: 123,
    tags: ['<string>'],
    comments: ['<string>']
  })
};

fetch('https://api.dcycle.io/v2/tasks', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
import requests

url = "https://api.dcycle.io/v2/tasks"

payload = {
    "project_id": "<string>",
    "title": "<string>",
    "assigned_to": "<string>",
    "description": "<string>",
    "due_date": "<string>",
    "stage": "<string>",
    "category": "<string>",
    "parent_task_id": "<string>",
    "progress": 123,
    "tags": ["<string>"],
    "comments": ["<string>"]
}
headers = {
    "x-api-key": "<x-api-key>",
    "x-organization-id": "<x-organization-id>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
curl --request POST \
  --url https://api.dcycle.io/v2/tasks \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --header 'x-organization-id: <x-organization-id>' \
  --data '
{
  "project_id": "<string>",
  "title": "<string>",
  "assigned_to": "<string>",
  "description": "<string>",
  "due_date": "<string>",
  "stage": "<string>",
  "category": "<string>",
  "parent_task_id": "<string>",
  "progress": 123,
  "tags": [
    "<string>"
  ],
  "comments": [
    "<string>"
  ]
}
'
{
  "id": "<string>",
  "title": "<string>",
  "stage": "<string>",
  "assigned_to": {},
  "projects": {}
}

Create Task

Create a new task linked to a project. The assigned user receives an email notification unless they are the creator.

Request

Headers

x-api-key
string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
x-organization-id
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa
Accept-Language
string
default:"es"
Language for the notification email: en, es, fr, pt, it, de

Body Parameters

project_id
string
required
UUID of the project to link the task to
title
string
required
Task title
assigned_to
string
required
UUID of the user to assign the task to
description
string
Task description
due_date
string
Due date (YYYY-MM-DD)
stage
string
Initial stage: not_applicable, pending, in_progress, completed, validated
category
string
Task category
parent_task_id
string
UUID of the parent task (creates a subtask)
progress
number
Initial progress (0–100)
tags
string[]
List of tags
comments
string[]
Initial comments to add to the task

Response (201 Created)

id
string
Created task UUID
title
string
Task title
stage
string
Task stage
assigned_to
object
Assigned user details
projects
array[object]
Linked projects

Example

curl -X POST "https://api.dcycle.io/v2/tasks" \
  -H "x-api-key: ${DCYCLE_API_KEY}" \
  -H "x-organization-id: ${DCYCLE_ORG_ID}" \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "project-uuid",
    "title": "Upload Q2 electricity invoices",
    "assigned_to": "user-uuid",
    "description": "Upload all Q2 2025 electricity invoices for Madrid office",
    "due_date": "2025-07-15",
    "stage": "pending",
    "tags": ["invoices", "Q2"]
  }'
import requests
import os

response = requests.post(
    "https://api.dcycle.io/v2/tasks",
    headers={
        "x-api-key": os.getenv("DCYCLE_API_KEY"),
        "x-organization-id": os.getenv("DCYCLE_ORG_ID"),
        "Content-Type": "application/json",
    },
    json={
        "project_id": "project-uuid",
        "title": "Upload Q2 electricity invoices",
        "assigned_to": "user-uuid",
        "description": "Upload all Q2 2025 electricity invoices for Madrid office",
        "due_date": "2025-07-15",
        "stage": "pending",
        "tags": ["invoices", "Q2"],
    },
)

task = response.json()
print(f"Created task: {task['id']}{task['title']}")
const axios = require('axios');

const { data: task } = await axios.post(
  'https://api.dcycle.io/v2/tasks',
  {
    project_id: 'project-uuid',
    title: 'Upload Q2 electricity invoices',
    assigned_to: 'user-uuid',
    description: 'Upload all Q2 2025 electricity invoices for Madrid office',
    due_date: '2025-07-15',
    stage: 'pending',
    tags: ['invoices', 'Q2'],
  },
  {
    headers: {
      'x-api-key': process.env.DCYCLE_API_KEY,
      'x-organization-id': process.env.DCYCLE_ORG_ID,
      'Content-Type': 'application/json',
    },
  }
);

console.log(`Created task: ${task.id} — ${task.title}`);

Successful Response (201)

{
  "id": "task-uuid",
  "title": "Upload Q2 electricity invoices",
  "description": "Upload all Q2 2025 electricity invoices for Madrid office",
  "due_date": "2025-07-15",
  "stage": "pending",
  "category": null,
  "organization_id": "org-uuid",
  "assigned_to": {
    "id": "user-uuid",
    "first_name": "Carlos",
    "last_name": "López",
    "email": "carlos@example.com"
  },
  "projects": [
    { "id": "project-uuid", "name": "Carbon Footprint 2025" }
  ],
  "comments": [],
  "progress": null,
  "tags": ["invoices", "Q2"]
}

Common Errors

401 Unauthorized

Cause: Missing or invalid API key
{"detail": "Invalid API key for organization", "code": "INVALID_API_KEY"}

403 Forbidden

Cause: The authenticated user is not a member of the organization
{"detail": "Logged User is not Member of Organization", "code": "LOGGED_USER_NOT_MEMBER"}

422 Unprocessable Entity

Cause: Invalid or missing required fields in the request body
{
  "detail": [
    {
      "loc": ["body", "title"],
      "msg": "field required",
      "type": "value_error.missing"
    }
  ]
}

Get Task

Retrieve task details

Update Task

Modify task fields