# Resume Whatsapp Batch

`POST /v1/whatsapp/batches/{batch_id}/resume`

Carry on sending from where the batch stopped.

Authenticate with `Authorization: Bearer $TALQING_API_KEY`. Errors use the shared envelope: https://docs.talqing.com/api-reference/errors.md

## OpenAPI

```json
{
 "openapi":"3.1.0",
 "servers":[
  {
   "description":"Talqing API",
   "url":"https://api.talqing.com"
  }
 ],
 "paths":{
  "/v1/whatsapp/batches/{batch_id}/resume":{
   "post":{
    "description":"Carry on sending from where the batch stopped.",
    "operationId":"whatsapp.batches.resume",
    "parameters":[
     {
      "in":"path",
      "name":"batch_id",
      "required":true,
      "schema":{
       "format":"uuid",
       "title":"Batch Id",
       "type":"string"
      }
     }
    ],
    "responses":{
     "200":{
      "content":{
       "application/json":{
        "schema":{
         "$ref":"#/components/schemas/WhatsAppBatchResponse"
        }
       }
      },
      "description":"Successful Response"
     },
     "400":{
      "$ref":"#/components/responses/BadRequest"
     },
     "401":{
      "$ref":"#/components/responses/Unauthorized"
     },
     "403":{
      "$ref":"#/components/responses/Forbidden"
     },
     "404":{
      "$ref":"#/components/responses/NotFound"
     },
     "409":{
      "$ref":"#/components/responses/Conflict"
     },
     "422":{
      "$ref":"#/components/responses/ValidationFailed"
     },
     "default":{
      "$ref":"#/components/responses/Error"
     }
    },
    "security":[
     {
      "BearerAuth":[]
     },
     {
      "SessionCookie":[]
     }
    ],
    "summary":"Resume Whatsapp Batch",
    "tags":[
     "whatsapp"
    ]
   }
  }
 },
 "components":{
  "responses":{
   "BadRequest":{
    "content":{
     "application/json":{
      "schema":{
       "$ref":"#/components/schemas/ErrorResponse"
      }
     }
    },
    "description":"Well-formed, but rejected by a rule; `detail.errors` lists each problem."
   },
   "Conflict":{
    "content":{
     "application/json":{
      "schema":{
       "$ref":"#/components/schemas/ErrorResponse"
      }
     }
    },
    "description":"The resource's current state forbids this \u2014 a name already taken, a job already running."
   },
   "Error":{
    "content":{
     "application/json":{
      "schema":{
       "$ref":"#/components/schemas/ErrorResponse"
      }
     }
    },
    "description":"Unexpected error. Every error this API returns carries this body."
   },
   "Forbidden":{
    "content":{
     "application/json":{
      "schema":{
       "$ref":"#/components/schemas/ErrorResponse"
      }
     }
    },
    "description":"Authenticated, but this organization role may not perform the operation."
   },
   "NotFound":{
    "content":{
     "application/json":{
      "schema":{
       "$ref":"#/components/schemas/ErrorResponse"
      }
     }
    },
    "description":"No such resource in this organization."
   },
   "Unauthorized":{
    "content":{
     "application/json":{
      "schema":{
       "$ref":"#/components/schemas/ErrorResponse"
      }
     }
    },
    "description":"Missing credential, or one that is revoked or no longer a member of this organization."
   },
   "ValidationFailed":{
    "content":{
     "application/json":{
      "schema":{
       "$ref":"#/components/schemas/ErrorResponse"
      }
     }
    },
    "description":"The request did not match this operation's schema; `detail.errors` lists each field."
   }
  },
  "schemas":{
   "ErrorBody":{
    "description":"The structured half of our error contract: a human `message` plus a list\nof individual `errors` (used wherever we surface many problems at once,\nincluding tool publish, op-tree checks, and request validation). The global\nexception handlers normalize every API error to\n`{detail: {message, errors, code}}`, so SDKs can parse one shape consistently.",
    "properties":{
     "code":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "description":"A stable identifier for this error, when it has one.",
      "title":"Code"
     },
     "errors":{
      "items":{
       "type":"string"
      },
      "title":"Errors",
      "type":"array"
     },
     "message":{
      "title":"Message",
      "type":"string"
     }
    },
    "required":[
     "message",
     "errors"
    ],
    "title":"ErrorBody",
    "type":"object"
   },
   "ErrorResponse":{
    "description":"The body of every error response, at every status code.",
    "properties":{
     "detail":{
      "$ref":"#/components/schemas/ErrorBody"
     }
    },
    "required":[
     "detail"
    ],
    "title":"ErrorResponse",
    "type":"object"
   },
   "FixedDailyCap":{
    "additionalProperties":false,
    "description":"The same limit every day.",
    "properties":{
     "kind":{
      "const":"fixed",
      "title":"Kind",
      "type":"string"
     },
     "limit":{
      "minimum":1.0,
      "title":"Limit",
      "type":"integer"
     }
    },
    "required":[
     "kind",
     "limit"
    ],
    "title":"FixedDailyCap",
    "type":"object"
   },
   "RampDailyCap":{
    "additionalProperties":false,
    "description":"`start` a day, raised by `step` every `interval_days` sending days, up to `end`.",
    "properties":{
     "end":{
      "title":"End",
      "type":"integer"
     },
     "interval_days":{
      "maximum":30.0,
      "minimum":1.0,
      "title":"Interval Days",
      "type":"integer"
     },
     "kind":{
      "const":"ramp",
      "title":"Kind",
      "type":"string"
     },
     "start":{
      "minimum":1.0,
      "title":"Start",
      "type":"integer"
     },
     "step":{
      "minimum":1.0,
      "title":"Step",
      "type":"integer"
     }
    },
    "required":[
     "kind",
     "start",
     "end",
     "step",
     "interval_days"
    ],
    "title":"RampDailyCap",
    "type":"object"
   },
   "StoredAgentPlan":{
    "description":"What a call ran, frozen at the moment it started.\n\nWritten only when the call differs from \"the published agent, as-is\" \u2014 so a\nnull `agent_plan` means exactly that. `members[0]` is the agent that\nanswered.",
    "properties":{
     "members":{
      "items":{
       "$ref":"#/components/schemas/StoredPlanMember"
      },
      "title":"Members",
      "type":"array"
     }
    },
    "required":[
     "members"
    ],
    "title":"StoredAgentPlan",
    "type":"object"
   },
   "StoredPlanMember":{
    "description":"One member of a frozen plan, as `sessions.agent_plan` stores it.",
    "properties":{
     "agent_id":{
      "anyOf":[
       {
        "format":"uuid",
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Agent Id"
     },
     "name":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Name"
     },
     "override":{
      "additionalProperties":true,
      "title":"Override",
      "type":"object"
     },
     "version":{
      "anyOf":[
       {
        "type":"integer"
       },
       {
        "type":"null"
       }
      ],
      "title":"Version"
     }
    },
    "required":[
     "name",
     "agent_id",
     "version",
     "override"
    ],
    "title":"StoredPlanMember",
    "type":"object"
   },
   "TimeWindow":{
    "description":"The hours a list may run in, on the list's own clock.\n\nShared rather than duplicated, for the same reason ``window_state`` is: a\ncall batch and an email send run store the same three values under the same\nnames and must not each get their own copy of the rules. The field that\ncarries one is named for what it gates \u2014 ``calling_window`` on a campaign,\n``window`` on an email batch and its runs.\n\nA window that crosses midnight (``21:00``-``06:00``) is valid and means\nexactly what an evening consumer-calling window means: the day check applies\nto the *start* side, so ``21:00``-``06:00`` on ``days: [5]`` runs Friday\n21:00 through Saturday 06:00.",
    "properties":{
     "days":{
      "default":[
       1,
       2,
       3,
       4,
       5,
       6,
       7
      ],
      "description":"ISO weekdays the window opens on, 1 = Monday.",
      "items":{
       "type":"integer"
      },
      "title":"Days",
      "type":"array"
     },
     "end":{
      "format":"time",
      "title":"End",
      "type":"string"
     },
     "start":{
      "format":"time",
      "title":"Start",
      "type":"string"
     }
    },
    "required":[
     "start",
     "end"
    ],
    "title":"TimeWindow",
    "type":"object"
   },
   "WhatsAppBatchCounts":{
    "properties":{
     "delivered":{
      "title":"Delivered",
      "type":"integer"
     },
     "failed":{
      "title":"Failed",
      "type":"integer"
     },
     "queued":{
      "title":"Queued",
      "type":"integer"
     },
     "read":{
      "title":"Read",
      "type":"integer"
     },
     "ready":{
      "title":"Ready",
      "type":"integer"
     },
     "replied":{
      "title":"Replied",
      "type":"integer"
     },
     "sending":{
      "title":"Sending",
      "type":"integer"
     },
     "sent":{
      "title":"Sent",
      "type":"integer"
     },
     "skipped":{
      "title":"Skipped",
      "type":"integer"
     },
     "total":{
      "title":"Total",
      "type":"integer"
     },
     "undelivered":{
      "title":"Undelivered",
      "type":"integer"
     }
    },
    "required":[
     "total",
     "ready",
     "skipped",
     "sending",
     "queued",
     "sent",
     "delivered",
     "read",
     "undelivered",
     "failed",
     "replied"
    ],
    "title":"WhatsAppBatchCounts",
    "type":"object"
   },
   "WhatsAppBatchResponse":{
    "properties":{
     "agent_id":{
      "anyOf":[
       {
        "format":"uuid",
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Agent Id"
     },
     "agent_name":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Agent Name"
     },
     "agent_plan":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/StoredAgentPlan"
       },
       {
        "type":"null"
       }
      ]
     },
     "counts":{
      "$ref":"#/components/schemas/WhatsAppBatchCounts"
     },
     "created_at":{
      "format":"date-time",
      "title":"Created At",
      "type":"string"
     },
     "delivery_attempts":{
      "title":"Delivery Attempts",
      "type":"integer"
     },
     "delivery_retry_after_hours":{
      "title":"Delivery Retry After Hours",
      "type":"integer"
     },
     "failure_reason":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Failure Reason"
     },
     "finished_at":{
      "anyOf":[
       {
        "format":"date-time",
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Finished At"
     },
     "id":{
      "format":"uuid",
      "title":"Id",
      "type":"string"
     },
     "input_columns":{
      "items":{
       "type":"string"
      },
      "title":"Input Columns",
      "type":"array"
     },
     "integration_id":{
      "anyOf":[
       {
        "format":"uuid",
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Integration Id"
     },
     "integration_name":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Integration Name"
     },
     "name":{
      "title":"Name",
      "type":"string"
     },
     "next_send_at":{
      "anyOf":[
       {
        "format":"date-time",
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Next Send At"
     },
     "next_send_reason":{
      "anyOf":[
       {
        "enum":[
         "start",
         "window",
         "daily_cap",
         "retry",
         "gap"
        ],
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Next Send Reason"
     },
     "own_agent":{
      "title":"Own Agent",
      "type":"boolean"
     },
     "send_daily_cap":{
      "anyOf":[
       {
        "discriminator":{
         "mapping":{
          "fixed":"#/components/schemas/FixedDailyCap",
          "ramp":"#/components/schemas/RampDailyCap"
         },
         "propertyName":"kind"
        },
        "oneOf":[
         {
          "$ref":"#/components/schemas/FixedDailyCap"
         },
         {
          "$ref":"#/components/schemas/RampDailyCap"
         }
        ]
       },
       {
        "type":"null"
       }
      ],
      "title":"Send Daily Cap"
     },
     "send_daily_cap_today":{
      "anyOf":[
       {
        "type":"integer"
       },
       {
        "type":"null"
       }
      ],
      "title":"Send Daily Cap Today"
     },
     "send_gap_seconds":{
      "title":"Send Gap Seconds",
      "type":"integer"
     },
     "sender_e164":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Sender E164"
     },
     "sent_today":{
      "title":"Sent Today",
      "type":"integer"
     },
     "start_at":{
      "anyOf":[
       {
        "format":"date-time",
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Start At"
     },
     "started_at":{
      "anyOf":[
       {
        "format":"date-time",
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Started At"
     },
     "status":{
      "enum":[
       "draft",
       "scheduled",
       "sending",
       "paused",
       "completed",
       "canceled",
       "failed"
      ],
      "title":"Status",
      "type":"string"
     },
     "template":{
      "$ref":"#/components/schemas/WhatsAppTemplateSnapshot"
     },
     "timezone":{
      "title":"Timezone",
      "type":"string"
     },
     "to_column":{
      "title":"To Column",
      "type":"string"
     },
     "variable_map":{
      "additionalProperties":{
       "type":"string"
      },
      "title":"Variable Map",
      "type":"object"
     },
     "vars":{
      "anyOf":[
       {
        "additionalProperties":{
         "type":"string"
        },
        "type":"object"
       },
       {
        "type":"null"
       }
      ],
      "title":"Vars"
     },
     "window":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/TimeWindow"
       },
       {
        "type":"null"
       }
      ]
     }
    },
    "required":[
     "id",
     "name",
     "integration_id",
     "integration_name",
     "sender_e164",
     "agent_id",
     "own_agent",
     "agent_name",
     "agent_plan",
     "vars",
     "template",
     "to_column",
     "variable_map",
     "input_columns",
     "status",
     "failure_reason",
     "start_at",
     "timezone",
     "window",
     "send_daily_cap",
     "send_daily_cap_today",
     "send_gap_seconds",
     "delivery_attempts",
     "delivery_retry_after_hours",
     "counts",
     "sent_today",
     "next_send_at",
     "next_send_reason",
     "created_at",
     "started_at",
     "finished_at"
    ],
    "title":"WhatsAppBatchResponse",
    "type":"object"
   },
   "WhatsAppTemplateButton":{
    "properties":{
     "code":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Code"
     },
     "phone_number":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Phone Number"
     },
     "text":{
      "title":"Text",
      "type":"string"
     },
     "ttl_minutes":{
      "anyOf":[
       {
        "type":"integer"
       },
       {
        "type":"null"
       }
      ],
      "title":"Ttl Minutes"
     },
     "type":{
      "enum":[
       "url",
       "phone_number",
       "quick_reply",
       "copy_code",
       "voice_call"
      ],
      "title":"Type",
      "type":"string"
     },
     "url":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Url"
     }
    },
    "required":[
     "type",
     "text",
     "url",
     "phone_number",
     "code",
     "ttl_minutes"
    ],
    "title":"WhatsAppTemplateButton",
    "type":"object"
   },
   "WhatsAppTemplateHeader":{
    "properties":{
     "text":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Text"
     },
     "type":{
      "enum":[
       "text",
       "image",
       "video",
       "document"
      ],
      "title":"Type",
      "type":"string"
     },
     "url":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Url"
     }
    },
    "required":[
     "type",
     "text",
     "url"
    ],
    "title":"WhatsAppTemplateHeader",
    "type":"object"
   },
   "WhatsAppTemplateSnapshot":{
    "description":"The whole message as a batch sends it: header, body, footer and buttons.",
    "properties":{
     "body":{
      "title":"Body",
      "type":"string"
     },
     "buttons":{
      "items":{
       "$ref":"#/components/schemas/WhatsAppTemplateButton"
      },
      "title":"Buttons",
      "type":"array"
     },
     "category":{
      "enum":[
       "marketing",
       "utility",
       "authentication"
      ],
      "title":"Category",
      "type":"string"
     },
     "footer":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Footer"
     },
     "header":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/WhatsAppTemplateHeader"
       },
       {
        "type":"null"
       }
      ]
     },
     "id":{
      "title":"Id",
      "type":"string"
     },
     "language":{
      "title":"Language",
      "type":"string"
     },
     "name":{
      "title":"Name",
      "type":"string"
     },
     "variables":{
      "items":{
       "type":"string"
      },
      "title":"Variables",
      "type":"array"
     }
    },
    "required":[
     "id",
     "name",
     "language",
     "category",
     "header",
     "body",
     "footer",
     "buttons",
     "variables"
    ],
    "title":"WhatsAppTemplateSnapshot",
    "type":"object"
   }
  }
 }
}
```
