You can use the additional SFTP users endpoint to:
You can obtain the environment_id using the GET request with the WordPress Site Environments endpoint.
The environment_id is also shown after the site_id in the URL in MyKinsta when you access the environment, for example in the URL https://my.kinsta.com/sites/details/fbab4927-e354-4044-b226-29ac0fbd20ca/c84ce214-69b9-4a32-8e67-880672cf1d38?idCompany=bdd25d71-5706-4890-870f-1adda17c505d:
site_id is fbab4927-e354-4044-b226-29ac0fbd20ca environment_id is c84ce214-69b9-4a32-8e67-880672cf1d38 company_id is bdd25d71-5706-4890-870f-1adda17c505dThe sftp_account_id is shown when you GET the list of additional SFTP users.
Toggling status for additional SFTP accounts in progress
No or invalid API key provided to the request
Error occurred while trying to toggle status for additional SFTP accounts
{- "enabled": true
}{- "operation_id": "sftp-accounts:toggle-status-54fb80af-576c-4fdc-ba4f-b596c83f15a1",
- "message": "Updating Additional SFTP Accounts Status in progress",
- "status": 202
}Adding additional SFTP account successful
No or invalid API key provided to the request
Error occurred while trying to add additional SFTP account
{- "username": "test-user",
- "password": "R8zXwT@#bV!kJq9^",
- "root_directory": "/dir_1",
- "permission": "write"
}{- "operation_id": "sftp-accounts:add-additional-sftp-account-54fb80af-576c-4fdc-ba4f-b596c83f15a1",
- "message": "Adding Additional SFTP Account in progress",
- "status": 202
}Successfully found additional SFTP accounts
No or invalid API key provided to the request
Could not find the additional SFTP accounts or the user does not have permissions to retrieve data
Error occurred while retrieving additional SFTP accounts
{- "environment": {
- "additional_sftp_accounts": [
- {
- "id": "54fb80af-576c-4fdc-ba4f-b596c83f15a1",
- "username": "test-user",
- "root_directory": "/",
- "is_active": true,
- "permission": "write"
}
], - "container_info": {
- "additional_sftp_accounts_port": "12374"
}
}
}Removing additional SFTP account in progress
No or invalid API key provided to the request
Error occurred while trying to remove additional SFTP account
{- "operation_id": "sftp-accounts:remove-additional-sftp-account-54fb80af-576c-4fdc-ba4f-b596c83f15a1",
- "message": "Removing Additional SFTP Account in progress",
- "status": 202
}