> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kakiyo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Campaign Analytics

> Get detailed analytics for a specific campaign

## Overview

Get detailed analytics and performance metrics for a specific campaign. This endpoint provides comprehensive insights into campaign performance, prospect engagement, and conversion metrics.

## Path Parameters

<ParamField path="campaignId" type="string" required>
  The unique identifier of the campaign to analyze
</ParamField>

## Use Cases

* **Campaign Performance Review**: Analyze individual campaign effectiveness
* **Optimization Insights**: Identify areas for campaign improvement
* **ROI Analysis**: Calculate return on investment for specific campaigns
* **A/B Testing**: Compare performance between different campaign strategies

## Response Structure

### Campaign Details

* Basic campaign information and configuration
* Current status and timeline

### Performance Metrics

* Prospect engagement statistics
* Message and response metrics
* Qualification and conversion rates

### Daily Activity Breakdown

* Day-by-day activity analysis
* Trend identification over time

### Status Distribution

* Breakdown of prospects by conversation status
* Qualification status analysis

## Example Response

```json theme={null}
{
  "campaign": {
    "id": "campaign_123",
    "name": "Q4 Enterprise Outreach",
    "status": "active",
    "createdAt": "2024-01-15T10:30:00Z",
    "agent": "agent_456",
    "product": "Enterprise Solution"
  },
  "metrics": {
    "totalProspects": 150,
    "totalMessages": 420,
    "totalQualified": 12,
    "totalAnswers": 35,
    "totalClosed": 8,
    "conversionRate": 8.0,
    "responseRate": 23.33,
    "qualificationRate": 34.29,
    "averageMessagesPerProspect": 2.8
  },
  "activity": {
    "dailyBreakdown": [
      {
        "date": "2024-01-20",
        "messages": 25,
        "responses": 4,
        "qualified": 1
      },
      {
        "date": "2024-01-19",
        "messages": 30,
        "responses": 6,
        "qualified": 2
      }
    ],
    "last7Days": {
      "messages": 180,
      "responses": 28,
      "qualified": 8
    }
  },
  "statusDistribution": {
    "pending": 85,
    "contacted": 45,
    "responded": 35,
    "qualified": 12,
    "closed": 8
  },
  "qualificationBreakdown": {
    "pending": 123,
    "qualified": 12,
    "disqualified": 15
  }
}
```

## Testing Example

```bash theme={null}
curl -X GET "https://api.kakiyo.com/v1/analytics/campaigns/campaign_123" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
```

```javascript theme={null}
// JavaScript/Node.js
const campaignId = 'campaign_123';
const response = await fetch(`https://api.kakiyo.com/v1/analytics/campaigns/${campaignId}`, {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
});

const analytics = await response.json();
console.log('Campaign Analytics:', analytics);
```

```python theme={null}
# Python
import requests

campaign_id = 'campaign_123'
response = requests.get(
    f'https://api.kakiyo.com/v1/analytics/campaigns/{campaign_id}',
    headers={
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
    }
)

analytics = response.json()
print('Campaign Analytics:', analytics)
```

## Error Responses

### Campaign Not Found

```json theme={null}
{
  "error": "not_found",
  "message": "Campaign not found"
}
```

### Access Denied

```json theme={null}
{
  "error": "forbidden", 
  "message": "You do not have access to this campaign"
}
```

## Analytics Insights

### Performance Indicators

**High-Performing Campaigns:**

* Response rate > 20%
* Qualification rate > 30%
* Conversion rate > 5%

**Optimization Opportunities:**

* Low response rate: Review messaging strategy
* High responses, low qualification: Improve targeting
* High qualification, low closing: Enhance follow-up process

### Daily Activity Patterns

Monitor daily breakdowns to identify:

* Peak engagement days
* Message volume optimization
* Response timing patterns

## Best Practices

1. **Regular Review**: Analyze campaign metrics weekly
2. **Comparative Analysis**: Compare with team averages
3. **Trend Monitoring**: Track performance changes over time
4. **Data-Driven Decisions**: Use metrics to guide campaign adjustments


## OpenAPI

````yaml GET /analytics/campaigns/{campaignId}
openapi: 3.1.0
info:
  title: Kakiyo API
  description: API for automating LinkedIn outreach campaigns with AI-powered conversations
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.kakiyo.com/v1
security:
  - bearerAuth: []
paths:
  /analytics/campaigns/{campaignId}:
    get:
      summary: Campaign Analytics
      description: Get detailed analytics for a specific campaign
      operationId: getCampaignAnalytics
      parameters:
        - name: campaignId
          in: path
          required: true
          schema:
            type: string
          example: campaign_12345abcde
      responses:
        '200':
          description: Campaign analytics retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  campaign:
                    type: object
                    properties:
                      id:
                        type: string
                        example: campaign_123
                      name:
                        type: string
                        example: Q4 Enterprise Outreach
                  metrics:
                    type: object
                    properties:
                      totalProspects:
                        type: integer
                        example: 150
                      conversionRate:
                        type: number
                        example: 8
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Campaign not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          example: validation_error
        message:
          type: string
          example: The request parameters failed validation
        details:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
                example: name
              message:
                type: string
                example: The name field is required
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````