> For the complete documentation index, see [llms.txt](https://docs.360dialog.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.360dialog.com/docs/inbox/inbox-api/api-ref/chats.md).

# Chats

Existing conversations with WhatsApp Users

## POST /api/v1/chat\_import/

> Import an existing WhatsApp chat generated by the "Export chat" action in the WhatsApp Business app.\
> \
> Use this endpoint to upload the chat and all media files. Requires some preparation work to be done in the app\
> &#x20;that served as export target for WhatApp.\
> \
> Parameters you supply such as contacts, UTC offset must come from the device you exported the WhatsApp chat on.

```json
{"openapi":"3.0.3","info":{"title":"360dialog Inbox API","version":"1.28.0"},"tags":[{"name":"Chats","description":"Existing conversations with WhatsApp Users"}],"servers":[{"url":"https://{YOUR_STACK_NAME}.inbox.getchat.360dialog.io/","description":"Your Inbox address. Open the Inbox from the 360dialog Hub to see it.","variables":{"YOUR_STACK_NAME":{"default":"your-stack","description":"The first part of your Inbox address"}}}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"A user token, sent as `Token <token>`. Create a user in the admin panel (group App integration) and get its token from `POST /api/v1/auth/token/`. The channel API key (`D360-Api-Key`) is not supported."}},"schemas":{"ChatImportRequest":{"type":"object","properties":{"chat_text":{"type":"string","description":"The text chat log as given to you by WhatsApp"},"chat_participants":{"type":"array","items":{"$ref":"#/components/schemas/ChatImportContact"},"description":"Required if chat partner is in the device's contacts, supply chat partner's phone number with this. If you cannot tell which contact is incoming and which is outgoing, supply both. Do not supply more than two contacts."},"utc_offset_minutes":{"type":"integer","description":"The device may have had a non-UTC time zone; supply the number of minutes that time zone is ahead of UTC. Supply a negative number if you are in the Americas"},"device_language_code":{"type":"string","description":"Locale code of device's system language, and optionally, country"},"media_files":{"type":"array","items":{"$ref":"#/components/schemas/ChatImportMediaFile"}}},"required":["chat_text","device_language_code","media_files","utc_offset_minutes"]},"ChatImportContact":{"type":"object","properties":{"handle":{"type":"string","description":"Name of message sender as seen in device's contacts and the WhatsApp chat export (text part)"},"phone_number":{"type":"string","description":"Phone number of contact"}},"required":["handle","phone_number"]},"ChatImportMediaFile":{"type":"object","properties":{"b64_content":{"type":"string","description":"Content of media file, encoded with base64"},"mime_type":{"type":"string","description":"MIME type of media file"},"file_name":{"type":"string","description":"File name of media file as given to you by WhatsApp"}},"required":["b64_content","file_name","mime_type"]},"Chat":{"type":"object","properties":{"contact":{"allOf":[{"$ref":"#/components/schemas/Person"}],"description":"Who are we talking to"},"new_messages":{"type":"integer","description":"The number of messages not received by currently authenticated user"},"wa_id":{"type":"string","description":"**Deprecated**"},"bsuid":{"type":"string","readOnly":true,"nullable":true,"title":"Business-Scoped User ID","description":"Business-Scoped User ID for this contact. Populated from the webhook's `user_id` field. Stable across phone number changes for the same user-portfolio pair, so this is the most reliable long-term identifier."},"phone_number":{"type":"string","readOnly":true,"nullable":true,"description":"Phone number when known. Equals `wa_id` for phone-primary contacts. For BSUID-primary contacts (where `wa_id` is a BSUID), populated when WhatsApp shares the phone number — e.g. recent interaction within the last 30 days, or via Contact Book."},"last_message":{"$ref":"#/components/schemas/RetrieveMessage"},"assigned_to_user":{"$ref":"#/components/schemas/User"},"assigned_group":{"$ref":"#/components/schemas/Group"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tagging"}},"thread_controller":{"readOnly":true,"nullable":true,"description":"Who currently responds in this conversation: `mba` while Meta Business Agent holds control, `inbox` after an agent took over. `null` means Meta Business Agent was never involved in this chat.\n\n* `mba` - Meta Business Agent\n* `inbox` - Inbox","oneOf":[{"$ref":"#/components/schemas/ThreadControllerEnum"},{"$ref":"#/components/schemas/NullEnum"}]}},"required":["assigned_group","assigned_to_user","bsuid","contact","last_message","new_messages","phone_number","tags","thread_controller","wa_id"]},"Person":{"type":"object","properties":{"wa_id":{"type":"string","title":"WhatsApp id","description":"WhatsApp ID — either a phone number in canonical form (e.g. 48123123123) or a Business-Scoped User ID (e.g. US.13491208655302741918) for users who have hidden their phone number.","pattern":"^([A-Z]{2}\\.(ENT\\.)?[a-zA-Z0-9]+|[0-9]+)$","maxLength":200},"bsuid":{"type":"string","readOnly":true,"nullable":true,"title":"Business-Scoped User ID","description":"Business-Scoped User ID for this contact. Populated from the webhook's `user_id` field. Stable across phone number changes for the same user-portfolio pair, so this is the most reliable long-term identifier."},"phone_number":{"type":"string","readOnly":true,"nullable":true,"description":"Phone number when known. Equals `wa_id` for phone-primary contacts. For BSUID-primary contacts (where `wa_id` is a BSUID), populated when WhatsApp shares the phone number — e.g. recent interaction within the last 30 days, or via Contact Book."},"waba_payload":{"$ref":"#/components/schemas/WabaPayloadContact"},"initials":{"type":"string","description":"Contact user name initials used for display when avatar image is missing"},"last_message_timestamp":{"type":"number","format":"double","nullable":true,"description":"[POSIX timestamp](https://en.wikipedia.org/wiki/Unix_time) of last message that was sent by this contact. It is the floor of the customer care messaging window: a non-template message can always be delivered for some time after the customer last wrote to your business, and Meta may keep the window open for longer — see `messaging_window_expires_at`. Read more at WhatsApp Business API docs [Messages Cut-off Control](https://developers.facebook.com/docs/whatsapp/api/messages#cut-off-control)."},"messaging_window_expires_at":{"type":"number","format":"double","readOnly":true,"description":"[POSIX timestamp](https://en.wikipedia.org/wiki/Unix_time) after which a non-template message to this contact is rejected with HTTP 453. Derived from what Meta reported for this conversation, the customer's last message, and — for click-to-WhatsApp chats we have not replied to yet — the ad referral. Never assume a fixed duration: read this value."},"messaging_window_origin":{"type":"string","readOnly":true,"nullable":true,"description":"`conversation.origin.type` reported by Meta alongside `messaging_window_expires_at` — what opened the conversation (e.g. `service`, `marketing`, `utility`, `authentication`, or `referral_conversion` for a click-to-WhatsApp ad)."},"resolved":{"type":"boolean","description":"Whether this chat is considered resolved by the assigned agent. Can automatically be set to false if contact keeps sending messages."}},"required":["bsuid","initials","messaging_window_expires_at","messaging_window_origin","phone_number","wa_id","waba_payload"]},"WabaPayloadContact":{"type":"object","properties":{"profile":{"$ref":"#/components/schemas/WabaPayloadProfile"},"wa_id":{"type":"string"}},"required":["profile","wa_id"]},"WabaPayloadProfile":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"RetrieveMessage":{"type":"object","properties":{"id":{"type":"string","description":"Internal Inbox Message ID"},"waba_payload":{"description":"See [Inbound Notifications from WhatsApp Business API](https://developers.facebook.com/docs/whatsapp/api/webhooks/inbound)"},"waba_statuses":{"allOf":[{"$ref":"#/components/schemas/WabaMessageStatuses"}],"description":"Timestamps of all statuses of the message"},"contact":{"allOf":[{"$ref":"#/components/schemas/Person"}],"description":"Who are we talking to"},"from_us":{"type":"boolean","readOnly":true,"title":"From us?","description":"Allows to easily implement different display for messages sent by us or by customer."},"received":{"type":"boolean","default":false,"description":"Tells if this message was marked as received by you (currently logged in user)"},"sender":{"allOf":[{"$ref":"#/components/schemas/User"}],"description":"Who is talking on our behalf\n\n`null` if this is an incoming message."},"before_time":{"type":"integer"},"since_time":{"type":"integer"},"customer_wa_id":{"type":"string","readOnly":true,"title":"Customer WhatsApp id","description":"**Deprecated**"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tagging"},"default":[],"description":"Tags assigned to this Message"},"chat_tags":{"type":"array","items":{"$ref":"#/components/schemas/Tagging"},"default":[],"description":"Tags assigned to the Chat this Message belongs to"},"sent_by_mba":{"type":"boolean","readOnly":true,"title":"Sent by Meta Business Agent","description":"This message was sent on the business's behalf by Meta Business Agent (the copy arrived on the `standby` webhook field). Only set when `from_us` is `true`; distinguishes AI messages from ones sent by inbox users or automation."}},"required":["contact","customer_wa_id","from_us","id","sent_by_mba","waba_payload","waba_statuses"]},"WabaMessageStatuses":{"type":"object","properties":{"sent":{"type":"number","format":"double","nullable":true},"delivered":{"type":"number","format":"double","nullable":true},"read":{"type":"number","format":"double","nullable":true}}},"User":{"type":"object","properties":{"url":{"type":"string","format":"uri","readOnly":true},"id":{"type":"integer","readOnly":true},"username":{"type":"string","description":"Username that is used in combination with password during login.\n\nOnly alphanumeric characters are allowed (A-Z, a-z, 0-9)."},"first_name":{"type":"string","maxLength":150},"last_name":{"type":"string","maxLength":150},"email":{"type":"string","format":"email","description":"E-mail address of this new user.\n\n"},"profile":{"allOf":[{"$ref":"#/components/schemas/UserProfile"}],"description":"Optional field used to create app users and additional admin users"},"groups":{"type":"array","items":{"$ref":"#/components/schemas/GroupMember"},"readOnly":true,"description":"List of group objects the user belongs to (read-only)"},"group_ids":{"type":"array","items":{"type":"integer","writeOnly":true},"writeOnly":true,"description":"List of group IDs to assign to the user (write-only)"},"permissions":{"$ref":"#/components/schemas/Permissions"},"assigned_wa_ids":{"type":"array","items":{"type":"string"},"readOnly":true}},"required":["assigned_wa_ids","email","groups","id","permissions","url","username"]},"UserProfile":{"type":"object","properties":{"role":{"allOf":[{"$ref":"#/components/schemas/RoleEnum"}],"description":"<p>Possible values:<br>    * <code>user</code> (<strong>User</strong>) - can do everything that isn't marked as admin only in API documentation<br>    * <code>admin</code> (<strong>Admin</strong>) - can use all available API endpoints and has Inbox admin panel access<br>    * <code>app</code> (<strong>App integration</strong>) - can do everything regular users have access too, but has no access to inbox web frontend</p>\n\n* `user` - Regular user\n* `admin` - Admin\n* `app` - App integration"},"is_available":{"type":"boolean","description":"Manual status set by the user to indicate availability for communication."}}},"RoleEnum":{"enum":["user","admin","app"],"type":"string","description":"* `user` - Regular user\n* `admin` - Admin\n* `app` - App integration"},"GroupMember":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"required":["id","name"]},"Permissions":{"type":"object","properties":{"can_use_tags":{"type":"boolean","description":"Uncheck this to disable tagging for related Users completely."},"can_read_chats":{"allOf":[{"$ref":"#/components/schemas/CanReadChatsEnum"}],"description":"<p>Possible values:<br><code>all</code> - User can read from All Chats<br>\n<code>group</code> - User can read from Only Chats assigned to User's Groups<br>\n<code>user</code> - User can read from Only Chats assigned to User directly<br>\n<code>none</code> - User can read from No Chats</p>\n\n* `all` - All Chats\n* `group` - Only Chats assigned to User's Groups\n* `user` - Only Chats assigned to User directly\n* `none` - No Chats"},"can_write_to_chats":{"allOf":[{"$ref":"#/components/schemas/CanWriteToChatsEnum"}],"description":"<p>Possible values:<br><code>all</code> - User can write to All Chats<br>\n<code>group</code> - User can write to Only Chats assigned to User's Groups<br>\n<code>user</code> - User can write to Only Chats assigned to User directly<br>\n<code>none</code> - User can write to No Chats</p>\n\n* `all` - All Chats\n* `group` - Only Chats assigned to User's Groups\n* `user` - Only Chats assigned to User directly\n* `none` - No Chats"}}},"CanReadChatsEnum":{"enum":["all","group","user","none"],"type":"string","description":"* `all` - All Chats\n* `group` - Only Chats assigned to User's Groups\n* `user` - Only Chats assigned to User directly\n* `none` - No Chats"},"CanWriteToChatsEnum":{"enum":["all","group","user","none"],"type":"string","description":"* `all` - All Chats\n* `group` - Only Chats assigned to User's Groups\n* `user` - Only Chats assigned to User directly\n* `none` - No Chats"},"Tagging":{"type":"object","properties":{"name":{"type":"string","description":"Tag object name"},"web_inbox_color":{"type":"string","description":"A Web App related setting - which color to show on the Web App frontend"},"tagging_id":{"type":"integer","readOnly":true,"description":"This tagging relation ID. Used when deleting a Tagging for example."},"id":{"type":"integer","description":"Tag object unique ID"},"extra":{"description":"Tagging extra payload"}},"required":["id","name","tagging_id","web_inbox_color"]},"Group":{"type":"object","properties":{"id":{"type":"integer","readOnly":true},"name":{"type":"string","maxLength":1000}},"required":["id","name"]},"ThreadControllerEnum":{"enum":["mba","inbox"],"type":"string","description":"* `mba` - Meta Business Agent\n* `inbox` - Inbox"},"NullEnum":{"enum":[null]}}},"paths":{"/api/v1/chat_import/":{"post":{"operationId":"createChatImport","description":"Import an existing WhatsApp chat generated by the \"Export chat\" action in the WhatsApp Business app.\n\nUse this endpoint to upload the chat and all media files. Requires some preparation work to be done in the app\n that served as export target for WhatApp.\n\nParameters you supply such as contacts, UTC offset must come from the device you exported the WhatsApp chat on.","tags":["Chats"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatImportRequest"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/ChatImportRequest"}},"multipart/form-data":{"schema":{"$ref":"#/components/schemas/ChatImportRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Chat"}}},"description":""}}}}}}
```

## GET /api/v1/chats/

> Get existing chats and the number of new messages in each chat.\
> \
> This endpoint is similar to \`/persons/\` endpoint - here also contacts are listed, but only these contacts for which conversation already exists.\
> \
> \
> Chats are sorted by \`last\_message\_timestamp\`, newest to oldest.\
> \
> \
> To mark these messages as received, first store \`wa\_id\` (WhatsApp ID) field value of this endpoint.\
> Then use \`messages\` endpoint to read messages for related contact and\
> store the message \`id\`. After making sure the user has received the message on the frontend,\
> check the timestamp of the most recent message received and use it with\
> \`/mark\_as\_received/\` endpoint to actually mark it as received.\
> \
> \
> Marking messages as received is important to prevent duplicate notifications.\
> \
> Response is paginated.\
> Use \`limit\` and \`offset\` query parameters to access each page.\
> Query parameter \`limit\` default value is 100.\
> JSON response body field \`count\` tells the total number of elements available on all pages.

```json
{"openapi":"3.0.3","info":{"title":"360dialog Inbox API","version":"1.28.0"},"tags":[{"name":"Chats","description":"Existing conversations with WhatsApp Users"}],"servers":[{"url":"https://{YOUR_STACK_NAME}.inbox.getchat.360dialog.io/","description":"Your Inbox address. Open the Inbox from the 360dialog Hub to see it.","variables":{"YOUR_STACK_NAME":{"default":"your-stack","description":"The first part of your Inbox address"}}}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"A user token, sent as `Token <token>`. Create a user in the admin panel (group App integration) and get its token from `POST /api/v1/auth/token/`. The channel API key (`D360-Api-Key`) is not supported."}},"schemas":{"PaginatedChatList":{"type":"object","required":["count","results"],"properties":{"count":{"type":"integer"},"next":{"type":"string","nullable":true,"format":"uri"},"previous":{"type":"string","nullable":true,"format":"uri"},"results":{"type":"array","items":{"$ref":"#/components/schemas/Chat"}}}},"Chat":{"type":"object","properties":{"contact":{"allOf":[{"$ref":"#/components/schemas/Person"}],"description":"Who are we talking to"},"new_messages":{"type":"integer","description":"The number of messages not received by currently authenticated user"},"wa_id":{"type":"string","description":"**Deprecated**"},"bsuid":{"type":"string","readOnly":true,"nullable":true,"title":"Business-Scoped User ID","description":"Business-Scoped User ID for this contact. Populated from the webhook's `user_id` field. Stable across phone number changes for the same user-portfolio pair, so this is the most reliable long-term identifier."},"phone_number":{"type":"string","readOnly":true,"nullable":true,"description":"Phone number when known. Equals `wa_id` for phone-primary contacts. For BSUID-primary contacts (where `wa_id` is a BSUID), populated when WhatsApp shares the phone number — e.g. recent interaction within the last 30 days, or via Contact Book."},"last_message":{"$ref":"#/components/schemas/RetrieveMessage"},"assigned_to_user":{"$ref":"#/components/schemas/User"},"assigned_group":{"$ref":"#/components/schemas/Group"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tagging"}},"thread_controller":{"readOnly":true,"nullable":true,"description":"Who currently responds in this conversation: `mba` while Meta Business Agent holds control, `inbox` after an agent took over. `null` means Meta Business Agent was never involved in this chat.\n\n* `mba` - Meta Business Agent\n* `inbox` - Inbox","oneOf":[{"$ref":"#/components/schemas/ThreadControllerEnum"},{"$ref":"#/components/schemas/NullEnum"}]}},"required":["assigned_group","assigned_to_user","bsuid","contact","last_message","new_messages","phone_number","tags","thread_controller","wa_id"]},"Person":{"type":"object","properties":{"wa_id":{"type":"string","title":"WhatsApp id","description":"WhatsApp ID — either a phone number in canonical form (e.g. 48123123123) or a Business-Scoped User ID (e.g. US.13491208655302741918) for users who have hidden their phone number.","pattern":"^([A-Z]{2}\\.(ENT\\.)?[a-zA-Z0-9]+|[0-9]+)$","maxLength":200},"bsuid":{"type":"string","readOnly":true,"nullable":true,"title":"Business-Scoped User ID","description":"Business-Scoped User ID for this contact. Populated from the webhook's `user_id` field. Stable across phone number changes for the same user-portfolio pair, so this is the most reliable long-term identifier."},"phone_number":{"type":"string","readOnly":true,"nullable":true,"description":"Phone number when known. Equals `wa_id` for phone-primary contacts. For BSUID-primary contacts (where `wa_id` is a BSUID), populated when WhatsApp shares the phone number — e.g. recent interaction within the last 30 days, or via Contact Book."},"waba_payload":{"$ref":"#/components/schemas/WabaPayloadContact"},"initials":{"type":"string","description":"Contact user name initials used for display when avatar image is missing"},"last_message_timestamp":{"type":"number","format":"double","nullable":true,"description":"[POSIX timestamp](https://en.wikipedia.org/wiki/Unix_time) of last message that was sent by this contact. It is the floor of the customer care messaging window: a non-template message can always be delivered for some time after the customer last wrote to your business, and Meta may keep the window open for longer — see `messaging_window_expires_at`. Read more at WhatsApp Business API docs [Messages Cut-off Control](https://developers.facebook.com/docs/whatsapp/api/messages#cut-off-control)."},"messaging_window_expires_at":{"type":"number","format":"double","readOnly":true,"description":"[POSIX timestamp](https://en.wikipedia.org/wiki/Unix_time) after which a non-template message to this contact is rejected with HTTP 453. Derived from what Meta reported for this conversation, the customer's last message, and — for click-to-WhatsApp chats we have not replied to yet — the ad referral. Never assume a fixed duration: read this value."},"messaging_window_origin":{"type":"string","readOnly":true,"nullable":true,"description":"`conversation.origin.type` reported by Meta alongside `messaging_window_expires_at` — what opened the conversation (e.g. `service`, `marketing`, `utility`, `authentication`, or `referral_conversion` for a click-to-WhatsApp ad)."},"resolved":{"type":"boolean","description":"Whether this chat is considered resolved by the assigned agent. Can automatically be set to false if contact keeps sending messages."}},"required":["bsuid","initials","messaging_window_expires_at","messaging_window_origin","phone_number","wa_id","waba_payload"]},"WabaPayloadContact":{"type":"object","properties":{"profile":{"$ref":"#/components/schemas/WabaPayloadProfile"},"wa_id":{"type":"string"}},"required":["profile","wa_id"]},"WabaPayloadProfile":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"RetrieveMessage":{"type":"object","properties":{"id":{"type":"string","description":"Internal Inbox Message ID"},"waba_payload":{"description":"See [Inbound Notifications from WhatsApp Business API](https://developers.facebook.com/docs/whatsapp/api/webhooks/inbound)"},"waba_statuses":{"allOf":[{"$ref":"#/components/schemas/WabaMessageStatuses"}],"description":"Timestamps of all statuses of the message"},"contact":{"allOf":[{"$ref":"#/components/schemas/Person"}],"description":"Who are we talking to"},"from_us":{"type":"boolean","readOnly":true,"title":"From us?","description":"Allows to easily implement different display for messages sent by us or by customer."},"received":{"type":"boolean","default":false,"description":"Tells if this message was marked as received by you (currently logged in user)"},"sender":{"allOf":[{"$ref":"#/components/schemas/User"}],"description":"Who is talking on our behalf\n\n`null` if this is an incoming message."},"before_time":{"type":"integer"},"since_time":{"type":"integer"},"customer_wa_id":{"type":"string","readOnly":true,"title":"Customer WhatsApp id","description":"**Deprecated**"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tagging"},"default":[],"description":"Tags assigned to this Message"},"chat_tags":{"type":"array","items":{"$ref":"#/components/schemas/Tagging"},"default":[],"description":"Tags assigned to the Chat this Message belongs to"},"sent_by_mba":{"type":"boolean","readOnly":true,"title":"Sent by Meta Business Agent","description":"This message was sent on the business's behalf by Meta Business Agent (the copy arrived on the `standby` webhook field). Only set when `from_us` is `true`; distinguishes AI messages from ones sent by inbox users or automation."}},"required":["contact","customer_wa_id","from_us","id","sent_by_mba","waba_payload","waba_statuses"]},"WabaMessageStatuses":{"type":"object","properties":{"sent":{"type":"number","format":"double","nullable":true},"delivered":{"type":"number","format":"double","nullable":true},"read":{"type":"number","format":"double","nullable":true}}},"User":{"type":"object","properties":{"url":{"type":"string","format":"uri","readOnly":true},"id":{"type":"integer","readOnly":true},"username":{"type":"string","description":"Username that is used in combination with password during login.\n\nOnly alphanumeric characters are allowed (A-Z, a-z, 0-9)."},"first_name":{"type":"string","maxLength":150},"last_name":{"type":"string","maxLength":150},"email":{"type":"string","format":"email","description":"E-mail address of this new user.\n\n"},"profile":{"allOf":[{"$ref":"#/components/schemas/UserProfile"}],"description":"Optional field used to create app users and additional admin users"},"groups":{"type":"array","items":{"$ref":"#/components/schemas/GroupMember"},"readOnly":true,"description":"List of group objects the user belongs to (read-only)"},"group_ids":{"type":"array","items":{"type":"integer","writeOnly":true},"writeOnly":true,"description":"List of group IDs to assign to the user (write-only)"},"permissions":{"$ref":"#/components/schemas/Permissions"},"assigned_wa_ids":{"type":"array","items":{"type":"string"},"readOnly":true}},"required":["assigned_wa_ids","email","groups","id","permissions","url","username"]},"UserProfile":{"type":"object","properties":{"role":{"allOf":[{"$ref":"#/components/schemas/RoleEnum"}],"description":"<p>Possible values:<br>    * <code>user</code> (<strong>User</strong>) - can do everything that isn't marked as admin only in API documentation<br>    * <code>admin</code> (<strong>Admin</strong>) - can use all available API endpoints and has Inbox admin panel access<br>    * <code>app</code> (<strong>App integration</strong>) - can do everything regular users have access too, but has no access to inbox web frontend</p>\n\n* `user` - Regular user\n* `admin` - Admin\n* `app` - App integration"},"is_available":{"type":"boolean","description":"Manual status set by the user to indicate availability for communication."}}},"RoleEnum":{"enum":["user","admin","app"],"type":"string","description":"* `user` - Regular user\n* `admin` - Admin\n* `app` - App integration"},"GroupMember":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"required":["id","name"]},"Permissions":{"type":"object","properties":{"can_use_tags":{"type":"boolean","description":"Uncheck this to disable tagging for related Users completely."},"can_read_chats":{"allOf":[{"$ref":"#/components/schemas/CanReadChatsEnum"}],"description":"<p>Possible values:<br><code>all</code> - User can read from All Chats<br>\n<code>group</code> - User can read from Only Chats assigned to User's Groups<br>\n<code>user</code> - User can read from Only Chats assigned to User directly<br>\n<code>none</code> - User can read from No Chats</p>\n\n* `all` - All Chats\n* `group` - Only Chats assigned to User's Groups\n* `user` - Only Chats assigned to User directly\n* `none` - No Chats"},"can_write_to_chats":{"allOf":[{"$ref":"#/components/schemas/CanWriteToChatsEnum"}],"description":"<p>Possible values:<br><code>all</code> - User can write to All Chats<br>\n<code>group</code> - User can write to Only Chats assigned to User's Groups<br>\n<code>user</code> - User can write to Only Chats assigned to User directly<br>\n<code>none</code> - User can write to No Chats</p>\n\n* `all` - All Chats\n* `group` - Only Chats assigned to User's Groups\n* `user` - Only Chats assigned to User directly\n* `none` - No Chats"}}},"CanReadChatsEnum":{"enum":["all","group","user","none"],"type":"string","description":"* `all` - All Chats\n* `group` - Only Chats assigned to User's Groups\n* `user` - Only Chats assigned to User directly\n* `none` - No Chats"},"CanWriteToChatsEnum":{"enum":["all","group","user","none"],"type":"string","description":"* `all` - All Chats\n* `group` - Only Chats assigned to User's Groups\n* `user` - Only Chats assigned to User directly\n* `none` - No Chats"},"Tagging":{"type":"object","properties":{"name":{"type":"string","description":"Tag object name"},"web_inbox_color":{"type":"string","description":"A Web App related setting - which color to show on the Web App frontend"},"tagging_id":{"type":"integer","readOnly":true,"description":"This tagging relation ID. Used when deleting a Tagging for example."},"id":{"type":"integer","description":"Tag object unique ID"},"extra":{"description":"Tagging extra payload"}},"required":["id","name","tagging_id","web_inbox_color"]},"Group":{"type":"object","properties":{"id":{"type":"integer","readOnly":true},"name":{"type":"string","maxLength":1000}},"required":["id","name"]},"ThreadControllerEnum":{"enum":["mba","inbox"],"type":"string","description":"* `mba` - Meta Business Agent\n* `inbox` - Inbox"},"NullEnum":{"enum":[null]}}},"paths":{"/api/v1/chats/":{"get":{"operationId":"listChats","description":"Get existing chats and the number of new messages in each chat.\n\nThis endpoint is similar to `/persons/` endpoint - here also contacts are listed, but only these contacts for which conversation already exists.\n\n\nChats are sorted by `last_message_timestamp`, newest to oldest.\n\n\nTo mark these messages as received, first store `wa_id` (WhatsApp ID) field value of this endpoint.\nThen use `messages` endpoint to read messages for related contact and\nstore the message `id`. After making sure the user has received the message on the frontend,\ncheck the timestamp of the most recent message received and use it with\n`/mark_as_received/` endpoint to actually mark it as received.\n\n\nMarking messages as received is important to prevent duplicate notifications.\n\nResponse is paginated.\nUse `limit` and `offset` query parameters to access each page.\nQuery parameter `limit` default value is 100.\nJSON response body field `count` tells the total number of elements available on all pages.","parameters":[{"in":"query","name":"assigned_group","schema":{"type":"integer"},"description":"Filter only Chats assigned to specified Group.\n            Skip this param to display all messages currently logged in User has access to.\n            Param value is an integer identifier of the Group.\n            Only Groups the User is member of can be used."},{"in":"query","name":"assigned_to_me","schema":{"type":"boolean"},"description":"Filter only Chats assigned to currently logged in User.\n            Skip this param or leave default `false` to display all messages User has access to."},{"in":"query","name":"blocked","schema":{"type":"boolean"},"description":"Filter only Chats which are blocked due to spam and abuse of WhatsApp."},{"in":"query","name":"chat_tag_id","schema":{"type":"integer"},"description":"Filter only Chats having given tag ID."},{"in":"query","name":"limit","schema":{"type":"integer"},"description":"Number of results to return per page."},{"in":"query","name":"message_has_referral","schema":{"type":"boolean"},"description":"When set to `true`, only Chats having Message with referral object are returned."},{"in":"query","name":"message_referral_body","schema":{"type":"string"},"description":"Filter only Chats that had a Message with `referral.body`, and the **last such Message** had `referral.body` equal to given param."},{"in":"query","name":"message_referral_headline","schema":{"type":"string"},"description":"Filter only Chats that had a Message with `referral.headline`, and the **last such Message** had `referral.headline` equal to given param."},{"in":"query","name":"message_referral_media_type","schema":{"type":"string"},"description":"Filter only Chats that had a Message with `referral.media_type`, and the **last such Message** had `referral.media_type` equal to given param.\n            Possible values are `\"image\"` and `\"video\"`."},{"in":"query","name":"message_referral_source_id","schema":{"type":"string"},"description":"Filter only Chats that had a Message with `referral.source_id`, and the **last such Message** had `referral.source_id` equal to given param."},{"in":"query","name":"message_referral_source_type","schema":{"type":"string"},"description":"Filter only Chats that had a Message with `referral.source_type`, and the **last such Message** had `referral.source_type` equal to given param.\n            Possible values are `\"ad\"` and `\"post\"`."},{"in":"query","name":"message_referral_source_url","schema":{"type":"string"},"description":"Filter only Chats that had a Message with `referral.source_url`, and the **last such Message** had `referral.source_url` containing phrase of `message_referral_source_url`.\n            For example, `message_referral_source_url=asd` matches `referral.source_url` = `https://asd.com`"},{"in":"query","name":"messages_before_time","schema":{"type":"integer"},"description":"[POSIX timestamp](https://en.wikipedia.org/wiki/Unix_time).\n            Returns only Chats **containing Messages** that are **older** than specified value."},{"in":"query","name":"messages_since_time","schema":{"type":"integer"},"description":"[POSIX timestamp](https://en.wikipedia.org/wiki/Unix_time).\n            Returns only Chats **containing Messages** at **the same timestamp or newer** than specified value."},{"in":"query","name":"offset","schema":{"type":"integer"},"description":"The initial index from which to return the results."},{"in":"query","name":"reported","schema":{"type":"boolean"},"description":"Filter only Chats which are reported due to spam and abuse of WhatsApp."},{"in":"query","name":"search","schema":{"type":"string"},"description":"Filter Chats by string query - search for chats containing specified text phrase.\n\nThe API will search in following places:\n\n* `contact.waba_payload.profile.name` and `contact.waba_payload.wa_id` of each Chat\n\n* `name` field of each Tag in `tags` of each Chat"},{"in":"query","name":"unread","schema":{"type":"boolean"},"description":"Filter only Chats that have unread messages."}],"tags":["Chats"],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedChatList"}}},"description":""}}}}}}
```

## GET /api/v1/chats/{wa\_id}/

> Get one Chat, including its contact, the number of new messages, its assignment and its tags.

```json
{"openapi":"3.0.3","info":{"title":"360dialog Inbox API","version":"1.28.0"},"tags":[{"name":"Chats","description":"Existing conversations with WhatsApp Users"}],"servers":[{"url":"https://{YOUR_STACK_NAME}.inbox.getchat.360dialog.io/","description":"Your Inbox address. Open the Inbox from the 360dialog Hub to see it.","variables":{"YOUR_STACK_NAME":{"default":"your-stack","description":"The first part of your Inbox address"}}}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"A user token, sent as `Token <token>`. Create a user in the admin panel (group App integration) and get its token from `POST /api/v1/auth/token/`. The channel API key (`D360-Api-Key`) is not supported."}},"schemas":{"Chat":{"type":"object","properties":{"contact":{"allOf":[{"$ref":"#/components/schemas/Person"}],"description":"Who are we talking to"},"new_messages":{"type":"integer","description":"The number of messages not received by currently authenticated user"},"wa_id":{"type":"string","description":"**Deprecated**"},"bsuid":{"type":"string","readOnly":true,"nullable":true,"title":"Business-Scoped User ID","description":"Business-Scoped User ID for this contact. Populated from the webhook's `user_id` field. Stable across phone number changes for the same user-portfolio pair, so this is the most reliable long-term identifier."},"phone_number":{"type":"string","readOnly":true,"nullable":true,"description":"Phone number when known. Equals `wa_id` for phone-primary contacts. For BSUID-primary contacts (where `wa_id` is a BSUID), populated when WhatsApp shares the phone number — e.g. recent interaction within the last 30 days, or via Contact Book."},"last_message":{"$ref":"#/components/schemas/RetrieveMessage"},"assigned_to_user":{"$ref":"#/components/schemas/User"},"assigned_group":{"$ref":"#/components/schemas/Group"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tagging"}},"thread_controller":{"readOnly":true,"nullable":true,"description":"Who currently responds in this conversation: `mba` while Meta Business Agent holds control, `inbox` after an agent took over. `null` means Meta Business Agent was never involved in this chat.\n\n* `mba` - Meta Business Agent\n* `inbox` - Inbox","oneOf":[{"$ref":"#/components/schemas/ThreadControllerEnum"},{"$ref":"#/components/schemas/NullEnum"}]}},"required":["assigned_group","assigned_to_user","bsuid","contact","last_message","new_messages","phone_number","tags","thread_controller","wa_id"]},"Person":{"type":"object","properties":{"wa_id":{"type":"string","title":"WhatsApp id","description":"WhatsApp ID — either a phone number in canonical form (e.g. 48123123123) or a Business-Scoped User ID (e.g. US.13491208655302741918) for users who have hidden their phone number.","pattern":"^([A-Z]{2}\\.(ENT\\.)?[a-zA-Z0-9]+|[0-9]+)$","maxLength":200},"bsuid":{"type":"string","readOnly":true,"nullable":true,"title":"Business-Scoped User ID","description":"Business-Scoped User ID for this contact. Populated from the webhook's `user_id` field. Stable across phone number changes for the same user-portfolio pair, so this is the most reliable long-term identifier."},"phone_number":{"type":"string","readOnly":true,"nullable":true,"description":"Phone number when known. Equals `wa_id` for phone-primary contacts. For BSUID-primary contacts (where `wa_id` is a BSUID), populated when WhatsApp shares the phone number — e.g. recent interaction within the last 30 days, or via Contact Book."},"waba_payload":{"$ref":"#/components/schemas/WabaPayloadContact"},"initials":{"type":"string","description":"Contact user name initials used for display when avatar image is missing"},"last_message_timestamp":{"type":"number","format":"double","nullable":true,"description":"[POSIX timestamp](https://en.wikipedia.org/wiki/Unix_time) of last message that was sent by this contact. It is the floor of the customer care messaging window: a non-template message can always be delivered for some time after the customer last wrote to your business, and Meta may keep the window open for longer — see `messaging_window_expires_at`. Read more at WhatsApp Business API docs [Messages Cut-off Control](https://developers.facebook.com/docs/whatsapp/api/messages#cut-off-control)."},"messaging_window_expires_at":{"type":"number","format":"double","readOnly":true,"description":"[POSIX timestamp](https://en.wikipedia.org/wiki/Unix_time) after which a non-template message to this contact is rejected with HTTP 453. Derived from what Meta reported for this conversation, the customer's last message, and — for click-to-WhatsApp chats we have not replied to yet — the ad referral. Never assume a fixed duration: read this value."},"messaging_window_origin":{"type":"string","readOnly":true,"nullable":true,"description":"`conversation.origin.type` reported by Meta alongside `messaging_window_expires_at` — what opened the conversation (e.g. `service`, `marketing`, `utility`, `authentication`, or `referral_conversion` for a click-to-WhatsApp ad)."},"resolved":{"type":"boolean","description":"Whether this chat is considered resolved by the assigned agent. Can automatically be set to false if contact keeps sending messages."}},"required":["bsuid","initials","messaging_window_expires_at","messaging_window_origin","phone_number","wa_id","waba_payload"]},"WabaPayloadContact":{"type":"object","properties":{"profile":{"$ref":"#/components/schemas/WabaPayloadProfile"},"wa_id":{"type":"string"}},"required":["profile","wa_id"]},"WabaPayloadProfile":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"RetrieveMessage":{"type":"object","properties":{"id":{"type":"string","description":"Internal Inbox Message ID"},"waba_payload":{"description":"See [Inbound Notifications from WhatsApp Business API](https://developers.facebook.com/docs/whatsapp/api/webhooks/inbound)"},"waba_statuses":{"allOf":[{"$ref":"#/components/schemas/WabaMessageStatuses"}],"description":"Timestamps of all statuses of the message"},"contact":{"allOf":[{"$ref":"#/components/schemas/Person"}],"description":"Who are we talking to"},"from_us":{"type":"boolean","readOnly":true,"title":"From us?","description":"Allows to easily implement different display for messages sent by us or by customer."},"received":{"type":"boolean","default":false,"description":"Tells if this message was marked as received by you (currently logged in user)"},"sender":{"allOf":[{"$ref":"#/components/schemas/User"}],"description":"Who is talking on our behalf\n\n`null` if this is an incoming message."},"before_time":{"type":"integer"},"since_time":{"type":"integer"},"customer_wa_id":{"type":"string","readOnly":true,"title":"Customer WhatsApp id","description":"**Deprecated**"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tagging"},"default":[],"description":"Tags assigned to this Message"},"chat_tags":{"type":"array","items":{"$ref":"#/components/schemas/Tagging"},"default":[],"description":"Tags assigned to the Chat this Message belongs to"},"sent_by_mba":{"type":"boolean","readOnly":true,"title":"Sent by Meta Business Agent","description":"This message was sent on the business's behalf by Meta Business Agent (the copy arrived on the `standby` webhook field). Only set when `from_us` is `true`; distinguishes AI messages from ones sent by inbox users or automation."}},"required":["contact","customer_wa_id","from_us","id","sent_by_mba","waba_payload","waba_statuses"]},"WabaMessageStatuses":{"type":"object","properties":{"sent":{"type":"number","format":"double","nullable":true},"delivered":{"type":"number","format":"double","nullable":true},"read":{"type":"number","format":"double","nullable":true}}},"User":{"type":"object","properties":{"url":{"type":"string","format":"uri","readOnly":true},"id":{"type":"integer","readOnly":true},"username":{"type":"string","description":"Username that is used in combination with password during login.\n\nOnly alphanumeric characters are allowed (A-Z, a-z, 0-9)."},"first_name":{"type":"string","maxLength":150},"last_name":{"type":"string","maxLength":150},"email":{"type":"string","format":"email","description":"E-mail address of this new user.\n\n"},"profile":{"allOf":[{"$ref":"#/components/schemas/UserProfile"}],"description":"Optional field used to create app users and additional admin users"},"groups":{"type":"array","items":{"$ref":"#/components/schemas/GroupMember"},"readOnly":true,"description":"List of group objects the user belongs to (read-only)"},"group_ids":{"type":"array","items":{"type":"integer","writeOnly":true},"writeOnly":true,"description":"List of group IDs to assign to the user (write-only)"},"permissions":{"$ref":"#/components/schemas/Permissions"},"assigned_wa_ids":{"type":"array","items":{"type":"string"},"readOnly":true}},"required":["assigned_wa_ids","email","groups","id","permissions","url","username"]},"UserProfile":{"type":"object","properties":{"role":{"allOf":[{"$ref":"#/components/schemas/RoleEnum"}],"description":"<p>Possible values:<br>    * <code>user</code> (<strong>User</strong>) - can do everything that isn't marked as admin only in API documentation<br>    * <code>admin</code> (<strong>Admin</strong>) - can use all available API endpoints and has Inbox admin panel access<br>    * <code>app</code> (<strong>App integration</strong>) - can do everything regular users have access too, but has no access to inbox web frontend</p>\n\n* `user` - Regular user\n* `admin` - Admin\n* `app` - App integration"},"is_available":{"type":"boolean","description":"Manual status set by the user to indicate availability for communication."}}},"RoleEnum":{"enum":["user","admin","app"],"type":"string","description":"* `user` - Regular user\n* `admin` - Admin\n* `app` - App integration"},"GroupMember":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"required":["id","name"]},"Permissions":{"type":"object","properties":{"can_use_tags":{"type":"boolean","description":"Uncheck this to disable tagging for related Users completely."},"can_read_chats":{"allOf":[{"$ref":"#/components/schemas/CanReadChatsEnum"}],"description":"<p>Possible values:<br><code>all</code> - User can read from All Chats<br>\n<code>group</code> - User can read from Only Chats assigned to User's Groups<br>\n<code>user</code> - User can read from Only Chats assigned to User directly<br>\n<code>none</code> - User can read from No Chats</p>\n\n* `all` - All Chats\n* `group` - Only Chats assigned to User's Groups\n* `user` - Only Chats assigned to User directly\n* `none` - No Chats"},"can_write_to_chats":{"allOf":[{"$ref":"#/components/schemas/CanWriteToChatsEnum"}],"description":"<p>Possible values:<br><code>all</code> - User can write to All Chats<br>\n<code>group</code> - User can write to Only Chats assigned to User's Groups<br>\n<code>user</code> - User can write to Only Chats assigned to User directly<br>\n<code>none</code> - User can write to No Chats</p>\n\n* `all` - All Chats\n* `group` - Only Chats assigned to User's Groups\n* `user` - Only Chats assigned to User directly\n* `none` - No Chats"}}},"CanReadChatsEnum":{"enum":["all","group","user","none"],"type":"string","description":"* `all` - All Chats\n* `group` - Only Chats assigned to User's Groups\n* `user` - Only Chats assigned to User directly\n* `none` - No Chats"},"CanWriteToChatsEnum":{"enum":["all","group","user","none"],"type":"string","description":"* `all` - All Chats\n* `group` - Only Chats assigned to User's Groups\n* `user` - Only Chats assigned to User directly\n* `none` - No Chats"},"Tagging":{"type":"object","properties":{"name":{"type":"string","description":"Tag object name"},"web_inbox_color":{"type":"string","description":"A Web App related setting - which color to show on the Web App frontend"},"tagging_id":{"type":"integer","readOnly":true,"description":"This tagging relation ID. Used when deleting a Tagging for example."},"id":{"type":"integer","description":"Tag object unique ID"},"extra":{"description":"Tagging extra payload"}},"required":["id","name","tagging_id","web_inbox_color"]},"Group":{"type":"object","properties":{"id":{"type":"integer","readOnly":true},"name":{"type":"string","maxLength":1000}},"required":["id","name"]},"ThreadControllerEnum":{"enum":["mba","inbox"],"type":"string","description":"* `mba` - Meta Business Agent\n* `inbox` - Inbox"},"NullEnum":{"enum":[null]}}},"paths":{"/api/v1/chats/{wa_id}/":{"get":{"operationId":"retrieveChat","description":"Get one Chat, including its contact, the number of new messages, its assignment and its tags.","parameters":[{"in":"path","name":"wa_id","schema":{"type":"string","pattern":"^[^/]+$"},"required":true}],"tags":["Chats"],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Chat"}}},"description":""}}}}}}
```

## POST /api/v1/chats/{wa\_id}/handover/

> Hands control of this conversation back to Meta Business Agent.\
> \
> The reverse direction needs no endpoint: the inbox takes control of a\
> conversation simply by sending a message to it.

```json
{"openapi":"3.0.3","info":{"title":"360dialog Inbox API","version":"1.28.0"},"tags":[{"name":"Chats","description":"Existing conversations with WhatsApp Users"}],"servers":[{"url":"https://{YOUR_STACK_NAME}.inbox.getchat.360dialog.io/","description":"Your Inbox address. Open the Inbox from the 360dialog Hub to see it.","variables":{"YOUR_STACK_NAME":{"default":"your-stack","description":"The first part of your Inbox address"}}}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"A user token, sent as `Token <token>`. Create a user in the admin panel (group App integration) and get its token from `POST /api/v1/auth/token/`. The channel API key (`D360-Api-Key`) is not supported."}}},"paths":{"/api/v1/chats/{wa_id}/handover/":{"post":{"operationId":"handoverChat","description":"Hands control of this conversation back to Meta Business Agent.\n\nThe reverse direction needs no endpoint: the inbox takes control of a\nconversation simply by sending a message to it.","parameters":[{"in":"path","name":"wa_id","schema":{"type":"string","pattern":"^[^/]+$"},"required":true}],"tags":["Chats"],"responses":{"200":{"description":"Thread control passed to the Inbox","content":{"application/json":{"schema":{"type":"object","properties":{"thread_controller":{"type":"string"}}}}}}}}}}}
```

## PATCH /api/v1/chats/{wa\_id}/resolve/

> Marks a chat as resolved, or removes this mark.

```json
{"openapi":"3.0.3","info":{"title":"360dialog Inbox API","version":"1.28.0"},"tags":[{"name":"Chats","description":"Existing conversations with WhatsApp Users"}],"servers":[{"url":"https://{YOUR_STACK_NAME}.inbox.getchat.360dialog.io/","description":"Your Inbox address. Open the Inbox from the 360dialog Hub to see it.","variables":{"YOUR_STACK_NAME":{"default":"your-stack","description":"The first part of your Inbox address"}}}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"A user token, sent as `Token <token>`. Create a user in the admin panel (group App integration) and get its token from `POST /api/v1/auth/token/`. The channel API key (`D360-Api-Key`) is not supported."}},"schemas":{"PatchedResolvedChat":{"type":"object","properties":{"wa_id":{"type":"string","readOnly":true,"title":"WhatsApp id","description":"WhatsApp ID — either a phone number in canonical form (e.g. 48123123123) or a Business-Scoped User ID (e.g. US.13491208655302741918) for users who have hidden their phone number."},"bsuid":{"type":"string","readOnly":true,"nullable":true,"title":"Business-Scoped User ID","description":"Business-Scoped User ID for this contact. Populated from the webhook's `user_id` field. Stable across phone number changes for the same user-portfolio pair, so this is the most reliable long-term identifier."},"phone_number":{"type":"string","readOnly":true,"nullable":true,"description":"Phone number when known. Equals `wa_id` for phone-primary contacts. For BSUID-primary contacts (where `wa_id` is a BSUID), populated when WhatsApp shares the phone number — e.g. recent interaction within the last 30 days, or via Contact Book."},"resolved":{"type":"boolean","description":"Whether this chat is considered resolved by the assigned agent. Can automatically be set to false if contact keeps sending messages."}}},"ResolvedChat":{"type":"object","properties":{"wa_id":{"type":"string","readOnly":true,"title":"WhatsApp id","description":"WhatsApp ID — either a phone number in canonical form (e.g. 48123123123) or a Business-Scoped User ID (e.g. US.13491208655302741918) for users who have hidden their phone number."},"bsuid":{"type":"string","readOnly":true,"nullable":true,"title":"Business-Scoped User ID","description":"Business-Scoped User ID for this contact. Populated from the webhook's `user_id` field. Stable across phone number changes for the same user-portfolio pair, so this is the most reliable long-term identifier."},"phone_number":{"type":"string","readOnly":true,"nullable":true,"description":"Phone number when known. Equals `wa_id` for phone-primary contacts. For BSUID-primary contacts (where `wa_id` is a BSUID), populated when WhatsApp shares the phone number — e.g. recent interaction within the last 30 days, or via Contact Book."},"resolved":{"type":"boolean","description":"Whether this chat is considered resolved by the assigned agent. Can automatically be set to false if contact keeps sending messages."}},"required":["bsuid","phone_number","wa_id"]}}},"paths":{"/api/v1/chats/{wa_id}/resolve/":{"patch":{"operationId":"updateResolved","description":"Marks a chat as resolved, or removes this mark.","parameters":[{"in":"path","name":"wa_id","schema":{"type":"string","pattern":"^[^/]+$"},"required":true}],"tags":["Chats"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchedResolvedChat"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/PatchedResolvedChat"}},"multipart/form-data":{"schema":{"$ref":"#/components/schemas/PatchedResolvedChat"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolvedChat"}}},"description":""}}}}}}
```

## GET /api/v1/settings/useravailability/

> Singleton resource served at /settings/useravailability/ (no pk).

```json
{"openapi":"3.0.3","info":{"title":"360dialog Inbox API","version":"1.28.0"},"tags":[{"name":"Chats","description":"Existing conversations with WhatsApp Users"}],"servers":[{"url":"https://{YOUR_STACK_NAME}.inbox.getchat.360dialog.io/","description":"Your Inbox address. Open the Inbox from the 360dialog Hub to see it.","variables":{"YOUR_STACK_NAME":{"default":"your-stack","description":"The first part of your Inbox address"}}}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"A user token, sent as `Token <token>`. Create a user in the admin panel (group App integration) and get its token from `POST /api/v1/auth/token/`. The channel API key (`D360-Api-Key`) is not supported."}},"schemas":{"UserAvailabilitySettings":{"type":"object","properties":{"feature_set_enabled":{"type":"boolean","description":"Only if checked, any settings in this feature set take effect. If not checked, auto-assignment will not happen, and user availability has no effect (and cannot be toggled by users)"}}}}},"paths":{"/api/v1/settings/useravailability/":{"get":{"operationId":"getUserAvailabilitySettings","description":"Singleton resource served at /settings/useravailability/ (no pk).","tags":["Chats"],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAvailabilitySettings"}}},"description":""}}}}}}
```

## PUT /api/v1/settings/useravailability/

> Singleton resource served at /settings/useravailability/ (no pk).

```json
{"openapi":"3.0.3","info":{"title":"360dialog Inbox API","version":"1.28.0"},"tags":[{"name":"Chats","description":"Existing conversations with WhatsApp Users"}],"servers":[{"url":"https://{YOUR_STACK_NAME}.inbox.getchat.360dialog.io/","description":"Your Inbox address. Open the Inbox from the 360dialog Hub to see it.","variables":{"YOUR_STACK_NAME":{"default":"your-stack","description":"The first part of your Inbox address"}}}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"A user token, sent as `Token <token>`. Create a user in the admin panel (group App integration) and get its token from `POST /api/v1/auth/token/`. The channel API key (`D360-Api-Key`) is not supported."}},"schemas":{"UserAvailabilitySettings":{"type":"object","properties":{"feature_set_enabled":{"type":"boolean","description":"Only if checked, any settings in this feature set take effect. If not checked, auto-assignment will not happen, and user availability has no effect (and cannot be toggled by users)"}}}}},"paths":{"/api/v1/settings/useravailability/":{"put":{"operationId":"updateUserAvailabilitySettings","description":"Singleton resource served at /settings/useravailability/ (no pk).","tags":["Chats"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAvailabilitySettings"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/UserAvailabilitySettings"}},"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UserAvailabilitySettings"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAvailabilitySettings"}}},"description":""}}}}}}
```

## PATCH /api/v1/settings/useravailability/

> Singleton resource served at /settings/useravailability/ (no pk).

```json
{"openapi":"3.0.3","info":{"title":"360dialog Inbox API","version":"1.28.0"},"tags":[{"name":"Chats","description":"Existing conversations with WhatsApp Users"}],"servers":[{"url":"https://{YOUR_STACK_NAME}.inbox.getchat.360dialog.io/","description":"Your Inbox address. Open the Inbox from the 360dialog Hub to see it.","variables":{"YOUR_STACK_NAME":{"default":"your-stack","description":"The first part of your Inbox address"}}}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"A user token, sent as `Token <token>`. Create a user in the admin panel (group App integration) and get its token from `POST /api/v1/auth/token/`. The channel API key (`D360-Api-Key`) is not supported."}},"schemas":{"PatchedUserAvailabilitySettings":{"type":"object","properties":{"feature_set_enabled":{"type":"boolean","description":"Only if checked, any settings in this feature set take effect. If not checked, auto-assignment will not happen, and user availability has no effect (and cannot be toggled by users)"}}},"UserAvailabilitySettings":{"type":"object","properties":{"feature_set_enabled":{"type":"boolean","description":"Only if checked, any settings in this feature set take effect. If not checked, auto-assignment will not happen, and user availability has no effect (and cannot be toggled by users)"}}}}},"paths":{"/api/v1/settings/useravailability/":{"patch":{"operationId":"partialUpdateUserAvailabilitySettings","description":"Singleton resource served at /settings/useravailability/ (no pk).","tags":["Chats"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchedUserAvailabilitySettings"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/PatchedUserAvailabilitySettings"}},"multipart/form-data":{"schema":{"$ref":"#/components/schemas/PatchedUserAvailabilitySettings"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAvailabilitySettings"}}},"description":""}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.360dialog.com/docs/inbox/inbox-api/api-ref/chats.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
