# Create a new user under an existing account Creates a new user profile under an existing account. The user will have a unique username within the account's domain. This endpoint validates that the username is not reserved, the username doesn't already exist, and the associated account exists. Returns the created user information. RBAC: requires Users.Manage Endpoint: POST /api/v1/admin/create-user Version: 1.0 Security: ## Query parameters: - `account_id` (string) Account id to add user to Example: "us_01hxcvk1hjexere4pvtrj0ymqq" - `htmlContent` (any) Returns text as html if true or original text if false. Applicable only to local posts and users. Default is true. ## Request fields (application/json): - `username` (string, required) Username Example: "john_smith" - `displayName` (string, required) Display Name Example: "John Smith" - `summary` (string,null) User's bio Example: "I work in IT" - `avatarId` (string,null) Avatar upload id or null to remove Example: "us_01hxcvk1hjexere4pvtrj0ymqq" - `headerId` (string,null) Header upload id or null to remove Example: "us_01hxcvk1hjexere4pvtrj0ymqq" - `actorType` (string,null) User's role Enum: "Application", "Group", "Organization", "Person", "Service" - `channel` (boolean) Whether this user is a channel ## Response 200 fields (application/json): - `groupUserName` (string,null) Name of the channel inside a group - `id` (string, required) internal id of this user Example: "us_01hxcvk1hjexere4pvtrj0ymqq" - `username` (string, required) unique user name Example: "john_smith" - `domain` (string, required) user's domain, remote only, empty for local Example: "wlsly1.net" - `displayName` (string, required) full name of the user Example: "John Smith" - `summary` (string, required) User's summary or bio Example: "Pixels are my paint, code is my canvas, creativity is my brush." - `uri` (string, required) URI of this user Example: "https://wlsly1.net/users/john_smith" - `stats` (object, required) User stats - `stats.posts` (integer, required) number of posts - `stats.followers` (integer, required) number of followers - `stats.following` (integer, required) number of following - `stats.followingHidden` (boolean, required) privacy setting to hide followings - `stats.totalStorageBytes` (integer, required) total storage volume in bytes - `stats.comments` (integer, required) number of comments - `fields` (object, required) User fields - `avatar` (object,null) User's avatar - `avatar.uploadId` (string, required) Internal id Example: "us_01hxcvk1hjexere4pvtrj0ymqq" - `avatar.userId` (string, required) User id this upload belongs to Example: "us_01hxcvk1hjexere4pvtrj0ymqq" - `avatar.uploadType` (string, required) Type of the upload Enum: "VIDEO", "IMAGE", "AUDIO", "DOCUMENT", "OTHER" - `avatar.meta` (object, required) Meta data - `avatar.meta.blurhash` (string,null) - `avatar.meta.name` (string,null) - `avatar.meta.altText` (string,null) - `avatar.size` (integer, required) Size in bytes of all the files in this upload - `avatar.files` (array, required) List of all the files this upload has - `avatar.files.uri` (string,null, required) Full url of the file - `avatar.files.fileId` (string, required) File id Example: "us_01hxcvk1hjexere4pvtrj0ymqq" - `avatar.files.extension` (string, required) File extension Example: "mp4" - `avatar.files.original` (boolean, required) true if this file is original, false if it is a derivative - `avatar.files.meta` (object, required) File metadata. Contains optional values for width, height etc. - `avatar.files.meta.duration` (number,null) Video duration in seconds - `avatar.files.meta.width` (integer,null) Media width - `avatar.files.meta.height` (integer,null) Media height - `avatar.files.meta.codec` (string,null) Video codec - `avatar.files.meta.rotate` (integer,null) Rotation in degrees - `avatar.files.size` (integer, required) File size in bytes - `avatar.files.createdAt` (string, required) Example: "2022-03-10T16:15:50Z" - `avatar.files.updatedAt` (string, required) Example: "2022-03-10T16:15:50Z" - `avatar.files.type` (string, required) File type Enum: "VIDEO", "IMAGE", "AUDIO", "DOCUMENT", "OTHER" - `avatar.tags` (array, required) List of tags attached to upload Enum: "Post", "Avatar", "Header", "Album", "Emoji", "Event" - `avatar.error` (string,null) Upload processing error - `avatar.cached` (boolean) true if cached - `avatar.logs` (string,null) Logs - `avatar.remote` (boolean) true if this upload is remote - `header` (object,null) User's header - `deleted` (boolean,null) - `state` (string, required) User's moderation state Enum: "REGULAR", "SENSITIVE", "LIMITED", "SUSPENDED" - `relationship` (object,null) Relationship with this user - `relationship.following` (string,null) Does the viewer follow the target? Enum: "PENDING", "ACCEPTED", "REJECTED" - `relationship.followed` (string,null) Does the target follow the viewer? Enum: "PENDING", "ACCEPTED", "REJECTED" - `relationship.blocked` (boolean,null) Viewer blocked the target - `relationship.blockedBy` (boolean,null) Target blocked the viewer - `relationship.muted` (object,null) Viewer mutes the target - `relationship.muted.state` (boolean) - `relationship.muted.expiresAt` (string,null) Example: "2022-03-10T16:15:50Z" - `relationship.note` (string,null) Viewer's private note about the target - `emojis` (array,null) - `emojis.shortcode` (string, required) - `emojis.category` (string,null) - `emojis.url` (string, required) - `emojis.staticUrl` (string, required) - `emojis.visibleInPicker` (boolean) - `location` (object,null) User's location, geo and name - `location.geo` (object,null) Coordinates and other geo data - `location.geo.latitude` (number) - `location.geo.longitude` (number) - `location.geo.altitude` (number,null) - `location.geo.accuracy` (number,null) - `location.geo.verticalAccuracy` (number,null) - `location.geo.speed` (number,null) - `location.geo.bearing` (number,null) - `location.geo.timestamp` (integer,null) - `location.autoUpdate` (boolean) - `location.show` (boolean) - `timezone` (object,null) User's timezone - `timezone.ianaTimezone` (string,null) - `birthday` (object,null) User's birthday - `birthday.date` (string,null) Example: "2022-03-10T16:15:50Z" - `software` (string, required) Software platform type (wellesley, mastodon, threads.net) Example: "wellesley" - `channel` (boolean) is channel user - `groupId` (string,null) UUID with type prefix Example: "us_01hxcvk1hjexere4pvtrj0ymqq" - `groupPrivacy` (string,null) * PUBLIC - Channel is visible to everyone and can be followed by anyone. * PRIVATE - Channel is visible only to group members and can only be followed by group members. Enum: "PUBLIC", "PRIVATE" - `groupMain` (boolean,null) - `groupDefault` (boolean,null) - `actorType` (string,null) Whether this user is a person, application or a service Enum: "Application", "Group", "Organization", "Person", "Service" ## Response 403 fields (application/json): - `errorCode` (string, required) Error code - `message` (string, required) Error message - `docUrl` (string) Link to documentation ## Response 404 fields (application/json): - `errorCode` (string, required) Error code - `message` (string, required) Error message - `docUrl` (string) Link to documentation ## Response 409 fields (application/json): - `errorCode` (string, required) Error code - `message` (string, required) Error message - `docUrl` (string) Link to documentation ## Response 500 fields (application/json): - `errorCode` (string, required) Error code - `message` (string, required) Error message - `docUrl` (string) Link to documentation ## Response 400 fields