# Users

User management and invitations

## Get user profile

> Retrieve information about the authenticated user. This endpoint is only available with user-scoped authentication.

```json
{"openapi":"3.0.3","info":{"title":"Blynk Platform API","version":"1.0.0"},"tags":[{"name":"Users","description":"User management and invitations"}],"servers":[{"url":"https://{server_address}","description":"Blynk Server","variables":{"server_address":{"default":"blynk.cloud","description":"Your Blynk server domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer token obtained from authentication endpoint"}},"schemas":{"UserProfile":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"User ID"},"name":{"type":"string","description":"User name"},"email":{"type":"string","format":"email","description":"User email"},"title":{"type":"string","description":"User title"},"nickName":{"type":"string","description":"User nickname"},"phoneNumber":{"type":"string","description":"User phone number"},"role":{"type":"object","description":"User role information","required":["id","name","permissions"],"properties":{"id":{"type":"integer","format":"int32","description":"Role ID"},"name":{"type":"string","description":"Role name"},"permissions":{"type":"array","items":{"$ref":"#/components/schemas/Permission"},"description":"Array of permission names"}}},"orgId":{"type":"integer","format":"int32","description":"Organization ID, that the user belongs to"},"orgName":{"type":"string","description":"Organization name"},"tz":{"type":"string","description":"User timezone in the IANA Time Zone Database (TZDB) format."},"locale":{"type":"string","description":"User locale."},"status":{"type":"string","enum":["Pending","Active","Inactive","Suspended"],"description":"User status"},"lastModifiedTs":{"type":"integer","format":"int64","description":"Timestamp, indicating the time, when the user was modified last time (Unix epoch milliseconds)"},"lastLoggedAt":{"type":"integer","format":"int64","description":"Timestamp, when the user has logged in last time (Unix epoch milliseconds)"},"registeredAt":{"type":"integer","format":"int64","description":"Timestamp, when the user has registered (Unix epoch milliseconds)"},"isDev":{"type":"boolean","description":"Whether the user has enabled the developer mode"},"isDarkMode":{"type":"boolean","description":"Whether the user has enabled dark mode"}},"required":["id","email","role","orgId","status","lastModifiedTs","registeredAt","isDev","isDarkMode"]},"Permission":{"type":"string","description":"User permission name that grants access to specific features and operations","enum":["ALLOW_FORCE_USER_LOGOUT","ASSIGN_TAG","AUTHENTICATE_TO_MCP","AUTOMATION_CREATE","AUTOMATION_DELETE","AUTOMATION_EDIT","AUTOMATION_EXECUTE","AUTOMATION_VIEW","BILLING","CHANGE_DEV_MODE","CHANGE_USER_PASSWORD","EDIT_DEVICE_SEGMENTS","EDIT_TIMELINE","ENABLE_OFFLINE_AUTOMATION","EXPORT_SEARCH_DEVICES","EXPORT_SEARCH_ORGS","EXPORT_SEARCH_USERS","MANAGE_ASSETS","MANAGE_AUTOMATION_TEMPLATES","MANAGE_AWS_IOT_INTEGRATION","MANAGE_BLUEPRINTS","MANAGE_BLUES_INTEGRATION","MANAGE_CHIRPSTACK_INTEGRATION","MANAGE_COLUMNS","MANAGE_CUSTOM_DATA_TABLE","MANAGE_DEMAND_RESPONSE","MANAGE_EVENTS_ANALYTICS","MANAGE_FORMS","MANAGE_IN_APP_CAMPAIGN","MANAGE_MYRIOTA_INTEGRATION","MANAGE_OPEN_WEATHER_INTEGRATION","MANAGE_ORDERS","MANAGE_SHARING","MANAGE_STATIC_TOKENS","MANAGE_STREAMING","MANAGE_TAG","MANAGE_TOURS","MANAGE_TTN_INTEGRATION","MANAGE_WEB_HOOK","OAUTH_TOKEN_CREATE","OAUTH_TOKEN_DELETE","OAUTH_TOKEN_EDIT","OAUTH_TOKEN_VIEW","ORG_ANALYTICS_CREATE","ORG_ANALYTICS_DELETE","ORG_ANALYTICS_EDIT","ORG_ANALYTICS_VIEW","ORG_CREATE","ORG_DELETE","ORG_DELETE_USERS","ORG_DEVICES_CONTROL","ORG_DEVICES_CREATE","ORG_DEVICES_DELETE","ORG_DEVICES_EDIT","ORG_DEVICES_VIEW","ORG_DEVICE_DATA_DELETE","ORG_DEVICE_DATA_EXPORT","ORG_DEVICE_DATA_IMPORT","ORG_DEVICE_VIEW_ACTION_LOG","ORG_EDIT","ORG_EDIT_USERS","ORG_INVITE_USERS","ORG_LOCATION_ASSIGN","ORG_LOCATION_CREATE","ORG_LOCATION_DELETE","ORG_LOCATION_EDIT","ORG_LOCATION_VIEW","ORG_SMS_SETTINGS_UPDATE","ORG_SWITCH","ORG_VIEW","ORG_VIEW_USERS","OTA_CANCEL","OTA_START","OTA_VIEW","OWN_DEVICES_CONTROL","OWN_DEVICES_DELETE","OWN_DEVICES_EDIT","OWN_DEVICES_VIEW","OWN_DEVICE_DATA_DELETE","OWN_DEVICE_DATA_EXPORT","OWN_DEVICE_DATA_IMPORT","OWN_DEVICE_VIEW_ACTION_LOG","OWN_LOCATION_ASSIGN","OWN_LOCATION_DELETE","OWN_LOCATION_EDIT","OWN_LOCATION_VIEW","OWN_ORG_EDIT","PRODUCT_CREATE","PRODUCT_DELETE","PRODUCT_EDIT","PRODUCT_VIEW","PROVISION_DEVICES","PUBLISH_BLUEPRINT","ROLE_CREATE","ROLE_DELETE","ROLE_EDIT","ROLE_VIEW","RULE_CREATE","RULE_DELETE","RULE_EDIT","RULE_VIEW","SET_AUTH_TOKEN","SKIP_FIRMWARE_TYPE_CHECK_OTA","SUSPEND_USER","TEMPLATE_VOICE_ASSISTANCE","TRANSFER_DEVICE","TRANSFER_ORG","TRANSFER_USER","USER_TRANSLATION_CRUD","VIEW_DEVICE_DATA_SNAPSHOTS","VIEW_DEVICE_SEGMENTS","VIEW_FORMS","VIEW_HIERARCHY_TAG","VIEW_ORDERS","VIEW_OWN_ORG_TAG","VIEW_OWN_TAG","VIEW_THEME","VIEW_TIMELINE","VIEW_USER_ACTION_LOG"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}},"required":["message"]}},"required":["error"]}}},"paths":{"/api/v1/organization/user/profile":{"get":{"tags":["Users"],"summary":"Get user profile","description":"Retrieve information about the authenticated user. This endpoint is only available with user-scoped authentication.","operationId":"getUserProfile","responses":{"200":{"description":"User profile details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfile"}}}},"403":{"description":"Forbidden - This endpoint requires user-scoped authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Get users in organization

> Retrieve a paginated list of users in the organization, associated with the authentication token.\
> \
> Required permissions, when user-scoped authentication is used: \`ORG\_VIEW\_USERS\`.<br>

```json
{"openapi":"3.0.3","info":{"title":"Blynk Platform API","version":"1.0.0"},"tags":[{"name":"Users","description":"User management and invitations"}],"servers":[{"url":"https://{server_address}","description":"Blynk Server","variables":{"server_address":{"default":"blynk.cloud","description":"Your Blynk server domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer token obtained from authentication endpoint"}},"schemas":{"User":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"User ID"},"name":{"type":"string","description":"User name"},"email":{"type":"string","format":"email","description":"User email"},"roleId":{"type":"integer","format":"int32","description":"User role ID"},"orgId":{"type":"integer","format":"int32","description":"Organization ID, that the user belongs to"},"isDev":{"type":"boolean","description":"Whether the user has enabled the developer mode"}},"required":["id","roleId","orgId","isDev"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}},"required":["message"]}},"required":["error"]}}},"paths":{"/api/v1/organization/users":{"get":{"tags":["Users"],"summary":"Get users in organization","description":"Retrieve a paginated list of users in the organization, associated with the authentication token.\n\nRequired permissions, when user-scoped authentication is used: `ORG_VIEW_USERS`.\n","operationId":"getUsers","parameters":[{"name":"includeSubOrgUsers","in":"query","schema":{"type":"boolean","default":false},"description":"Include users from sub-organizations"},{"name":"page","in":"query","schema":{"type":"integer","format":"int32","default":0,"minimum":0},"description":"Page number (0-indexed)"},{"name":"size","in":"query","schema":{"type":"integer","format":"int32","default":50,"minimum":1,"maximum":1000},"description":"Page size (max 1000)"}],"responses":{"200":{"description":"List of users","content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/User"}},"totalElements":{"type":"integer","format":"int64"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden"},"429":{"description":"Too many requests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Search users

> Search for users by the provided query.\
> \
> Required permissions, when user-scoped authentication is used: \`ORG\_VIEW\_USERS\`.<br>

```json
{"openapi":"3.0.3","info":{"title":"Blynk Platform API","version":"1.0.0"},"tags":[{"name":"Users","description":"User management and invitations"}],"servers":[{"url":"https://{server_address}","description":"Blynk Server","variables":{"server_address":{"default":"blynk.cloud","description":"Your Blynk server domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer token obtained from authentication endpoint"}},"schemas":{"User":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"User ID"},"name":{"type":"string","description":"User name"},"email":{"type":"string","format":"email","description":"User email"},"roleId":{"type":"integer","format":"int32","description":"User role ID"},"orgId":{"type":"integer","format":"int32","description":"Organization ID, that the user belongs to"},"isDev":{"type":"boolean","description":"Whether the user has enabled the developer mode"}},"required":["id","roleId","orgId","isDev"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}},"required":["message"]}},"required":["error"]}}},"paths":{"/api/v1/organization/search/users":{"get":{"tags":["Users"],"summary":"Search users","description":"Search for users by the provided query.\n\nRequired permissions, when user-scoped authentication is used: `ORG_VIEW_USERS`.\n","operationId":"searchUsers","parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string","maxLength":255},"description":"Search query string"},{"name":"sortBy","in":"query","schema":{"type":"string"},"description":"Field to sort by"},{"name":"sortOrder","in":"query","schema":{"type":"string","enum":["ASC","DESC"],"default":"ASC"},"description":"Sort order"},{"name":"page","in":"query","schema":{"type":"integer","format":"int32","default":0,"minimum":0},"description":"Page number (0-indexed)"},{"name":"size","in":"query","schema":{"type":"integer","format":"int32","default":50,"minimum":1,"maximum":1000},"description":"Page size (max 1000)"}],"responses":{"200":{"description":"Search results","content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/User"},"description":"Array of matching users"},"totalElements":{"type":"integer","format":"int64","description":"Total amount of users, available to fetch."}},"required":["content","totalElements"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden"},"429":{"description":"Too many requests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Get user by ID

> Retrieve detailed information about a specific user.\
> \
> Required permissions, when user-scoped authentication is used: \`ORG\_VIEW\_USERS\`.<br>

```json
{"openapi":"3.0.3","info":{"title":"Blynk Platform API","version":"1.0.0"},"tags":[{"name":"Users","description":"User management and invitations"}],"servers":[{"url":"https://{server_address}","description":"Blynk Server","variables":{"server_address":{"default":"blynk.cloud","description":"Your Blynk server domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer token obtained from authentication endpoint"}},"schemas":{"UserDetails":{"allOf":[{"$ref":"#/components/schemas/User"},{"type":"object","properties":{"title":{"type":"string","description":"User title"},"nickName":{"type":"string","description":"User nickname"},"phoneNumber":{"type":"string","description":"User phone number"},"tz":{"type":"string","description":"User timezone in the IANA Time Zone Database (TZDB) format."},"locale":{"type":"string","description":"User locale."},"status":{"type":"string","enum":["Pending","Active","Inactive","Suspended"],"description":"User status"},"lastModifiedTs":{"type":"integer","format":"int64","description":"Timestamp, indicating the time, when the user was modified last time (Unix epoch milliseconds)"},"lastLoggedAt":{"type":"integer","format":"int64","description":"Timestamp, when the user has logged in last time (Unix epoch milliseconds)"},"registeredAt":{"type":"integer","format":"int64","description":"Timestamp, when the user has registered (Unix epoch milliseconds)"}},"required":["id","email","roleId","orgId","status","lastModifiedTs","registeredAt","isDev"]}]},"User":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"User ID"},"name":{"type":"string","description":"User name"},"email":{"type":"string","format":"email","description":"User email"},"roleId":{"type":"integer","format":"int32","description":"User role ID"},"orgId":{"type":"integer","format":"int32","description":"Organization ID, that the user belongs to"},"isDev":{"type":"boolean","description":"Whether the user has enabled the developer mode"}},"required":["id","roleId","orgId","isDev"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}},"required":["message"]}},"required":["error"]}}},"paths":{"/api/v1/organization/user":{"get":{"tags":["Users"],"summary":"Get user by ID","description":"Retrieve detailed information about a specific user.\n\nRequired permissions, when user-scoped authentication is used: `ORG_VIEW_USERS`.\n","operationId":"getUser","parameters":[{"name":"userId","in":"query","required":true,"schema":{"type":"integer","format":"int64"},"description":"User ID"}],"responses":{"200":{"description":"User details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserDetails"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden"},"404":{"description":"User not found or access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Create a new user in personal organization

> Create a personal organization and a new user in it.\
> \
> If there is already an existing user with the provided email, API will return 200 OK response with the existing user details.\
> \
> Required permissions, when user-scoped authentication is used: \`ORG\_INVITE\_USERS\`.<br>

```json
{"openapi":"3.0.3","info":{"title":"Blynk Platform API","version":"1.0.0"},"tags":[{"name":"Users","description":"User management and invitations"}],"servers":[{"url":"https://{server_address}","description":"Blynk Server","variables":{"server_address":{"default":"blynk.cloud","description":"Your Blynk server domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer token obtained from authentication endpoint"}},"schemas":{"Address":{"type":"object","properties":{"fullAddress":{"type":"string","maxLength":512,"description":"Full address"},"country":{"type":"string","maxLength":74,"description":"Country name"},"city":{"type":"string","maxLength":50,"description":"City name"},"state":{"type":"string","maxLength":40,"description":"State or province"},"zip":{"type":"string","maxLength":12,"description":"Postal code"}}},"UserDetails":{"allOf":[{"$ref":"#/components/schemas/User"},{"type":"object","properties":{"title":{"type":"string","description":"User title"},"nickName":{"type":"string","description":"User nickname"},"phoneNumber":{"type":"string","description":"User phone number"},"tz":{"type":"string","description":"User timezone in the IANA Time Zone Database (TZDB) format."},"locale":{"type":"string","description":"User locale."},"status":{"type":"string","enum":["Pending","Active","Inactive","Suspended"],"description":"User status"},"lastModifiedTs":{"type":"integer","format":"int64","description":"Timestamp, indicating the time, when the user was modified last time (Unix epoch milliseconds)"},"lastLoggedAt":{"type":"integer","format":"int64","description":"Timestamp, when the user has logged in last time (Unix epoch milliseconds)"},"registeredAt":{"type":"integer","format":"int64","description":"Timestamp, when the user has registered (Unix epoch milliseconds)"}},"required":["id","email","roleId","orgId","status","lastModifiedTs","registeredAt","isDev"]}]},"User":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"User ID"},"name":{"type":"string","description":"User name"},"email":{"type":"string","format":"email","description":"User email"},"roleId":{"type":"integer","format":"int32","description":"User role ID"},"orgId":{"type":"integer","format":"int32","description":"Organization ID, that the user belongs to"},"isDev":{"type":"boolean","description":"Whether the user has enabled the developer mode"}},"required":["id","roleId","orgId","isDev"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}},"required":["message"]}},"required":["error"]}}},"paths":{"/api/v1/organization/users/create":{"post":{"tags":["Users"],"summary":"Create a new user in personal organization","description":"Create a personal organization and a new user in it.\n\nIf there is already an existing user with the provided email, API will return 200 OK response with the existing user details.\n\nRequired permissions, when user-scoped authentication is used: `ORG_INVITE_USERS`.\n","operationId":"addUser","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"User email"},"password":{"type":"string","format":"password","description":"User password","maxLength":200},"name":{"type":"string","description":"User's full name. Can only contain letters, hyphens, spaces, dots and apostrophes.","maxLength":50},"title":{"type":"string","description":"User's title or position. Can only contain letters, hyphens and spaces.","maxLength":50},"nickName":{"type":"string","description":"User's nickname. Can only contain letters, digits, hyphens and spaces.","maxLength":50},"phoneNumber":{"type":"string","description":"User's phone number"},"organizationName":{"type":"string","minLength":3,"maxLength":100,"description":"Name of the personal organization to create. If not specified, the organization will be created with the default name. Can only contain letters, digits, spaces, dots, hyphens and apostrophes."},"address":{"$ref":"#/components/schemas/Address"},"tz":{"type":"string","description":"User's time zone","maxLength":200}},"required":["email","password"]}}}},"responses":{"200":{"description":"User with the provided email already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserDetails"}}}},"201":{"description":"User created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserDetails"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden"},"429":{"description":"Too many requests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Create user in organization

> Create a new user account in the existing organization.\
> \
> The specified \`roleId\` must be a valid role in the target organization.\
> \
> Required permissions, when user-scoped authentication is used: \`ORG\_INVITE\_USERS\`.<br>

```json
{"openapi":"3.0.3","info":{"title":"Blynk Platform API","version":"1.0.0"},"tags":[{"name":"Users","description":"User management and invitations"}],"servers":[{"url":"https://{server_address}","description":"Blynk Server","variables":{"server_address":{"default":"blynk.cloud","description":"Your Blynk server domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer token obtained from authentication endpoint"}},"schemas":{"Address":{"type":"object","properties":{"fullAddress":{"type":"string","maxLength":512,"description":"Full address"},"country":{"type":"string","maxLength":74,"description":"Country name"},"city":{"type":"string","maxLength":50,"description":"City name"},"state":{"type":"string","maxLength":40,"description":"State or province"},"zip":{"type":"string","maxLength":12,"description":"Postal code"}}},"UserDetails":{"allOf":[{"$ref":"#/components/schemas/User"},{"type":"object","properties":{"title":{"type":"string","description":"User title"},"nickName":{"type":"string","description":"User nickname"},"phoneNumber":{"type":"string","description":"User phone number"},"tz":{"type":"string","description":"User timezone in the IANA Time Zone Database (TZDB) format."},"locale":{"type":"string","description":"User locale."},"status":{"type":"string","enum":["Pending","Active","Inactive","Suspended"],"description":"User status"},"lastModifiedTs":{"type":"integer","format":"int64","description":"Timestamp, indicating the time, when the user was modified last time (Unix epoch milliseconds)"},"lastLoggedAt":{"type":"integer","format":"int64","description":"Timestamp, when the user has logged in last time (Unix epoch milliseconds)"},"registeredAt":{"type":"integer","format":"int64","description":"Timestamp, when the user has registered (Unix epoch milliseconds)"}},"required":["id","email","roleId","orgId","status","lastModifiedTs","registeredAt","isDev"]}]},"User":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"User ID"},"name":{"type":"string","description":"User name"},"email":{"type":"string","format":"email","description":"User email"},"roleId":{"type":"integer","format":"int32","description":"User role ID"},"orgId":{"type":"integer","format":"int32","description":"Organization ID, that the user belongs to"},"isDev":{"type":"boolean","description":"Whether the user has enabled the developer mode"}},"required":["id","roleId","orgId","isDev"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}},"required":["message"]}},"required":["error"]}}},"paths":{"/api/v1/organization/users/create-in-org":{"post":{"tags":["Users"],"summary":"Create user in organization","description":"Create a new user account in the existing organization.\n\nThe specified `roleId` must be a valid role in the target organization.\n\nRequired permissions, when user-scoped authentication is used: `ORG_INVITE_USERS`.\n","operationId":"createUserInOrg","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"User email"},"password":{"type":"string","format":"password","description":"User password","maxLength":200},"name":{"type":"string","description":"User's full name. Can only contain letters, hyphens, spaces, dots and apostrophes.","maxLength":50},"title":{"type":"string","description":"User's title or position. Can only contain letters, hyphens and spaces.","maxLength":50},"nickName":{"type":"string","description":"User's nickname. Can only contain letters, digits, hyphens and spaces.","maxLength":50},"phoneNumber":{"type":"string","description":"User's phone number"},"address":{"$ref":"#/components/schemas/Address"},"tz":{"type":"string","description":"User's time zone","maxLength":200},"orgId":{"type":"integer","format":"int32","description":"Organization ID to create user in."},"roleId":{"type":"integer","format":"int32","description":"Role ID to assign to the user."}},"required":["email","password","orgId","roleId"]}}}},"responses":{"201":{"description":"User created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserDetails"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden"},"404":{"description":"Organization not found or access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Update user role

> Update the role of a user in the organization.\
> \
> When user-scoped authentication is used, the following validations apply:\
> 1\. The authenticated user cannot modify their own role\
> 2\. The authenticated user cannot assign a role with higher permissions than their own\
> 3\. The authenticated user cannot change the role of a user with higher permissions than their own\
> \
> Required permissions, when user-scoped authentication is used: \`ORG\_VIEW\_USERS\`, \`ORG\_EDIT\_USERS\`.<br>

```json
{"openapi":"3.0.3","info":{"title":"Blynk Platform API","version":"1.0.0"},"tags":[{"name":"Users","description":"User management and invitations"}],"servers":[{"url":"https://{server_address}","description":"Blynk Server","variables":{"server_address":{"default":"blynk.cloud","description":"Your Blynk server domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer token obtained from authentication endpoint"}},"schemas":{"UserDetails":{"allOf":[{"$ref":"#/components/schemas/User"},{"type":"object","properties":{"title":{"type":"string","description":"User title"},"nickName":{"type":"string","description":"User nickname"},"phoneNumber":{"type":"string","description":"User phone number"},"tz":{"type":"string","description":"User timezone in the IANA Time Zone Database (TZDB) format."},"locale":{"type":"string","description":"User locale."},"status":{"type":"string","enum":["Pending","Active","Inactive","Suspended"],"description":"User status"},"lastModifiedTs":{"type":"integer","format":"int64","description":"Timestamp, indicating the time, when the user was modified last time (Unix epoch milliseconds)"},"lastLoggedAt":{"type":"integer","format":"int64","description":"Timestamp, when the user has logged in last time (Unix epoch milliseconds)"},"registeredAt":{"type":"integer","format":"int64","description":"Timestamp, when the user has registered (Unix epoch milliseconds)"}},"required":["id","email","roleId","orgId","status","lastModifiedTs","registeredAt","isDev"]}]},"User":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"User ID"},"name":{"type":"string","description":"User name"},"email":{"type":"string","format":"email","description":"User email"},"roleId":{"type":"integer","format":"int32","description":"User role ID"},"orgId":{"type":"integer","format":"int32","description":"Organization ID, that the user belongs to"},"isDev":{"type":"boolean","description":"Whether the user has enabled the developer mode"}},"required":["id","roleId","orgId","isDev"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}},"required":["message"]}},"required":["error"]}}},"paths":{"/api/v1/organization/users/role":{"put":{"tags":["Users"],"summary":"Update user role","description":"Update the role of a user in the organization.\n\nWhen user-scoped authentication is used, the following validations apply:\n1. The authenticated user cannot modify their own role\n2. The authenticated user cannot assign a role with higher permissions than their own\n3. The authenticated user cannot change the role of a user with higher permissions than their own\n\nRequired permissions, when user-scoped authentication is used: `ORG_VIEW_USERS`, `ORG_EDIT_USERS`.\n","operationId":"updateUserRole","parameters":[{"name":"userId","in":"query","required":true,"schema":{"type":"integer","format":"int64"},"description":"User ID"},{"name":"roleId","in":"query","required":true,"schema":{"type":"integer","format":"int32"},"description":"Role ID to assign"}],"responses":{"200":{"description":"User role updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserDetails"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden"},"404":{"description":"User/role not found or access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Invite user to organization

> Send an invitation to a user to join the organization.\
> \
> Required permissions, when user-scoped authentication is used: \`ORG\_INVITE\_USERS\`.<br>

```json
{"openapi":"3.0.3","info":{"title":"Blynk Platform API","version":"1.0.0"},"tags":[{"name":"Users","description":"User management and invitations"}],"servers":[{"url":"https://{server_address}","description":"Blynk Server","variables":{"server_address":{"default":"blynk.cloud","description":"Your Blynk server domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer token obtained from authentication endpoint"}},"schemas":{"UserDetails":{"allOf":[{"$ref":"#/components/schemas/User"},{"type":"object","properties":{"title":{"type":"string","description":"User title"},"nickName":{"type":"string","description":"User nickname"},"phoneNumber":{"type":"string","description":"User phone number"},"tz":{"type":"string","description":"User timezone in the IANA Time Zone Database (TZDB) format."},"locale":{"type":"string","description":"User locale."},"status":{"type":"string","enum":["Pending","Active","Inactive","Suspended"],"description":"User status"},"lastModifiedTs":{"type":"integer","format":"int64","description":"Timestamp, indicating the time, when the user was modified last time (Unix epoch milliseconds)"},"lastLoggedAt":{"type":"integer","format":"int64","description":"Timestamp, when the user has logged in last time (Unix epoch milliseconds)"},"registeredAt":{"type":"integer","format":"int64","description":"Timestamp, when the user has registered (Unix epoch milliseconds)"}},"required":["id","email","roleId","orgId","status","lastModifiedTs","registeredAt","isDev"]}]},"User":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"User ID"},"name":{"type":"string","description":"User name"},"email":{"type":"string","format":"email","description":"User email"},"roleId":{"type":"integer","format":"int32","description":"User role ID"},"orgId":{"type":"integer","format":"int32","description":"Organization ID, that the user belongs to"},"isDev":{"type":"boolean","description":"Whether the user has enabled the developer mode"}},"required":["id","roleId","orgId","isDev"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}},"required":["message"]}},"required":["error"]}}},"paths":{"/api/v1/organization/users/invite":{"post":{"tags":["Users"],"summary":"Invite user to organization","description":"Send an invitation to a user to join the organization.\n\nRequired permissions, when user-scoped authentication is used: `ORG_INVITE_USERS`.\n","operationId":"inviteUser","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"name":{"type":"string","description":"User's full name. Cannot contain slashes, backslashes, `<` or `>`.","minLength":1,"maxLength":100},"roleId":{"type":"integer","format":"int32","description":"Role ID to assign to the user upon accepting the invitation"},"orgId":{"type":"integer","format":"int32","description":"Organization ID. If not provided, the organization associated with the authentication token will be used."},"locale":{"type":"string","description":"User's locale"}},"required":["email","name","roleId"]}}}},"responses":{"201":{"description":"Invitation sent successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserDetails"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden"},"404":{"description":"Organization not found or access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Register user

> Create a new personal organization and send user invitation for registration.\
> \
> User-scoped authentication is not allowed for this endpoint.<br>

```json
{"openapi":"3.0.3","info":{"title":"Blynk Platform API","version":"1.0.0"},"tags":[{"name":"Users","description":"User management and invitations"}],"servers":[{"url":"https://{server_address}","description":"Blynk Server","variables":{"server_address":{"default":"blynk.cloud","description":"Your Blynk server domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer token obtained from authentication endpoint"}},"schemas":{"UserDetails":{"allOf":[{"$ref":"#/components/schemas/User"},{"type":"object","properties":{"title":{"type":"string","description":"User title"},"nickName":{"type":"string","description":"User nickname"},"phoneNumber":{"type":"string","description":"User phone number"},"tz":{"type":"string","description":"User timezone in the IANA Time Zone Database (TZDB) format."},"locale":{"type":"string","description":"User locale."},"status":{"type":"string","enum":["Pending","Active","Inactive","Suspended"],"description":"User status"},"lastModifiedTs":{"type":"integer","format":"int64","description":"Timestamp, indicating the time, when the user was modified last time (Unix epoch milliseconds)"},"lastLoggedAt":{"type":"integer","format":"int64","description":"Timestamp, when the user has logged in last time (Unix epoch milliseconds)"},"registeredAt":{"type":"integer","format":"int64","description":"Timestamp, when the user has registered (Unix epoch milliseconds)"}},"required":["id","email","roleId","orgId","status","lastModifiedTs","registeredAt","isDev"]}]},"User":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"User ID"},"name":{"type":"string","description":"User name"},"email":{"type":"string","format":"email","description":"User email"},"roleId":{"type":"integer","format":"int32","description":"User role ID"},"orgId":{"type":"integer","format":"int32","description":"Organization ID, that the user belongs to"},"isDev":{"type":"boolean","description":"Whether the user has enabled the developer mode"}},"required":["id","roleId","orgId","isDev"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}},"required":["message"]}},"required":["error"]}}},"paths":{"/api/v1/organization/users/register":{"post":{"tags":["Users"],"summary":"Register user","description":"Create a new personal organization and send user invitation for registration.\n\nUser-scoped authentication is not allowed for this endpoint.\n","operationId":"registerUser","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"User email"},"locale":{"type":"string","description":"User's locale"}},"required":["email"]}}}},"responses":{"201":{"description":"User registered successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserDetails"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden"},"429":{"description":"Too many requests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Transfer user to another organization

> Transfer a user to a different organization.\
> \
> The following constraints apply:\
> \- Users in \`Pending\` status cannot be transferred\
> \- Cannot transfer a user to the same organization they are already in\
> \- The destination organization must not exceed its user limit\
> \
> Required permissions, when user-scoped authentication is used: \`ORG\_VIEW\_USERS\`, \`TRANSFER\_USER\`.<br>

```json
{"openapi":"3.0.3","info":{"title":"Blynk Platform API","version":"1.0.0"},"tags":[{"name":"Users","description":"User management and invitations"}],"servers":[{"url":"https://{server_address}","description":"Blynk Server","variables":{"server_address":{"default":"blynk.cloud","description":"Your Blynk server domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer token obtained from authentication endpoint"}},"schemas":{"UserDetails":{"allOf":[{"$ref":"#/components/schemas/User"},{"type":"object","properties":{"title":{"type":"string","description":"User title"},"nickName":{"type":"string","description":"User nickname"},"phoneNumber":{"type":"string","description":"User phone number"},"tz":{"type":"string","description":"User timezone in the IANA Time Zone Database (TZDB) format."},"locale":{"type":"string","description":"User locale."},"status":{"type":"string","enum":["Pending","Active","Inactive","Suspended"],"description":"User status"},"lastModifiedTs":{"type":"integer","format":"int64","description":"Timestamp, indicating the time, when the user was modified last time (Unix epoch milliseconds)"},"lastLoggedAt":{"type":"integer","format":"int64","description":"Timestamp, when the user has logged in last time (Unix epoch milliseconds)"},"registeredAt":{"type":"integer","format":"int64","description":"Timestamp, when the user has registered (Unix epoch milliseconds)"}},"required":["id","email","roleId","orgId","status","lastModifiedTs","registeredAt","isDev"]}]},"User":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"User ID"},"name":{"type":"string","description":"User name"},"email":{"type":"string","format":"email","description":"User email"},"roleId":{"type":"integer","format":"int32","description":"User role ID"},"orgId":{"type":"integer","format":"int32","description":"Organization ID, that the user belongs to"},"isDev":{"type":"boolean","description":"Whether the user has enabled the developer mode"}},"required":["id","roleId","orgId","isDev"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}},"required":["message"]}},"required":["error"]}}},"paths":{"/api/v1/organization/users/transfer":{"post":{"tags":["Users"],"summary":"Transfer user to another organization","description":"Transfer a user to a different organization.\n\nThe following constraints apply:\n- Users in `Pending` status cannot be transferred\n- Cannot transfer a user to the same organization they are already in\n- The destination organization must not exceed its user limit\n\nRequired permissions, when user-scoped authentication is used: `ORG_VIEW_USERS`, `TRANSFER_USER`.\n","operationId":"transferUser","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"integer","description":"User ID","format":"int64"},"targetOrgId":{"type":"integer","format":"int32","description":"Target organization ID"},"roleId":{"type":"integer","format":"int32","description":"Role ID to assign to the user in the target organization","minimum":1}},"required":["userId","targetOrgId","roleId"]}}}},"responses":{"200":{"description":"User transferred successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserDetails"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden or no access to user's/target organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"User or organization not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Send push notification to user

> Send a push notification to a user's mobile devices.\
> \
> This endpoint is available only when organization-scoped authentication is used.<br>

```json
{"openapi":"3.0.3","info":{"title":"Blynk Platform API","version":"1.0.0"},"tags":[{"name":"Users","description":"User management and invitations"}],"servers":[{"url":"https://{server_address}","description":"Blynk Server","variables":{"server_address":{"default":"blynk.cloud","description":"Your Blynk server domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer token obtained from authentication endpoint"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}},"required":["message"]}},"required":["error"]}}},"paths":{"/api/v1/organization/users/send-push-notification":{"post":{"tags":["Users"],"summary":"Send push notification to user","description":"Send a push notification to a user's mobile devices.\n\nThis endpoint is available only when organization-scoped authentication is used.\n","operationId":"sendPushToUser","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"integer","format":"int64","description":"User ID"},"title":{"type":"string","description":"Notification title","maxLength":50},"body":{"type":"string","description":"Notification message body","maxLength":255},"imageUrl":{"type":"string","description":"URL of the image to display in the notification (optional)","maxLength":1024}},"required":["userId","title"]}}}},"responses":{"204":{"description":"Push notification sent successfully"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"User not found or access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Register FCM push token for user

> Register a Firebase Cloud Messaging (FCM) push token for a user's mobile device.\
> This allows the user to receive push notifications on the registered device.<br>

```json
{"openapi":"3.0.3","info":{"title":"Blynk Platform API","version":"1.0.0"},"tags":[{"name":"Users","description":"User management and invitations"}],"servers":[{"url":"https://{server_address}","description":"Blynk Server","variables":{"server_address":{"default":"blynk.cloud","description":"Your Blynk server domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer token obtained from authentication endpoint"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}},"required":["message"]}},"required":["error"]}}},"paths":{"/api/v1/organization/users/fcm-token/register":{"post":{"tags":["Users"],"summary":"Register FCM push token for user","description":"Register a Firebase Cloud Messaging (FCM) push token for a user's mobile device.\nThis allows the user to receive push notifications on the registered device.\n","operationId":"registerFcmToken","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"integer","format":"int64","description":"User ID"},"uid":{"type":"string","description":"Unique device identifier","maxLength":1000},"token":{"type":"string","description":"FCM push token","maxLength":1000},"clientType":{"type":"string","description":"Client platform type","enum":["ANDROID","IOS"]}},"required":["userId","uid","token","clientType"]}}}},"responses":{"204":{"description":"FCM token registered successfully"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden"},"404":{"description":"User not found or access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.blynk.io/en/blynk.cloud/platform-https-api/users.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
