---
search:
  tags:
    - Ad groups
    - PATCH
seo:
  description: >-
    Available on: Meta. Reference for the PATCH
    /mutations/{advertiserId}/ad-groups/{id}/schedule endpoint in the AdCrunch
    API.
sidebar:
  label: Update an ad group’s schedule
  badge: PATCH
title: Update an ad group’s schedule
type: openapi-operation
---
**Available on:** [![Meta](/providers/meta.svg)](https://docs.adcrunch.dev/connect/providers)

Changes the schedule of an ad group. The path names the ad group, and the body holds only the change.

It starts a Mutation of the kind `meta_update_schedule`, the same change that `POST /mutations` starts with that kind. The MCP tool of the same name makes the same change.

The change does **not** happen during this request. The answer is `202`, and `Location` names the Mutation. Poll `GET /mutations/{id}` until it reports `complete` or `errored`. A Mutation is durable, so the id stays valid across retries and restarts.

A refused request starts nothing. AdCrunch refuses a body that does not match, an advertiser that is not yours, an advertiser with no usable connection, and an advertiser connected without write access before a Mutation exists. So a failed call leaves no row in the history.

**This operation checks the credential first and the body second.** A missing or unusable credential answers `401` even when the body is wrong as well.

`PATCH /mutations/{advertiserId}/ad-groups/{id}/schedule`

**Request body** (`application/json`, required)

- `endTime` (string | null) — When delivery stops, as an ISO 8601 timestamp in the future, for example 2026-12-31T23:59:00+01:00. Send null for no end. An ad set with a lifetime budget must keep an end time. A later end time adds days of spend, so the total spend of a daily budget increases. With no end, the ad set spends until you pause it, up to 7 times its daily budget in one week. With a lifetime budget, the total spend stays within the lifetime budget. An ACTIVE ad set that has ended delivers again when it gets a new end time or no end, with no status change. To change a daily budget to a lifetime budget, first set an end time with meta\_update\_schedule, then set the lifetime budget. To change a lifetime budget to a daily budget, first set the daily budget, then remove the end time with meta\_update\_schedule. Meta refuses a lifetime budget with no end time. To undo a schedule change, send the times that it replaced (priorValue). An end time that is not in the future cannot go back: Meta refuses it, and AdCrunch refuses it too. To stop an ad set after you extend its end, set its status to PAUSED with meta\_update\_status.
- `startTime` (string) — When delivery starts, as an ISO 8601 timestamp. Meta gets it as you send it, also on an ad set that has started, and Meta decides what it does. Give startTime, endTime, or both.

Request body example:

```json
{
  "startTime": "2030-01-01T00:00:00+01:00"
}
```

**Responses**

- `202` — The Mutation started, and it has not ended. The body is the answer of \`GET /mutations/{id}\`, with \`status\` of \`running\`. Poll the path in \`Location\` for the outcome.
- `400` — The request does not match the schema of this operation: a field is missing or has the wrong type, or the body is not valid JSON. \`error\` is \`invalid\_request\`, and \`issues\` names each field. Nothing was changed.
- `401` — No API key, or one that does not resolve. See the security scheme. \`error\` is \`unauthorized\`.
- `402` — The organization has no active subscription. An owner subscribes at \`paywallUrl\`. \`error\` is \`organization\_unentitled\`.
- `403` — The caller does not hold \`mutation:write\`, or the advertiser is connected without write access. In the second case \`error\` is \`missing\_write\_access\` and \`message\` says how to fix it. AdCrunch started nothing.
- `404` — The advertiser does not exist, it belongs to another organization, or it is not a Meta ad account. \`error\` is \`not\_found\` in each case. An advertiser that does not exist and an advertiser of another organization get the same answer on purpose, so a caller cannot learn which ids exist. AdCrunch started nothing.
- `409` — The advertiser has no usable connection: a person removed it, it expired, or the provider refused it. A person must connect it again. \`error\` is \`provider\_not\_connected\`, the code that a live read of Observe sends for the same failure. AdCrunch started nothing.

Response example, 202:

```json
{
  "mutationId": "mut_k3x9q2v7m4n8p1r5t6w0y2z4",
  "status": "running"
}
```
