Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.usetitan.app/llms.txt

Use this file to discover all available pages before exploring further.

The presence API lets you control the online/offline status of a session account and query the current presence state of contacts. When you subscribe to a contact’s presence, Titan fires presence.update webhook events whenever their status changes — so you can build features like online indicators and last-seen timestamps.

Set presence

curl -X POST https://api.example.com/api/sessions/default/presence \
  -H "Authorization: Bearer titan_..." \
  -H "Content-Type: application/json" \
  -d '{"presence": "available"}'
POST /api/sessions/{session}/presence Sets the online/offline status of the session account. Use available to appear online in WhatsApp and unavailable to appear offline.
session
string
required
Session name.
presence
string
required
Presence status: available (online) or unavailable (offline).
{
  "data": { "success": true }
}

Get presence for a contact

curl https://api.example.com/api/sessions/default/presence/5511999999999%40s.whatsapp.net \
  -H "Authorization: Bearer titan_..."
GET /api/sessions/{session}/presence/{chatId} Returns the current presence state for a specific contact. To receive live updates, subscribe to the contact’s presence first.
session
string
required
Session name.
chatId
string
required
Contact or chat JID (URL-encoded).
chatId
string
The JID of the contact.
presence
string
Current presence state: available, unavailable, composing, or recording.
lastSeen
string
ISO 8601 timestamp of when the contact was last seen online. May be absent if the contact has hidden their last-seen.
{
  "data": {
    "chatId": "[email protected]",
    "presence": "available",
    "lastSeen": "2026-01-15T09:45:00Z"
  }
}

Get presence for all subscribed contacts

curl https://api.example.com/api/sessions/default/presence \
  -H "Authorization: Bearer titan_..."
GET /api/sessions/{session}/presence Returns the last known presence state for all contacts the session is subscribed to.
session
string
required
Session name.
{
  "data": [
    {
      "chatId": "[email protected]",
      "presence": "available",
      "lastSeen": "2026-01-15T09:45:00Z"
    },
    {
      "chatId": "[email protected]",
      "presence": "unavailable",
      "lastSeen": "2026-01-14T18:30:00Z"
    }
  ]
}

Subscribe to presence updates

curl -X POST https://api.example.com/api/sessions/default/presence/5511999999999%40s.whatsapp.net/subscribe \
  -H "Authorization: Bearer titan_..."
POST /api/sessions/{session}/presence/{chatId}/subscribe Subscribes the session to presence updates for a contact. After subscribing, Titan fires a presence.update webhook event whenever the contact’s presence changes.
session
string
required
Session name.
chatId
string
required
Contact JID (URL-encoded) to subscribe to.
{
  "data": { "success": true }
}

Presence update webhook event

When a subscribed contact’s presence changes, Titan delivers a presence.update webhook event with this payload:
from
object
JIDRef of the contact whose presence changed.
sender
object
JIDRef of the sender within a group context (if applicable).
state
string
Typing or activity state: composing or paused.
unavailable
boolean
Whether the contact is currently offline.
lastSeen
integer
Unix timestamp of the contact’s last seen time.
media
string
Media type being composed. audio indicates the contact is recording a voice note.