PLEXICHATNarrative Docs

Users

Guides, route-group overviews, and live schema entry points for the Plexichat backend.

REST http://api.plexichat.com/api/v1Gateway ws://api.plexichat.com/gatewayVersion a.1.0-49

Users API

Endpoints for user profile management.

Base URL: https://api.plexichat.com

GET /users/@me

Get the current authenticated user's profile.

Example Request


curl -X GET https://api.plexichat.com/users/@me \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"

Response (200 OK)


{
  "id": "123456789012345678",
  "username": "johndoe",
  "email": "[email protected]",
  "avatar_url": "https://api.plexichat.com/avatars/users/123456789012345678",
  "created_at": 1704067200,
  "email_verified": true,
  "totp_enabled": false,
  "age_verified": false
}

Response Fields

FieldTypeDescription
idstringUser's snowflake ID
usernamestringUsername
emailstringEmail address (private)
avatar_urlstring?Avatar URL
created_atintUnix timestamp of account creation
email_verifiedboolEmail verification status
totp_enabledbool2FA enabled status
age_verifiedboolAge verification status
badgesarrayArray of user badge identifiers

GET /users/@me/messaging-settings

Get current authenticated user's messaging preferences.

Response (200 OK)


{
  "user_id": "123456789012345678",
  "read_receipts_enabled": true,
  "typing_indicators_enabled": true,
  "compact_messages_enabled": true,
  "allow_dms_from": "everyone",
  "auto_create_dms": true,
  "max_message_length": null,
  "max_attachment_size": null,
  "max_attachments_per_message": null
}

PATCH /users/@me/messaging-settings

Update current authenticated user's messaging preferences.

Request Body

All fields optional.

FieldTypeDescription
read_receipts_enabledboolSend read receipts to others
typing_indicators_enabledboolShow your typing status
compact_messages_enabledboolEnable message grouping
allow_dms_fromstring"everyone", "friends", or "none"
auto_create_dmsboolAutomatically create conversations

Example Request


{
  "read_receipts_enabled": false,
  "allow_dms_from": "friends"
}

Response (200 OK)

Returns updated messaging settings object.

PATCH /users/@me

Update the current user's profile.

Request Body

FieldTypeRequiredConstraintsDescription
usernamestringNo3-32 charactersNew username
emailstringNoValid emailNew email
passwordstringNoMin 8 charactersNew password
current_passwordstringConditional-Required if changing password

Example Request


curl -X PATCH https://api.plexichat.com/users/@me \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "username": "newusername"
  }'

Response (200 OK)

Returns the updated user object.

Error Responses

StatusCodeDescription
400Invalid inputValidation failed
400Weak passwordPassword doesn't meet requirements
400Missing current_passwordRequired for password change
409Already existsUsername or email taken

POST /users/@me/avatar

Upload a new avatar for the current user.

Example Request


curl -X POST https://api.plexichat.com/users/@me/avatar \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN" \
  -F "file=@/path/to/avatar.png"

Response (200 OK)


{
  "success": true,
  "avatar_url": "https://api.plexichat.com/avatars/users/123456789012345678",
  "width": 256,
  "height": 256,
  "size": 12345,
  "animated": false
}

Error Responses

StatusCodeDescription
400Invalid file typeFile must be an image
400File too largeExceeds size limit

GET /users/@me/notes

Get or create the personal notes channel for the current user.

Personal notes are a single-user conversation for storing private notes that sync across devices.

Headers


Authorization: Bearer <token>

Response (200 OK)


{
  "id": "123456789012345678",
  "type": "notes",
  "name": "Personal Notes",
  "last_message_id": "234567890123456789",
  "last_message_at": 1704067200
}

GET /users/@me/channels

Get all DM channels for the current user.

Headers


Authorization: Bearer <token>

Response (200 OK)


[
  {
    "id": "123456789012345678",
    "type": "dm",
    "recipient_id": "234567890123456789",
    "recipient": {
      "id": "234567890123456789",
      "username": "janedoe"
    },
    "last_message_id": "345678901234567890"
  }
]

Response Fields

FieldTypeDescription
idstringDM channel's snowflake ID
typestringAlways "dm"
recipient_idstringOther user's ID
recipientobjectRecipient user info
last_message_idstring?ID of last message

POST /users/@me/channels

Create or get a DM channel with a user.

Headers


Authorization: Bearer <token>

Request Body

FieldTypeRequiredDescription
recipient_idstringYesTarget user's snowflake ID

Example Request


{
  "recipient_id": "234567890123456789"
}

Response (200 OK)


{
  "id": "123456789012345678",
  "type": "dm",
  "recipient_id": "234567890123456789",
  "recipient": {
    "id": "234567890123456789",
    "username": "janedoe"
  }
}

Error Responses

StatusCodeDescription
400recipient_id requiredMissing recipient_id
400Invalid recipient IDID format invalid
403Cannot messageUser has blocked you
404User not foundRecipient doesn't exist

GET /users/search

Search for a user by username.

Query Parameters

ParameterTypeRequiredDescription
usernamestringYesUsername to search for (exact match, case-insensitive)

Example Request


curl -X GET "https://api.plexichat.com/users/search?username=johndoe" \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"

Response (200 OK)


{
  "id": "123456789012345678",
  "username": "johndoe",
  "avatar_url": "https://api.plexichat.com/avatars/users/123456789012345678",
  "created_at": 1704067200
}

Error Responses

StatusCodeDescription
400Username requiredMissing username parameter
404User not foundNo user with that username

GET /users/{user_id}

Get public profile information for a user.

Headers


Authorization: Bearer <token>

Path Parameters

ParameterTypeDescription
user_idstringUser's snowflake ID

Response (200 OK)


{
  "id": "123456789012345678",
  "username": "johndoe",
  "avatar_url": "https://cdn.example.com/avatars/123.png",
  "created_at": 1704067200
}

Error Responses

StatusCodeDescription
400Invalid user IDID format invalid
404User not foundUser doesn't exist

---

User Objects

Full User Object (Private)

Returned for the authenticated user (/users/@me).


{
  "id": "123456789012345678",
  "username": "johndoe",
  "email": "[email protected]",
  "avatar_url": "https://cdn.example.com/avatars/123.png",
  "created_at": 1704067200,
  "email_verified": true,
  "totp_enabled": false,
  "age_verified": false,
  "badges": ["early_supporter"]
}

Public User Object

Returned for other users (/users/{user_id}).


{
  "id": "123456789012345678",
  "username": "johndoe",
  "avatar_url": "https://api.plexichat.com/avatars/users/123456789012345678",
  "created_at": 1704067200,
  "badges": []
}

---

Related Endpoints