# Put

## Update an existing section

### Parameters:

| Name        | Optional / Required | Data type | Description                                                                                                                    | Default  |
| ----------- | ------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------ | -------- |
| id          | required            | String    | One of your section ids                                                                                                        |          |
| name        | required            | String    | A name for your new section                                                                                                    |          |
| description | optional            | String    | A description for your new section                                                                                             |          |
| sorting     | optional            | String    | Sort documents in section manually or automatically (manually, 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=iMWWKoMS76pjqMoO_F54wo1ijuIzhbSfK" -d "name=Sports 2016" "https://api.yumpu.com/2.0/collection/section.json"
```

{% endtab %}

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

```php
require_once('../yumpu.php');
$yumpu = new Yumpu();
$data = array(
    'id'=>'iMWWKoMS76pjqMoO_F54wo1ijuIzhbSfK',
    'name' => 'Sports 2016'
);
$putSection = $yumpu->putSection($data);
print_r($putSection);
```

{% endtab %}

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

```javascript
var yumpu = require('yumpu');
yumpu.setToken('yourToken');
var parameters = {
  id: 'iMWWKoMS76pjqMoO_F54wo1ijuIzhbSfK',
  name: 'Sports 2016'
};
yumpu.putSection(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=iMWWKoMS76pjqMoO_F54wo1ijuIzhbSfK",
                "name=Sports 2016" };
System.out.println(y.putSection(params));
```

{% endtab %}
{% endtabs %}

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

```bash
{
  "section": [
    {
      "id": "e6WHgwLimYExykjX",
      "create_date": "2016-09-06 15:58:35",
      "update_date": "2016-09-13 10:01:31",
      "name": "Sports 2016",
      "description": "Sports",
      "sorting": "manually",
      "order": 1,
      "documents": {
        "55910932": {
          "id": 55910932,
          "user_id": 106836286,
          "title": "new title",
          "description": "",
          "cover": "https://img.yumpu.com/55910932/1/115x163/new-title.jpg",
          "create_date": "2016-09-06 12:46:48",
          "update_date": "2016-09-06 12:48:03",
          "cover_size": "115x163",
          "pages": 3,
          "language": "de",
          "settings": {
            "privacy_mode": "public"
          },
          "sha1_checksum": "4cf2c13c2692e0054d3837e3c7848ec8319111dd"
        },
        "55914449": {
          "id": 55914449,
          "user_id": 106836286,
          "title": "Audi Modelle",
          "description": "",
          "cover": "https://img.yumpu.com/55914449/1/109x163/audi-modelle.jpg",
          "create_date": "2016-09-07 10:11:48",
          "update_date": "2016-09-07 10:13:03",
          "cover_size": "109x163",
          "pages": 69,
          "language": "de",
          "settings": {
            "privacy_mode": "public"
          },
          "sha1_checksum": "45330f1f1bae0c0344046c487105a2a0efa2c194"
        }
      }
    }
  ],
  "state": "success",
  "status_code": 200,
  "completed_in": 0.1772
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.yumpu.com/api/section/sectionput.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
