Script endpoints
info
these are endpoints relating to scripts
Getting script info
GET
/scripts/:script_id
Parameters
| Name | Type | Description |
|---|---|---|
| script_id | String | The scripts id |
Response
- Success
{
"success": true,
"script": {
"id": "SCRIPT_ID",
"name": "SCRIPT_NAME",
"free_for_all": false,
"use_heartbeat": true,
"kick_outdated": false,
"enabled": true,
"total_executions": 0
}
}
Getting executions
GET
/scripts/:script_id/executions
Parameters
| Name | Type | Description |
|---|---|---|
| script_id | String | The scripts id |
Response
- Success
{
"success": true,
"executions": { "01/01": 0 }
}
Editing a script
POST
/scripts/:script_id/edit
Parameters
| Name | Type | Description |
|---|---|---|
| script_id | String | The scripts id |
Body
| Name | Type | Nullable | Description |
|---|---|---|---|
| name | String | ✅ | Name for the script |
| free_for_all | Boolean | ✅ | Allow users to execute without a key |
| use_heartbeat | Boolean | ✅ | Continue to check users after initial verification |
| kick_outdated | Boolean | ✅ | Kick users using old version of the script |
Response
- Success
- Error
{ "success": true }
| Code | Message |
|---|---|
| 0 | account expired |
| 1 | cannot edit nothing |
Deleting a script
POST
/scripts/:script_id/remove
Parameters
| Name | Type | Description |
|---|---|---|
| script_id | String | The scripts id |
Response
- Success
{ "success": true }
Updating a script
POST
/scripts/:script_id/update
Parameters
| Name | Type | Description |
|---|---|---|
| script_id | String | The scripts id |
Body
| Name | Type | Nullable | Description |
|---|---|---|---|
| script | String | ❌ | the source code of the script |
Response
- Success
- Error
{ "success": true }
| Code | Message | Extra |
|---|---|---|
| 0 | account expired | |
| 1 | max obfuscations reached | |
| 1 | failed to obfuscate script | luraph_errors: [{ param: 'PARAM', message: 'MESSAGE' }] |
Toggling a script
POST
/scripts/:script_id/toggle
Parameters
| Name | Type | Description |
|---|---|---|
| script_id | String | The scripts id |
Body
| Name | Type | Nullable | Description |
|---|---|---|---|
| state | Boolean | ❌ | script enabled state |
Response
- Success
- Error
{ "success": true }
| Code | Message |
|---|---|
| 0 | account expired |