API EndpointsListsCreate New List

Create New List

Endpoint

URL: /:projectId/lists/

Method: POST

Authentication Required: Yes (Access Token in Authorization Header)


Description

This endpoint allows clients to create a new sublist. The list must have a valid parent list ID and a name. Authentication is required.


Request

Path Parameters

ParameterTypeRequiredDescription
projectIdstringYesThe project ID associated with the request.

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token for authentication.

Body Parameters

ParameterTypeRequiredDescription
listNamestringYesThe name of the new list.
parentIdstringYesThe ID of the parent list for nested lists.

Example Request

POST /12345/lists/
Content-Type: application/json
Authorization: Bearer <ACCESS_TOKEN>
 
{
  "listName": "My New List",
  "parentId": "67890"
}

Response

Success Response (200 OK)

{
  "id": "98765",
  "projectId": "12345",
  "userId": "56789",
  "parentId": "67890",
  "name": "My New List",
  "entityIds": [],
  "entities": [],
  "createdAt": "2024-02-12T10:00:00Z",
  "updatedAt": "2024-02-12T10:00:00Z"
}

Error Responses

Missing or Invalid Data (400 Bad Request)

{
  "error": "Missing required parameters in request body"
}

Invalid Parent List ID (400 Bad Request)

{
  "error": "Invalid parent list ID for sublist"
}

Server Error (500 Internal Server Error)

{
  "error": "Server error"
}

Notes

  • The parentId must be a valid existing list ID.
  • The listName must be provided and cannot be empty.
  • The created list will be returned with its details after successful creation.