Create an SFTP user for a Project
POST/projects/ {projectId}/ sftp-users/
v2
POST
sftp-user-create-sftp-user
Request
Responses
Usage examples
- cURL
- JavaScript SDK
- PHP SDK
$ curl \
--fail \
--location \
-X POST \
-d '{"accessLevel":"read","authentication":{"password":"string"},"description":"string","directories":["string"],"expiresAt":"2024-11-08T18:11:51.313Z"}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/projects/string/sftp-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.sftpUserCreateSftpUser({
"projectId": "string",
"data": {
"accessLevel": "read",
"authentication": {
"password": "string"
},
"description": "string",
"directories": [
"string"
],
"expiresAt": "2024-11-08T18:11:51.313Z"
}
});
assertStatus(response, 201);
use \Mittwald\ApiClient\Generated\V2\Clients\SSHSFTPUser\SftpUserCreateSftpUser\SftpUserCreateSftpUserRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\SSHSFTPUser\SftpUserCreateSftpUser\SftpUserCreateSftpUserRequestBody;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
// TODO: Please consult the properties and constructor signature of
// SftpUserCreateSftpUserRequestBody to learn how to construct a valid instance
$body = new SftpUserCreateSftpUserRequestBody(/* TODO: ... */);
$request = (new SftpUserCreateSftpUserRequest(
projectId: "string",
body: $body
));
$response = $client->sshsftpUser()->sftpUserCreateSftpUser($request);
var_dump($response->getBody();