hooks

Hook scripts for specific events.
get /events/hooks

List of all installed hook scripts.

Parameters
pagination string query
Responses
200 successful operation
HookInfo array
HookInfo object
[
  {
    "id": 0,
    "event": "PreNetworkConfig",
    "scriptId": 0,
    "serverIds": [
      0
    ],
    "allServers": true,
    "scriptName": "string",
    "serverNames": [
      "string"
    ]
  }
]
post /events/hooks

Install a hook script at a given hook point.

Parameters
body object
{
  "event": "PreNetworkConfig",
  "scriptId": 0,
  "serverIds": [
    0
  ],
  "allServers": true
}
Responses
default successful operation
get /events/scripts

List all script files.

Parameters
pagination string query
Responses
200 successful operation
ScriptIdentifier array
ScriptIdentifier object
[
  {
    "id": 0,
    "name": "string"
  }
]
post /events/scripts

Create a script file.

Parameters
body object
{
  "name": "string",
  "contents": "string"
}
Responses
200 successful operation
GeneratedId object
{
  "id": 0
}
400 Filename already exists.
patch /events/hooks/{id}

Install a hook script at a given hook point.

Parameters
id integer path Required
body object
{
  "event": "PreNetworkConfig",
  "scriptId": 0,
  "serverIds": [
    0
  ],
  "allServers": true
}
Responses
default successful operation
delete /events/hooks/{id}

Delete a hook event.

Parameters
id integer path Required
Responses
default successful operation
get /events/hook-scripts

List all script files with their linked hooks.

Parameters
pagination string query
Responses
200 successful operation
ScriptInfo array
ScriptInfo object
[
  {
    "id": 0,
    "name": "string",
    "hooks": [
      {
        "event": "PreNetworkConfig",
        "serverIds": [
          0
        ],
        "allServers": true
      }
    ],
    "hookNames": "string"
  }
]
post /events/hook-scripts

Create a script file and link hooks.

Parameters
body object
{
  "name": "string",
  "hooks": [
    {
      "event": "PreNetworkConfig",
      "serverIds": [
        0
      ],
      "allServers": true
    }
  ],
  "contents": "string"
}
Responses
200 successful operation
GeneratedId object
{
  "id": 0
}
get /events/scripts/{id}

Get the script file contents.

Parameters
id integer path Required
Responses
200 successful operation
string
patch /events/scripts/{id}

Update or rename a script file.

Parameters
id integer path Required
body object
{
  "name": "string",
  "contents": "string"
}
Responses
400 Filename already exists.
delete /events/scripts/{id}

Delete a script file.

Parameters
id integer path Required
Responses
default successful operation
post /events/scripts/execute

Run a script immediately.

Parameters
body object
{
  "args": [
    "string"
  ],
  "script": "string",
  "servers": [
    0
  ],
  "scriptId": 0
}
Responses
200 successful operation
ManagedTask object
A long-running task that goes on in the background after this task is completed. See tasks endpoints for details
{
  "id": 0,
  "done": true,
  "name": "string",
  "state": "WAITING",
  "object": "string",
  "output": "string",
  "result": {},
  "progress": {
    "total": 0,
    "complete": 0
  },
  "startedAt": 0,
  "startedBy": "string",
  "statusCode": 0
}
patch /events/hook-scripts/{id}

Update or rename a script file and linked hooks.

Parameters
id integer path Required
body object
{
  "name": "string",
  "hooks": [
    {
      "event": "PreNetworkConfig",
      "serverIds": [
        0
      ],
      "allServers": true
    }
  ],
  "contents": "string"
}
Responses
default successful operation
get /events/hooks/hook-points

List of all available hook points.

Responses
200 successful operation
HookPointInfo array
HookPointInfo object
[
  {
    "name": "string",
    "parameters": [
      {
        "name": "string",
        "description": "string"
      }
    ],
    "description": "string",
    "canChooseServer": true
  }
]