Create an SSH user for a Project
POST/projects/ {projectId}/ ssh-users/
v2
POST
ssh-user-create-ssh-user
Request
Responses
Usage examples
- cURL
- JavaScript SDK
- PHP SDK
$ curl \
--fail \
--location \
-X POST \
-d '{"authentication":{"password":"string"},"description":"string","expiresAt":"2024-12-18T07:57:23.689Z"}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/projects/string/ssh-users
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.sshUserCreateSshUser({
"projectId": "string",
"data": {
"authentication": {
"password": "string"
},
"description": "string",
"expiresAt": "2024-12-18T07:57:23.689Z"
}
});
assertStatus(response, 201);
use \Mittwald\ApiClient\Generated\V2\Clients\SSHSFTPUser\SshUserCreateSshUser\SshUserCreateSshUserRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\SSHSFTPUser\SshUserCreateSshUser\SshUserCreateSshUserRequestBody;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
// TODO: Please consult the properties and constructor signature of
// SshUserCreateSshUserRequestBody to learn how to construct a valid instance
$body = new SshUserCreateSshUserRequestBody(/* TODO: ... */);
$request = (new SshUserCreateSshUserRequest(
projectId: "string",
body: $body
));
$response = $client->sshsftpUser()->sshUserCreateSshUser($request);
var_dump($response->getBody();