Activity
List Activity Actions
Returns a list of activity actions.
Query Parameters
Control what fields are being returned in the object.
A limit on the number of objects that are returned.
What metadata to return in the response.
How many items to skip when fetching data.
How to sort the returned items. sort
is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (-
) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV. You can also use a ?
to sort randomly.
Select items in collection by given conditions.
Filter by items that contain the given search query in one of their fields.
Responses
Unique identifier for the object.
Action that was performed.
The user who performed this action. Many-to-one to users.
When the action happened.
The IP address of the user at the time the action took place.
User agent string of the browser the user used when the action took place.
Collection identifier in which the item resides.
Unique identifier for the item the action applied to. This is always a string, even for integer primary keys.
User comment. This will store the comments that show up in the right sidebar of the item edit page in the admin app.
Origin of the request when the action took place.
Any changes that were made in this activity. One-to-many to revisions.
Returns the total item count of the collection you're querying.
Returns the item count of the collection you're querying, taking the current filter/search parameters into account.
GET /activity
import { createDirectus, rest, readActivities } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(readActivities(query_object));
POST /graphql/system
type Query {
activity: [directus_activity]
}
{
"data": [
{
"id": 2,
"action": "update",
"timestamp": "2019-12-05T22:52:09Z",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/78.0.3904.108 Safari/537.36",
"item": "328",
"comment": null,
"origin": "https://directus.io",
"revisions": []
}
],
"meta": {}
}
Retrieve an Activity Action
Returns a single activity action by primary key.
Query Parameters
Identifier for the object.
Control what fields are being returned in the object.
What metadata to return in the response.
Responses
Unique identifier for the object.
Action that was performed.
The user who performed this action. Many-to-one to users.
When the action happened.
The IP address of the user at the time the action took place.
User agent string of the browser the user used when the action took place.
Collection identifier in which the item resides.
Unique identifier for the item the action applied to. This is always a string, even for integer primary keys.
User comment. This will store the comments that show up in the right sidebar of the item edit page in the admin app.
Origin of the request when the action took place.
Any changes that were made in this activity. One-to-many to revisions.
GET /activity/{id}
import { createDirectus, rest, readActivity } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(readActivity(activity_id, query_object));
POST /graphql/system
type Query {
activity_by_id(id: ID!): directus_activity
}
{
"data": {
"id": 2,
"action": "update",
"timestamp": "2019-12-05T22:52:09Z",
"ip": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/78.0.3904.108 Safari/537.36",
"item": "328",
"comment": null,
"origin": "https://directus.io",
"revisions": []
}
}