### Tags API Source: https://unnichat.com.br/api/api-docs Endpoints for managing tags, including listing, creating, retrieving, deleting, and searching tags. ```APIDOC ## GET /tags ### Description Lists all available tags for the connection. ### Method GET ### Endpoint /tags ### Response #### Success Response (200) - **tags** (array) - A list of tag objects, each with an id and name. #### Response Example ```json { "tags": [ { "id": "tag_1", "name": "vip" }, { "id": "tag_2", "name": "lead" } ] } ``` ``` ```APIDOC ## POST /tags ### Description Creates a new tag. ### Method POST ### Endpoint /tags ### Parameters #### Request Body - **name** (string) - Required - The name of the tag to create. ### Request Example ```json { "name": "new_customer" } ``` ### Response #### Success Response (201) - **id** (string) - The unique identifier of the created tag. - **message** (string) - Confirmation message. #### Response Example ```json { "id": "tag_3", "message": "Tag created successfully." } ``` ``` ```APIDOC ## GET /tags/{id} ### Description Retrieves a specific tag by its unique ID. ### Method GET ### Endpoint /tags/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the tag. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the tag. - **name** (string) - The name of the tag. #### Response Example ```json { "id": "tag_1", "name": "vip" } ``` ``` ```APIDOC ## DELETE /tags/{id} ### Description Deletes a tag by its unique ID. ### Method DELETE ### Endpoint /tags/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the tag to delete. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Tag deleted successfully." } ``` ``` ```APIDOC ## POST /tags/search ### Description Searches for tags based on specified conditions. ### Method POST ### Endpoint /tags/search ### Parameters #### Request Body - **conditions** (object) - Required - An object containing search criteria (e.g., name). ### Request Example ```json { "conditions": { "name": "vip" } } ``` ### Response #### Success Response (200) - **tags** (array) - A list of tags matching the search criteria. #### Response Example ```json { "tags": [ { "id": "tag_1", "name": "vip" } ] } ``` ``` -------------------------------- ### Custom Fields API Source: https://unnichat.com.br/api/api-docs Endpoints for managing custom fields, including creation, retrieval, deletion, and searching. ```APIDOC ## POST /customFields ### Description Creates a new custom field. ### Method POST ### Endpoint /customFields ### Parameters #### Request Body - **name** (string) - Required - The name of the custom field. - **type** (string) - Required - The data type of the custom field (e.g., 'text', 'number', 'date'). ### Request Example ```json { "name": "Industry", "type": "text" } ``` ### Response #### Success Response (201) - **id** (string) - The unique identifier of the created custom field. - **message** (string) - Confirmation message. #### Response Example ```json { "id": "cf_1", "message": "Custom field created successfully." } ``` ``` ```APIDOC ## GET /customFields/{id} ### Description Retrieves a specific custom field by its unique ID. ### Method GET ### Endpoint /customFields/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the custom field. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the custom field. - **name** (string) - The name of the custom field. - **type** (string) - The data type of the custom field. #### Response Example ```json { "id": "cf_1", "name": "Industry", "type": "text" } ``` ``` ```APIDOC ## DELETE /customFields/{id} ### Description Deletes a custom field by its unique ID. ### Method DELETE ### Endpoint /customFields/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the custom field to delete. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Custom field deleted successfully." } ``` ``` ```APIDOC ## POST /customFields/search ### Description Searches for custom fields based on specified conditions. ### Method POST ### Endpoint /customFields/search ### Parameters #### Request Body - **conditions** (object) - Required - An object containing search criteria (e.g., name, type). ### Request Example ```json { "conditions": { "name": "Industry" } } ``` ### Response #### Success Response (200) - **customFields** (array) - A list of custom fields matching the search criteria. #### Response Example ```json { "customFields": [ { "id": "cf_1", "name": "Industry", "type": "text" } ] } ``` ``` -------------------------------- ### Contacts API Source: https://unnichat.com.br/api/api-docs Endpoints for managing contacts, including creation, retrieval, updating, searching, and managing associated tags, custom fields, and messages. ```APIDOC ## POST /contact ### Description Creates a new contact. Primarily for WhatsApp. ### Method POST ### Endpoint /contact ### Parameters #### Request Body - **name** (string) - Required - The name of the contact. - **phone** (string) - Required - The phone number of the contact (WhatsApp). ### Request Example ```json { "name": "John Doe", "phone": "+5511999999999" } ``` ### Response #### Success Response (201) - **id** (string) - The unique identifier of the created contact. - **message** (string) - Confirmation message. #### Response Example ```json { "id": "contact_123", "message": "Contact created successfully." } ``` ``` ```APIDOC ## GET /contact/{id} ### Description Retrieves a contact by its unique ID. ### Method GET ### Endpoint /contact/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the contact. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the contact. - **name** (string) - The name of the contact. - **phone** (string) - The phone number of the contact. - **tags** (array) - A list of tags associated with the contact. - **customFields** (object) - Key-value pairs of custom fields. #### Response Example ```json { "id": "contact_123", "name": "John Doe", "phone": "+5511999999999", "tags": ["vip", "lead"], "customFields": { "company": "Example Corp" } } ``` ``` ```APIDOC ## PATCH /contact/{id} ### Description Edits an existing contact by its unique ID. ### Method PATCH ### Endpoint /contact/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the contact. #### Request Body - **name** (string) - Optional - The new name for the contact. - **phone** (string) - Optional - The new phone number for the contact. ### Request Example ```json { "name": "Johnathan Doe" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Contact updated successfully." } ``` ``` ```APIDOC ## POST /contact/search ### Description Searches for contacts based on specified conditions. ### Method POST ### Endpoint /contact/search ### Parameters #### Request Body - **conditions** (object) - Required - An object containing search criteria (e.g., name, phone, tags). ### Request Example ```json { "conditions": { "name": "John", "tags": ["vip"] } } ``` ### Response #### Success Response (200) - **contacts** (array) - A list of contacts matching the search criteria. #### Response Example ```json { "contacts": [ { "id": "contact_123", "name": "John Doe", "phone": "+5511999999999" } ] } ``` ``` ```APIDOC ## POST /contact/{id}/tags ### Description Adds a new tag to a contact. ### Method POST ### Endpoint /contact/{id}/tags ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the contact. #### Request Body - **tag** (string) - Required - The tag to add to the contact. ### Request Example ```json { "tag": "new_customer" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Tag added successfully." } ``` ``` ```APIDOC ## DELETE /contact/{id}/tags/{tagId} ### Description Removes a tag from a contact. ### Method DELETE ### Endpoint /contact/{id}/tags/{tagId} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the contact. - **tagId** (string) - Required - The unique identifier of the tag to remove. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Tag removed successfully." } ``` ``` ```APIDOC ## POST /contact/{id}/customFields ### Description Adds a custom field to a contact. ### Method POST ### Endpoint /contact/{id}/customFields ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the contact. #### Request Body - **fieldName** (string) - Required - The name of the custom field. - **fieldValue** (string) - Required - The value of the custom field. ### Request Example ```json { "fieldName": "company", "fieldValue": "Example Corp" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Custom field added successfully." } ``` ``` ```APIDOC ## DELETE /contact/{id}/customFields/{fieldId} ### Description Removes a custom field from a contact. ### Method DELETE ### Endpoint /contact/{id}/customFields/{fieldId} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the contact. - **fieldId** (string) - Required - The unique identifier of the custom field to remove. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Custom field removed successfully." } ``` ``` ```APIDOC ## GET /contact/{id}/messages ### Description Retrieves the message history exchanged with a contact. ### Method GET ### Endpoint /contact/{id}/messages ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the contact. ### Response #### Success Response (200) - **messages** (array) - A list of messages exchanged with the contact. #### Response Example ```json { "messages": [ { "from": "contact_123", "to": "unnichat", "text": "Hello!", "timestamp": "2023-10-27T10:00:00Z" }, { "from": "unnichat", "to": "contact_123", "text": "Hi there!", "timestamp": "2023-10-27T10:05:00Z" } ] } ``` ``` ```APIDOC ## POST /contact/{id}/crm ### Description Creates a new deal in a pipeline column for a contact. ### Method POST ### Endpoint /contact/{id}/crm ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the contact. #### Request Body - **dealName** (string) - Required - The name of the deal. - **columnId** (string) - Required - The ID of the pipeline column where the deal should be created. ### Request Example ```json { "dealName": "New Project Proposal", "columnId": "column_abc" } ``` ### Response #### Success Response (201) - **dealId** (string) - The unique identifier of the created deal. - **message** (string) - Confirmation message. #### Response Example ```json { "dealId": "deal_xyz", "message": "Deal created successfully." } ``` ``` ```APIDOC ## DELETE /contact/{id}/crm/{crmId} ### Description Removes a deal associated with a contact from the pipeline. ### Method DELETE ### Endpoint /contact/{id}/crm/{crmId} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the contact. - **crmId** (string) - Required - The unique identifier of the deal to remove. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Deal removed successfully." } ``` ``` ```APIDOC ## DELETE /contact/{id}/crm/{crmId}/column/{columnId} ### Description Removes a deal from a specific pipeline column for a contact. ### Method DELETE ### Endpoint /contact/{id}/crm/{crmId}/column/{columnId} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the contact. - **crmId** (string) - Required - The unique identifier of the deal. - **columnId** (string) - Required - The ID of the pipeline column from which to remove the deal. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Deal removed from column successfully." } ``` ``` ```APIDOC ## PATCH /contact/{id}/crm/{crmId}/won ### Description Marks a deal as 'won' in the pipeline for a contact. ### Method PATCH ### Endpoint /contact/{id}/crm/{crmId}/won ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the contact. - **crmId** (string) - Required - The unique identifier of the deal. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Deal marked as won." } ``` ``` ```APIDOC ## PATCH /contact/{id}/crm/{crmId}/lost ### Description Marks a deal as 'lost' in the pipeline for a contact. ### Method PATCH ### Endpoint /contact/{id}/crm/{crmId}/lost ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the contact. - **crmId** (string) - Required - The unique identifier of the deal. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Deal marked as lost." } ``` ``` ```APIDOC ## POST /contact/{id}/crm/{crmId}/multipleCustomFields ### Description Sets the value of one or more custom fields for a deal associated with a contact. ### Method POST ### Endpoint /contact/{id}/crm/{crmId}/multipleCustomFields ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the contact. - **crmId** (string) - Required - The unique identifier of the deal. #### Request Body - **customFields** (object) - Required - An object where keys are custom field names and values are their new values. ### Request Example ```json { "customFields": { "estimated_value": "10000", "probability": "80%" } } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Custom fields updated successfully." } ``` ``` ```APIDOC ## POST /contact/{id}/assign ### Description Assigns a contact to an agent for handling. ### Method POST ### Endpoint /contact/{id}/assign ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the contact. #### Request Body - **agentId** (string) - Required - The unique identifier of the agent to assign the contact to. ### Request Example ```json { "agentId": "agent_456" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Contact assigned successfully." } ``` ``` ```APIDOC ## GET /contact/{id}/assign ### Description Retrieves the agent currently responsible for handling a contact. ### Method GET ### Endpoint /contact/{id}/assign ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the contact. ### Response #### Success Response (200) - **agentId** (string) - The unique identifier of the assigned agent. - **agentName** (string) - The name of the assigned agent. #### Response Example ```json { "agentId": "agent_456", "agentName": "Jane Smith" } ``` ``` -------------------------------- ### CRM API Source: https://unnichat.com.br/api/api-docs Endpoints for managing CRM data, including products, categories, and reasons for loss. ```APIDOC ## POST /crm/products ### Description Creates a new CRM product. ### Method POST ### Endpoint /crm/products ### Parameters #### Request Body - **name** (string) - Required - The name of the product. - **price** (number) - Required - The price of the product. ### Request Example ```json { "name": "Premium Service", "price": 150.00 } ``` ### Response #### Success Response (201) - **productId** (string) - The unique identifier of the created product. - **message** (string) - Confirmation message. #### Response Example ```json { "productId": "prod_789", "message": "Product created successfully." } ``` ``` ```APIDOC ## GET /crm/products/{id} ### Description Retrieves a CRM product by its unique ID. ### Method GET ### Endpoint /crm/products/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the product. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the product. - **name** (string) - The name of the product. - **price** (number) - The price of the product. #### Response Example ```json { "id": "prod_789", "name": "Premium Service", "price": 150.00 } ``` ``` ```APIDOC ## DELETE /crm/products/{id} ### Description Deletes a CRM product by its unique ID. ### Method DELETE ### Endpoint /crm/products/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the product to delete. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Product deleted successfully." } ``` ``` ```APIDOC ## PATCH /crm/products/{id} ### Description Edits an existing CRM product by its unique ID. ### Method PATCH ### Endpoint /crm/products/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the product. #### Request Body - **name** (string) - Optional - The new name for the product. - **price** (number) - Optional - The new price for the product. ### Request Example ```json { "price": 175.00 } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Product updated successfully." } ``` ``` ```APIDOC ## POST /crm/categories ### Description Creates a new CRM category. ### Method POST ### Endpoint /crm/categories ### Parameters #### Request Body - **name** ``` -------------------------------- ### Messages API Source: https://unnichat.com.br/api/api-docs Endpoints for retrieving and sending messages via WhatsApp and Instagram Direct. ```APIDOC ## GET /meta/messages/{messageId} ### Description Retrieves a specific message by its unique ID. ### Method GET ### Endpoint /meta/messages/{messageId} ### Parameters #### Path Parameters - **messageId** (string) - Required - The unique identifier of the message. ### Response #### Success Response (200) - **message** (object) - The message object containing details like sender, receiver, content, and timestamp. #### Response Example ```json { "message": { "id": "msg_abc", "from": "contact_123", "to": "unnichat", "text": "Hello!", "timestamp": "2023-10-27T10:00:00Z" } } ``` ``` ```APIDOC ## POST /meta/messages ### Description Sends a WhatsApp message. ### Method POST ### Endpoint /meta/messages ### Parameters #### Request Body - **to** (string) - Required - The recipient's WhatsApp number. - **text** (string) - Required - The content of the message. ### Request Example ```json { "to": "+5511999999999", "text": "Hello from Unnichat!" } ``` ### Response #### Success Response (200) - **messageId** (string) - The unique identifier of the sent message. - **status** (string) - The status of the message (e.g., 'sent'). #### Response Example ```json { "messageId": "msg_xyz", "status": "sent" } ``` ``` ```APIDOC ## POST /meta/templates ### Description Sends a WhatsApp template message. ### Method POST ### Endpoint /meta/templates ### Parameters #### Request Body - **to** (string) - Required - The recipient's WhatsApp number. - **templateName** (string) - Required - The name of the WhatsApp template. - **parameters** (array) - Optional - An array of parameters to populate the template. ### Request Example ```json { "to": "+5511999999999", "templateName": "welcome_message", "parameters": ["John Doe"] } ``` ### Response #### Success Response (200) - **messageId** (string) - The unique identifier of the sent message. - **status** (string) - The status of the message (e.g., 'sent'). #### Response Example ```json { "messageId": "msg_template_123", "status": "sent" } ``` ``` ```APIDOC ## POST /instagram/direct ### Description Sends a direct message on Instagram. ### Method POST ### Endpoint /instagram/direct ### Parameters #### Request Body - **toUsername** (string) - Required - The Instagram username of the recipient. - **text** (string) - Required - The content of the message. ### Request Example ```json { "toUsername": "instagram_user", "text": "Hello from Unnichat!" } ``` ### Response #### Success Response (200) - **messageId** (string) - The unique identifier of the sent message. - **status** (string) - The status of the message (e.g., 'sent'). #### Response Example ```json { "messageId": "ig_msg_456", "status": "sent" } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.