### GET /v1/company Source: https://helena.readme.io/reference/get_v1-company Retrieves a paginated list of companies. Authentication requires a Partner Token sent in the 'Authorization' header as 'Bearer'. ```APIDOC ## GET /v1/company ### Description Lists companies in a paginated manner. Requires a Partner Token for authentication, sent via the 'Authorization' header with 'Bearer' schema. ### Method GET ### Endpoint /v1/company ### Parameters #### Query Parameters - **SearchableText** (string) - Optional - Text for searching. - **OnlyInactive** (boolean) - Optional - Filter for inactive companies only. - **Status** (string) - Optional - Account status. Enum: SANDBOX, PRODUCTION. - **SetupStatus** (string) - Optional - Account setup status. Enum: SUBSCRIPTION_PENDING, SUBSCRIPTION_CREATED, PENDING_CONFIG, COMPLETED, SUBSCRIPTION_ARREARS, SUBSCRIPTION_SUSPENDED, SUBSCRIPTION_CANCELED. - **IncludeDetails** (array) - Optional - Details to include in the response. Items enum: Config. - **CreatedAt.Before** (string) - Optional - Upper bound for creation date search (UTM timezone). - **CreatedAt.After** (string) - Optional - Lower bound for creation date search (UTM timezone). - **UpdatedAt.Before** (string) - Optional - Upper bound for update date search (UTM timezone). - **UpdatedAt.After** (string) - Optional - Lower bound for update date search (UTM timezone). - **PageNumber** (integer) - Optional - Page number to retrieve. Default: 1. - **PageSize** (integer) - Optional - Number of items per page. Default: 15. - **OrderBy** (string) - Optional - Field to use for sorting. - **OrderDirection** (string) - Optional - Sorting direction. Enum: ASCENDING, DESCENDING. ### Request Example ```json { "message": "Example request body not applicable for GET request" } ``` ### Response #### Success Response (200) - **companies** (array) - List of company objects. - **pagination** (object) - Pagination details. #### Response Example ```json { "companies": [ { "id": "string", "name": "string", "status": "string", "setupStatus": "string", "createdAt": "string", "updatedAt": "string" } ], "pagination": { "currentPage": 0, "pageSize": 0, "totalCount": 0, "totalPages": 0 } } ``` ``` -------------------------------- ### GET /v1/template Source: https://helena.readme.io/reference/get_v1-template Retrieves a paginated list of message templates. Supports various filters for refining the search. ```APIDOC ## GET /v1/template ### Description Listagem paginada de modelos de mensagem. ### Method GET ### Endpoint https://api.helena.run/chat/v1/template ### Parameters #### Query Parameters - **Archived** (boolean) - Optional - Filtro por modelos de mensagem arquivados. - **Name** (string) - Optional - Filtro por nome do modelo de mensagem. - **SearchableText** (string) - Optional - Filtro por conteúdo do modelo de mensagem. - **ChannelId** (string (uuid)) - Optional - Filtro por id do canal. - **ApprovedOnly** (boolean) - Optional - Filtro por status do modelo de mensagem. - **Type** (string) - Optional - Filtro por tipo do modelo de mensagem. Enum: [QUICKREPLY, ATTENDANCE, CAMPAIGN] - **IncludeDetails** (array of strings) - Optional - Detalhes que devem ser incluidos na resposta. Enum: [All, Params, File, Interactive] - **CreatedAt.Before** (string (date-time)) - Optional - Limite superior de busca, sempre em fuso horário UTM. - **CreatedAt.After** (string (date-time)) - Optional - Limite inferior de busca, sempre em fuso horário UTM. - **UpdatedAt.Before** (string (date-time)) - Optional - Limite superior de busca, sempre em fuso horário UTM. - **UpdatedAt.After** (string (date-time)) - Optional - Limite inferior de busca, sempre em fuso horário UTM. - **PageNumber** (integer) - Optional - Número da página a ser obtida. Default: 1 - **PageSize** (integer) - Optional - Tamanho da página a ser obtida. Default: 15 - **OrderBy** (string) - Optional - Nome do campo para ser utilizado como pivô da ordenação. - **OrderDirection** (string) - Optional - Determina se a ordenação deve ser crescente ou decrescente. Enum: [ASCENDING, DESCENDING] ### Response #### Success Response (200) (Response structure not fully defined in the provided OpenAPI snippet) #### Response Example (No example provided in the OpenAPI snippet) ``` -------------------------------- ### GET /v1/chatbot - List Chatbots Source: https://helena.readme.io/reference/get_v1-chatbot Retrieves a list of chatbots with various filtering, pagination, and sorting options. ```APIDOC ## GET /v1/chatbot ### Description Lists available chatbots. Supports filtering by name, type, channel, department, publication status, automation usage, and creation/update times. Allows for pagination and ordering. ### Method GET ### Endpoint /v1/chatbot ### Parameters #### Query Parameters - **Name** (string) - Optional - Filter by chatbot name. - **Types** (array of strings) - Optional - Filter by chatbot usage type. Allowed values: "Reactive", "Automation". Can specify multiple. - **ChannelIds** (array of strings (uuid)) - Optional - Filter by channel ID. Can specify multiple. - **DefaultDepartmentIds** (array of strings (uuid)) - Optional - Filter by default department ID. Can specify multiple. - **PublishStatuses** (array of strings) - Optional - Filter by publication status. Allowed values: "Not_Published", "Publishing", "Ready", "Failed". Can specify multiple. - **AutomationUsages** (array of strings) - Optional - Filter by automation availability. Allowed values: "Api", "Manual", "Campaign", "Sequence". Can specify multiple. - **CreatedAt.Before** (string (date-time)) - Optional - Upper limit for creation time (UTC). - **CreatedAt.After** (string (date-time)) - Optional - Lower limit for creation time (UTC). - **UpdatedAt.Before** (string (date-time)) - Optional - Upper limit for update time (UTC). - **UpdatedAt.After** (string (date-time)) - Optional - Lower limit for update time (UTC). - **PageNumber** (integer) - Optional - Page number for pagination (default: 1, min: 0, max: 2147483647). - **PageSize** (integer) - Optional - Number of items per page (default: 15, min: 1, max: 100). - **OrderBy** (string) - Optional - Field to use for sorting. - **OrderDirection** (string) - Optional - Direction of sorting (e.g., 'asc', 'desc'). ### Response #### Success Response (200) - **Example**: `{ "data": [ { "id": "string (uuid)", "name": "string", "types": [ "Reactive" ], "channelId": "string (uuid)", "defaultDepartmentId": "string (uuid)", "publishStatus": "Ready", "automationUsage": "Api", "createdAt": "string (date-time)", "updatedAt": "string (date-time)" } ], "pageNumber": 0, "pageSize": 0, "totalRecords": 0 }` #### Error Response (400) - **Example**: `{ "errors": [ { "message": "string" } ] }` ``` -------------------------------- ### Authorization Header Usage Source: https://helena.readme.io/reference/delete_v1-company-id-tokens-tokenid Instructions for setting up the Authorization header using a permanent token. ```APIDOC ## Authorization Header Usage ### Description Utilize o token permanente que foi gerado para sua conta na seção de integrações. No campo abaixo, insira 'Bearer [token]' sem as aspas e sem os colchetes. ### Method Not Applicable (This describes a header, not a specific endpoint) ### Endpoint Not Applicable ### Parameters #### Header Parameters - **Authorization** (string) - Required - The authorization token in the format 'Bearer [token]'. ### Request Example ``` Authorization: Bearer pn_h4ggkn0PbulUOPlIwP8w5y0QAHPwt0Shmkp5B6fGmrQ ``` ### Response Not Applicable (This describes a header, not a specific endpoint response) ``` -------------------------------- ### Resposta de Endpoint Paginado em JSON Source: https://helena.readme.io/reference/pagina%C3%A7%C3%A3o Estrutura de resposta esperada para endpoints que utilizam paginação. Inclui informações sobre a página atual, tamanho da página, total de páginas e itens, e se há mais páginas disponíveis. ```json { "pageNumber": 1, "pageSize": 50, "totalPages": 5, "totalItems": 250, "hasMorePages": true, "items:" [{...}], ... } ``` -------------------------------- ### Authentication Source: https://helena.readme.io/reference/post_v1-scheduled-message Information on how to authenticate API requests using Bearer tokens. ```APIDOC ## Authentication ### Bearer Token Authentication **Type:** API Key **Description:** Use the permanent token generated for your account in the integrations section. In the field below, enter 'Bearer [token]' without quotes or brackets. Example: 'Bearer pn_h4ggkn0PbulUOPlIwP8w5y0QAHPwt0Shmkp5B6fGmrQ'. **In:** header **Name:** Authorization ``` -------------------------------- ### Company Account DTO Source: https://helena.readme.io/reference/post_v1-company-id-active Data Transfer Object representing a company account in the system, including contact information, setup status, and configuration. ```APIDOC ## Company Account DTO ### Description Represents a company account within the system, containing various details about the account's configuration and status. ### Properties - **phone** (string) - Optional - Formatted phone number. - **email** (string) - Optional - Contact email address. - **defaultDepartmentId** (string) - Optional - ID of the default department (UUID format). - **address** (AddressDataDTO) - Optional - Address details associated with the company. - **setupStatus** (string) - Optional - The setup status of the account. Possible values: DEMO, ONBOARDING, PRODUCTION, DELAYED, SUSPENDED, CANCELED. ``` -------------------------------- ### Company Account DTO Source: https://helena.readme.io/reference/get_v1-company-id Data Transfer Object representing a company account in the system. It includes details like phone number, email, setup status, and associated configuration. ```APIDOC ## Company Account Data Transfer Object (DTO) ### Description DTO representing a company account in the system. ### Properties - **phoneNumber** (string) - Nullable - Formatted phone number. - **email** (string) - Nullable - Contact email. - **defaultDepartmentId** (string) - Nullable - ID of the default department (format: uuid). - **address** (object) - The address details of the company (refer to AddressDataDTO). - **setupStatus** (string) - Enum: ["DEMO", "ONBOARDING", "PRODUCTION", "DELAYED", "SUSPENDED", "CANCELED"] - Account setup status. - **config** (object) - The public configuration for the company (refer to PublicCompanyConfigDTO). ``` -------------------------------- ### Create Company API Source: https://helena.readme.io/reference/post_v1-company This endpoint allows the creation of a new company account. You can specify the company's legal and trading name, document details, owner information, category, type, status, and select available applications and resources. It also supports custom configurations. ```APIDOC ## POST /api/companies ### Description Creates a new company account with specified details. ### Method POST ### Endpoint /api/companies ### Parameters #### Request Body - **documentType** (string) - Required - Enum: ["CPF", "CNPJ"] - Document type (CPF or CNPJ). - **documentId** (string) - Optional - Document number (CPF or CNPJ). - **legalName** (string) - Optional - Legal name of the company. - **name** (string) - Optional - Trading name of the company. - **owner** (object) - Required - Owner details of the company. - **name** (string) - Optional - Owner's name. - **email** (string) - Optional - Owner's email. - **phoneNumber** (string) - Optional - Owner's phone number. - **category** (string) - Optional - Company category. - **customCategory** (string) - Optional - Custom company category. - **type** (string) - Required - Enum: ["UNDEFINED", "MEI", "LIMITED", "INDIVIDUAL", "ASSOCIATION"] - Account type. - **status** (string) - Required - Enum: ["DEMO", "ONBOARDING", "PRODUCTION", "DELAYED", "SUSPENDED", "CANCELED"] - Account status. - **apps** (array) - Optional - List of enabled applications. - Items (string) - Enum: ["MESSAGE_DELAY", "SESSION_REASON", "SESSION_DISTRIBUTION", "CONTACT_PORTFOLIO", "PAYMENT", "WEBHOOK", "CAMPAIGN", "PANEL", "DIALOG", "SEQUENCE", "TRANSCRIPTION", "AI_AGENT", "SCHEDULED_MESSAGE", "GROUP"] - **resourcers** (array) - Optional - List of enabled resources. - Items (string) - Enum: ["WEBHOOK_API", "CUSTOM_FIELDS", "INSTA_MESSENGER_CHANNELS", "UNOFFICIAL_CHANNELS_ENABLED"] - **config** (object) - Optional - Company configuration settings. - **instaMessengerChannels** (integer) - Optional - Quantity of Messenger channels included. - **sequences** (integer) - Optional - Quantity of sequences included. - **aiAgents** (integer) - Optional - Quantity of AI agents included. ### Request Example ```json { "documentType": "CNPJ", "documentId": "12345678000199", "legalName": "Empresa Exemplo Ltda.", "name": "Exemplo Corp", "owner": { "name": "João Silva", "email": "joao.silva@example.com", "phoneNumber": "+5511987654321" }, "category": "Technology", "type": "LIMITED", "status": "ONBOARDING", "apps": [ "MESSAGE_DELAY", "CAMPAIGN", "AI_AGENT" ], "resourcers": [ "WEBHOOK_API", "CUSTOM_FIELDS" ], "config": { "instaMessengerChannels": 10, "sequences": 5, "aiAgents": 3 } } ``` ### Response #### Success Response (200) - **companyId** (string) - The unique identifier for the created company. - **message** (string) - Confirmation message of successful creation. #### Response Example ```json { "companyId": "cmp_abcdef1234567890", "message": "Company created successfully." } ``` ``` -------------------------------- ### Concatenar mensagens de áudio transcritas com JavaScript Source: https://helena.readme.io/reference/2-processar-audios Este snippet JavaScript concatena o texto de múltiplas mensagens de áudio transcritas e o sessionId de uma resposta de webhook anterior. Ele é útil para unificar o conteúdo de áudio antes de enviá-lo a um assistente de IA. ```javascript var text = ""; var sessionId = $('Webhook').first().json.body.sessionId; for (const item of $input.all()) { text += item.json.text + " \n"; } return { "text": text, "sessionId": sessionId }; ``` -------------------------------- ### POST /send Source: https://helena.readme.io/reference/post_v1-message-send Send a quick message to a recipient. This endpoint allows for detailed configuration of the message, including sender information, recipient, message body, and optional assignments for bots, departments, and users. ```APIDOC ## POST /send ### Description Send a quick message to a recipient. This endpoint allows for detailed configuration of the message, including sender information, recipient, message body, and optional assignments for bots, departments, and users. ### Method POST ### Endpoint /send ### Parameters #### Query Parameters None #### Request Body - **from** (string) - Optional - Phone number of the channel registered in the account. - **to** (string) - Required - Phone number of the recipient. - **botId** (string) - Optional - ID of the bot that will be activated after the contact's response. Format: uuid. - **body** (object) - Required - The message content. See `PublicQuickSendBodyDTO` for details. - **department** (object) - Optional - Department details for the message. See `PublicQuickSendDepartmentDTO` for details. - **user** (object) - Optional - User details for the message. See `PublicQuickSendUserDTO` for details. - **options** (object) - Optional - Additional options for the message. See `PublicQuickSendOptionsDTO` for details. ### Request Example ```json { "from": "+1234567890", "to": "+1987654321", "botId": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "body": { "type": "text", "text": "Hello! This is a test message." }, "department": { "id": "dept-123", "name": "Support" }, "user": { "id": "user-456", "name": "John Doe", "email": "john.doe@example.com", "phoneNumber": "+1112223333" }, "options": { "sendAt": "2023-10-27T10:00:00Z" } } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the message was sent successfully. #### Response Example ```json { "message": "Quick message sent successfully." } ``` ``` -------------------------------- ### Requisição de Paginação em JSON Source: https://helena.readme.io/reference/pagina%C3%A7%C3%A3o Exemplo de como enviar parâmetros de paginação (pageNumber e pageSize) no corpo de uma requisição JSON para endpoints de listagem. pageNumber define a página desejada e pageSize define o número de itens por página, com um máximo de 100. ```json { "pageNumber": 1, "pageSize": 50, ... } ``` -------------------------------- ### PublicReqQuickSendMessageDTO Source: https://helena.readme.io/reference/post_v1-message-send-sync Represents the request body for sending a quick message. It includes recipient details, message content, and optional bot/department/user information. ```APIDOC ## PublicReqQuickSendMessageDTO ### Description This DTO is used for sending quick messages. It requires the message body and the recipient's phone number. Optional fields include the sender's phone number, bot ID, department, user, and other options. ### Method POST (Assumed, as it's a request body definition for sending a message) ### Endpoint `/send/quickmessage` (Example endpoint, actual endpoint may vary) ### Parameters #### Request Body - **from** (string) - Optional - Número de telefone do canal cadastrado na conta. - **to** (string) - Required - Número de telefone do destinatário. - **botId** (string) - Optional - ID do bot que será ativado após a resposta do contato. (format: uuid) - **body** (object) - Required - Refers to `#/components/schemas/PublicQuickSendBodyDTO`. - **department** (object) - Optional - Refers to `#/components/schemas/PublicQuickSendDepartmentDTO`. - **user** (object) - Optional - Refers to `#/components/schemas/PublicQuickSendUserDTO`. - **options** (object) - Optional - Refers to `#/components/schemas/PublicQuickSendOptionsDTO` ### Request Example ```json { "from": "+1234567890", "to": "+1987654321", "botId": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "body": { "text": "Hello! How can I help you today?" } } ``` ### Response #### Success Response (200) - **messageId** (string) - The unique identifier of the sent message. - **status** (string) - The status of the message delivery (e.g., "sent", "delivered"). #### Response Example ```json { "messageId": "msg_12345abcde", "status": "sent" } ``` ``` -------------------------------- ### List Accounts Source: https://helena.readme.io/reference/contas Retrieves a paginated list of accounts with options for filtering, sorting, and including details. Authentication is required using a Partner Token. ```APIDOC ## GET /core/v1/company ### Description Lists accounts with pagination and filtering capabilities. Requires a Partner Token for authentication, sent in the `Authorization` header as `Bearer `. ### Method GET ### Endpoint https://api.helena.run/core/v1/company ### Parameters #### Query Parameters - **SearchableText** (string) - Optional - Text to search for. - **OnlyInactive** (boolean) - Optional - Filter for inactive accounts only. - **Status** (string) - Optional - Status of the account. Allowed values: `SANDBOX`, `PRODUCTION`. - **SetupStatus** (string) - Optional - Setup status of the account. Allowed values: `SUBSCRIPTION_PENDING`, `SUBSCRIPTION_CREATED`, `PENDING_CONFIG`, `COMPLETED`, `SUBSCRIPTION_ARREARS`, `SUBSCRIPTION_SUSPENDED`, `SUBSCRIPTION_CANCELED`. - **IncludeDetails** (array of strings) - Optional - Details to include in the response (e.g., `ADD`). - **CreatedAt.Before** (date-time) - Optional - Upper bound for creation date (UTM). - **CreatedAt.After** (date-time) - Optional - Lower bound for creation date (UTM). - **UpdatedAt.Before** (date-time) - Optional - Upper bound for update date (UTM). - **UpdatedAt.After** (date-time) - Optional - Lower bound for update date (UTM). - **PageNumber** (int32) - Optional - Page number to retrieve. Defaults to 1. - **PageSize** (int32) - Optional - Number of items per page. Defaults to 15. Allowed range: 1 to 100. - **OrderBy** (string) - Optional - Field name to use for sorting. - **OrderDirection** (string) - Optional - Direction of sorting. Allowed values: `ASCENDING`, `DESCENDING`. ### Request Example ```json { "query": "?SearchableText=example&Status=PRODUCTION&PageSize=20" } ``` ### Response #### Success Response (200) - **pageNumber** (int32) - The current page number. - **pageSize** (int32) - The number of items per page. - **orderBy** (string | null) - The field used for sorting. - **orderDirection** (string | null) - The direction of sorting (`ASCENDING` or `DESCENDING`). - **items** (array of objects | null) - A list of account objects. - **id** (uuid) - Unique identifier of the account. - **createdAt** (date-time) - Date the account was created. - **updatedAt** (date-time) - Date the account was last updated. - **active** (boolean) - Indicates if the account is active. - **legalName** (string | null) - The legal name of the company. - **documentType** (string) - Type of document (`CPF` or `CNPJ`). - **documentId** (string | null) - Document number (CPF or CNPJ). - **name** (string | null) - Trade name of the company. - **partnerName** (string | null) - Name of the associated partner. - **ownerId** (uuid | null) - ID of the account owner. - **category** (string | null) - Company category. - **customCategory** (string | null) - Custom company category. - **type** (string) - Type of account (`UNDEFINED`, `MEI`, `LIMITED`, `INDIVIDUAL`, `ASSOCIATION`). - **invoiceType** (string) - Type of invoicing (`HELENA`, `DIALOG360`). - **partnerId** (uuid | null) - ID of the partner. - **pictureUrl** (string | null) - URL of the profile picture. - **wppNumber** (string | null) - WhatsApp number. - **phoneNumber** (string | null) - Phone number. - **phoneNumberFormatted** (string | null) - Formatted phone number. - **email** (string | null) - Contact email. - **defaultDepartmentId** (uuid | null) - ID of the default department. - **address** (object) - Address details of the account. - **setupStatus** (string) - Setup status of the account (`DEMO`, `ONBOARDING`, `PRODUCTION`, `DELAYED`, `SUSPENDED`, `CANCELED`). - **config** (object) - Account configuration details. - **totalItems** (int32) - Total number of items available. - **totalPages** (int32) - Total number of pages. - **hasMorePages** (boolean) - Indicates if there are more pages. #### Response Example ```json { "pageNumber": 1, "pageSize": 15, "orderBy": null, "orderDirection": null, "items": [ { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "createdAt": "2023-10-27T10:00:00Z", "updatedAt": "2023-10-27T11:00:00Z", "active": true, "legalName": "Example Corp", "documentType": "CNPJ", "documentId": "12345678000199", "name": "Example Company", "partnerName": "Partner A", "ownerId": "f0e1d2c3-b4a5-6789-0123-456789abcdef", "category": "Technology", "customCategory": "SaaS", "type": "LIMITED", "invoiceType": "HELENA", "partnerId": "c1b2a3d4-e5f6-7890-1234-567890abcd", "pictureUrl": "https://example.com/image.png", "wppNumber": "+5511987654321", "phoneNumber": "+551133334444", "phoneNumberFormatted": "(11) 3333-4444", "email": "contact@example.com", "defaultDepartmentId": "d1c2b3a4-e5f6-7890-1234-567890abc1", "address": {}, "setupStatus": "PRODUCTION", "config": {} } ], "totalItems": 50, "totalPages": 4, "hasMorePages": true } ``` ``` -------------------------------- ### PublicUtmDTO Source: https://helena.readme.io/reference/post_v1-message-send-sync Represents UTM (Urchin Tracking Module) parameters used for tracking campaign effectiveness. ```APIDOC ## PublicUtmDTO ### Description This DTO captures UTM parameters for marketing campaign tracking. It includes various fields to identify the source, medium, campaign, and other details of the traffic. ### Method GET/POST/PUT (Usage depends on the specific endpoint where this DTO is applied) ### Endpoint (Endpoint varies based on usage) ### Parameters #### Query Parameters / Request Body Fields - **sourceId** (string) - Optional - Read-only. Unique identifier for the source. - **source** (string) - Optional - The source of the traffic (e.g., 'google', 'facebook'). - **clid** (string) - Optional - Read-only. Client ID associated with the UTM parameters. - **medium** (string) - Optional - The medium used for the campaign (e.g., 'cpc', 'organic'). - **campaign** (string) - Optional - The name of the campaign. - **content** (string) - Optional - Used to differentiate ads or links that point to the same URL. - **headline** (string) - Optional - The headline associated with the ad or link. - **term** (string) - Optional - The search term used for paid search campaigns. - **referralUrl** (string) - Optional - The URL from which the user was referred. ### Request Example (Illustrative, if used in a query parameter) `?source=google&medium=cpc&campaign=summer_sale&term=running+shoes` ### Response (Response structure depends on the endpoint using this DTO) #### Success Response (200) (Fields will reflect the UTM parameters as stored or processed by the API) #### Response Example (Illustrative) ```json { "sourceId": "src_xyz789", "source": "google", "clid": "client_abc", "medium": "cpc", "campaign": "summer_sale", "term": "running shoes" } ``` ``` -------------------------------- ### Pagination Request and Response Source: https://helena.readme.io/reference/pagina%C3%A7%C3%A3o Details on how to control and interpret pagination in API listing endpoints. ```APIDOC ## Pagination Overview Many entity listing endpoints support pagination, controlled via `pageNumber` and `pageSize`. ### Request Parameters These parameters are typically sent in the request body for listing endpoints. #### Request Body - **pageNumber** (integer) - Required - The page number to retrieve. - **pageSize** (integer) - Required - The number of items to return per page. Maximum value is 100. **Note:** Changing `pageSize` in subsequent requests will yield different results for `pageNumber`. It is recommended to maintain a constant `pageSize` when iterating through `pageNumber`. ### Request Example ```json { "pageNumber": 1, "pageSize": 50 } ``` ### Response Structure The response for paginated endpoints includes information about the current page and total items available. #### Success Response (200) - **pageNumber** (integer) - The page number that was retrieved. - **pageSize** (integer) - The page size that was used for the current request. - **totalPages** (integer) - The total number of pages available for the current query. - **totalItems** (integer) - The total number of items available for the current query. - **hasMorePages** (boolean) - Indicates if there are more pages to consult (`true` if `pageNumber` is less than `totalPages`). - **items** (array) - An array of the entities returned, with a size less than or equal to `pageSize`. ### Response Example ```json { "pageNumber": 1, "pageSize": 50, "totalPages": 5, "totalItems": 250, "hasMorePages": true, "items": [ {...} ] } ``` ``` -------------------------------- ### Authentication Source: https://helena.readme.io/reference/delete_v1-panel-card-cardid-note-noteid This section details how to authenticate your requests using a permanent token generated in the integrations section. ```APIDOC ## Authorization Header ### Description Utilize o token permanente que foi gerado para sua conta na seção de integrações. No campo abaixo, insira 'Bearer [token]' sem as aspas e sem os colchetes. ### Method Any ### Endpoint Any ### Parameters #### Header Parameters - **Authorization** (string) - Required - 'Bearer [token]' ``` -------------------------------- ### Create Contact API Source: https://helena.readme.io/reference/post_v1-contact This endpoint allows you to create a new contact. You can provide various details such as names, emails, phone numbers, and associated portfolios or sequences. The API also supports options for updating existing contacts (upsert), specifying which fields to update, and how to handle tags during an upsert operation. It can also return the existing contact if found without updating. ```APIDOC ## POST /contacts ### Description Creates a new contact or updates an existing one based on the provided options. ### Method POST ### Endpoint /contacts ### Parameters #### Request Body - **name** (string) - Required - Full name of the contact. - **email** (string) - Optional - Email address of the contact. - **phoneNumber** (string) - Optional - Phone number of the contact. - **portfolioIds** (array[string]) - Optional - IDs of the portfolios assigned. - **portfolioNames** (array[string]) - Optional - Names of the portfolios assigned. This field will be ignored if `PortfolioIds` is set. - **sequenceIds** (array[string]) - Optional - IDs of the sequences assigned. - **customFields** (object) - Optional - Key-value object for custom fields. Keys should match custom field names, and values should have compatible data types. Incompatible items will be ignored. - **metadata** (object) - Optional - Key-value object for relevant metadata. Can be used to add, update, or remove metadata. - **options** (object) - Optional - Options for contact creation and upsert behavior. - **upsert** (boolean) - Optional - If true, updates the contact if it already exists. - **upsertFields** (array[string]) - Optional - Specifies which fields to update during an upsert. If not provided, all fields are affected. - **upsertTagOperation** (string) - Optional - Defines tag handling during upsert. Options: "INSERTIFNOTEXISTS", "DELETEIFEXISTS", "REPLACEALL" (default). - **getIfExists** (boolean) - Optional - If true, returns the existing contact without updating if found. ### Request Example ```json { "name": "John Doe", "email": "john.doe@example.com", "phoneNumber": "+1234567890", "portfolioIds": ["portfolio-123"], "options": { "upsert": true, "upsertFields": ["Email", "PhoneNumber"], "upsertTagOperation": "REPLACEALL" } } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the contact. - **name** (string) - The full name of the contact. - **email** (string) - The email address of the contact. - **phoneNumber** (string) - The phone number of the contact. - **portfolioIds** (array[string]) - IDs of the portfolios assigned. - **sequenceIds** (array[string]) - IDs of the sequences assigned. - **customFields** (object) - Key-value object of custom fields. - **metadata** (object) - Key-value object of metadata. - **createdAt** (string) - Timestamp when the contact was created. - **updatedAt** (string) - Timestamp when the contact was last updated. #### Response Example ```json { "id": "contact-abcde", "name": "John Doe", "email": "john.doe@example.com", "phoneNumber": "+1234567890", "portfolioIds": ["portfolio-123"], "sequenceIds": [], "customFields": {}, "metadata": {}, "createdAt": "2023-10-27T10:00:00Z", "updatedAt": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### Authentication Source: https://helena.readme.io/reference/get_v1-message-id Details on how to authenticate API requests using a Bearer token. ```APIDOC ## Authentication ### Bearer Token Authentication Requests to the API must be authenticated using a Bearer token. **Method:** API Key **Name:** Authorization **In:** Header **Description:** Utilize the permanent token generated for your account in the integrations section. In the Authorization header field, insert 'Bearer [token]' without quotes or brackets. **Example:** `Authorization: Bearer pn_h4ggkn0PbulUOPlIwP8w5y0QAHPwt0Shmkp5B6fGmrQ` ``` -------------------------------- ### Security Scheme: Bearer Authentication Source: https://helena.readme.io/reference/post_v1-message-send-sync Details on how to authenticate requests using a Bearer token. ```APIDOC ## Security Scheme: Bearer Authentication ### Description This API uses Bearer token authentication. You need to include your API token in the `Authorization` header of your requests. ### Method All API requests requiring authentication. ### Endpoint All API endpoints. ### Parameters #### Headers - **Authorization** (string) - Required - The authentication token. Format: `Bearer [YOUR_API_TOKEN]`. ### Request Example ```bash curl -X GET "https://api.example.com/resource" \ -H "Authorization: Bearer pn_h4ggkn0PbulUOPlIwP8w5y0QAHPwt0Shmkp5B6fGmrQ" \ -H "Content-Type: application/json" ``` ### Response Authentication-related responses will typically be HTTP status codes like 401 (Unauthorized) if the token is invalid or missing. ``` -------------------------------- ### Authentication Header Source: https://helena.readme.io/reference/get_v1-panel-card This section details the authorization header required for API requests. It specifies the format for using a permanent token generated from the integrations section. ```APIDOC ## Authorization Header ### Description Utilize o token permanente que foi gerado para sua conta na seção de integrações. No campo abaixo, insira 'Bearer [token]' sem as aspas e sem os colchetes. Exemplo: 'Bearer pn_h4ggkn0PbulUOPlIwP8w5y0QAHPwt0Shmkp5B6fGmrQ'. ### Method ### Endpoint ### Parameters #### Header Parameters - **Authorization** (string) - Required - Use 'Bearer [token]' where [token] is your permanent token. ``` -------------------------------- ### Authentication Source: https://helena.readme.io/reference/put_v1-scheduled-message-id This section details how to authenticate using a permanent token. You should use a 'Bearer' token generated from the integrations section. The format is 'Bearer [token]'. ```APIDOC ## Authentication ### Description Utilize o token permanente que foi gerado para sua conta na seção de integrações. No campo abaixo, insira 'Bearer [token]' sem as aspas e sem os colchetes. Exemplo: 'Bearer pn_h4ggkn0PbulUOPlIwP8w5y0QAHPwt0Shmkp5B6fGmrQ'. ### Method [Not specified, but typically POST or GET for authentication-related endpoints] ### Endpoint [Not specified] ### Parameters #### Header Parameters - **Authorization** (string) - Required - 'Bearer [token]' ### Request Example ```json { "Authorization": "Bearer pn_h4ggkn0PbulUOPlIwP8w5y0QAHPwt0Shmkp5B6fGmrQ" } ``` ### Response #### Success Response (200) [Details not provided in the input] #### Response Example [Details not provided in the input] ``` -------------------------------- ### Authentication Header Source: https://helena.readme.io/reference/get_v1-session-id This section details how to authenticate your requests using a permanent token generated from your account's integrations section. You should prepend 'Bearer ' to your token. ```APIDOC ## Authorization Header ### Description Utilize o token permanente que foi gerado para sua conta na seção de integrações. No campo abaixo, insira 'Bearer [token]' sem as aspas e sem os colchetes. ### Method (Implied by usage in other endpoints, typically included in request headers for all applicable endpoints) ### Endpoint (Applies to all relevant endpoints) ### Parameters #### Header Parameters - **Authorization** (string) - Required - 'Bearer [token]' ### Request Example ``` { "Authorization": "Bearer YOUR_PERMANENT_TOKEN" } ``` ### Response (N/A for header definition, actual responses depend on the specific endpoint) ``` -------------------------------- ### Obter Mensagem Agendada por ID Source: https://helena.readme.io/reference/get_v1-scheduled-message-id Retorna os detalhes de uma mensagem agendada específica. ```APIDOC ## GET /websites/helena_readme_io_reference/scheduled_messages/{id} ### Description Retorna os detalhes de uma mensagem agendada específica. ### Method GET ### Endpoint /websites/helena_readme_io_reference/scheduled_messages/{id} ### Parameters #### Path Parameters - **id** (string) - Required - O ID da mensagem agendada a ser recuperada. ### Request Example (Nenhum corpo de requisição para GET) ### Response #### Success Response (200) - **id** (string) - O ID da mensagem agendada. - **content** (string) - O conteúdo da mensagem. - **scheduled_at** (string) - A data e hora em que a mensagem foi agendada (formato ISO 8601). #### Response Example { "id": "msg_abc123", "content": "Lembrete: Reunião amanhã às 10h.", "scheduled_at": "2023-10-27T10:00:00Z" } ``` -------------------------------- ### POST /core/v2/file - Upload File Metadata Source: https://helena.readme.io/reference/get_v2-file Submit file metadata to receive a pre-signed URL for uploading file content. After uploading the file content using the provided URL (via PUT request), you must call this endpoint again to confirm the upload. ```APIDOC ## POST /core/v2/file ### Description Send file metadata to obtain a pre-signed URL for uploading file content. After uploading the file content using the PUT method to the provided URL, make a subsequent call to this endpoint to confirm the upload. ### Method POST ### Endpoint /core/v2/file ### Parameters #### Request Body - **fileName** (string) - Required - The name of the file. - **contentType** (string) - Required - The MIME type of the file. - **fileSize** (integer) - Required - The size of the file in bytes. ### Request Example ```json { "fileName": "example.jpg", "contentType": "image/jpeg", "fileSize": 102400 } ``` ### Response #### Success Response (200) - **uploadUrl** (string) - The URL to upload the file content to. - **fileId** (string) - The unique identifier for the uploaded file. #### Response Example ```json { "uploadUrl": "https://example.com/upload/path/to/file?signature=...", "fileId": "abc123xyz789" } ``` ```