Update an SSH user
PATCH/ssh-users/ {sshUserId}/
v2
PATCH
ssh-user-update-ssh-user
Request
Responses
Usage examples
- cURL
- JavaScript SDK
- PHP SDK
$ curl \
--fail \
--location \
-X PATCH \
-d '{"active":true,"description":"string","expiresAt":"2024-11-23T00:28:39.949Z","password":"string","publicKeys":[{"comment":"string","key":"string"}]}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/ssh-users/string
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";
const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.sshsftpUser.sshUserUpdateSshUser({
"sshUserId": "string",
"data": {
"active": true,
"description": "string",
"expiresAt": "2024-11-23T00:28:39.948Z",
"password": "string",
"publicKeys": [
{
"comment": "string",
"key": "string"
}
]
}
});
assertStatus(response, 204);
use \Mittwald\ApiClient\Generated\V2\Clients\SSHSFTPUser\SshUserUpdateSshUser\SshUserUpdateSshUserRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\SSHSFTPUser\SshUserUpdateSshUser\SshUserUpdateSshUserRequestBody;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
// TODO: Please consult the properties and constructor signature of
// SshUserUpdateSshUserRequestBody to learn how to construct a valid instance
$body = new SshUserUpdateSshUserRequestBody(/* TODO: ... */);
$request = (new SshUserUpdateSshUserRequest(
sshUserId: "string",
body: $body
));
$response = $client->sshsftpUser()->sshUserUpdateSshUser($request);
var_dump($response->getBody();