- API Reference
- SSH/SFTP User
- Get all SFTP users for a Project
Get all SFTP users for a Project
Request
- projectIdstringrequired
ID of the Project to request SFTPUsers for.
- limitinteger (≥ 0)
The max count of resources to return in the list response.
- skipinteger
Number of items to skip. Should be multiple of
limit. - pageinteger (≥ 0)
Page to display.
skipandpageend up doing the same. If bothpageandskipare set, skip is used.
Responses
- X-Pagination-Limitinteger
The limit used to select the resources for the response
- X-Pagination-Skipinteger
The number of skipped items
- X-Pagination-Pagenumber
The calculate page of the list response. Refer to parameters to learn more.
- X-Pagination-TotalCountinteger
The total amount of items available in the remote ressource. Use this value in combination with the limit to calculate the available pages.
OK
- Array[
A representation of an SFTPUser.
- *object
A representation of an SFTPUser.
- accessLevelstring (one of: full, read, unspecified)required
The level of access for an SFTPUser.
- activeboolean
- authUpdatedAtstring (date-time)required
- createdAtstring (date-time)required
- descriptionstringrequired
- detailedPublicKeysarray of object
- Array[
A representation of an ssh-public-key, enriched with information derived from the key.
- *object
A representation of an ssh-public-key, enriched with information derived from the key.
- algorithmstring
Absent if the key cannot be parsed.
- commentstringrequired
- fingerprintstring
SHA256 fingerprint in OpenSSH format, as printed by
ssh-keygen -l. Absent if the key cannot be parsed. - keystringrequired
]
- directoriesarray of string
- Array[
- *string
]
- expiresAtstring (date-time)
- hasPasswordbooleanrequired
- idstringrequired
- projectIdstringrequired
- publicKeysarray of objectdeprecated
deprecated by detailedPublicKeys
- Array[
A representation of an ssh-public-key.
- *object
A representation of an ssh-public-key.
- commentstringrequired
- keystringrequired
]
- updatedAtstring (date-time)
- userNamestringrequired
]
Content-Type: application/json
[
{
"accessLevel": "full",
"active": true,
"authUpdatedAt": "1985-10-26T01:21:00.000Z",
"createdAt": "1985-10-26T01:21:00.000Z",
"description": "string",
"detailedPublicKeys": [
{
"algorithm": "ssh-ed25519",
"comment": "string",
"fingerprint": "SHA256:uNiVztksCsDhcc0u9e8BujQXVUpKZIDTMczCvj3tD2s",
"key": "string"
}
],
"directories": [
"string"
],
"expiresAt": "1985-10-26T01:21:00.000Z",
"hasPassword": true,
"id": "string",
"projectId": "string",
"updatedAt": "1985-10-26T01:21:00.000Z",
"userName": "string"
}
]
{
"items": {
"description": "A representation of an SFTPUser.",
"properties": {
"accessLevel": {
"description": "The level of access for an SFTPUser.",
"enum": [
"full",
"read",
"unspecified"
],
"type": "string"
},
"active": {
"type": "boolean"
},
"authUpdatedAt": {
"format": "date-time",
"type": "string"
},
"createdAt": {
"format": "date-time",
"type": "string"
},
"description": {
"type": "string"
},
"detailedPublicKeys": {
"items": {
"description": "A representation of an ssh-public-key, enriched with information derived from the key.",
"properties": {
"algorithm": {
"description": "Absent if the key cannot be parsed.",
"example": "ssh-ed25519",
"type": "string"
},
"comment": {
"type": "string"
},
"fingerprint": {
"description": "SHA256 fingerprint in OpenSSH format, as printed by `ssh-keygen -l`. Absent if the key cannot be parsed.",
"example": "SHA256:uNiVztksCsDhcc0u9e8BujQXVUpKZIDTMczCvj3tD2s",
"type": "string"
},
"key": {
"type": "string"
}
},
"required": [
"comment",
"key"
],
"type": "object"
},
"type": "array"
},
"directories": {
"items": {
"type": "string"
},
"type": "array"
},
"expiresAt": {
"format": "date-time",
"type": "string"
},
"hasPassword": {
"type": "boolean"
},
"id": {
"type": "string"
},
"projectId": {
"type": "string"
},
"publicKeys": {
"deprecated": true,
"description": "deprecated by detailedPublicKeys",
"items": {
"description": "A representation of an ssh-public-key.",
"properties": {
"comment": {
"type": "string"
},
"key": {
"type": "string"
}
},
"required": [
"comment",
"key"
],
"type": "object"
},
"type": "array"
},
"updatedAt": {
"format": "date-time",
"type": "string"
},
"userName": {
"type": "string"
}
},
"required": [
"id",
"projectId",
"description",
"userName",
"createdAt",
"authUpdatedAt",
"accessLevel",
"hasPassword"
],
"type": "object"
},
"type": "array"
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
The requested resource was not found
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
Your request ran into a rate limit. You have to wait until rate limit expires
- messagestring
- typestring
Content-Type: application/json
{
"message": "too many requests",
"type": "RateLimitError"
}
{
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "too many requests"
},
"type": {
"type": "string",
"example": "RateLimitError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
Usage examples
$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/projects/string/sftp-users?limit=50&page=1
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.sftpUserListSftpUsers({
"projectId": "string",
"queryParameters": {
"limit": 50,
"page": 1
}
});
assertStatus(response, 200);
use \Mittwald\ApiClient\Generated\V2\Clients\SSHSFTPUser\SftpUserListSftpUsers\SftpUserListSftpUsersRequest;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
$request = (new SftpUserListSftpUsersRequest(
projectId: "string"
))
->withLimit(50)
->withPage(1);
$response = $client->sshsftpUser()->sftpUserListSftpUsers($request);
var_dump($response->getBody();