# Post

## Create a new section

### Parameters:

| Name        | Optional / Required | Data type | Description                                                                                                             | Default  |
| ----------- | ------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------- | -------- |
| id          | required            | String    | One of your collection 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 (by create\_date\_desc, create\_date\_asc, title\_desc, title\_asc) | manually |

### Demo

&#x20;URL Find your token on - [yumpu.com](https://www.yumpu.com/en/account/profile/api) Token&#x20;

&#x20;id  name&#x20;

#### Optional parameters:

&#x20;description  sorting&#x20;

Add optional parametersRun request

```
```

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

```
curl -X POST -H "X-ACCESS-TOKEN: YOUR_ACCESS_TOKEN" -d "id=iMWWKoMS76pjqMoO" -d "name=Sports" "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',
    'name' => 'Sports',
  'description' => 'Sports'
);
$newSection = $yumpu->postSection($data);
print_r($newSection);
```

{% endtab %}

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

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

{% endtab %}
{% endtabs %}

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

```bash
{
   "section": [
     {
       "id": "F54wo1ijuIzhbSfK",
       "create_date": "2013-09-23 10:46:53",
       "update_date": "0000-00-00 00:00:00",
       "name": "Sports",
       "description": "Sports",
       "sorting": "manually",
       "order": 2,
       "documents": ""
     }
   ],
   "state": "success"
 }
```
