Session Client API
Generated client method reference for the session namespace.
Generated file warning: this page is generated by packages/schema/scripts/gen-client-reference-docs.ts. Do not edit generated method content by hand.
This page documents 16 schema-registry client methods in the session namespace.
Get phone battery level
| Prop | Value |
|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | session.getBatteryLevel |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
| Type | Method | Path | Name | Status |
|---|
| Primary | GET | /api/session/getBatteryLevel | getBatteryLevel | Active |
| Alias | GET | /api/getBatteryLevel | getBatteryLevel | Active |
const result = await client.getBatteryLevel({});
const result = await client.session.getBatteryLevel({});
curl -X GET "http://localhost:8080/api/session/getBatteryLevel" \
-H "content-type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
--data '{}'
This method does not define input parameters.
| Prop | Value |
|---|
| Return type | number |
Get connection state
| Prop | Value |
|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | session.getConnectionState |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
| Type | Method | Path | Name | Status |
|---|
| Primary | GET | /api/session/getConnectionState | getConnectionState | Active |
| Alias | GET | /api/getConnectionState | getConnectionState | Active |
const result = await client.getConnectionState({});
const result = await client.session.getConnectionState({});
curl -X GET "http://localhost:8080/api/session/getConnectionState" \
-H "content-type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
--data '{}'
This method does not define input parameters.
| Prop | Value |
|---|
| Return type | unknown |
Get enabled features
| Prop | Value |
|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | session.getFeatures |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
| Type | Method | Path | Name | Status |
|---|
| Primary | GET | /api/session/getFeatures | getFeatures | Active |
| Alias | GET | /api/getFeatures | getFeatures | Active |
const result = await client.getFeatures({});
const result = await client.session.getFeatures({});
curl -X GET "http://localhost:8080/api/session/getFeatures" \
-H "content-type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
--data '{}'
This method does not define input parameters.
| Prop | Value |
|---|
| Return type | unknown |
Get host phone number
| Prop | Value |
|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | session.getHostNumber |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
| Type | Method | Path | Name | Status |
|---|
| Primary | GET | /api/session/getHostNumber | getHostNumber | Active |
| Alias | GET | /api/getHostNumber | getHostNumber | Active |
const result = await client.getHostNumber({});
const result = await client.session.getHostNumber({});
curl -X GET "http://localhost:8080/api/session/getHostNumber" \
-H "content-type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
--data '{}'
This method does not define input parameters.
| Prop | Value |
|---|
| Return type | string |
Get license type
| Prop | Value |
|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | session.getLicenseType |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
| Type | Method | Path | Name | Status |
|---|
| Primary | GET | /api/session/getLicenseType | getLicenseType | Active |
| Alias | GET | /api/getLicenseType | getLicenseType | Active |
const result = await client.getLicenseType({});
const result = await client.session.getLicenseType({});
curl -X GET "http://localhost:8080/api/session/getLicenseType" \
-H "content-type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
--data '{}'
This method does not define input parameters.
| Prop | Value |
|---|
| Return type | unknown | boolean |
Get loaded message count
| Prop | Value |
|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | getAmountOfLoadedMessages, session.getAmountOfLoadedMessages, session.getLoadedMessageCount |
| Deprecated aliases | getAmountOfLoadedMessages, session.getAmountOfLoadedMessages |
| License | none |
| WAPI override | getAmountOfLoadedMessages |
| Deprecated | No |
| Type | Method | Path | Name | Status |
|---|
| Primary | GET | /api/session/getLoadedMessageCount | getLoadedMessageCount | Active |
| Deprecated alias | GET | /api/getAmountOfLoadedMessages | getAmountOfLoadedMessages | Deprecated |
| Alias | GET | /api/getLoadedMessageCount | getLoadedMessageCount | Active |
| Deprecated alias | GET | /api/session/getAmountOfLoadedMessages | session.getAmountOfLoadedMessages | Deprecated |
const result = await client.getLoadedMessageCount({});
const result = await client.session.getLoadedMessageCount({});
curl -X GET "http://localhost:8080/api/session/getLoadedMessageCount" \
-H "content-type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
--data '{}'
This method does not define input parameters.
| Prop | Value |
|---|
| Return type | number |
Get host account info
| Prop | Value |
|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | session.getMe |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
| Type | Method | Path | Name | Status |
|---|
| Primary | GET | /api/session/getMe | getMe | Active |
| Alias | GET | /api/getMe | getMe | Active |
const result = await client.getMe({});
const result = await client.session.getMe({});
curl -X GET "http://localhost:8080/api/session/getMe" \
-H "content-type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
--data '{}'
This method does not define input parameters.
| Prop | Value |
|---|
| Return type | unknown |
Get process statistics
| Prop | Value |
|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | session.getProcessStats |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
| Type | Method | Path | Name | Status |
|---|
| Primary | GET | /api/session/getProcessStats | getProcessStats | Active |
| Alias | GET | /api/getProcessStats | getProcessStats | Active |
const result = await client.getProcessStats({});
const result = await client.session.getProcessStats({});
curl -X GET "http://localhost:8080/api/session/getProcessStats" \
-H "content-type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
--data '{}'
This method does not define input parameters.
| Prop | Value |
|---|
| Return type | unknown |
Take screenshot
| Prop | Value |
|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | chatId, width, height |
| Aliases | session.getSnapshot, session.takeScreenshot, takeScreenshot |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
| Type | Method | Path | Name | Status |
|---|
| Primary | GET | /api/session/getSnapshot | getSnapshot | Active |
| Alias | GET | /api/getSnapshot | getSnapshot | Active |
| Alias | GET | /api/session/takeScreenshot | session.takeScreenshot | Active |
| Alias | GET | /api/takeScreenshot | takeScreenshot | Active |
const result = await client.getSnapshot({
chatId: "447123456789@c.us",
width: 1,
height: 1,
});
const result = await client.session.getSnapshot({
chatId: "447123456789@c.us",
width: 1,
height: 1,
});
curl -G "http://localhost:8080/api/session/getSnapshot" \
-H "x-api-key: YOUR_API_KEY" \
--data-urlencode "chatId=447123456789@c.us" \
--data-urlencode "width=1" \
--data-urlencode "height=1"
| Prop | Value |
|---|
| Return type | string |
Get user agent
| Prop | Value |
|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | userAgent |
| Aliases | getGeneratedUserAgent, session.getGeneratedUserAgent, session.getUserAgent |
| Deprecated aliases | getGeneratedUserAgent, session.getGeneratedUserAgent |
| License | none |
| WAPI override | getGeneratedUserAgent |
| Deprecated | No |
| Type | Method | Path | Name | Status |
|---|
| Primary | GET | /api/session/getUserAgent | getUserAgent | Active |
| Deprecated alias | GET | /api/getGeneratedUserAgent | getGeneratedUserAgent | Deprecated |
| Alias | GET | /api/getUserAgent | getUserAgent | Active |
| Deprecated alias | GET | /api/session/getGeneratedUserAgent | session.getGeneratedUserAgent | Deprecated |
const result = await client.getUserAgent({
userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)",
});
const result = await client.session.getUserAgent({
userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)",
});
curl -G "http://localhost:8080/api/session/getUserAgent" \
-H "x-api-key: YOUR_API_KEY" \
--data-urlencode "userAgent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"
| Prop | Value |
|---|
| Return type | string |
Get WhatsApp Web version
| Prop | Value |
|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | getWhatsAppVersion, session.getWAVersion, session.getWhatsAppVersion |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
| Type | Method | Path | Name | Status |
|---|
| Primary | GET | /api/session/getWAVersion | getWAVersion | Active |
| Alias | GET | /api/getWAVersion | getWAVersion | Active |
| Alias | GET | /api/getWhatsAppVersion | getWhatsAppVersion | Active |
| Alias | GET | /api/session/getWhatsAppVersion | session.getWhatsAppVersion | Active |
const result = await client.getWAVersion({});
const result = await client.session.getWAVersion({});
curl -X GET "http://localhost:8080/api/session/getWAVersion" \
-H "content-type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
--data '{}'
This method does not define input parameters.
| Prop | Value |
|---|
| Return type | string |
Health check
| Prop | Value |
|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | session.healthCheck |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
| Type | Method | Path | Name | Status |
|---|
| Primary | GET | /api/session/healthCheck | healthCheck | Active |
| Alias | GET | /api/healthCheck | healthCheck | Active |
const result = await client.healthCheck({});
const result = await client.session.healthCheck({});
curl -X GET "http://localhost:8080/api/session/healthCheck" \
-H "content-type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
--data '{}'
This method does not define input parameters.
| Prop | Value |
|---|
| Return type | unknown |
Check if phone is charging
| Prop | Value |
|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | getIsPlugged, session.getIsPlugged, session.isPlugged |
| Deprecated aliases | getIsPlugged, session.getIsPlugged |
| License | none |
| WAPI override | getIsPlugged |
| Deprecated | No |
| Type | Method | Path | Name | Status |
|---|
| Primary | GET | /api/session/isPlugged | isPlugged | Active |
| Deprecated alias | GET | /api/getIsPlugged | getIsPlugged | Deprecated |
| Alias | GET | /api/isPlugged | isPlugged | Active |
| Deprecated alias | GET | /api/session/getIsPlugged | session.getIsPlugged | Deprecated |
const result = await client.isPlugged({});
const result = await client.session.isPlugged({});
curl -X GET "http://localhost:8080/api/session/isPlugged" \
-H "content-type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
--data '{}'
This method does not define input parameters.
| Prop | Value |
|---|
| Return type | boolean |
Set host name
| Prop | Value |
|---|
| Namespace | session |
| Action | update |
| Functionality | personal-only |
| Positional parameter order | name |
| Aliases | session.setDisplayName, session.setMyName, session.setName, setDisplayName |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
| Type | Method | Path | Name | Status |
|---|
| Primary | PUT | /api/session/setName | setMyName | Active |
| Alias | PUT | /api/session/setDisplayName | session.setDisplayName | Active |
| Alias | PUT | /api/session/setMyName | session.setMyName | Active |
| Alias | PUT | /api/setDisplayName | setDisplayName | Active |
| Alias | PUT | /api/setMyName | setMyName | Active |
const result = await client.setMyName({
name: "OpenWA Bot",
});
const result = await client.session.setName({
name: "OpenWA Bot",
});
curl -X PUT "http://localhost:8080/api/session/setName" \
-H "content-type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
--data '{
"name": "OpenWA Bot"
}'
| Prop | Value |
|---|
| Return type | boolean |
Set host status
| Prop | Value |
|---|
| Namespace | session |
| Action | update |
| Functionality | both |
| Positional parameter order | statusText |
| Aliases | session.setMyStatus, session.setStatus, session.setStatusText, setStatusText |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
| Type | Method | Path | Name | Status |
|---|
| Primary | PUT | /api/session/setStatus | setMyStatus | Active |
| Alias | PUT | /api/session/setMyStatus | session.setMyStatus | Active |
| Alias | PUT | /api/session/setStatusText | session.setStatusText | Active |
| Alias | PUT | /api/setMyStatus | setMyStatus | Active |
| Alias | PUT | /api/setStatusText | setStatusText | Active |
const result = await client.setMyStatus({
statusText: "Available",
});
const result = await client.session.setStatus({
statusText: "Available",
});
curl -X PUT "http://localhost:8080/api/session/setStatus" \
-H "content-type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
--data '{
"statusText": "Available"
}'
| Prop | Value |
|---|
| Return type | boolean |
Set profile picture
| Prop | Value |
|---|
| Namespace | session |
| Action | update |
| Functionality | both |
| Positional parameter order | image |
| Aliases | session.setProfilePic, session.setProfilePicture, setProfilePic |
| Deprecated aliases | session.setProfilePic, setProfilePic |
| License | insiders |
| WAPI override | setProfilePic |
| Deprecated | No |
| Type | Method | Path | Name | Status |
|---|
| Primary | PUT | /api/session/setProfilePicture | setProfilePicture | Active |
| Deprecated alias | PUT | /api/session/setProfilePic | session.setProfilePic | Deprecated |
| Deprecated alias | PUT | /api/setProfilePic | setProfilePic | Deprecated |
| Alias | PUT | /api/setProfilePicture | setProfilePicture | Active |
const result = await client.setProfilePicture({
image: "data:image/png;base64,iVBORw0KGgo...",
});
const result = await client.session.setProfilePicture({
image: "data:image/png;base64,iVBORw0KGgo...",
});
curl -X PUT "http://localhost:8080/api/session/setProfilePicture" \
-H "content-type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
--data '{
"image": "data:image/png;base64,iVBORw0KGgo..."
}'
| Prop | Value |
|---|
| Return type | boolean |
Was this helpful?
Wally and his cute companion coffee mug are coding day and night to keep this up-to-date!