---
title: "Trigger Creative Exchange from your CI server"
slug: "trigger-creative-exchange-from-your-ci-server"
abstract: "Trigger Creative Exchange from your CI server"
---
# Trigger Creative Exchange from your CI server

To quickly change the styling of your SXA sites, you can trigger Creative Exchange from your Continuous Integration (CI) server. Continuous integration enables you to integrate code changes routinely into the main branch of a repository, and to test the changes, as early and often as possible.

> [!note]
> Before you start working on automating your Creative Exchange deployment, you must understand how to use the [Sitecore PowerShell Extensions Web API](https://doc.sitecorepowershell.com/modules/integration-points/web-api).

<details>
<summary><h2>Trigger export and import</h2></summary>

To trigger export and import using a simple web request:

- Create endpoints for the Creative Exchange import and export. For examples, go to:

    ```

    /sitecore/system/Modules/PowerShell/Script Library/SXA/SXA - Creative Exchange/Web API/ce-export
    /sitecore/system/Modules/PowerShell/Script Library/SXA/SXA - Creative Exchange/Web API/ce-import
    ```

    ![Create endpoints](https://doc.sitecore.com/api/markdown-image/xp/en/developers/sxa/103/sitecore-experience-accelerator/images/3F587F6271B34DAB8FFB73EC47960964.png)

> [!note]
> Do not save your web request items under any of the SXA roots as they might be overwritten in the next release.

1. In the import section, import the cmdlets:

    `Get-CreativeExchangeExportResponse`

    `Get-CreativeExchangeImportResponse`

2. Specify the path. For example:

    `$item = Get-Item -Path "/sitecore/content/Tenant/Site/Home"`

3. Specify the cmdlet and its parameters. For example:

    `$exportArgs = Get-CreativeExchangeExportResponse -CurrentItem $item -DeviceId "{FE5D7FDF-89C0-4D99-9AA3-B5FBD009C9F3}"`

    You can modify the parameters to change the [import](https://doc.sitecore.com/xp/en/developers/sxa/103/sitecore-experience-accelerator/trigger-creative-exchange-from-your-ci-server.html#UUID-5ab8ee18-3344-602b-40cb-348567023da1_id__The_Get-CreativeExchangeImportRespo "Change import options using the Get-CreativeExchangeImportResponse cmdlet")/[export](https://doc.sitecore.com/xp/en/developers/sxa/103/sitecore-experience-accelerator/trigger-creative-exchange-from-your-ci-server.html#UUID-5ab8ee18-3344-602b-40cb-348567023da1_id__The_Get-CreativeExchangeExportRespo "Change export options using the Get-CreativeExchangeExportResponse cmdlet") options.

4. When the export/import is complete, you get the `$exportArgs/$importArgs` object as a result:
    - `$exportArgs` (`Sitecore.XA.Feature.CreativeExchange.Pipelines.Export.Export.ExportArgs`)
    - `$importArgs`
    - (`Sitecore.XA.Feature.CreativeExchange.Pipelines.Export.Export.ImportArgs`)
5. Use the `$responseObject` object to retrieve the content for the parameters.

    You can use it to fetch necessary information and return it as a Web API response. In the following example, we have built a dynamic object and serialized the specified object to JSON format:

    ```csharp
    Import-Function Get-CreativeExchangeExportResponse
    $item = Get-Item -Path "/sitecore/content/Tenant/Site/Home"
    $exportArgs = Get-CreativeExchangeExportResponse -CurrentItem $item -DeviceId "{FE5D7FDF-89C0-4D99-9AA3-B5FBD009C9F3}"
    $responseObject = @{
        "Messages" = $exportArgs.Messages;
        "Result"   = $exportArgs.CreativeExchangeExportStorage.GetResult()
    }
    Set-HostProperty -HostWidth 9999
    [Newtonsoft.Json.JsonConvert]::SerializeObject($responseObject)
    ```

</details>

<details>
<summary><h2>Change export options using the Get-CreativeExchangeExportResponse cmdlet</h2></summary>

The following table describes the available `Get-CreativeExchangeExportResponse` cmdlet parameters.

To change the export options:

- Modify the parameters of the `Get-CreativeExchangeExportResponse` cmdlet.

    | **Type** | **Name** | **Mandatory** | **Default** |
    | --- | --- | --- | --- |
    | `[Item]` | CurrentItem | true |  |
    | `[Sitecore.XA.Feature.CreativeExchange.Storage.CreativeExchangeStorageDefinition]` | StorageDefinition | false | `"Folder on server"` |
    | `[Sitecore.XA.Feature.CreativeExchange.Enums.MarkupMode]` | MarkupMode | false | `[Sitecore.XA.Feature.CreativeExchange.Enums.MarkupMode]::AgencyDrop` |
    | `[Sitecore.XA.Feature.CreativeExchange.Enums.ExportScope]` | ExportScope | false | `[Sitecore.XA.Feature.CreativeExchange.Enums.ExportScope]::Site` |
    | `[Sitecore.XA.Feature.CreativeExchange.Enums.BucketExportMode]` | BucketExportMode | false | `[Sitecore.XA.Feature.CreativeExchange.Enums.BucketExportMode]::OneOfTemplate` |
    | `[string]` | Language | false | `"en"` |
    | `[int]` | FileSizeLimit | false | `0` |
    | `[Sitecore.Data.ID]` | DeviceId | false | `"{FE5D7FDF-89C0-4D99-9AA3-B5FBD009C9F3}"` |
    | `[string]` | UserName | false | `"sitecore\\admin"` |

</details>

<details>
<summary><h2>Change import options using the Get-CreativeExchangeImportResponse cmdlet</h2></summary>

The following table describes the available `Get-CreativeExchangeImportResponse` cmdlet parameters.

To change the import options:

- Modify the parameters of the `Get-CreativeExchangeImportResponse` cmdlet.

    | **Type** | **Name** | **Mandatory** | **Default** |
    | --- | --- | --- | --- |
    | `[Item]` | CurrentItem | true |  |
    | `[Sitecore.XA.Feature.CreativeExchange.Storage.CreativeExchangeStorageDefinition]` | StorageDefinition | false | `"Folder on server"` |
    | `[int]` | FileSizeLimit | false | `0` |
    | `[Sitecore.Data.ID]` | DeviceId | false | `"{FE5D7FDF-89C0-4D99-9AA3-B5FBD009C9F3}"` |

</details>