Skip to content
On this page

Directus Cloud

Everything you need to start building. Provisioned in 90 seconds. Starting at $15/month.

Get Started

Comments

Comments are a collaboration tool and can be left on items from the sidebar.

The Comment Object

collection string
Collection identifier in which the item resides.

id uuid
Unique identifier for the object.

item string
The item the comment is created for.

comment string
User comment. This will store the comments that show up in the right sidebar of the item edit page in the Data Studio.

date_created timestamp
Timestamp in ISO8601 when the comment was created.

date_updated timestamp
Timestamp in ISO8601 when the comment was last updated.

user_created many-to-one
The user who created the comment. Many-to-one to users.

user_updated many-to-one
The user who last updated the comment. Many-to-one to users.

json
{
	"collection": "articles",
	"id": "2fab3b9d-0543-4b87-8a30-3c5ee66fedf1",
	"item": "15",
	"comment": "This is a comment on an article",
	"date_created": "2023-01-15T09:14:52Z",
	"date_updated": "2023-01-15T09:00:00Z",
	"user_created": "12e62fd0-29c7-4fd3-b3d3-c7a39933e8af",
	"user_updated": "12e62fd0-29c7-4fd3-b3d3-c7a39933e8af"
}
{
	"collection": "articles",
	"id": "2fab3b9d-0543-4b87-8a30-3c5ee66fedf1",
	"item": "15",
	"comment": "This is a comment on an article",
	"date_created": "2023-01-15T09:14:52Z",
	"date_updated": "2023-01-15T09:00:00Z",
	"user_created": "12e62fd0-29c7-4fd3-b3d3-c7a39933e8af",
	"user_updated": "12e62fd0-29c7-4fd3-b3d3-c7a39933e8af"
}

Get Comments

Returns a list of comments.

Request

Query Parameters

Supports all global query parameters.

Returns

An array of up to limit comment objects. If no items are available, data will be an empty array.

Get Comment by ID

Returns a single comment by primary key.

Request

Query Parameters

Supports all global query parameters.

Response

Returns a comment object if a valid identifier was provided.

Create a Comment

Create a new comment. This action is only available to authenticated users.

Request

Query Parameters

Supports all global query parameters.

Request Body

A partial comment object.

Response

Returns the comment object of the comment that was created.

Create Multiple Comments

Create multiple new comments. This action is only available to authenticated users.

Request

Query Parameters

Supports all global query parameters.

Request Body

An array of partial comment objects. name is required.

Response

Returns an array of comment objects of the comments that were created.

Update a Comment

Update an existing comment. This action is only available to authenticated users.

Request

Query Parameters

Supports all global query parameters.

Request Body

A partial comment object.

Response

Returns the comment object of the comment that was updated.

Update Multiple Comments

Update multiple existing comments. This action is only available to authenticated users.

Request

Query Parameters

Supports all global query parameters.

Request Body

keys Required
Array of primary keys of the comments you'd like to update.

data Required
Any of the comment object's properties.

Response

Returns the comment objects of the comments that were updated.

Delete a Comment

Delete an existing comment. This action is only available to authenticated users.

Request

Response

Empty body.

Delete Multiple Comments

Delete multiple existing comments. This action is only available to authenticated users.

Request

Request Body

An array of comment primary keys.

Returns

Empty body.