# Campaign Metrics

## Fetch Campaign Metrics

> Fetch Campaign Metrics

```json
{"openapi":"3.0.3","info":{"title":"Reporting","version":"v1"},"tags":[{"name":"metrics","description":"Provide metrics to the customers"}],"security":[{"user":[]},{"accessKey":[]}],"components":{"securitySchemes":{"user":{"description":"Provide the token that is returned upon login","scheme":"bearer","type":"http","bearerFormat":"jwt"},"accessKey":{"description":"Uses the Authorization header: 'AccessKey ' followed by your access key token (e.g., 'Authorization: AccessKey AbCdEfGhIjKlMnOpQrStUvWxYzAbCdEfGhIj')","scheme":"AccessKey","type":"http"}},"schemas":{"CampaignMetricsResult":{"type":"array","items":{"type":"object","properties":{"summary":{"type":"object","properties":{"campaignId":{"type":"string","format":"uuid"},"campaignName":{"type":"string"},"campaignCreatedDate":{"type":"string","format":"date-time"},"campaignActivatedDate":{"type":"string","format":"date-time"},"campaignStatus":{"type":"string"},"campaignStage":{"type":"string"},"platformId":{"type":"string"},"queued":{"type":"integer","format":"int64","nullable":true},"skipped":{"type":"integer","format":"int64","nullable":true},"scheduled":{"type":"integer","format":"int64","nullable":true},"sent":{"type":"integer","format":"int64","nullable":true},"delivered":{"type":"integer","format":"int64","nullable":true},"bounced":{"type":"integer","format":"int64","nullable":true},"globalHoldout":{"type":"integer","format":"int64","nullable":true},"opened":{"type":"integer","format":"int64","nullable":true},"readOrOpened":{"type":"integer","format":"int64","nullable":true},"clicked":{"type":"integer","format":"int64","nullable":true},"unsubscribed":{"type":"integer","format":"int64","nullable":true},"checkoutAbandonedCount":{"type":"integer","format":"int64","nullable":true},"orderConfirmedCount":{"type":"integer","format":"int64","nullable":true},"formViewedCount":{"type":"integer","format":"int64","nullable":true},"formSubmittedCount":{"type":"integer","format":"int64","nullable":true},"pageViewedCount":{"type":"integer","format":"int64","nullable":true},"productViewedCount":{"type":"integer","format":"int64","nullable":true},"attributedRevenue":{"type":"number","format":"float","nullable":true},"currency":{"type":"string","nullable":true}}}}}},"ValidationError":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}},"required":["code","message"]}},"responses":{"validationError":{"description":"The request did not pass validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}},"paths":{"/workspaces/{workspaceId}/reporting/campaigns/metrics":{"get":{"summary":"Fetch Campaign Metrics","operationId":"getCampaignMetrics","description":"Fetch Campaign Metrics","tags":["metrics"],"parameters":[{"name":"periodStart","in":"query","description":"The start of the period for which to fetch metrics","required":true,"schema":{"type":"string","format":"date-time","description":"The date and time in the format 'YYYY-MM-DDTHH:MM:SSZ' or 'YYYY-MM-DDTHH:MM:SS-HH:MM'."}},{"name":"periodEnd","in":"query","description":"The end of the period for which to fetch metrics","required":false,"schema":{"type":"string","format":"date-time","description":"The date and time in the format 'YYYY-MM-DDTHH:MM:SSZ' or 'YYYY-MM-DDTHH:MM:SS-HH:MM'."}},{"name":"conversionMetric","in":"query","description":"The metric to use when calculating conversion rates.\nThis is used to determine the conversion rate for the campaign.\nIf not provided, it defaults to 'order-confirmed'.\n","required":false,"schema":{"type":"string","default":"order-confirmed","enum":["order-fulfilled","order-confirmed","generic-event-1","generic-event-2","generic-event-3"]}},{"name":"filter","in":"query","description":"Filter conditions for fetching metrics. Each condition must be in the format: equals(`field`,`value`).\n\nSupported field-value pairs:\n- `campaignID` - UUID. Can supply multiple equals conditions to match multiple campaign IDs.\n- `name` - string. Can supply multiple equals conditions to match multiple campaign names.\n- `status` - string. Can supply multiple equals conditions to filter by campaign statuses.\n  Allowed values:\n    - draft\n    - pending_review\n    - scheduled\n    - preparing\n    - inactive\n    - ended\n    - waiting\n    - error\n    - active\n- `tagID` - UUID. Filter by campaigns with a specific tag.\n- `channelID` - UUID. Filter by campaigns sent via a specific channel.\n- `platformID` - string. Can supply multiple equals conditions to match multiple platforms.\n  Common values include: sms-messagebird, email-sparkpost, whatsapp.\n- `createdSince` - ISO-8601 timestamp string. Filter for campaigns created after this time.\n- `createdUpTo` - ISO-8601 timestamp string. Filter for campaigns created up to this time.\n","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"List of campaign metrics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignMetricsResult"}}}},"422":{"$ref":"#/components/responses/validationError"}}}}}}
```
