Documentation / MCP / campaigns_organization_delete
campaigns_organization_delete
POSThttps://mcp.oppalerts.com/mcptool: campaigns_organization_delete
Deletes one organization from a campaign.
What it does
The tool deletes one organization from a campaign. Its websites and names can be added again later with campaigns_organization_add.
Deleting an owned brand or a competitor makes the stored daily counts of the brand searches out of date. In the web app, Edit Campaign makes the same change, in the organization boxes of the Settings tab.
Who May Call It
- The account owner, an account editor, or a campaign editor of this campaign. An account viewer or a campaign viewer gets the error
no_access. - The token or the connection needs the scope
api:write, andmcp:useas every MCP tool does. Withoutapi:write, the call gets the errorforbidden. Authentication says which tokens and apps have it. - The tool tells the MCP client that it changes data and that the change is destructive, so a client such as Claude asks you before the call.
Connect
claude mcp add --transport http oppalerts https://mcp.oppalerts.com/mcp
The first call opens a browser window for the OppAlerts login. Allow changes there. Connect an AI Agent has the details.
Parameters
campaignint, required, 1 to 4294967295- The campaign id, from campaigns_list. It must be a campaign of your account.
organizationint, required, 1 to 4294967295- The organization id, from campaigns_organizations.
Rules
organizationis required. campaigns_organizations gives the organization id.- An organization id that is not in the campaign is refused with
organization_not_found, and nothing changes. Sodeletedis alwaystruein a successful response.
Strict Rules
- A field that is not in the list above is refused. The result then has
isErrortrue, and its text starts withbad_param. The error names the field: "<field> is not a field of this tool." - A bad value is refused, and the error names the field. A bad value is a value of the wrong type, a number with a fraction for a whole-number field, a value out of its range, a value that is not in its list, or an empty text, list, or object. A required field that you do not send is refused too. To send no value for an optional field, leave the field out. No field has a default value, and the tool never changes a value that you send.
- An error about the format of a call, such as a refused field, names the field. Its message ends with one sentence: "Read the documentation at https://oppalerts.com/docs for the correct format." Every other error, such as
forbiddenbelow, has only its own sentence.
Response fields
organization_idint- The organization id that you sent.
deletedbooltrue: the organization was deleted. An organization id that is not in the campaign is refused withorganization_not_found, so a successful response always hastrue.
Example
Call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "campaigns_organization_delete",
"arguments": {
"campaign": 124,
"organization": 9
}
}
}
Response
The response is shown in full.
{
"organization_id": 9,
"deleted": true
}
Errors
An error returns as a tool result with isError true. Its text starts with the error code. An example: a call by a team member who cannot make this change.
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": [
{
"type": "text",
"text": "no_access: You have read permissions for this campaign."
}
],
"isError": true
}
}
One error is not a tool result. A call with a token that does not have the scope api:write gets the HTTP status 403, as the MCP standard says. The answer has a WWW-Authenticate header with error="insufficient_scope" and the scopes that the call needs. An MCP app that reads this header asks you for the permissions to change campaigns. The body has the error code forbidden and its sentence. The tool does not run, and the call is not counted.
HTTP/1.1 403 Forbidden
WWW-Authenticate: Bearer error="insufficient_scope", scope="mcp:use api:write", resource_metadata="https://mcp.oppalerts.com/.well-known/oauth-protected-resource/mcp", error_description="This token cannot change data. Make a new API token with edit permissions on the API tokens page, or connect the app again and allow changes."
Content-Type: application/json
{
"error": "forbidden",
"error_description": "This token cannot change data. Make a new API token with edit permissions on the API tokens page, or connect the app again and allow changes."
}
The error codes of this tool, each with its HTTP status and its sentence:
bad_param(HTTP 400 in the API): A parameter is missing or has a wrong value. The sentence names it.no_campaign(HTTP 404 in the API): That campaign is not in this account.forbidden(HTTP 403 in the API, and HTTP 403 in MCP too, see above): This token cannot change data. Make a new API token with edit permissions on the API tokens page, or connect the app again and allow changes.no_access(HTTP 403 in the API): You have read permissions for this campaign.db_error(HTTP 500 in the API): The change could not be saved. Nothing was changed.organization_not_found(HTTP 404 in the API): Not deleted: that organization is not in this campaign.
Limits
- This tool has its own daily count for the account. When the count is used up, the call is refused with
daily_limit(HTTP 429 in the API). account_calls_left shows the calls left today and when the count resets. - A refused call does not use the daily count of this tool.
- This tool is not an index search. It does not use the daily count of index searches.
- Only one change runs at a time per account. A call made while another change is running for the account is refused with
one_at_a_time(HTTP 429 in the API) and uses no daily call. Send it again after a few seconds.
Same change in the API
POST /v1/campaigns/organization_delete HTTP/1.1
Host: api.oppalerts.com
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{"campaign": 124, "organization": 9}
The API page is POST /v1/campaigns/organization_delete.