openapi: 3.2.0 info: contact: email: hello@entergram.com name: Entergram description: Secure, workspace-scoped API for Entergram PRO. Use API keys created in Settings > Developers to access workspace metadata, accounts, contacts, groups, chats, custom fields, and tickets through a stable, documented contract. title: Entergram Public Live Chats API version: v1 security: - ApiKeyAuth: [] tags: - description: Actor-owned live Telegram transport view used for current chat discovery before message operations. name: Live Chats paths: /v1/live/chats: get: description: Returns the actor-owned live Telegram transport view. Use this when you need current transport discovery or want to choose the right account before message operations. For predictable pagination across multiple accounts, pass `account_id`. This is not the shared CRM workspace DB view. operationId: list-live-chats parameters: - description: Optional connected account id filter. Pass this for deterministic pagination across multiple accounts. explode: false in: query name: account_id schema: description: Optional connected account id filter. Pass this for deterministic pagination across multiple accounts. examples: - acct_demo_123 type: string - description: Number of live chats to return per page. explode: false in: query name: limit schema: default: 50 description: Number of live chats to return per page. examples: - 50 format: int64 maximum: 200 minimum: 1 type: integer - description: Zero-based offset for pagination. explode: false in: query name: offset schema: default: 0 description: Zero-based offset for pagination. examples: - 0 format: int64 minimum: 0 type: integer responses: '200': content: application/json: schema: $ref: '#/components/schemas/LiveChatsEnvelope' description: OK '401': content: application/problem+json: schema: $ref: '#/components/schemas/ErrorModel' description: Unauthorized '403': content: application/problem+json: schema: $ref: '#/components/schemas/ErrorModel' description: Forbidden '422': content: application/problem+json: schema: $ref: '#/components/schemas/ErrorModel' description: Unprocessable Entity '500': content: application/problem+json: schema: $ref: '#/components/schemas/ErrorModel' description: Internal Server Error '502': content: application/problem+json: schema: $ref: '#/components/schemas/ErrorModel' description: Bad Gateway '503': content: application/problem+json: schema: $ref: '#/components/schemas/ErrorModel' description: Service Unavailable summary: List actor-owned live Telegram chats tags: - Live Chats x-required-scopes: - chats.read - accounts.read /v1/live/chats/{chat_id}: get: description: Returns a live Telegram transport row for a canonical chat id and explicit connected account. Use this when you need the live transport snapshot for one account-specific chat before message operations. operationId: get-live-chat parameters: - description: Connected account id that owns the live transport view for this chat. explode: false in: query name: account_id required: true schema: description: Connected account id that owns the live transport view for this chat. examples: - acct_demo_123 type: string - description: Canonical Telegram chat identifier. in: path name: chat_id required: true schema: description: Canonical Telegram chat identifier. examples: - '-1000001234567' type: string responses: '200': content: application/json: schema: $ref: '#/components/schemas/LiveChatEnvelope' description: OK '400': content: application/problem+json: schema: $ref: '#/components/schemas/ErrorModel' description: Bad Request '401': content: application/problem+json: schema: $ref: '#/components/schemas/ErrorModel' description: Unauthorized '403': content: application/problem+json: schema: $ref: '#/components/schemas/ErrorModel' description: Forbidden '404': content: application/problem+json: schema: $ref: '#/components/schemas/ErrorModel' description: Not Found '422': content: application/problem+json: schema: $ref: '#/components/schemas/ErrorModel' description: Unprocessable Entity '500': content: application/problem+json: schema: $ref: '#/components/schemas/ErrorModel' description: Internal Server Error '502': content: application/problem+json: schema: $ref: '#/components/schemas/ErrorModel' description: Bad Gateway '503': content: application/problem+json: schema: $ref: '#/components/schemas/ErrorModel' description: Service Unavailable summary: Get one actor-owned live Telegram chat tags: - Live Chats x-required-scopes: - chats.read - accounts.read components: schemas: ChatLastMessageSender: additionalProperties: false properties: displayName: description: Best available sender display name from the canonical snapshot. examples: - David Hngr type: - string - 'null' id: description: Telegram sender identifier when the canonical snapshot exposed it. examples: - '580876383' type: - string - 'null' required: - id - displayName type: object ErrorDetail: additionalProperties: false properties: location: description: Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id' type: string message: description: Error message text type: string value: description: The value at the given location type: object LiveChatsEnvelope: additionalProperties: false properties: data: $ref: '#/components/schemas/LiveChatsList' required: - data type: object LiveChatsList: additionalProperties: false properties: items: items: $ref: '#/components/schemas/LiveChatSummary' type: - array - 'null' pagination: $ref: '#/components/schemas/Pagination' required: - items - pagination type: object LiveChatEnvelope: additionalProperties: false properties: data: $ref: '#/components/schemas/LiveChatSummary' required: - data type: object Pagination: additionalProperties: false properties: hasMore: type: boolean limit: format: int64 type: integer nextOffset: format: int64 type: - integer - 'null' offset: format: int64 type: integer total: format: int64 type: integer required: - limit - offset - total - hasMore - nextOffset type: object ErrorModel: additionalProperties: false properties: detail: description: A human-readable explanation specific to this occurrence of the problem. examples: - Property foo is required but is missing. type: string errors: description: Optional list of individual error details items: $ref: '#/components/schemas/ErrorDetail' type: - array - 'null' instance: description: A URI reference that identifies the specific occurrence of the problem. examples: - https://example.com/error-log/abc123 format: uri type: string status: description: HTTP status code examples: - 400 format: int64 type: integer title: description: A short, human-readable summary of the problem type. This value should not change between occurrences of the error. examples: - Bad Request type: string type: default: about:blank description: A URI reference to human-readable documentation for the error. examples: - https://example.com/errors/example format: uri type: string type: object LiveChatSummary: additionalProperties: false properties: accountId: description: Connected account id that can access this live chat row. examples: - acct_demo_123 type: string accountName: description: Best available account label for the connected account. examples: - Ops Sample type: string email: description: Database overlay for the chat email field when a matching cached chat exists. examples: - ops@example.com type: - string - 'null' id: description: Composite live row identifier in the format :. examples: - acct_demo_123:-1000001234567 type: string lastMessage: $ref: '#/components/schemas/LiveChatLastMessage' description: Live Telegram last-message preview when available. phoneNumber: description: Phone number surfaced by Telegram for private chats when available. examples: - '+48123123123' type: - string - 'null' priority: description: Database overlay for the chat priority when a matching cached chat exists. examples: - Medium type: - string - 'null' telegramChatId: description: Canonical Telegram chat identifier used by message operations. examples: - '-1000001234567' type: string title: description: Best available live display name for the chat. examples: - Support Queue Alpha type: string type: description: Telegram chat type. examples: - group type: string unreadCount: description: Unread message count reported by the live transport. examples: - 4 format: int64 type: integer username: description: Telegram username when exposed by the transport. examples: - support_queue_alpha type: - string - 'null' required: - id - telegramChatId - accountId - accountName - title - type - username - phoneNumber - email - priority - unreadCount - lastMessage type: object LiveChatLastMessage: additionalProperties: false properties: date: description: Telegram timestamp for the last message when the transport exposed it. format: date-time type: - string - 'null' id: description: Telegram message identifier when available. examples: - '123456' type: - string - 'null' isOut: description: True for messages sent by the connected Telegram account; null when direction is unknown. type: - boolean - 'null' sender: $ref: '#/components/schemas/ChatLastMessageSender' description: Telegram sender identity when available. text: description: Telegram last-message preview text. examples: - Hello from Telegram type: string required: - id - text - date - isOut - sender type: object securitySchemes: ApiKeyAuth: description: Workspace-scoped PRO API key created in Entergram Settings > Developers. in: header name: X-API-Key type: apiKey x-entergram-scopes: - workspace.read - members.read - accounts.read - contacts.read - chats.read - chats.write - messages.read - messages.write - custom_fields.read - custom_fields.write - tickets.read - tickets.write - events.read - webhooks.read - webhooks.write