---
title: "Update marketing expansion"

doc_type: openapi
doc_category: openapi
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-rest-api/marketing/marketing-events/update-marketing-expansion'
  md: 'https://developer.shopline.com/docs/admin-rest-api/marketing/marketing-events/update-marketing-expansion.md'
---
# Update marketing expansion

- **Base URL:** `https://{handle}.myshopline.com/admin/openapi`
- **Required Scopes:** `write_marketing_event`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** RESTful

## Endpoint

```http
POST /sales/marketing_activity_extension/:marketing_activity_id.json
```

## Base URL

* `https://{handle}.myshopline.com/admin/openapi`

  * `{handle}`: `handle` : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is `open001.myshopline.com` , the store handle is `open001` .

## Required Permissions

* `write_marketing_event`

## Request

### Path Parameters

* `marketing_activity_id`

  string (required)

  Marketing expansion campaign id

### Request Headers

* `Content-Type`

  string (required)

  The field must be set to the fixed value `application/json; charset=utf-8`.

* `Authorization`

  string (required)

   The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. 

### Request Body

* `marketing_activity`

  object

  Marketing expansion

  * `utm_medium`

    string

    Source type of logo ( email , article )

  * `marketing_activity_title`

    string

    Marketing expansion campaign title

  * `status`

    string

    Status before marketing campaign , draft:draft,failed:failure,active:active,inactive:inactive,scheduled:scheduled,paused:paused,deleted_externally:deleted on the outside

  * `utm_content`

    string

    Distinguish between different links within the same ad

  * `form_data`

    string

    Json's form data is serialized as a string

  * `started_at`

    string

    Start time

  * `utm_source`

    string

    Identity advertising customers , advertising websites

  * `utm_term`

    string

    Signature search keyword

  * `target_status`

    string

    Target status to be replaced by marketing campaign , draft:draft,failed:failure,active:active,inactive:inactive,scheduled:scheduled,paused:paused,deleted_externally:deleted on the outside

  * `utm_campaign`

    string

    Logo specific advertising

  * `ended_at`

    string

    End time

  * `remote_id`

    string

     unique id for [App] data

## Response

### Status Codes

