Create script

Create a new script in your account.


POST/api/scripts

Create a script

Creates a new script with the specified configuration.

Required attributes

  • Name
    label
    Type
    string
    Description

    The label to recognize the script.

  • Name
    user
    Type
    string
    Description

    The user to run the script as. Besides 'ploi' and 'root' this may be any system user that exists on the target server(s), for example a site's isolated system user.

  • Name
    content
    Type
    string
    Description

    The content of the script to run.

Request

POST
/api/scripts
curl -X POST "https://ploi.io/api/scripts" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "label": "Echo Script",
    "user": "ploi",
    "content": "echo 123"
  }'

Response

{
  "data": {
    "id": 1,
    "user": "ploi",
    "label": "Echo Script",
    "content": "echo 123",
    "created_at": "2019-08-07 11:21:02"
  }
}