ChatifyPHP

API Reference

Complete route table, request/response formats, authentication, and rate limiting

All Chatify functionality is exposed through a JSON API. The bundled UI uses this same API internally.

Base URL

{APP_URL}/{api.prefix}

Default: http://localhost:8000/api/chatify/v1

The prefix is configurable via CHATIFY_API_PREFIX or config('chatify.api.prefix').

Authentication

All routes require authentication. The auth mechanism depends on your middleware configuration:

ModeMiddlewareHow to authenticate
Web (session)web,authBrowser session cookie
API (token)api,auth:sanctumAuthorization: Bearer {token} header

See Installation for setup details.

Rate limiting

Two rate limiter groups are applied:

GroupDefaultApplied to
chatify-messages60 req/min per userSend message, typing, search, forward
chatify-uploads10 req/min per userAvatar upload, attachment upload, background upload, settings

See Backend Customization to adjust limits.

API resources

Responses use Laravel API Resources for consistent JSON structure:

ResourceKey fields
ConversationResourceid, type, name, description, avatar_url, participants_preview, last_message, unread_count, is_pinned, pin_order
MessageResourceid, conversation_id, body, attachment, sender, reply_to, forwarded_from, edited_at, created_at
UserResourceid, name, avatar_url, is_online (email included only if api.expose_email is true)
ParticipantResourceid, user, role, permissions, last_read_at
UserSettingsResourcetheme, font, color, chat_background, locale
AttachmentResourcename, type, size, url

Pagination

List endpoints return paginated responses using Laravel's cursor or offset pagination:

{
  "data": [...],
  "meta": {
    "current_page": 1,
    "last_page": 5,
    "per_page": 20,
    "total": 95
  },
  "links": {
    "next": "...",
    "prev": null
  }
}

Routes

Translations

MethodURIDescriptionThrottle
GET/translationsGet translations for the current locale--

Conversations

MethodURIDescriptionThrottle
GET/conversationsList inbox (paginated)--
POST/conversations/directCreate or find a direct conversation--
POST/conversations/groupCreate a group conversation--
GET/conversations/{conversation}Get a single conversation--
PATCH/conversations/{conversation}Update conversation (group info)--
POST/conversations/{conversation}/avatarUpload group avatarchatify-uploads
DELETE/conversations/{conversation}Delete a conversation--
POST/conversations/{conversation}/hideHide from inbox--
POST/conversations/{conversation}/clearClear all messages (saved only)--
POST/conversations/{conversation}/readMark as read--
PATCH/conversations/{conversation}/pinPin or unpin--
PUT/conversations/pin-orderReorder pinned conversations--

Messages

MethodURIDescriptionThrottle
GET/conversations/{conversation}/messagesList messages (paginated)chatify-messages
GET/conversations/{conversation}/messages/searchSearch messageschatify-messages
POST/conversations/{conversation}/messagesSend a messagechatify-messages
PATCH/messages/{message}Edit a messagechatify-messages
DELETE/messages/{message}Delete a message--
POST/conversations/{conversation}/forwardForward a messagechatify-messages

Typing

MethodURIDescriptionThrottle
POST/conversations/{conversation}/typingSend typing indicatorchatify-messages

Participants

MethodURIDescriptionThrottle
GET/conversations/{conversation}/participantsList group participants--
POST/conversations/{conversation}/participantsAdd participants--
PATCH/conversations/{conversation}/participants/{user}Update role/permissions--
DELETE/conversations/{conversation}/participants/{user}Remove a participant--
POST/conversations/{conversation}/transfer-ownershipTransfer group ownership--
POST/conversations/{conversation}/leaveLeave a group--

Contacts

MethodURIDescriptionThrottle
GET/contacts/searchSearch users by name--

Favorites

MethodURIDescriptionThrottle
GET/favoritesList favorite users--
POST/favorites/{user}Toggle favorite status--

Blocks

MethodURIDescriptionThrottle
GET/blocksList blocked users--
POST/blocks/{user}Block a user--
DELETE/blocks/{user}Unblock a user--

Presence

MethodURIDescriptionThrottle
POST/presence/heartbeatSend online heartbeat--
POST/presence/offlineMark self as offline--

Users

MethodURIDescriptionThrottle
GET/users/{user}Get user profile--

Settings

MethodURIDescriptionThrottle
GET/settingsGet current user settings--
PATCH/settingsUpdate settings (theme, font, color, locale)chatify-uploads
POST/settings/avatarUpload user avatarchatify-uploads
POST/settings/chat-backgroundUpload custom chat backgroundchatify-uploads

Attachments

MethodURIDescriptionThrottle
GET/conversations/{conversation}/attachmentsList conversation attachments--
GET/attachments/{filename}Download an attachment--
MethodURIDescriptionThrottle
GET/link-previewFetch Open Graph metadata for a URL--

Broadcasting

MethodURIDescriptionThrottle
POST/broadcasting/authAuthorize a broadcast channel subscription--

On this page