* `200`

  For the complete list of codes and messages, see [Http status code](https://developer.shopline.com/docs/apps/api-instructions-for-use/http-status-code.md?lang=en).

* `400`

  

* `401`

  

* `429`

  

### Response Headers

* `traceId`

  A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise.

### Response Body

#### 200

* `marketing_activity`

  object

  Marketing expansion

  * `started_at`

    string

    Start time

  * `marketing_activity_title`

    string

    Title of marketing

  * `marketing_activity_id`

    string

    Marketing expansion campaign id

  * `remote_id`

    string

    unique id for [App] data

  * `utm_source`

    string

    Identity advertising customers , advertising websites

  * `utm_term`

    string

    Signature search keyword

  * `ended_at`

    string

    End time

  * `form_data`

    string

    Json's form data is serialized as a string

  * `utm_medium`

    string

    Source type of logo ( email , article )

  * `status`

    string

    Status before marketing campaign , draft:draft,failed:failure,active:active,inactive:inactive,scheduled:scheduled,paused:paused,deleted_externally:deleted on the outside

  * `target_status`

    string

    Target status to be replaced by marketing campaign , draft:draft,failed:failure,active:active,inactive:inactive,scheduled:scheduled,paused:paused,deleted_externally:deleted on the outside

  * `utm_content`

    string

    Distinguish between different links within the same ad

  * `utm_campaign`

    string

    Logo specific advertising


#### 400

* `errors`

  string

  Error message. 


#### 401

* `errors`

  string

  Error message. 


#### 429

* `errors`

  string

  Error message. 


## OpenAPI Definition

```json
{
  "externalDocs": {
    "description": "Permission point used by the interface is `write_marketing_event` , For more information about the use of permission points, see",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=en",
    "errorTableDescription": ""
  },
  "operationId": "fJXmtwWa",
  "parameters": [
    {
      "name": "marketing_activity_id",
      "in": "path",
      "description": "Marketing expansion campaign id",
      "required": true,
      "style": "simple",
      "schema": {
        "name": "marketing_activity_id",
        "description": "Marketing expansion campaign id",
        "type": "string",
        "example": ""
      },
      "example": "",
      "examples": {
        "Edit a marketing expansion activity that doesn ' t exist": {
          "value": "MA_6019932248375043369"
        }
      }
    },
    {
      "name": "Content-Type",
      "in": "header",
      "description": "The field must be set to the fixed value `application/json; charset=utf-8`.",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Content-Type",
        "type": "string",
        "example": "application/json; charset=utf-8"
      }
    },
    {
      "name": "Authorization",
      "in": "header",
      "description": " The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. ",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Authorization",
        "description": " The access token for the API. Please refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then put the obtained access token into the API request header in Bearer Token.",
        "type": "string",
        "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
      },
      "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "marketing_activity": {
              "name": "marketing_activity",
              "description": "Marketing expansion",
              "type": "object",
              "properties": {
                "utm_medium": {
                  "name": "utm_medium",
                  "description": "Source type of logo ( email , article )",
                  "type": "string",
                  "example": "email"
                },
                "marketing_activity_title": {
                  "name": "marketing_activity_title",
                  "description": "Marketing expansion campaign title",
                  "type": "string",
                  "example": "This is marketing activity title"
                },
                "status": {
                  "name": "status",
                  "description": "Status before marketing campaign , draft:draft,failed:failure,active:active,inactive:inactive,scheduled:scheduled,paused:paused,deleted_externally:deleted on the outside",
                  "type": "string",
                  "example": "draft"
                },
                "utm_content": {
                  "name": "utm_content",
                  "description": "Distinguish between different links within the same ad",
                  "type": "string",
                  "example": "googleAds"
                },
                "form_data": {
                  "name": "form_data",
                  "description": "Json's form data is serialized as a string",
                  "type": "string",
                  "example": "{\\\"budget\\\":{\\\"frequency\\\":\\\"DAILY\\\",\\\"currency\\\":\\\"TWD\\\"},\\\"time\\\":{\\\"startTime\\\":1671275280000,\\\"endTime\\\":1671361680000}}"
                },
                "started_at": {
                  "name": "started_at",
                  "description": "Start time",
                  "type": "string",
                  "example": "2022-12-15T09:00:00+08:00"
                },
                "utm_source": {
                  "name": "utm_source",
                  "description": "Identity advertising customers , advertising websites",
                  "type": "string",
                  "example": "www.shopline.com"
                },
                "utm_term": {
                  "name": "utm_term",
                  "description": "Signature search keyword",
                  "type": "string",
                  "example": "this is utm term name"
                },
                "target_status": {
                  "name": "target_status",
                  "description": "Target status to be replaced by marketing campaign , draft:draft,failed:failure,active:active,inactive:inactive,scheduled:scheduled,paused:paused,deleted_externally:deleted on the outside",
                  "type": "string",
                  "example": "active"
                },
                "utm_campaign": {
                  "name": "utm_campaign",
                  "description": "Logo specific advertising",
                  "type": "string",
                  "example": "google"
                },
                "ended_at": {
                  "name": "ended_at",
                  "description": "End time",
                  "type": "string",
                  "example": "2022-12-15T09:00:00+08:00"
                },
                "remote_id": {
                  "name": "remote_id",
                  "description": " unique id for [App] data",
                  "type": "string",
                  "example": "c219fd95-3f9f-4c96-b995-e3b40f87d321"
                }
              },
              "example": {
                "utm_source": "www.shopline.com",
                "form_data": "{\\\"budget\\\":{\\\"frequency\\\":\\\"DAILY\\\",\\\"currency\\\":\\\"TWD\\\"},\\\"time\\\":{\\\"startTime\\\":1671275280000,\\\"endTime\\\":1671361680000}}",
                "utm_content": "googleAds",
                "marketing_activity_title": "This is marketing activity title",
                "remote_id": "c219fd95-3f9f-4c96-b995-e3b40f87d321",
                "utm_campaign": "google",
                "ended_at": "2022-12-15T09:00:00+08:00",
                "utm_term": "this is utm term name",
                "started_at": "2022-12-15T09:00:00+08:00",
                "status": "draft",
                "target_status": "active",
                "utm_medium": "email"
              }
            }
          },
          "example": {
            "marketing_activity": {
              "utm_campaign": "google",
              "form_data": "{\\\"budget\\\":{\\\"frequency\\\":\\\"DAILY\\\",\\\"currency\\\":\\\"TWD\\\"},\\\"time\\\":{\\\"startTime\\\":1671275280000,\\\"endTime\\\":1671361680000}}",
              "status": "draft",
              "utm_medium": "email",
              "utm_term": "this is utm term name",
              "ended_at": "2022-12-15T09:00:00+08:00",
              "started_at": "2022-12-15T09:00:00+08:00",
              "utm_source": "www.shopline.com",
              "target_status": "active",
              "utm_content": "googleAds",
              "marketing_activity_title": "This is marketing activity title",
              "remote_id": "c219fd95-3f9f-4c96-b995-e3b40f87d321"
            }
          }
        },
        "examples": {
          "Edit a marketing expansion activity that doesn ' t exist": {
            "value": {
              "marketing_activity": {
                "utm_content": "googleAds",
                "status": "draft",
                "target_status": "active",
                "utm_campaign": "google",
                "form_data": "{\\\"budget\\\":{\\\"frequency\\\":\\\"DAILY\\\",\\\"currency\\\":\\\"TWD\\\"},\\\"time\\\":{\\\"startTime\\\":1671275280000,\\\"endTime\\\":1671361680000}}",
                "ended_at": "2024-12-15T09:00:00+08:00",
                "remote_id": "c219fd95-3f9f-4c96-b995-e3b40f87d321",
                "utm_source": "www.shopline.com",
                "utm_term": "this is utm term name",
                "marketing_activity_title": "This is marketing activity title",
                "utm_medium": "email",
                "started_at": "2022-12-15T09:00:00+08:00"
              }
            }
          }
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "description": "For the complete list of codes and messages, see [Http status code](https://developer.shopline.com/docs/apps/api-instructions-for-use/http-status-code.md?lang=en).",
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "marketing_activity": {
                "name": "marketing_activity",
                "description": "Marketing expansion",
                "type": "object",
                "properties": {
                  "started_at": {
                    "name": "started_at",
                    "description": "Start time",
                    "type": "string",
                    "example": "2022-12-15T09:00:00+08:00"
                  },
                  "marketing_activity_title": {
                    "name": "marketing_activity_title",
                    "description": "Title of marketing",
                    "type": "string",
                    "example": "Black five activity"
                  },
                  "marketing_activity_id": {
                    "name": "marketing_activity_id",
                    "description": "Marketing expansion campaign id",
                    "type": "string",
                    "example": "MA_5797003750150774786"
                  },
                  "remote_id": {
                    "name": "remote_id",
                    "description": "unique id for [App] data",
                    "type": "string",
                    "example": "123"
                  },
                  "utm_source": {
                    "name": "utm_source",
                    "description": "Identity advertising customers , advertising websites",
                    "type": "string",
                    "example": "www.shopline.com"
                  },
                  "utm_term": {
                    "name": "utm_term",
                    "description": "Signature search keyword",
                    "type": "string",
                    "example": "this is utm term name"
                  },
                  "ended_at": {
                    "name": "ended_at",
                    "description": "End time",
                    "type": "string",
                    "example": "2022-12-15T09:00:00+08:00"
                  },
                  "form_data": {
                    "name": "form_data",
                    "description": "Json's form data is serialized as a string",
                    "type": "string",
                    "example": "{\\\"budget\\\":{\\\"frequency\\\":\\\"DAILY\\\",\\\"currency\\\":\\\"TWD\\\"},\\\"time\\\":{\\\"startTime\\\":1671275280000,\\\"endTime\\\":1671361680000}}"
                  },
                  "utm_medium": {
                    "name": "utm_medium",
                    "description": "Source type of logo ( email , article )",
                    "type": "string",
                    "example": "email"
                  },
                  "status": {
                    "name": "status",
                    "description": "Status before marketing campaign , draft:draft,failed:failure,active:active,inactive:inactive,scheduled:scheduled,paused:paused,deleted_externally:deleted on the outside",
                    "type": "string",
                    "example": "draft"
                  },
                  "target_status": {
                    "name": "target_status",
                    "description": "Target status to be replaced by marketing campaign , draft:draft,failed:failure,active:active,inactive:inactive,scheduled:scheduled,paused:paused,deleted_externally:deleted on the outside",
                    "type": "string",
                    "example": "active"
                  },
                  "utm_content": {
                    "name": "utm_content",
                    "description": "Distinguish between different links within the same ad",
                    "type": "string",
                    "example": "googleAds"
                  },
                  "utm_campaign": {
                    "name": "utm_campaign",
                    "description": "Logo specific advertising",
                    "type": "string",
                    "example": "google"
                  }
                },
                "example": {
                  "utm_content": "googleAds",
                  "ended_at": "2022-12-15T09:00:00+08:00",
                  "started_at": "2022-12-15T09:00:00+08:00",
                  "marketing_activity_id": "MA_5797003750150774786",
                  "utm_source": "www.shopline.com",
                  "utm_term": "this is utm term name",
                  "utm_medium": "email",
                  "remote_id": "123",
                  "status": "draft",
                  "form_data": "{\\\"budget\\\":{\\\"frequency\\\":\\\"DAILY\\\",\\\"currency\\\":\\\"TWD\\\"},\\\"time\\\":{\\\"startTime\\\":1671275280000,\\\"endTime\\\":1671361680000}}",
                  "target_status": "active",
                  "utm_campaign": "google",
                  "marketing_activity_title": "Black five activity"
                }
              }
            },
            "example": {
              "marketing_activity": {
                "remote_id": "123",
                "status": "draft",
                "utm_medium": "email",
                "form_data": "{\\\"budget\\\":{\\\"frequency\\\":\\\"DAILY\\\",\\\"currency\\\":\\\"TWD\\\"},\\\"time\\\":{\\\"startTime\\\":1671275280000,\\\"endTime\\\":1671361680000}}",
                "started_at": "2022-12-15T09:00:00+08:00",
                "utm_source": "www.shopline.com",
                "marketing_activity_id": "MA_5797003750150774786",
                "utm_campaign": "google",
                "utm_term": "this is utm term name",
                "ended_at": "2022-12-15T09:00:00+08:00",
                "utm_content": "googleAds",
                "target_status": "active",
                "marketing_activity_title": "Black five activity"
              }
            }
          }
        }
      }
    },
    "400": {
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "name": "errors",
                "description": "Error message. ",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          },
          "examples": {
            "Edit a marketing expansion activity that doesn ' t exist": {
              "value": {}
            }
          }
        }
      }
    },
    "401": {
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "Error message. ",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    },
    "429": {
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "Error message. ",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": []
    }
  ],
  "method": "post",
  "path": "/sales/marketing_activity_extension/:marketing_activity_id.json",
  "servers": [
    {
      "url": "https://{handle}.myshopline.com/admin/openapi",
      "variables": {
        "handle": {
          "default": "openapiceshidianpu",
          "description": "`handle` : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is `open001.myshopline.com` , the store handle is `open001` ."
        }
      }
    }
  ],
  "info": {
    "title": "Update marketing expansion",
    "version": "v20270301"
  },
  "authIndexes": [
    "write_marketing_event"
  ]
}
```