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 Chat Commands API version: v1 security: - ApiKeyAuth: [] tags: - description: Telegram chat creation and group/channel management commands scoped to an explicit connected account. name: Chat Commands paths: /v1/live/chats/commands: post: description: Runs an allowlisted Telegram chat command through the selected connected account. Supports chat creation, member invitation/removal, management fetch, join requests, invite links, info/privacy updates, and default permissions updates. operationId: run-live-chat-command requestBody: content: application/json: schema: $ref: '#/components/schemas/CommandBody' required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/CommandEnvelope' 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 '409': content: application/problem+json: schema: $ref: '#/components/schemas/ErrorModel' description: Conflict '422': content: application/problem+json: schema: $ref: '#/components/schemas/ErrorModel' description: Unprocessable Entity '429': content: application/problem+json: schema: $ref: '#/components/schemas/ErrorModel' description: Too Many Requests '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 '504': content: application/problem+json: schema: $ref: '#/components/schemas/ErrorModel' description: Gateway Timeout summary: Run a Telegram chat creation or management command tags: - Chat Commands x-required-scopes: - chats.write - 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 CommandEnvelope: additionalProperties: false properties: data: $ref: '#/components/schemas/CommandResult' required: - data type: object CommandResult: additionalProperties: false properties: accountId: type: string chatId: type: string commandType: type: string result: additionalProperties: {} type: object required: - accountId - commandType type: object CommandBody: additionalProperties: false properties: accountId: description: Connected account id from the accounts endpoint. examples: - acct_demo_123 type: string chatId: description: Canonical Telegram chat id. Required for all commands except chat.create.group and chat.create.channel. examples: - '-1000001234567' type: string commandType: description: Allowed Telegram chat command type. examples: - chat.management.fetch type: string idempotencyKey: description: Optional client-supplied idempotency key for retries. examples: - chat-command-001 type: string payload: additionalProperties: {} description: Command payload using the ws-v2 field names, for example user_ids, user_id, chat_type, title, or protected_content. type: object required: - accountId - commandType 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 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