Skip to main content
GET
/
v1
/
users
/
{userId}
/
state
Get User State
curl --request GET \
  --url https://api.jelou.ai/v1/users/{userId}/state \
  --header 'Authorization: Basic <encoded-value>'
{
  "id": "<string>",
  "names": "<string>",
  "botId": "<string>",
  "groupId": "<string>",
  "state": "auto"
}

Description

Manage the operational status of a user within your bot. You can check whether a contact is in manual or automatic mode and update this setting to control who responds to conversations.

Get User Status

Endpoint

GET https://api.jelou.ai/v1/users/{userId}/state

Path Parameters

userId
string
required
User’s phone number (without the + sign).

Response Example

{
  "id": "573001234567",
  "names": "John Doe",
  "botId": "bot-12345",
  "groupId": "grp-67890",
  "state": "auto"
}

Change User Status

Endpoint

POST https://api.jelou.ai/v1/users/state

Request Body

ttl
number
Time in seconds that the manual state will remain before automatically expiring.
botId
string
required
Identifier of the bot associated with the user.
userId
string
required
User’s phone number (without the + sign).
state
string
required
Target state. Allowed values: "manual" or "auto".

Request Example

cURL
curl --request POST \
  --url https://api.jelou.ai/v1/users/state \
  --header 'Authorization: Basic <Base64Encoded clientId:clientSecret>' \
  --header 'Content-Type: application/json' \
  --data '{
    "ttl": 3600,
    "botId": "bot-12345",
    "userId": "573001234567",
    "state": "manual"
  }'

Response Example

{
  "id": "573001234567",
  "names": "John Doe",
  "botId": "bot-12345",
  "groupId": "grp-67890",
  "state": "manual"
}
When a user is in manual state, the bot stops responding automatically and manual messages must be sent using the send endpoints. Make sure to coordinate the state change with your support team.

Common Errors

  • 400 - Could not get or update the user’s status.
  • 401 - Invalid or missing credentials.
  • 404 - User or bot not found.

Authorizations

Authorization
string
header
required

Basic authentication using Base64 encoded clientId:clientSecret

Path Parameters

userId
string
required

Phone number without + sign

Response

User state retrieved

id
string
names
string
botId
string
groupId
string
state
enum<string>
Available options:
auto,
manual