---
updatedAt: 2026-05-20T09:37:17.000Z
agentTools:
  projectIndex: https://dev.gotom.io/llms.txt
---

# Update a campaign

All the properties are optional, only the supplied properties are changed.

Notice that when changing the customer, it will apply the new customer discounts automatically. 

When changing or setting agency/intermediator, by default, commissions will be set to the values found in the agency/intermediator again. Even if the commission was set on the flight. Updating agency/intermediator to `null` will, by default, set the commissions to `0` and the `commissionStatus` as well to `0`.

When agency/intermediator are sent in the body and you don't want to update the commissions you can use the query parameter `update_commissions=0`.


# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "version": "4.4.12",
    "title": "Campaign API"
  },
  "x-explorer-enabled": false,
  "paths": {
    "/app-api/campaign/{campaignExternalId}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ParamCampaignExternalId"
        }
      ],
      "post": {
        "tags": [
          "Campaign"
        ],
        "summary": "Update a campaign",
        "description": "All the properties are optional, only the supplied properties are changed.\n\nNotice that when changing the customer, it will apply the new customer discounts automatically. \n\nWhen changing or setting agency/intermediator, by default, commissions will be set to the values found in the agency/intermediator again. Even if the commission was set on the flight. Updating agency/intermediator to `null` will, by default, set the commissions to `0` and the `commissionStatus` as well to `0`.\n\nWhen agency/intermediator are sent in the body and you don't want to update the commissions you can use the query parameter `update_commissions=0`.\n",
        "parameters": [
          {
            "in": "query",
            "name": "update_commissions",
            "schema": {
              "type": "integer",
              "default": 1,
              "enum": [
                0,
                1
              ]
            },
            "description": "Whether to update commissions or not\n * **0**: commissions will not be updated and stay the same even if agency and/or intermediator are changed. Flights created hereafter will use the old commissions.\n * **1**: commissions will be updated only if the payload as well has values set for the intermediator or agency. Flights created hereafter will always use those commissions as well. If you have set custom flight commissions manually on flights, they will be reset to the values of the agency/intermediator.\n"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignUpdate"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Campaign has been updated"
          },
          "400": {
            "description": "Returns a list of errors in the input data. For this call the following violation codes can be expected\n * `5658b9ca-ce50-4a98-a0da-97d9361845e3` - An invalid ID field has been given (for example the `entityId`\n   in the customer object could not be found), here you have to refer to the `propertyPath` value to\n   find out which property caused the error\n * `fa0401a7-6720-44dd-b443-2389aab8c8b7` - Cannot change campaign status from booking to reservation because flights were already invoiced in this campaign.\n * `b31b973d-8238-467c-bf01-1e9a4ded9631` - Cannot change campaign customer because flights were already invoiced in this campaign.\n * `ec75ef78-1db7-4469-a7fc-b14a71e5dbee` - Cannot change campaign agency  because flights were already invoiced in this campaign.\n * `9e8d02a8-f693-4df3-869e-a16d196d9d8a` - Cannot change campaign intermediator  because flights were already invoiced in this campaign.\n * `800b5cad-7f13-4b27-b3d6-74fa3c47b4e1` - Cannot change campaign currency  because flights were already invoiced in this campaign.\n * `7e44e734-3535-4172-8e32-0efa8b33a5e0` - The value of the billingType is not valid, only supported billingTypes can be used\n * `43452cb6-8850-4036-b1f5-971c8328e10b` - The update payload contains a billingType update but the campaign is already invoiced so the billingType can't be changed.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConstraintViolationResponse"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerErrorDefault"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ContactRef": {
        "description": "This entity represents either a customer, agency, intermediator or publisher, either the external ID or the external CRM ID or the goTom ID can be set",
        "type": "object",
        "nullable": true,
        "properties": {
          "entityId": {
            "description": "ID of the entity (might be a customer, agency, intermediator of publisher) for this contact (corresponds to the \"Kunde\", \"Vermittler\", \"Agentur\" field)",
            "type": "integer"
          },
          "entityExternalId": {
            "description": "External ID of the entity (might be a customer, agency, intermediator of publisher) for this contact (corresponds to the \"Kunde\", \"Vermittler\", \"Agentur\" field)",
            "type": "string"
          },
          "entityExternalCrmId": {
            "description": "External CRM ID of the entity (might be a customer, agency, intermediator of publisher) for this contact (corresponds to the \"Kunde\", \"Vermittler\", \"Agentur\" field)",
            "type": "string"
          },
          "addressId": {
            "description": "ID of the address for this contact (corresponds to the \"Adresse\" field in the UI)",
            "type": "integer",
            "nullable": true
          },
          "addressExternalId": {
            "description": "External ID of the address for this contact (corresponds to the \"Adresse\" field in the UI)",
            "type": "string",
            "nullable": true
          },
          "addressExternalCrmId": {
            "description": "External CRM ID of the address for this contact (corresponds to the \"Adresse\" field in the UI)",
            "type": "string",
            "nullable": true
          },
          "personId": {
            "description": "ID of the person for this contact (corresponds to the \"Kontakt\" field)",
            "type": "integer",
            "nullable": true
          },
          "personExternalId": {
            "description": "External ID of the person for this contact (corresponds to the \"Kontakt\" field)",
            "type": "string",
            "nullable": true
          },
          "personExternalCrmId": {
            "description": "External CRM ID of the person for this contact (corresponds to the \"Kontakt\" field)",
            "type": "string",
            "nullable": true
          }
        }
      },
      "Campaign": {
        "description": "A goTom campaign",
        "type": "object",
        "properties": {
          "name": {
            "description": "Corresponds with the field \"Kampagne\"",
            "type": "string"
          },
          "status": {
            "description": "Corresponds with the field \"Status\"",
            "type": "string",
            "default": "booking",
            "enum": [
              "booking",
              "reservation"
            ]
          },
          "bookingDate": {
            "description": "Corresponds with the field \"Buchungsdatum\"",
            "type": "string",
            "format": "date"
          },
          "campaignTypeId": {
            "description": "Corresponds with the field \"Kampagnentyp\"",
            "type": "integer",
            "example": 1
          },
          "campaignTypeReference": {
            "description": "Corresponds with the field \"Kampagnentyp Referenz\"",
            "type": "string"
          },
          "customer": {
            "description": "Corresponds with the field \"Kunde\"",
            "allOf": [
              {
                "$ref": "#/components/schemas/ContactRef"
              }
            ]
          },
          "intermediator": {
            "description": "Corresponds with the field \"Vermittler\"",
            "allOf": [
              {
                "$ref": "#/components/schemas/ContactRef"
              }
            ]
          },
          "agency": {
            "description": "Corresponds with the field \"Agentur\"",
            "allOf": [
              {
                "$ref": "#/components/schemas/ContactRef"
              }
            ]
          },
          "note": {
            "description": "Corresponds with the Field \"Bemerkungen\"",
            "type": "string",
            "nullable": true
          },
          "noteInternal": {
            "description": "Corresponds with the Field \"Interne Bemerkungen\"",
            "type": "string"
          },
          "noteReservation": {
            "description": "Corresponds with the Field \"Reservationsabklärung\"",
            "type": "string"
          },
          "pdfInvoiceWithAttachment": {
            "description": "Corresponds to the \"Dokumente\" field. If true, the invoice will be created with an appendix e.g. the Order Confirmation; if false, it will be created without one, as default it would be true.",
            "type": "boolean",
            "default": true
          },
          "billingType": {
            "type": "integer",
            "enum": [
              0,
              1,
              2,
              3
            ],
            "example": 0,
            "description": "Corresponds with the field \"Billing type\" / \"Abrechnungsart\" on the \"Invoicing\" / \"Billing type\" view of the campaign.\nUse this value only if you want to explicitly define the billing type of the campaign. You can safely omit this value to let goTom apply the rules for finding the right billing type for this campaign.\nBilling type possible values and their meaning:\n\n * `0` - Custom - The user must explicitly set up the invoices and assign flights\n * `1` - End / Nach Ablauf - All flights are automatically assigned to one invoice\n * `2` - Monthly to daily value /  Monatlich nach Tageswert - Automatic assignment on a monthly basis, distributed by time\n * `3` - Monthly to delivery value / Monatlich nach Lieferwert - Automatic assignment on a monthly basis, distributed by delivery value\n \nPlease note, that your instance may not support all values. If your instance does not have an ad-server integration the value for \"Monthly to delivery value\" can't be used. If you use a value that is not supported by your instance, you will get an API error (code `7e44e734-3535-4172-8e32-0efa8b33a5e0`) with the list of the possible values for your instance.\nIf the campaign has at least one invoice that has already been invoiced it is also not possible to change this value to something different. If this is the case you will get the API error code `43452cb6-8850-4036-b1f5-971c8328e10b` and *none* of the updates in the payload will be applied.\n"
          }
        }
      },
      "CampaignUpdate": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Campaign"
          },
          {
            "$ref": "#/components/schemas/CampaignSalesMixin"
          }
        ]
      },
      "CampaignSalesMixin": {
        "type": "object",
        "properties": {
          "salesSupportId": {
            "description": "Correspons with the field \"Innendienst\". Only `salesSupportId` or `salesSupportEmail` should be provided.",
            "type": "integer",
            "example": null
          },
          "salesSupportEmail": {
            "description": "Correspons with the field \"Innendienst\". Only `salesSupportId` or `salesSupportEmail` should be provided.",
            "type": "string",
            "example": "sales-support@acme-corp.ch"
          },
          "salesId": {
            "description": "Corresponds with the field \"Verkauf\". Only `salesId` or `salesEmail` should be provided.",
            "type": "integer",
            "example": 23
          },
          "salesEmail": {
            "description": "Corresponds with the field \"Verkauf\".  Only `salesId` or `salesEmail` should be provided.",
            "type": "string",
            "example": null
          }
        }
      },
      "AnyValue": {
        "description": "Can be any value - string, number, boolean, array or object.",
        "nullable": true,
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "integer"
          },
          {
            "type": "boolean"
          },
          {
            "type": "array",
            "items": {}
          },
          {
            "type": "object"
          }
        ]
      },
      "InternalServerErrorResponse": {
        "properties": {
          "message": {
            "type": "string",
            "example": "Internal Server Error"
          }
        }
      },
      "ConstraintViolationResponse": {
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConstraintViolationItem"
            }
          }
        }
      },
      "ConstraintViolationItem": {
        "properties": {
          "propertyPath": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "invalidValue": {
            "$ref": "#/components/schemas/AnyValue"
          },
          "cause": {
            "$ref": "#/components/schemas/AnyValue"
          },
          "code": {
            "type": "string"
          }
        }
      }
    },
    "parameters": {
      "ParamCampaignExternalId": {
        "in": "path",
        "name": "campaignExternalId",
        "schema": {
          "type": "string"
        },
        "required": true,
        "example": "example-campaign",
        "description": "External ID of a campaign. See: [Good and Bad External IDs](/docs/good-and-bad-external-ids)"
      }
    },
    "responses": {
      "InternalServerErrorDefault": {
        "description": "If your request broke our code. Send us your request-document to reproduce the error and we'll fix it.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/InternalServerErrorResponse"
            }
          }
        }
      }
    }
  }
}
```