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 Accounts API version: v1 security: - ApiKeyAuth: [] tags: - description: Connected account inventory. name: Accounts paths: /v1/accounts: get: description: 'Operational account discovery, filtered by actor access and token scopes. Capabilities describe account access, not guaranteed Telegram chat permissions or live health; every operation reauthorizes access. Required scopes: `accounts.read`.' operationId: list-accounts responses: '200': content: application/json: schema: $ref: '#/components/schemas/AccountsEnvelope' description: OK default: content: application/problem+json: schema: $ref: '#/components/schemas/ErrorModel' description: Error summary: List Telegram accounts available to the authenticated actor tags: - Accounts x-required-scopes: - accounts.read components: schemas: 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 ConnectedAccountOwner: additionalProperties: false properties: displayName: type: - string - 'null' id: type: string required: - id - displayName type: object AccountsEnvelope: additionalProperties: false properties: data: $ref: '#/components/schemas/AccountsList' required: - data type: object AccountCapabilities: additionalProperties: false properties: manage: type: boolean read: type: boolean send: type: boolean required: - read - send - manage 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 AccountsList: additionalProperties: false properties: items: items: $ref: '#/components/schemas/ConnectedAccountSummary' type: - array - 'null' total: format: int64 type: integer required: - items - total type: object ConnectedAccountSummary: additionalProperties: false properties: analyticsConnectedAt: format: date-time type: - string - 'null' canonicalAccountId: type: string capabilities: $ref: '#/components/schemas/AccountCapabilities' chatCount: format: int64 type: integer color: type: - string - 'null' createdAt: format: date-time type: string displayName: type: - string - 'null' id: type: string identityVersion: type: string lastMessageDate: format: date-time type: - string - 'null' legacyAccountIds: items: type: string type: - array - 'null' legacyIdDeprecated: type: boolean owner: $ref: '#/components/schemas/ConnectedAccountOwner' phoneNumber: type: - string - 'null' platform: type: string routeAvailability: type: string telegramUserId: type: - string - 'null' userId: type: string username: type: string required: - id - userId - platform - username - displayName - phoneNumber - telegramUserId - color - createdAt - analyticsConnectedAt - chatCount - lastMessageDate - owner 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