# Put

## Update an existing collection

### Parameters:

| Name             | Optional / Required | Data type | Description                                                                                                                 | Default  |
| ---------------- | ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------- | -------- |
| id               | required            | String    | An id of your collections                                                                                                   |          |
| name             | required            | String    | A name for your collection                                                                                                  |          |
| icon             | optional            | String    | The icon used in the App                                                                                                    |          |
| section\_sorting | optional            | String    | Sort sections in a collection manually or automatically (by create\_date\_desc, create\_date\_asc, title\_desc, title\_asc) | manually |

{% tabs %}
{% tab title="curl" %}
Example:

```
curl -X PUT -H "X-ACCESS-TOKEN: YOUR_ACCESS_TOKEN" -d "id=omkYGduXowlyx9WF" -d "name=Holidays 2013" "https://api.yumpu.com/2.0/collection.json"
```

{% endtab %}

{% tab title="PHP" %}
Example:

```php
$data = array(
    'id'=>'omkYGduXowlyx9WF',
    'name' => 'Holidays 2013'
);
$putCollection = $yumpu->putCollection($data);
print_r($putCollection);
```

{% endtab %}

{% tab title="JavaScript" %}
Example:

```javascript
var yumpu = require('yumpu');
yumpu.setToken('yourToken');
var parameters = {
  id: 'omkYGduXowlyx9WF',
  name: 'Holidays 2013'
};
yumpu.putCollection(parameters, function(statusCode, document){
   console.log('Status: ' + statusCode);
   console.log(document);
});
```

{% endtab %}

{% tab title="Java" %}
Example:

```java
Yumpu y = new Yumpu("your access token");
String[] params = { "id=omkYGduXowlyx9WF", "name=Holidays 2013" };
System.out.println(y.putCollection(params));
```

{% endtab %}
{% endtabs %}

Whatever language you are using, the result will be the same.

```bash
{
  "collection": [
    {
      "id": "omkYGduXowlyx9WF",
      "create_date": "2013-09-23 09:05:47",
      "update_date": "2013-09-23 09:11:45",
      "name": "Holidays 2013",
      "icon": "none",
      "order": 0,
      "sections": [
        {
          "id": "omkYGduXowlyx9WF_stVFPUYW3kHX07B6",
          "name": "",
          "description": "",
          "sorting": "manually",
          "order": 0
        }
      ]
    }
  ],
  "state": "success"
}
```
