---
updatedAt: 2026-09-09T22:08:03.000Z
agentTools:
  projectIndex: https://developer.callhub.io/llms.txt
---

# /p2p_campaigns/:id/

Change the status (start / pause / stop) or rename a P2P (Peer-to-Peer) campaign.

PATCH semantics: send only the fields you want to change. Both `status` and `name` are optional; at least one must be provided.

### Status values

| Value | Meaning                                 | Notes                                                            |
| ----: | --------------------------------------- | ---------------------------------------------------------------- |
|     1 | **START** — run the campaign            | Fails with 400 if no contacts, no caller ID, or pending approval |
|     2 | **PAUSE** — pause a running campaign    | Campaign-list cache cleared on success                           |
|     4 | **END** — stop the campaign permanently | Cache cleared; recurring child occurrences are also ended        |

<br />

### Name editing while running

If the campaign is at `status = 1` (START), `name` cannot be changed unless the same request also transitions out of START (`status: 2` or `status: 4`). Otherwise returns 400 `"Campaign must be stopped before it can be edited."` — matches the rule the web UI enforces.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "api-settings",
    "version": "2.1"
  },
  "servers": [
    {
      "url": "https://api.callhub.io"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "x-default": "",
        "type": "apiKey",
        "name": "Authorization",
        "in": "header",
        "x-bearer-format": "token"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/v1/p2p_campaigns/{id}/": {
      "patch": {
        "description": "",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer",
                      "enum": [
                        1,
                        2,
                        4
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Campaign ID"
          }
        ],
        "operationId": "patch_v1-p2p-campaigns-id",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "number",
                    "description": "1 = START, 2 = PAUSE, 4 = END",
                    "enum": [
                      1,
                      2,
                      4
                    ],
                    "default": "2"
                  },
                  "name": {
                    "type": "string",
                    "description": "Campaign name. Cannot be changed while status is 1 (START) unless the same request transitions out of START."
                  }
                }
              },
              "examples": {
                "Example C — Atomic stop + rename": {
                  "summary": "Example C — Atomic stop + rename",
                  "value": {
                    "status": 4,
                    "name": "Renamed and stopped"
                  }
                },
                "Example B — Rename only:": {
                  "summary": "Example B — Rename only:",
                  "value": {
                    "name": "Renamed campaign"
                  }
                },
                "Example A — START": {
                  "summary": "Example A — START",
                  "value": {
                    "status": 1
                  }
                }
              }
            }
          }
        },
        "summary": "/p2p_campaigns/:id/"
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```