curl --request DELETE \
--url 'https://YOURSITE.konstant.ly/openapi/v1/users/blocked/1234567890' \
--header 'X-API-KEY: 1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv'
import requests
def activate_user(api_key: str, user_id: str) -> bool:
url = f"https://YOURSITE.konstant.ly/openapi/v1/users/blocked/{user_id}"
headers = {"X-API-KEY": api_key}
response = requests.delete(url, headers=headers)
if response.status_code == 404:
raise ValueError(f"User {user_id} not found")
if response.status_code == 402:
raise ValueError("License limit exceeded. Upgrade your plan to activate more users.")
response.raise_for_status()
return True
# Example usage
try:
if activate_user("1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv", "1234567890"):
print("User has been activated successfully")
except Exception as e:
print(f"Failed to activate user: {str(e)}")
const axios = require('axios');
async function activateUser(apiKey, userId) {
try {
await axios.delete(
`https://YOURSITE.konstant.ly/openapi/v1/users/blocked/${userId}`,
{
headers: { 'X-API-KEY': apiKey }
}
);
return true;
} catch (error) {
if (error.response?.status === 404) {
throw new Error(`User ${userId} not found`);
}
if (error.response?.status === 402) {
throw new Error('License limit exceeded. Upgrade your plan.');
}
throw error;
}
}
// Example usage
activateUser('1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv', '1234567890')
.then(() => console.log('User has been activated successfully'))
.catch(error => console.error('Failed:', error.message));
{}
{
"status": 404,
"message": "Not found"
}
{
"status": 402,
"message": "Payment required"
}
Users
Activate User
Activate (unban) a deactivated user account
DELETE
/
users
/
blocked
/
{userId}
curl --request DELETE \
--url 'https://YOURSITE.konstant.ly/openapi/v1/users/blocked/1234567890' \
--header 'X-API-KEY: 1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv'
import requests
def activate_user(api_key: str, user_id: str) -> bool:
url = f"https://YOURSITE.konstant.ly/openapi/v1/users/blocked/{user_id}"
headers = {"X-API-KEY": api_key}
response = requests.delete(url, headers=headers)
if response.status_code == 404:
raise ValueError(f"User {user_id} not found")
if response.status_code == 402:
raise ValueError("License limit exceeded. Upgrade your plan to activate more users.")
response.raise_for_status()
return True
# Example usage
try:
if activate_user("1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv", "1234567890"):
print("User has been activated successfully")
except Exception as e:
print(f"Failed to activate user: {str(e)}")
const axios = require('axios');
async function activateUser(apiKey, userId) {
try {
await axios.delete(
`https://YOURSITE.konstant.ly/openapi/v1/users/blocked/${userId}`,
{
headers: { 'X-API-KEY': apiKey }
}
);
return true;
} catch (error) {
if (error.response?.status === 404) {
throw new Error(`User ${userId} not found`);
}
if (error.response?.status === 402) {
throw new Error('License limit exceeded. Upgrade your plan.');
}
throw error;
}
}
// Example usage
activateUser('1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv', '1234567890')
.then(() => console.log('User has been activated successfully'))
.catch(error => console.error('Failed:', error.message));
{}
{
"status": 404,
"message": "Not found"
}
{
"status": 402,
"message": "Payment required"
}
Reactivate a previously deactivated user account, allowing them to log in again.
Request Headers
API Key. Go to your Konstantly site > Settings > API and copy the value from there.
URL Parameters
User API ID to activate
Response
Returns an empty response on success.Error Responses
curl --request DELETE \
--url 'https://YOURSITE.konstant.ly/openapi/v1/users/blocked/1234567890' \
--header 'X-API-KEY: 1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv'
import requests
def activate_user(api_key: str, user_id: str) -> bool:
url = f"https://YOURSITE.konstant.ly/openapi/v1/users/blocked/{user_id}"
headers = {"X-API-KEY": api_key}
response = requests.delete(url, headers=headers)
if response.status_code == 404:
raise ValueError(f"User {user_id} not found")
if response.status_code == 402:
raise ValueError("License limit exceeded. Upgrade your plan to activate more users.")
response.raise_for_status()
return True
# Example usage
try:
if activate_user("1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv", "1234567890"):
print("User has been activated successfully")
except Exception as e:
print(f"Failed to activate user: {str(e)}")
const axios = require('axios');
async function activateUser(apiKey, userId) {
try {
await axios.delete(
`https://YOURSITE.konstant.ly/openapi/v1/users/blocked/${userId}`,
{
headers: { 'X-API-KEY': apiKey }
}
);
return true;
} catch (error) {
if (error.response?.status === 404) {
throw new Error(`User ${userId} not found`);
}
if (error.response?.status === 402) {
throw new Error('License limit exceeded. Upgrade your plan.');
}
throw error;
}
}
// Example usage
activateUser('1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv', '1234567890')
.then(() => console.log('User has been activated successfully'))
.catch(error => console.error('Failed:', error.message));
{}
{
"status": 404,
"message": "Not found"
}
{
"status": 402,
"message": "Payment required"
}
Was this page helpful?
⌘I