# Reactivate user Reactivate a previously deactivated user within an organization, restoring their roles and department memberships. Sets the user's status back to active. Their previously assigned roles and department memberships are preserved and become effective again. #### Path Parameters **`organization_id`** string required The unique identifier of the organization (format: `org_*`). **`user_id`** string required The unique identifier of the user to reactivate (format: `usr_*`). ## Returns The updated user object with `account_state` set to `"active"`. Request ```bash cURL curl -X POST https://api.aitronos.com/v1/organizations/org_xyz789/users/usr_abc123/reactivate \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` ```python Python SDK from aitronos import Aitronos client = Aitronos(api_key="your-api-key") # Users V2 endpoints coming to SDK soon # result = client.users.reactivate( # organization_id="org_xyz789", # user_id="usr_abc123", # ) ``` ```python Python import requests org_id = "org_xyz789" user_id = "usr_abc123" url = f"https://api.aitronos.com/v1/organizations/{org_id}/users/{user_id}/reactivate" headers = {"Authorization": "Bearer YOUR_ACCESS_TOKEN"} response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript JavaScript const orgId = "org_xyz789"; const userId = "usr_abc123"; const response = await fetch( `https://api.aitronos.com/v1/organizations/${orgId}/users/${userId}/reactivate`, { method: "POST", headers: { Authorization: "Bearer YOUR_ACCESS_TOKEN", }, } ); const data = await response.json(); console.log(data); ``` Response ```json 200 OK { "id": "usr_abc123", "full_name": "Jane Doe", "email": "jane@example.com", "user_name": "janedoe", "account_state": "active", "role_ids": ["role_admin1"], "department_ids": ["dept_eng001"], "organization_id": "org_xyz789", "invitation_link": null, "invited_at": null, "deactivated_at": null } ``` ```json 422 Validation Error { "success": false, "error": { "code": "USER_NOT_DEACTIVATED", "message": "This user account is not deactivated and cannot be reactivated.", "system_message": "this user account is not deactivated and cannot be reactivated.", "type": "client_error", "status": 422, "details": { "user_id": "usr_abc123" }, "trace_id": "abc-123-def", "timestamp": "2025-12-22T15:30:00Z" } } ``` ## Related Resources - [Invite user (v2)](/docs/api-reference/users/invite-v2) - [Update memberships](/docs/api-reference/users/update-memberships) - [Deactivate user](/docs/api-reference/users/deactivate) - [Remove user](/docs/api-reference/users/remove)