# Manage giveaways

> Apart from [displaying][displaying-giveaways] and [creating][create-giveaways] giveaway pools, you can import codes into them, export the codes as a CSV file, and edit or delete them.

> For the complete documentation index, see [llms.txt](https://docs.talon.one/llms.txt).

## Import giveaway codes

You can import codes into a [giveaway pool](/docs/product/giveaways/overview.md) at any time:

1. On the leftmost menu, click **Incentives** > **Giveaways**.
1. Click the name of the pool where you want to import the giveaway codes.
1. In the top-right corner of the page, click **Manage Giveaway Codes** >
 <Upload className="icon"/> **Import Giveaway Codes**.

   :::note
   You can import the same code multiple times. Duplicate codes are treated and distributed
   to customers as unique codes.
   :::

1. Click <Upload className="icon"/> **Upload a CSV file**.

   :::tip
- To see the required structure of the CSV file, click **Download a sample file**.
- To upload codes with custom attributes,
  see [Importing codes with custom attributes](#import-codes-with-custom-attributes).
:::

1. Click **Import Giveaway Codes**.

### Import coupons with custom attributes {#import-codes-with-custom-attributes}

:::important
Before you begin, we recommend you:
- Familiarize yourself with the
  JSON [syntax](https://www.w3schools.com/js/js_json_syntax.asp)
  and [data types](https://www.w3schools.com/js/js_json_datatypes.asp).
- Ensure you know each
  attribute's API name, type, and value.
- Ensure that [location attribute data](/docs/dev/tutorials/use-geolocation) is managed by a technical user.
:::

To import coupons with [custom attributes](/docs/product/account/dev-tools/manage-attributes):

1. In your CSV file, add a column called `attributes`.
1. Insert a **JSON object** listing the key-value pairs in the `attributes` column.

   The pattern is: `{"api_name_1": my_integer_value, "api_name_2": "my_string_value", ...}`.

   :::tip Troubleshooting

   If you use a text editor to edit your CSV file, you may encounter `Import Error: Read
   CSV error parse error on line 2` when you upload the file.
   To solve it, **duplicate all double-quotes**.

   The pattern is: `"{""api_name_1"": my_integer_value, ""api_name_2"": ""my_string_value"", ...}"`.
   :::

The format of the attribute value depends on the attribute type, as shown in the following table:

{

  <colgroup>
    <col span="1" style={{width:20+"%"}}/>
    <col span="1" style={{width:80+"%"}}/>
  </colgroup>
  
    
      Attribute type
      Attribute value format
    
  
  
    
      String
      <code>"value"</code>
    
    
      Number
      <code>1</code>
    
    
      Boolean
      <code>true</code> or <code>false</code>
    
    
      Time
      <code>"2022-03-15T00:00:00Z"</code>
    
    
      Location
      <code>"{'{'}\"name\":\"geofence_name\",\"format\":\"geojson-base64\",\"object\":\"geofence_data\"{'}'}"</code>
    
    
      List of strings
      <code>["value1", "value2", "value3"]</code>
    
    
      List of numbers
      <code>[1, 2, 3]</code>
    
    
      List of dates
      <code>["2022-02-15T00:00:00+02:00", "2022-10-15T00:00:00+02:00", "2022-03-16T00:00:00+02:00"]</code>
    
    
      List of locations
      <code>["{'{'}\"name\":\"geofence_name1\",\"format\":\"geojson-base64\",\"object\":\"geofence_data1\"{'}'}", "{'{'}\"name\":\"geofence_name2\",\"format\":\"geojson-base64\",\"object\":\"geofence_data2\"{'}'}", "{'{'}\"name\":\"geofence_name3\",\"format\":\"geojson-base64\",\"object\":\"geofence_data3\"{'}'}"]</code>
    
  

}

:::note Example
Imagine we want to import a coupon that has two custom attributes:
- A _string_ attribute called `type`.
- A _boolean_ attribute called `added_customer_benefits`.

The content of the `attributes` column in our CSV file must be:
`{"type": "special", "added_customer_benefits": true}`.
:::

## Export giveaway codes

You can export the codes of a [giveaway pool](/docs/product/giveaways/overview.md) at any time:

1. On the leftmost menu, click **Incentives** > **Giveaways**.
1. Click the name of the pool whose giveaway codes you want to export.
1. In the top-right corner of the page, click **Manage Giveaway Codes** >
   <Download className="icon"/> **Export Giveaway Codes**.
1. Select a time period to filter the giveaway codes by their creation date.

   :::tip
   Select **Max** to export all the giveaway codes in your pool.
   :::

1. Click **Export Giveaway Codes**.

:::note
The giveaway codes are exported as a CSV file. For details, see the [Export giveaway codes of a giveaway pool](/management-api#tag/Giveaways/operation/exportPoolGiveaways) endpoint.
:::

## Edit a giveaway pool

You can modify some characteristics of a [giveaway pool](/docs/product/giveaways/overview.md)
after it was created. For example, you can make it available in different Applications.

1. On the leftmost menu, click **Incentives** > **Giveaways**.
1. Click the name of the pool you want to edit.
1. In the top-right corner of the page, click <Edit className="icon" />
 **Edit Giveaway Pool**.
1. Edit the details or download a copy of your giveaway pool, or upload a new CSV file
   with more codes.
1. Click **Save**.

## Delete a giveaway pool

You can delete a [giveaway pool](/docs/product/giveaways/overview.md) if it's not referenced
by the rules of any campaign.

<FeatureAccessInfoBox/>

1. On the leftmost menu, click **Incentives** > **Giveaways**.
1. Click the name of the pool you want to delete.
1. In the top-right corner of the page, click <Edit className="icon" />
 **Edit Giveaway Pool** > <Delete className="icon" /> **Delete Giveaway Pool**.
1. In the pop-up that appears, click **Delete Giveaway Pool**.

## Related pages

- [Manage campaign features](/docs/product/campaigns/settings/manage-campaign-features.md)
- [Create a giveaway campaign](/docs/product/tutorials/giveaway/basic-giveaway.md)
- [Display a giveaway pool][displaying-giveaways]
- [Rewards](/docs/product/rewards/overview.md)

[displaying-giveaways]: /docs/product/giveaways/overview.md#display-a-giveaway-pool
[create-giveaways]: /docs/product/giveaways/create-giveaways.md
