curl --request POST \--url 'https://YOURSITE.konstantly.ai/api/v1/users/emp-1042/unblock' \--header 'X-API-KEY: 1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv'
import requestsdef activate_user(api_key: str, user_id: str) -> bool: url = f"https://YOURSITE.konstantly.ai/api/v1/users/{user_id}/unblock" headers = {"X-API-KEY": api_key} response = requests.post(url, headers=headers) if response.status_code == 404: raise ValueError(f"User {user_id} not found") if response.status_code == 403: raise ValueError("User limit reached. Upgrade your plan to activate more users.") response.raise_for_status() return True# Example usagetry: if activate_user("1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv", "emp-1042"): 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.post( `https://YOURSITE.konstantly.ai/api/v1/users/${userId}/unblock`, null, { 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 === 403) { throw new Error('User limit reached. Upgrade your plan.'); } throw error; }}// Example usageactivateUser('1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv', 'emp-1042') .then(() => console.log('User has been activated successfully')) .catch(error => console.error('Failed:', error.message));
{ "status": 422, "message": "User is not blocked"}
Users
Activate User
Activate (unban) a deactivated user account
POST
/
users
/
{userId}
/
unblock
curl --request POST \--url 'https://YOURSITE.konstantly.ai/api/v1/users/emp-1042/unblock' \--header 'X-API-KEY: 1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv'
import requestsdef activate_user(api_key: str, user_id: str) -> bool: url = f"https://YOURSITE.konstantly.ai/api/v1/users/{user_id}/unblock" headers = {"X-API-KEY": api_key} response = requests.post(url, headers=headers) if response.status_code == 404: raise ValueError(f"User {user_id} not found") if response.status_code == 403: raise ValueError("User limit reached. Upgrade your plan to activate more users.") response.raise_for_status() return True# Example usagetry: if activate_user("1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv", "emp-1042"): 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.post( `https://YOURSITE.konstantly.ai/api/v1/users/${userId}/unblock`, null, { 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 === 403) { throw new Error('User limit reached. Upgrade your plan.'); } throw error; }}// Example usageactivateUser('1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv', 'emp-1042') .then(() => console.log('User has been activated successfully')) .catch(error => console.error('Failed:', error.message));
{ "status": 422, "message": "User is not blocked"}
Reactivate a previously deactivated user account, allowing them to log in again.
DELETE /users/blocked/{userId} does the same and returns the same responses.
Request Headers
string
required
API Key. Go to your Konstantly site > Settings > API and copy the value from there.
URL Parameters
string
required
User ID to activate: your own user ID or the Konstantly user ID (see User IDs)
Response
Returns HTTP 204 with an empty body on success.
Error Responses
object
Returned when user is not found
Show Error object properties
integer
required
HTTP status code (404)
string
required
Error message
object
Returned when your plan’s user limit is reached and the user cannot be activated
Show Error object properties
integer
required
HTTP status code (403)
string
required
Error message
object
Returned when the user is not blocked
Show Error object properties
integer
required
HTTP status code (422)
string
required
Error message
curl --request POST \--url 'https://YOURSITE.konstantly.ai/api/v1/users/emp-1042/unblock' \--header 'X-API-KEY: 1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv'
import requestsdef activate_user(api_key: str, user_id: str) -> bool: url = f"https://YOURSITE.konstantly.ai/api/v1/users/{user_id}/unblock" headers = {"X-API-KEY": api_key} response = requests.post(url, headers=headers) if response.status_code == 404: raise ValueError(f"User {user_id} not found") if response.status_code == 403: raise ValueError("User limit reached. Upgrade your plan to activate more users.") response.raise_for_status() return True# Example usagetry: if activate_user("1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv", "emp-1042"): 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.post( `https://YOURSITE.konstantly.ai/api/v1/users/${userId}/unblock`, null, { 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 === 403) { throw new Error('User limit reached. Upgrade your plan.'); } throw error; }}// Example usageactivateUser('1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv', 'emp-1042') .then(() => console.log('User has been activated successfully')) .catch(error => console.error('Failed:', error.message));