Skip to content

Linux Groups

The Linux Groups resource provides access to all methods relating to Linux Groups in Keystash.

List Linux Groups

Path: /linux-groups/list

Method: GET

Authentication: Bearer Token

Request Headers

Key Value Required
Accept-Encoding gzip optional

Request Parameters

None.

Request Body

None.

Example Request

curl --location --request GET 'https://app.keystash.io/api/v1/linux-groups/list' \
--header 'Authorization: Bearer <token>'

Response Fields

Field Data Type Description
id string The unique ID of the Linux group
name string The name of the Linux group
user_counts integer The number of users assigned to the Linux group
group_counts integer The number of server groups this Linux group is assigned to
created string The date and time when the Linux group was created (format: YYYY-MM-DD HH:mm:ss)
created_user_id string The ID of the user who created the Linux group
created_by string The name of the user who created the Linux group
modified string The date and time when the Linux group was last modified (format: YYYY-MM-DD HH:mm:ss)
modified_user_id string The ID of the user who last modified the Linux group
modified_by string The name of the user who last modified the Linux group

Example Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[
  {
    "id": "x0Uf09z3TYjoNVFv",
    "name": "wheel",
    "user_counts": 5,
    "group_counts": 2,
    "created": "2023-11-14 16:53:55",
    "created_user_id": "bkQV8I5BRcAVpg1d",
    "created_by": "Max Smith",
    "modified": "2023-11-14 16:53:56",
    "modified_user_id": "tr568I5BRcAVpwx7",
    "modified_by": "Anne Teak"
  },
  {
    "id": "p8CduXmyw6n9dzdd",
    "name": "www-data",
    "user_counts": 3,
    "group_counts": 1,
    "created": "2023-11-15 09:22:33",
    "created_user_id": "zwQV8I5BRcAVpgPr",
    "created_by": "Perry Scope",
    "modified": "2023-11-15 09:22:34",
    "modified_user_id": "zwQV8I5BRcAVpgPr",
    "modified_by": "Perry Scope"
  },
  {
    "id": "DmcEgixUXpWVv7tk",
    "name": "nginx",
    "user_counts": 0,
    "group_counts": 0,
    "created": "2023-11-16 14:15:20",
    "created_user_id": "bkQV8I5BRcAVpg1d",
    "created_by": "Max Smith",
    "modified": "2023-11-16 14:15:20",
    "modified_user_id": "bkQV8I5BRcAVpg1d",
    "modified_by": "Max Smith"
  }
]

Example Error Response

HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8

{
  "error": {
    "code": "NotFound",
    "message": "Your request was successfully processed but there was no data to be returned.",
    "details": []
  }
}

Create Linux Group

Path: /linux-groups/create

Method: POST

Authentication: Bearer Token

Request Headers

Key Value Required
Content-Type application/json required
Accept-Encoding gzip optional

Request Parameters

None.

Request Body Parameters

Key Data Type Required Notes
name string required The name of the Linux group

Example Request Body

{
  "name": "docker"
}

Example Request

curl --location --request POST 'https://app.keystash.io/api/v1/linux-groups/create' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
    "name": "docker"
}'

Example Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "result": "Linux Group 'docker' was successfully created.",
  "id": "x0Uf09z3TYjoNVFv"
}

Example Error Response

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{
  "error": {
    "code": "BadArgument",
    "message": "The name field is required to create a Linux Group.",
    "details": []
  }
}

Update Linux Group

Path: /linux-groups/update

Method: PATCH

Authentication: Bearer Token

Request Headers

Key Value Required
Content-Type application/json required
Accept-Encoding gzip optional

Request Parameters

None.

Request Body Parameters

Key Data Type Required Notes
id string required The unique identifier of the Linux group
name string required The new name of the Linux group

Example Request Body

{
  "id": "x0Uf09z3TYjoNVFv",
  "name": "docker-users"
}

Example Request

curl --location --request PATCH 'https://app.keystash.io/api/v1/linux-groups/update' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
    "id": "x0Uf09z3TYjoNVFv",
    "name": "docker-users"
}'

Example Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "result": "Linux Group 'docker-users' was successfully updated."
}

Example Error Response

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{
  "error": {
    "code": "BadArgument",
    "message": "The id field is required to update a Linux Group.",
    "details": []
  }
}
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8

{
  "error": {
    "code": "NotFound",
    "message": "The Linux Group with the provided ID was not found.",
    "details": []
  }
}

Delete Linux Group

Path: /linux-groups/delete

Method: DELETE

Authentication: Bearer Token

Request Headers

Key Value Required
Accept-Encoding gzip optional

Request Parameters

Key Data Type Required Notes
id string required The ID of the Linux group to delete

Request Body

None.

Example Request

curl --location --request DELETE 'https://app.keystash.io/api/v1/linux-groups/delete?id=x0Uf09z3TYjoNVFv' \
--header 'Authorization: Bearer <token>'

Example Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "result": "Linux Group with ID 'x0Uf09z3TYjoNVFv' was successfully deleted."
}

Example Error Response

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{
  "error": {
    "code": "BadArgument",
    "message": "The id field is required to delete a Linux Group.",
    "details": []
  }
}
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8

{
  "error": {
    "code": "NotFound",
    "message": "The Linux Group with the provided ID was not found.",
    "details": []
  }
}