# Create Campaign Recipient Estimation Job

Trigger an asynchronous job to update the estimated number of recipients
for the given campaign ID. Use the `Get Campaign Recipient Estimation
Job` endpoint to retrieve the status of this estimation job. Use the
`Get Campaign Recipient Estimation` endpoint to retrieve the estimated
recipient count for a given campaign.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m`

**Scopes:**
`campaigns:write`

# OpenAPI definition

```json
{
  "openapi": "3.0.2",
  "info": {
    "title": "Campaigns API",
    "version": "2024-02-15",
    "description": "The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details.",
    "contact": {
      "name": "Klaviyo Developer Experience Team",
      "email": "developers@klaviyo.com",
      "url": "https://developers.klaviyo.com"
    },
    "termsOfService": "https://www.klaviyo.com/legal/api-terms",
    "license": {
      "name": "License",
      "url": "https://www.klaviyo.com/legal"
    }
  },
  "servers": [
    {
      "url": "https://a.klaviyo.com",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/campaign-recipient-estimation-jobs/": {
      "post": {
        "operationId": "create_campaign_recipient_estimation_job",
        "summary": "Create Campaign Recipient Estimation Job",
        "description": "Trigger an asynchronous job to update the estimated number of recipients\nfor the given campaign ID. Use the `Get Campaign Recipient Estimation\nJob` endpoint to retrieve the status of this estimation job. Use the\n`Get Campaign Recipient Estimation` endpoint to retrieve the estimated\nrecipient count for a given campaign.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m`\n\n**Scopes:**\n`campaigns:write`",
        "parameters": [
          {
            "name": "revision",
            "in": "header",
            "description": "API endpoint revision (format: YYYY-MM-DD[.suffix])",
            "required": true,
            "schema": {
              "type": "string",
              "default": "2024-02-15"
            }
          }
        ],
        "requestBody": {
          "description": "Trigger an asynchronous job to update the estimated number of recipients\nfor the given campaign ID. Use the `Get Campaign Recipient Estimation\nJob` endpoint to retrieve the status of this estimation job. Use the\n`Get Campaign Recipient Estimation` endpoint to retrieve the estimated\nrecipient count for a given campaign.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignRecipientEstimationJobCreateQuery"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostCampaignRecipientEstimationJobResponse"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/ClientError"
          },
          "5XX": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "tags": [
          "Jobs"
        ],
        "x-klaviyo-pre-release": "None",
        "x-klaviyo-ratelimit": {
          "burst": "10/s",
          "steady": "150/m"
        },
        "x-klaviyo-scopes": [
          "campaigns:write"
        ],
        "x-klaviyo-subtag": "Jobs"
      }
    }
  },
  "components": {
    "schemas": {
      "CampaignRecipientEstimationJobCreateQueryResourceObject": {
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/CampaignRecipientEstimationJobEnum"
          },
          "id": {
            "description": "The ID of the campaign to perform recipient estimation",
            "type": "string"
          }
        },
        "required": [
          "type",
          "id"
        ]
      },
      "CampaignRecipientEstimationJobCreateQuery": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/CampaignRecipientEstimationJobCreateQueryResourceObject"
          }
        },
        "required": [
          "data"
        ]
      },
      "PostCampaignRecipientEstimationJobResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "type": {
                "$ref": "#/components/schemas/CampaignRecipientEstimationJobEnum"
              },
              "id": {
                "description": "The ID of the campaign used for estimating recipients",
                "type": "string",
                "example": "01GMRWDSA0ARTAKE1SFX8JGXAY",
                "default": "01GMRWDSA0ARTAKE1SFX8JGXAY"
              },
              "attributes": {
                "type": "object",
                "properties": {
                  "status": {
                    "description": "The status of the recipient estimation job",
                    "type": "string",
                    "enum": [
                      "cancelled",
                      "complete",
                      "processing",
                      "queued"
                    ]
                  }
                },
                "required": [
                  "status"
                ]
              },
              "links": {
                "$ref": "#/components/schemas/ObjectLinks"
              }
            },
            "required": [
              "type",
              "id",
              "attributes",
              "links"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "ObjectLinks": {
        "type": "object",
        "properties": {
          "self": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "self"
        ]
      },
      "CampaignRecipientEstimationJobEnum": {
        "type": "string",
        "enum": [
          "campaign-recipient-estimation-job"
        ]
      }
    },
    "responses": {
      "ClientError": {
        "description": "Client Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "errors": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "code",
                      "title",
                      "detail"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "code": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "detail": {
                        "type": "string"
                      },
                      "source": {
                        "type": "object",
                        "properties": {
                          "pointer": {
                            "type": "string"
                          },
                          "parameter": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              },
              "required": [
                "errors"
              ]
            }
          }
        }
      },
      "ServerError": {
        "description": "Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "errors": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "code",
                      "title",
                      "detail"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "code": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "detail": {
                        "type": "string"
                      },
                      "source": {
                        "type": "object",
                        "properties": {
                          "pointer": {
                            "type": "string"
                          },
                          "parameter": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              },
              "required": [
                "errors"
              ]
            }
          }
        }
      }
    },
    "securitySchemes": {
      "Klaviyo-API-Key": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "Private key authentication for /api/ endpoints is performed by setting the `Authorization` header to `Klaviyo-API-Key your-private-api-key`<br>For more information please visit https://developers.klaviyo.com/en/v2024-02-15/reference/api-overview#authentication",
        "x-default": "Klaviyo-API-Key your-private-api-key"
      }
    }
  },
  "tags": [
    {
      "name": "Jobs"
    }
  ],
  "security": [
    {
      "Klaviyo-API-Key": []
    }
  ],
  "x-readme": {
    "explorer-enabled": false,
    "proxy-enabled": true,
    "samples-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 101,
      "1": 206,
      "2": 44,
      "3": 197,
      "4": 12,
      "5": 117,
      "6": 185,
      "7": 0,
      "8": 29,
      "9": 0,
      "10": 187,
      "11": 17
    }
  }
}
```