Operations
List Operations
List all operations that exist in Directus.
Query Parameters
Control what fields are being returned in the object.
A limit on the number of objects that are returned.
How many items to skip when fetching data.
What metadata to return in the response.
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.
Cursor for use in pagination. Often used in combination with limit.
Responses
Unique identifier for the operation.
The name of the operation.
Key for the operation. Must be unique within a given flow.
Type of operation. One of log
, mail
, notification
, create
, read
, request
, sleep
, transform
, trigger
, condition
, or any type of custom operation extensions.
Position of the operation on the X axis within the flow workspace.
Position of the operation on the Y axis within the flow workspace.
Options depending on the type of the operation.
The operation triggered when the current operation succeeds (or then
logic of a condition operation).
The operation triggered when the current operation fails (or otherwise
logic of a condition operation).
Timestamp in ISO8601 when the operation was created.
The user who created the operation.
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 /operations
import { createDirectus, rest, readOperations } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(readOperations(query_object));
POST /graphql/system
type Query {
operations: [directus_operations]
}
{
"data": [
{
"id": "2f24211d-d928-469a-aea3-3c8f53d4e426",
"name": "Log to Console",
"key": "log_console",
"type": "log",
"position_x": 12,
"position_y": 12,
"options": null,
"resolve": "63716273-0f29-4648-8a2a-2af2948f6f78",
"reject": "63716273-0f29-4648-8a2a-2af2948f6f78",
"date_created": "2022-05-11T13:14:52Z",
"user_created": "63716273-0f29-4648-8a2a-2af2948f6f78"
}
],
"meta": {}
}
Create Multiple Operations
Create multiple new operations.
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.
Request Body
Unique identifier for the operation.
The name of the operation.
Key for the operation. Must be unique within a given flow.
Type of operation. One of log
, mail
, notification
, create
, read
, request
, sleep
, transform
, trigger
, condition
, or any type of custom operation extensions.
Position of the operation on the X axis within the flow workspace.
Position of the operation on the Y axis within the flow workspace.
Options depending on the type of the operation.
The operation triggered when the current operation succeeds (or then
logic of a condition operation).
The operation triggered when the current operation fails (or otherwise
logic of a condition operation).
Timestamp in ISO8601 when the operation was created.
The user who created the operation.
Responses
Unique identifier for the operation.
The name of the operation.
Key for the operation. Must be unique within a given flow.
Type of operation. One of log
, mail
, notification
, create
, read
, request
, sleep
, transform
, trigger
, condition
, or any type of custom operation extensions.
Position of the operation on the X axis within the flow workspace.
Position of the operation on the Y axis within the flow workspace.
Options depending on the type of the operation.
The operation triggered when the current operation succeeds (or then
logic of a condition operation).
The operation triggered when the current operation fails (or otherwise
logic of a condition operation).
Timestamp in ISO8601 when the operation was created.
The user who created the operation.
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.
POST /operations
import { createDirectus, rest, createOperations } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(createOperations(operations_object_array));
POST /graphql/system
type Mutation {
create_operations_items(data: [create_directus_operations_input!]!): [directus_operations]
}
{
"data": [
{
"id": "2f24211d-d928-469a-aea3-3c8f53d4e426",
"name": "Log to Console",
"key": "log_console",
"type": "log",
"position_x": 12,
"position_y": 12,
"options": null,
"resolve": "63716273-0f29-4648-8a2a-2af2948f6f78",
"reject": "63716273-0f29-4648-8a2a-2af2948f6f78",
"date_created": "2022-05-11T13:14:52Z",
"user_created": "63716273-0f29-4648-8a2a-2af2948f6f78"
}
],
"meta": {}
}
Delete Multiple Operations
Delete multiple existing operations.
Responses
DELETE /operations
import { createDirectus, rest, deleteOperations } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(deleteOperations(operations_id_array));
POST /graphql/system
type Mutation {
delete_operations_items(ids: [ID!]!): delete_many
}
Update Multiple Operations
Update multiple operations at the same time.
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.
Request Body
Unique identifier for the operation.
The name of the operation.
Key for the operation. Must be unique within a given flow.
Type of operation. One of log
, mail
, notification
, create
, read
, request
, sleep
, transform
, trigger
, condition
, or any type of custom operation extensions.
Position of the operation on the X axis within the flow workspace.
Position of the operation on the Y axis within the flow workspace.
The operation triggered when the current operation succeeds (or then
logic of a condition operation).
The operation triggered when the current operation fails (or otherwise
logic of a condition operation).
Timestamp in ISO8601 when the operation was created.
The user who created the operation.
Responses
Unique identifier for the operation.
The name of the operation.
Key for the operation. Must be unique within a given flow.
Type of operation. One of log
, mail
, notification
, create
, read
, request
, sleep
, transform
, trigger
, condition
, or any type of custom operation extensions.
Position of the operation on the X axis within the flow workspace.
Position of the operation on the Y axis within the flow workspace.
Options depending on the type of the operation.
The operation triggered when the current operation succeeds (or then
logic of a condition operation).
The operation triggered when the current operation fails (or otherwise
logic of a condition operation).
Timestamp in ISO8601 when the operation was created.
The user who created the operation.
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.
PATCH /operations
import { createDirectus, rest, updateOperations } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(updateOperations(operations_id_array, partial_operations_object));
type Mutation {
update_operations_items(ids: [ID!]!, data: update_directus_operations_input): [directus_operations]
}
{
"data": [
{
"id": "2f24211d-d928-469a-aea3-3c8f53d4e426",
"name": "Log to Console",
"key": "log_console",
"type": "log",
"position_x": 12,
"position_y": 12,
"options": null,
"resolve": "63716273-0f29-4648-8a2a-2af2948f6f78",
"reject": "63716273-0f29-4648-8a2a-2af2948f6f78",
"date_created": "2022-05-11T13:14:52Z",
"user_created": "63716273-0f29-4648-8a2a-2af2948f6f78"
}
],
"meta": {}
}
Create an Operation
Create a new operation.
Query Parameters
Control what fields are being returned in the object.
What metadata to return in the response.
Request Body
Unique identifier for the operation.
The name of the operation.
Key for the operation. Must be unique within a given flow.
Type of operation. One of log
, mail
, notification
, create
, read
, request
, sleep
, transform
, trigger
, condition
, or any type of custom operation extensions.
Position of the operation on the X axis within the flow workspace.
Position of the operation on the Y axis within the flow workspace.
The operation triggered when the current operation succeeds (or then
logic of a condition operation).
The operation triggered when the current operation fails (or otherwise
logic of a condition operation).
Timestamp in ISO8601 when the operation was created.
The user who created the operation.
Responses
Unique identifier for the operation.
The name of the operation.
Key for the operation. Must be unique within a given flow.
Type of operation. One of log
, mail
, notification
, create
, read
, request
, sleep
, transform
, trigger
, condition
, or any type of custom operation extensions.
Position of the operation on the X axis within the flow workspace.
Position of the operation on the Y axis within the flow workspace.
The operation triggered when the current operation succeeds (or then
logic of a condition operation).
The operation triggered when the current operation fails (or otherwise
logic of a condition operation).
Timestamp in ISO8601 when the operation was created.
The user who created the operation.
POST /operations
import { createDirectus, rest, createOperations } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(createOperations(operations_object_array));
POST /graphql/system
type Mutation {
create_operations_items(data: [create_directus_operations_input!]!): [directus_operations]
}
{
"data": {
"id": "2f24211d-d928-469a-aea3-3c8f53d4e426",
"name": "Log to Console",
"key": "log_console",
"type": "log",
"position_x": 12,
"position_y": 12,
"options": null,
"resolve": "63716273-0f29-4648-8a2a-2af2948f6f78",
"reject": "63716273-0f29-4648-8a2a-2af2948f6f78",
"date_created": "2022-05-11T13:14:52Z",
"user_created": "63716273-0f29-4648-8a2a-2af2948f6f78"
}
}
Retrieve an Operation
Retrieve a single operation by primary key.
Query Parameters
Unique identifier for the object.
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 operation.
The name of the operation.
Key for the operation. Must be unique within a given flow.
Type of operation. One of log
, mail
, notification
, create
, read
, request
, sleep
, transform
, trigger
, condition
, or any type of custom operation extensions.
Position of the operation on the X axis within the flow workspace.
Position of the operation on the Y axis within the flow workspace.
The operation triggered when the current operation succeeds (or then
logic of a condition operation).
The operation triggered when the current operation fails (or otherwise
logic of a condition operation).
Timestamp in ISO8601 when the operation was created.
The user who created the operation.
GET /operations/{id}
import { createDirectus, rest, readOperation } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(readOperation(operation_id, query_object));
type Query {
operations_by_id(id: ID!): directus_operations
}
{
"data": {
"id": "2f24211d-d928-469a-aea3-3c8f53d4e426",
"name": "Log to Console",
"key": "log_console",
"type": "log",
"position_x": 12,
"position_y": 12,
"options": null,
"resolve": "63716273-0f29-4648-8a2a-2af2948f6f78",
"reject": "63716273-0f29-4648-8a2a-2af2948f6f78",
"date_created": "2022-05-11T13:14:52Z",
"user_created": "63716273-0f29-4648-8a2a-2af2948f6f78"
}
}
Delete an Operation
Delete an existing operation
Query Parameters
Unique identifier for the object.
Responses
DELETE /operations/{id}
import { createDirectus, rest, deleteOperation } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(deleteOperation(operation_id));
POST /graphql/system
type Mutation {
delete_operations_item(id: ID!): delete_one
}
Update an Operation
Update an existing operation.
Query Parameters
Unique identifier for the object.
Control what fields are being returned in the object.
What metadata to return in the response.
Request Body
Unique identifier for the operation.
The name of the operation.
Key for the operation. Must be unique within a given flow.
Type of operation. One of log
, mail
, notification
, create
, read
, request
, sleep
, transform
, trigger
, condition
, or any type of custom operation extensions.
Position of the operation on the X axis within the flow workspace.
Position of the operation on the Y axis within the flow workspace.
The operation triggered when the current operation succeeds (or then
logic of a condition operation).
The operation triggered when the current operation fails (or otherwise
logic of a condition operation).
Timestamp in ISO8601 when the operation was created.
The user who created the operation.
Responses
Unique identifier for the operation.
The name of the operation.
Key for the operation. Must be unique within a given flow.
Type of operation. One of log
, mail
, notification
, create
, read
, request
, sleep
, transform
, trigger
, condition
, or any type of custom operation extensions.
Position of the operation on the X axis within the flow workspace.
Position of the operation on the Y axis within the flow workspace.
The operation triggered when the current operation succeeds (or then
logic of a condition operation).
The operation triggered when the current operation fails (or otherwise
logic of a condition operation).
Timestamp in ISO8601 when the operation was created.
The user who created the operation.
PATCH /operations/{id}
import { createDirectus, rest, updateOperation } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(updateOperation(operation_id, partial_operation_object));
POST /graphql/system
type Mutation {
update_operations_item(id: ID!, data: update_directus_operations_input): directus_operations
}
{
"data": {
"id": "2f24211d-d928-469a-aea3-3c8f53d4e426",
"name": "Log to Console",
"key": "log_console",
"type": "log",
"position_x": 12,
"position_y": 12,
"options": null,
"resolve": "63716273-0f29-4648-8a2a-2af2948f6f78",
"reject": "63716273-0f29-4648-8a2a-2af2948f6f78",
"date_created": "2022-05-11T13:14:52Z",
"user_created": "63716273-0f29-4648-8a2a-2af2948f6f78"
}
}