Update an SFTP user
PATCH/sftp-users/ {sftpUserId}/
v2
PATCH
sftp-user-update-sftp-user
Request
Responses
Usage examples
- cURL
- JavaScript SDK
- PHP SDK
$ curl \
--fail \
--location \
-X PATCH \
-d '{"accessLevel":"read","active":true,"description":"string","directories":["string"],"expiresAt":"2024-11-08T18:11:51.527Z","password":"string","publicKeys":[{"comment":"string","key":"string"}]}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/sftp-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.sftpUserUpdateSftpUser({
"sftpUserId": "string",
"data": {
"accessLevel": "read",
"active": true,
"description": "string",
"directories": [
"string"
],
"expiresAt": "2024-11-08T18:11:51.527Z",
"password": "string",
"publicKeys": [
{
"comment": "string",
"key": "string"
}
]
}
});
assertStatus(response, 204);
use \Mittwald\ApiClient\Generated\V2\Clients\SSHSFTPUser\SftpUserUpdateSftpUser\SftpUserUpdateSftpUserRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\SSHSFTPUser\SftpUserUpdateSftpUser\SftpUserUpdateSftpUserRequestBody;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
// TODO: Please consult the properties and constructor signature of
// SftpUserUpdateSftpUserRequestBody to learn how to construct a valid instance
$body = new SftpUserUpdateSftpUserRequestBody(/* TODO: ... */);
$request = (new SftpUserUpdateSftpUserRequest(
sftpUserId: "string",
body: $body
));
$response = $client->sshsftpUser()->sftpUserUpdateSftpUser($request);
var_dump($response->getBody();