---
updatedAt: 2025-05-19T20:48:44.000Z
agentTools:
  projectIndex: https://developers.happeo.com/llms.txt
---

# Unlicense a user

Unlicenses (deactivates) one User account. Can only be called by an admin of the organisation. A user can not unlicense itself.

# OpenAPI definition

```json
{
  "openapi": "3.0.2",
  "info": {
    "version": "0.0.1",
    "title": "Happeo Users API",
    "description": "API to fetch, patch Happeo Users and also license/unlicense them",
    "license": {
      "name": "UNLICENSED"
    },
    "termsOfService": "https://www.happeo.com/tos",
    "contact": {
      "name": "API Support",
      "email": "support@happeo.com"
    }
  },
  "servers": [
    {
      "url": "https://api.happeo.com",
      "description": "Production server"
    },
    {
      "url": "https://api.staging.unvrs.io",
      "description": "Staging server"
    }
  ],
  "components": {
    "securitySchemes": {
      "headerAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-happeo-apikey",
        "description": "API key passed in the headers."
      }
    },
    "schemas": {
      "id": {
        "type": "string",
        "description": "The user id",
        "example": "123213",
        "nullable": false
      },
      "email": {
        "type": "string",
        "description": "The primary email of the user",
        "example": "example@example.com",
        "nullable": false,
        "format": "email"
      },
      "avatar": {
        "type": "string",
        "description": "The user profile picture URL",
        "example": "https://storage.googleapis.com/uploads/1234567890",
        "nullable": true,
        "format": "url"
      },
      "isAdmin": {
        "type": "boolean",
        "description": "States if the user is a Happeo administrator in their organisation"
      },
      "licensed": {
        "type": "boolean",
        "description": "States if the user is licensed (true) or not (false)"
      },
      "suspended": {
        "type": "boolean",
        "description": "States if the user is suspended (true) or not (false)"
      },
      "lastSeenMs": {
        "type": "number",
        "format": "int64",
        "nullable": true,
        "description": "Unix timestamp of when the user was seen last time.",
        "example": 1549633900290
      },
      "Name": {
        "type": "object",
        "description": "The object that contains the name of the user.",
        "properties": {
          "givenName": {
            "type": "string",
            "description": "The given name of the user"
          },
          "familyName": {
            "type": "string",
            "description": "The family name of the user"
          },
          "fullName": {
            "type": "string",
            "description": "The full name of the user (which is a combination of the given name and family name)"
          }
        }
      },
      "UserSource": {
        "type": "string",
        "description": "The source of the user information.\n\nPossible values:\n* `happeo` The user was created in Happeo.\n* `gsuite` The user has been provided from G Suite.",
        "enum": [
          "happeo",
          "gsuite"
        ],
        "example": "gsuite"
      },
      "UserType": {
        "type": "string",
        "description": "The type of the user.\n\nPossible values:\n* `regular` Standard user.\n* `system_account` The user is a system account, like the one used to access this api.",
        "enum": [
          "regular",
          "system_account"
        ],
        "example": "regular"
      },
      "UserOutput": {
        "type": "object",
        "description": "The user response body.",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/id"
          },
          "email": {
            "$ref": "#/components/schemas/email"
          },
          "name": {
            "$ref": "#/components/schemas/Name"
          },
          "avatar": {
            "$ref": "#/components/schemas/avatar"
          },
          "isAdmin": {
            "$ref": "#/components/schemas/isAdmin"
          },
          "licensed": {
            "$ref": "#/components/schemas/licensed"
          },
          "suspended": {
            "$ref": "#/components/schemas/suspended"
          },
          "userSource": {
            "$ref": "#/components/schemas/UserSource"
          },
          "userType": {
            "$ref": "#/components/schemas/UserType"
          },
          "lastSeenMs": {
            "$ref": "#/components/schemas/lastSeenMs"
          }
        }
      }
    },
    "parameters": {
      "userId": {
        "name": "userId",
        "in": "path",
        "description": "A user id.",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/id"
        }
      }
    },
    "responses": {
      "UserResponse": {
        "description": "A user.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/UserOutput"
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "headerAuth": []
    }
  ],
  "paths": {
    "/users/{userId}/unlicense": {
      "parameters": [
        {
          "$ref": "#/components/parameters/userId"
        }
      ],
      "post": {
        "summary": "Unlicense a user",
        "description": "Unlicenses (deactivates) one User account. Can only be called by an admin of the organisation. A user can not unlicense itself.",
        "operationId": "unlicenseUser",
        "responses": {
          "200": {
            "$ref": "#/components/responses/UserResponse"
          }
        },
        "tags": [
          "Users"
        ]
      }
    }
  },
  "tags": [
    {
      "name": "Users",
      "description": "User related operations"
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```