openapi: 3.1.0 info: title: WhatsApp Business Management Analytics API description: The WhatsApp Business Management API enables programmatic management of WhatsApp Business Accounts, phone numbers, message templates, analytics, user assignments, product catalogs, and webhook subscriptions through the Meta Graph API. version: '21.0' contact: name: Meta Platform Support url: https://developers.facebook.com/support/ termsOfService: https://www.whatsapp.com/legal/business-terms servers: - url: https://graph.facebook.com/v21.0 description: Meta Graph API Production Server security: - bearerAuth: [] tags: - name: Analytics description: Retrieve conversation and template analytics paths: /{waba-id}/conversation_analytics: get: operationId: getConversationAnalytics summary: WhatsApp Get Conversation Analytics description: Retrieves conversation analytics for a WhatsApp Business Account. tags: - Analytics parameters: - $ref: '#/components/parameters/WabaId' - name: start in: query required: true description: Start time (Unix timestamp or YYYY-MM-DD) schema: type: string example: example_value - name: end in: query required: true description: End time (Unix timestamp or YYYY-MM-DD) schema: type: string example: example_value - name: granularity in: query required: true schema: type: string enum: - HALF_HOUR - DAILY - MONTHLY example: HALF_HOUR - name: phone_numbers in: query description: Filter by phone number IDs schema: type: array items: type: string - name: metric_types in: query schema: type: array items: type: string enum: - CONVERSATION - COST - name: conversation_categories in: query schema: type: array items: type: string enum: - AUTHENTICATION - MARKETING - UTILITY - SERVICE - REFERRAL_CONVERSION - name: dimensions in: query schema: type: array items: type: string enum: - CONVERSATION_CATEGORY - CONVERSATION_TYPE - COUNTRY - PHONE responses: '200': description: Analytics retrieved content: application/json: schema: $ref: '#/components/schemas/ConversationAnalytics' x-microcks-operation: delay: 0 dispatcher: FALLBACK /{waba-id}/template_analytics: get: operationId: getTemplateAnalytics summary: WhatsApp Get Template Analytics description: Retrieves analytics for specific message templates. tags: - Analytics parameters: - $ref: '#/components/parameters/WabaId' - name: start in: query required: true schema: type: string example: example_value - name: end in: query required: true schema: type: string example: example_value - name: granularity in: query required: true schema: type: string enum: - DAILY example: DAILY - name: template_ids in: query required: true description: Template IDs to analyze (max 10) schema: type: array maxItems: 10 items: type: string - name: metric_types in: query schema: type: array items: type: string enum: - SENT - DELIVERED - READ - CLICKED - COST responses: '200': description: Template analytics retrieved content: application/json: schema: $ref: '#/components/schemas/TemplateAnalytics' x-microcks-operation: delay: 0 dispatcher: FALLBACK components: schemas: TemplateAnalytics: type: object properties: template_analytics: type: object properties: data: type: array items: type: object properties: template_id: type: string data_points: type: array items: type: object properties: start: type: integer end: type: integer sent: type: integer delivered: type: integer read: type: integer clicked: type: integer cost: type: number ConversationAnalytics: type: object properties: conversation_analytics: type: object properties: data: type: array items: type: object properties: data_points: type: array items: type: object properties: start: type: integer end: type: integer conversation: type: integer cost: type: number parameters: WabaId: name: waba-id in: path required: true description: WhatsApp Business Account ID schema: type: string securitySchemes: bearerAuth: type: http scheme: bearer description: System User Token with whatsapp_business_management permission externalDocs: description: WhatsApp Business Management API Documentation url: https://developers.facebook.com/docs/whatsapp/business-management-api