Update List
PATCH /v1/nexttask/lists/{id}
Change a list
Changes only the fields sent. Needs Lists > Edit, on a list you own.
Request
PATCH https://your-site.example/api/index.php/v1/nexttask/lists/{id}
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
id |
integer |
path |
Yes | The record the call is about. An id or ids in the body is ignored. |
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
title |
string |
No | |
color |
string |
No | A hex colour. |
{
"title": "Weekly groceries"
}
Responses
200 — The list.
{
"success": true,
"message": "string",
"messages": "string",
"data": {
"item": {
"id": 5,
"user_id": 1,
"title": "Groceries",
"color": "#1967d2",
"position": "string",
"is_default": 1,
"is_team": 1,
"owner_name": "string",
"access": "owner",
"can_leave": true,
"created": "string",
"created_by": 1,
"modified": "string",
"modified_by": 1
}
}
}
Errors
| Status | Code | When |
|---|---|---|
401 |
No valid API token. | |
403 |
FORBIDDEN when the role or the list does not allow it, APP_DISABLED when the feature's app is off. |
|
404 |
NOT_FOUND: no such record, or not one you can reach. |
|
422 |
VALIDATION, NESTING or QUOTA, with the reason in message. |
Examples
curl
curl -s -X PATCH "https://your-site.example/api/index.php/v1/nexttask/lists/1" \
-H "X-Joomla-Token: $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"title":"Weekly groceries"}'
PHP
<?php
$ch = curl_init('https://your-site.example/api/index.php/v1/nexttask/lists/1');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-Joomla-Token: ' . getenv('API_TOKEN'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => '{"title":"Weekly groceries"}',
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
JavaScript
const API_TOKEN = process.env.API_TOKEN;
const response = await fetch("https://your-site.example/api/index.php/v1/nexttask/lists/1", {
method: 'PATCH',
headers: {
"X-Joomla-Token": `${API_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"title": "Weekly groceries"
}),
});
const data = await response.json();