List Operations

List all operations that exist in Directus.

Query Parameters

fields
array

Control what fields are being returned in the object.

limit
integer

A limit on the number of objects that are returned.

offset
integer

How many items to skip when fetching data.

meta
string

What metadata to return in the response.

sort
array

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.

filter

Select items in collection by given conditions.

search
string

Filter by items that contain the given search query in one of their fields.

page
integer

Cursor for use in pagination. Often used in combination with limit.

Response

Successful request

data
array
meta
object
GET /operations
Response Example
{
  "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

fields
array

Control what fields are being returned in the object.

limit
integer

A limit on the number of objects that are returned.

meta
string

What metadata to return in the response.

offset
integer

How many items to skip when fetching data.

sort
array

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.

filter

Select items in collection by given conditions.

search
string

Filter by items that contain the given search query in one of their fields.

Request Body

data
array

Response

Successful request

data
array
meta
object
POST /operations
Response Example
{
  "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.

Request Body

An array of operations primary keys.

[array]
array
DELETE /operations

Update Multiple Operations

Update multiple operations at the same time.

Query Parameters

fields
array

Control what fields are being returned in the object.

limit
integer

A limit on the number of objects that are returned.

meta
string

What metadata to return in the response.

offset
integer

How many items to skip when fetching data.

sort
array

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.

filter

Select items in collection by given conditions.

search
string

Filter by items that contain the given search query in one of their fields.

Request Body

data
keys
array

Response

Successful request

data
array
meta
object
PATCH /operations
Response Example
{
  "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

fields
array

Control what fields are being returned in the object.

meta
string

What metadata to return in the response.

Request Body

[object]
object

Response

Successful request

data
object
POST /operations‎
Response Example
{
  "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

id
string

Unique identifier for the object.

fields
array

Control what fields are being returned in the object.

limit
integer

A limit on the number of objects that are returned.

meta
string

What metadata to return in the response.

offset
integer

How many items to skip when fetching data.

sort
array

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.

filter

Select items in collection by given conditions.

search
string

Filter by items that contain the given search query in one of their fields.

Response

Successful request

data
object
GET /operations/{id}
Response Example
{
  "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"
  }
}

Triggering an Operation

Trigger an operation based on primary key.

Query Parameters

id
integer

Identifier for the object.

Request Body

Payload for the operation, if needed.

Response

Result of the operation, if any.

data
POST /operations/{id}
Response Example
{}

Delete an Operation

Delete an existing operation

Query Parameters

id
string

Unique identifier for the object.

DELETE /operations/{id}

Update an Operation

Update an existing operation.

Query Parameters

id
string

Unique identifier for the object.

fields
array

Control what fields are being returned in the object.

meta
string

What metadata to return in the response.

Request Body

[object]
object

Response

Successful request

data
object
PATCH /operations/{id}
Response Example
{
  "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"
  }
}