SelfPrivacy API
API available as Swagger documentation, markdown version is below.
Version
1.2.0
Content negotiation
URI Scheme: http
Consumes: application/json
Produces: application/json
Access control
All endpoints
backups
bitwarden
email
gitea
nextcloud
o_cserv
pleroma
services
ssh
system
tokens
users
Paths
Delete token (DeleteAuthTokens)
DELETE /auth/tokens
Security Requirements
Parameters
Name |
Source |
Type |
Go type |
Separator |
Required |
Default |
Description |
token |
body |
DeleteAuthTokensBody |
DeleteAuthTokensBody |
|
✓ |
|
Token's name to delete |
All responses
Code |
Status |
Description |
200 |
OK |
Token deleted |
400 |
Bad Request |
Bad request |
404 |
Not Found |
Token not found |
Inlined models
DeleteAuthTokensBody
Properties
Name |
Type |
Go type |
Required |
Default |
Description |
Example |
token |
string |
string |
✓ |
|
Token name to delete |
|
Delete SSH key (DeleteServicesSSHKeysUsername)
DELETE /services/ssh/keys/{username}
Security Requirements
Parameters
Name |
Source |
Type |
Go type |
Separator |
Required |
Default |
Description |
username |
path |
string |
string |
|
✓ |
|
User to delete keys for |
public_key |
body |
DeleteServicesSSHKeysUsernameBody |
DeleteServicesSSHKeysUsernameBody |
|
✓ |
|
Key to delete |
All responses
Code |
Status |
Description |
200 |
OK |
SSH key deleted |
401 |
Unauthorized |
Unauthorized |
404 |
Not Found |
Key not found |
Inlined models
DeleteServicesSSHKeysUsernameBody
Properties
Name |
Type |
Go type |
Required |
Default |
Description |
Example |
public_key |
string |
string |
✓ |
|
|
|
Delete a user (DeleteUsersUsername)
DELETE /users/{username}
Security Requirements
Parameters
Name |
Source |
Type |
Go type |
Separator |
Required |
Default |
Description |
username |
path |
string |
string |
|
✓ |
|
User to delete |
All responses
Code |
Status |
Description |
200 |
OK |
Deleted user |
400 |
Bad Request |
Bad request |
401 |
Unauthorized |
Unauthorized |
404 |
Not Found |
User not found |
Get API version (GetAPIVersion)
GET /api/version
All responses
Code |
Status |
Description |
Schema |
200 |
OK |
API version |
schema |
401 |
Unauthorized |
Unauthorized |
|
Responses
200 - API version
Status: OK
Schema
Name |
Type |
Go type |
Required |
Default |
Description |
Example |
version |
string |
string |
|
|
API version |
|
401 - Unauthorized
Status: Unauthorized
Get recovery token status (GetAuthRecoveryToken)
GET /auth/recovery_token
Security Requirements
All responses
Code |
Status |
Description |
Has headers |
Schema |
200 |
OK |
Recovery token status |
|
schema |
400 |
Bad Request |
Bad request |
|
schema |
Responses
200 - Recovery token status
Status: OK
Schema
Name |
Type |
Go type |
Required |
Default |
Description |
Example |
date |
string |
string |
|
|
Recovery token date |
|
exists |
boolean |
bool |
|
|
Recovery token exists |
|
expiration |
string |
string |
|
|
Recovery token expiration date |
|
uses_left |
integer |
int64 |
|
|
Recovery token uses left |
|
valid |
boolean |
bool |
|
|
Recovery token is valid |
|
400 - Bad request
Status: Bad Request
Get current device tokens (GetAuthTokens)
GET /auth/tokens
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
List of tokens |
400 |
Bad Request |
Bad request |
Get DKIM key from file (GetServicesMailserverDkim)
GET /services/mailserver/dkim
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
DKIM key encoded in base64 |
401 |
Unauthorized |
Unauthorized |
404 |
Not Found |
DKIM key not found |
Get all restic backups (GetServicesResticBackupList)
GET /services/restic/backup/list
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
A list of snapshots |
400 |
Bad Request |
Bad request |
401 |
Unauthorized |
Unauthorized |
Force reload snapshots (GetServicesResticBackupReload)
GET /services/restic/backup/reload
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
Snapshots reloaded |
400 |
Bad Request |
Bad request |
401 |
Unauthorized |
Unauthorized |
Get backup status (GetServicesResticBackupStatus)
GET /services/restic/backup/status
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
Backup status |
400 |
Bad Request |
Bad request |
401 |
Unauthorized |
Unauthorized |
Get current SSH settings (GetServicesSSH)
GET /services/ssh
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
SSH settings |
400 |
Bad Request |
Bad request |
List SSH keys (GetServicesSSHKeysUsername)
GET /services/ssh/keys/{username}
Security Requirements
Parameters
Name |
Source |
Type |
Go type |
Separator |
Required |
Default |
Description |
username |
path |
string |
string |
|
✓ |
|
User to list keys for |
All responses
Code |
Status |
Description |
200 |
OK |
SSH keys |
401 |
Unauthorized |
Unauthorized |
Get service status (GetServicesStatus)
GET /services/status
All responses
Code |
Status |
Description |
Schema |
200 |
OK |
Service status |
schema |
401 |
Unauthorized |
Unauthorized |
schema |
Responses
200 - Service status
Status: OK
Schema
Name |
Type |
Go type |
Required |
Default |
Description |
Example |
bitwarden |
integer |
int64 |
|
|
Bitwarden service status |
|
gitea |
integer |
int64 |
|
|
Gitea service status |
|
http |
integer |
int64 |
|
|
Nginx service status |
|
imap |
integer |
int64 |
|
|
Dovecot service status |
|
nextcloud |
integer |
int64 |
|
|
Nextcloud service status |
|
ocserv |
integer |
int64 |
|
|
OpenConnect VPN service status |
|
pleroma |
integer |
int64 |
|
|
Pleroma service status |
|
smtp |
integer |
int64 |
|
|
Postfix service status |
|
401 - Unauthorized
Status: Unauthorized
Rebuild NixOS with nixos-rebuild switch (GetSystemConfigurationApply)
GET /system/configuration/apply
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
System rebuild has started |
401 |
Unauthorized |
Unauthorized |
Get current system autoupgrade settings (GetSystemConfigurationAutoUpgrade)
GET /system/configuration/autoUpgrade
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
Auto-upgrade settings |
400 |
Bad Request |
Bad request |
Pull Repository Changes (GetSystemConfigurationPull)
GET /system/configuration/pull
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
Got update |
201 |
Created |
Nothing to update |
401 |
Unauthorized |
Unauthorized |
500 |
Internal Server Error |
Something went wrong |
Rollback NixOS with nixos-rebuild switch --rollback (GetSystemConfigurationRollback)
GET /system/configuration/rollback
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
System rollback has started |
401 |
Unauthorized |
Unauthorized |
Get current system timezone (GetSystemConfigurationTimezone)
GET /system/configuration/timezone
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
Timezone |
400 |
Bad Request |
Bad request |
Upgrade NixOS with nixos-rebuild switch --upgrade (GetSystemConfigurationUpgrade)
GET /system/configuration/upgrade
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
System upgrade has started |
401 |
Unauthorized |
Unauthorized |
Get python version used by this API (GetSystemPythonVersion)
GET /system/pythonVersion
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
OK |
401 |
Unauthorized |
Unauthorized |
Reboot the system (GetSystemReboot)
GET /system/reboot
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
System reboot has started |
401 |
Unauthorized |
Unauthorized |
Get system version from uname -a (GetSystemVersion)
GET /system/version
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
OK |
401 |
Unauthorized |
Unauthorized |
Get a list of users (GetUsers)
GET /users
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
A list of users |
401 |
Unauthorized |
Unauthorized |
Get new device token (PostAuthNewDevice)
POST /auth/new_device
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
New device token |
400 |
Bad Request |
Bad request |
Authorize device (PostAuthNewDeviceAuthorize)
POST /auth/new_device/authorize
Parameters
Name |
Source |
Type |
Go type |
Separator |
Required |
Default |
Description |
data |
body |
PostAuthNewDeviceAuthorizeBody |
PostAuthNewDeviceAuthorizeBody |
|
✓ |
|
Who is authorizing |
All responses
Code |
Status |
Description |
200 |
OK |
Device authorized |
400 |
Bad Request |
Bad request |
404 |
Not Found |
Token not found |
Inlined models
PostAuthNewDeviceAuthorizeBody
Properties
Name |
Type |
Go type |
Required |
Default |
Description |
Example |
device |
string |
string |
|
|
Device to authorize |
|
token |
string |
string |
|
|
Mnemonic token to authorize |
|
Generate recovery token (PostAuthRecoveryToken)
POST /auth/recovery_token
Security Requirements
Parameters
Name |
Source |
Type |
Go type |
Separator |
Required |
Default |
Description |
data |
body |
PostAuthRecoveryTokenBody |
PostAuthRecoveryTokenBody |
|
✓ |
|
Token data |
All responses
Code |
Status |
Description |
Schema |
200 |
OK |
Recovery token generated |
schema |
400 |
Bad Request |
Bad request |
|
Responses
200 - Recovery token generated
Status: OK
Schema
Name |
Type |
Go type |
Required |
Default |
Description |
Example |
token |
string |
string |
|
|
Mnemonic recovery token |
|
400 - Bad request
Status: Bad Request
Inlined models
PostAuthRecoveryTokenBody
Properties
Name |
Type |
Go type |
Required |
Default |
Description |
Example |
expiration |
string |
string |
|
|
Token expiration date |
|
uses |
integer |
int64 |
|
|
Token uses |
|
Use recovery token (PostAuthRecoveryTokenUse)
POST /auth/recovery_token/use
Parameters
Name |
Source |
Type |
Go type |
Separator |
Required |
Default |
Description |
data |
body |
PostAuthRecoveryTokenUseBody |
PostAuthRecoveryTokenUseBody |
|
✓ |
|
Token data |
All responses
Code |
Status |
Description |
Schema |
200 |
OK |
Recovery token used |
schema |
400 |
Bad Request |
Bad request |
|
404 |
Not Found |
Token not found |
|
Responses
200 - Recovery token used
Status: OK
Schema
Name |
Type |
Go type |
Required |
Default |
Description |
Example |
token |
string |
string |
|
|
Device authorization token |
|
Inlined models
PostAuthRecoveryTokenUseBody
Properties
Name |
Type |
Go type |
Required |
Default |
Description |
Example |
device |
string |
string |
|
|
Device to authorize |
|
token |
string |
string |
|
|
Mnemonic recovery token |
|
Refresh token (PostAuthTokens)
POST /auth/tokens
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
Token refreshed |
400 |
Bad Request |
Bad request |
404 |
Not Found |
Token not found |
Disable Bitwarden (PostServicesBitwardenDisable)
POST /services/bitwarden/disable
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
Bitwarden disabled |
401 |
Unauthorized |
Unauthorized |
Enable Bitwarden (PostServicesBitwardenEnable)
POST /services/bitwarden/enable
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
Bitwarden enabled |
401 |
Unauthorized |
Unauthorized |
Disable Gitea (PostServicesGiteaDisable)
POST /services/gitea/disable
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
Gitea disabled |
401 |
Unauthorized |
Unauthorized |
Enable Gitea (PostServicesGiteaEnable)
POST /services/gitea/enable
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
Gitea enabled |
401 |
Unauthorized |
Unauthorized |
Disable Nextcloud (PostServicesNextcloudDisable)
POST /services/nextcloud/disable
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
Nextcloud disabled |
401 |
Unauthorized |
Unauthorized |
Enable Nextcloud (PostServicesNextcloudEnable)
POST /services/nextcloud/enable
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
Nextcloud enabled |
401 |
Unauthorized |
Unauthorized |
Disable OCserv (PostServicesOcservDisable)
POST /services/ocserv/disable
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
OCserv disabled |
401 |
Unauthorized |
Unauthorized |
Enable OCserv (PostServicesOcservEnable)
POST /services/ocserv/enable
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
OCserv enabled |
401 |
Unauthorized |
Unauthorized |
Disable Pleroma (PostServicesPleromaDisable)
POST /services/pleroma/disable
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
Pleroma disabled |
401 |
Unauthorized |
Unauthorized |
Enable Pleroma (PostServicesPleromaEnable)
POST /services/pleroma/enable
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
Pleroma enabled |
401 |
Unauthorized |
Unauthorized |
Enable SSH (PostServicesSSHEnable)
POST /services/ssh/enable
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
SSH enabled |
401 |
Unauthorized |
Unauthorized |
Add SSH key to the user (PostServicesSSHKeysUsername)
POST /services/ssh/keys/{username}
Security Requirements
Parameters
Name |
Source |
Type |
Go type |
Separator |
Required |
Default |
Description |
username |
path |
string |
string |
|
✓ |
|
User to add keys for |
public_key |
body |
PostServicesSSHKeysUsernameBody |
PostServicesSSHKeysUsernameBody |
|
✓ |
|
|
All responses
Code |
Status |
Description |
201 |
Created |
SSH key added |
401 |
Unauthorized |
Unauthorized |
404 |
Not Found |
User not found |
409 |
Conflict |
Key already exists |
Inlined models
PostServicesSSHKeysUsernameBody
Properties
Name |
Type |
Go type |
Required |
Default |
Description |
Example |
public_key |
string |
string |
✓ |
|
|
|
Create a new user (PostUsers)
POST /users
Consumes
Security Requirements
Parameters
Name |
Source |
Type |
Go type |
Separator |
Required |
Default |
Description |
user |
body |
PostUsersBody |
PostUsersBody |
|
✓ |
|
User to create |
All responses
Code |
Status |
Description |
201 |
Created |
Created user |
400 |
Bad Request |
Bad request |
401 |
Unauthorized |
Unauthorized |
409 |
Conflict |
User already exists |
Inlined models
PostUsersBody
Properties
Name |
Type |
Go type |
Required |
Default |
Description |
Example |
password |
string |
string |
✓ |
|
Unix password. |
|
username |
string |
string |
✓ |
|
Unix username. Must be alphanumeric and less than 32 characters |
|
Set the new key for backblaze (PutServicesResticBackblazeConfig)
PUT /services/restic/backblaze/config
Security Requirements
Parameters
Name |
Source |
Type |
Go type |
Separator |
Required |
Default |
Description |
backblazeSettings |
body |
PutServicesResticBackblazeConfigBody |
PutServicesResticBackblazeConfigBody |
|
✓ |
|
New Backblaze settings |
All responses
Code |
Status |
Description |
200 |
OK |
New Backblaze settings |
400 |
Bad Request |
Bad request |
401 |
Unauthorized |
Unauthorized |
Inlined models
PutServicesResticBackblazeConfigBody
Properties
Name |
Type |
Go type |
Required |
Default |
Description |
Example |
accountId |
string |
string |
✓ |
|
|
|
accountKey |
string |
string |
✓ |
|
|
|
bucket |
string |
string |
✓ |
|
|
|
Initiate a new restic backup (PutServicesResticBackupCreate)
PUT /services/restic/backup/create
Security Requirements
All responses
Code |
Status |
Description |
200 |
OK |
Backup creation has started |
400 |
Bad Request |
Bad request |
401 |
Unauthorized |
Unauthorized |
409 |
Conflict |
Backup already in progress |
Start backup restoration (PutServicesResticBackupRestore)
PUT /services/restic/backup/restore
Security Requirements
Parameters
All responses
Code |
Status |
Description |
200 |
OK |
Backup restoration process started |
400 |
Bad Request |
Bad request |
401 |
Unauthorized |
Unauthorized |
Inlined models
PutServicesResticBackupRestoreBody
Properties
Name |
Type |
Go type |
Required |
Default |
Description |
Example |
backupId |
string |
string |
✓ |
|
|
|
Change SSH settings (PutServicesSSH)
PUT /services/ssh
Security Requirements
Parameters
Name |
Source |
Type |
Go type |
Separator |
Required |
Default |
Description |
sshSettings |
body |
PutServicesSSHBody |
PutServicesSSHBody |
|
✓ |
|
SSH settings |
All responses
Code |
Status |
Description |
200 |
OK |
New settings saved |
400 |
Bad Request |
Bad request |
Inlined models
PutServicesSSHBody
Properties
Name |
Type |
Go type |
Required |
Default |
Description |
Example |
enable |
boolean |
bool |
✓ |
|
|
|
passwordAuthentication |
boolean |
bool |
✓ |
|
|
|
Add a SSH root key (PutServicesSSHKeySend)
PUT /services/ssh/key/send
Consumes
Security Requirements
Parameters
Name |
Source |
Type |
Go type |
Separator |
Required |
Default |
Description |
body |
body |
PutServicesSSHKeySendBody |
PutServicesSSHKeySendBody |
|
✓ |
|
Public key to add |
All responses
Code |
Status |
Description |
201 |
Created |
Key added |
400 |
Bad Request |
Bad request |
401 |
Unauthorized |
Unauthorized |
409 |
Conflict |
Key already exists |
Inlined models
PutServicesSSHKeySendBody
Properties
Name |
Type |
Go type |
Required |
Default |
Description |
Example |
public_key |
string |
string |
✓ |
|
ssh-ed25519 public key. |
|
Change system auto upgrade settings (PutSystemConfigurationAutoUpgrade)
PUT /system/configuration/autoUpgrade
Security Requirements
Parameters
All responses
Code |
Status |
Description |
200 |
OK |
New settings saved |
400 |
Bad Request |
Bad request |
Inlined models
PutSystemConfigurationAutoUpgradeBody
Properties
Name |
Type |
Go type |
Required |
Default |
Description |
Example |
allowReboot |
boolean |
bool |
✓ |
|
|
|
enable |
boolean |
bool |
✓ |
|
|
|
Change system timezone (PutSystemConfigurationTimezone)
PUT /system/configuration/timezone
Security Requirements
Parameters
All responses
Code |
Status |
Description |
200 |
OK |
Timezone changed |
400 |
Bad Request |
Bad request |
Inlined models
PutSystemConfigurationTimezoneBody
Properties
Name |
Type |
Go type |
Required |
Default |
Description |
Example |
timezone |
string |
string |
✓ |
|
|
|