# Create a dashboard section

Creates a new section on a specific dashboard.

[endpoint]
base_url = "https://telemetry.betterstack.com"
path = "/api/v2/dashboards/{dashboard_id}/sections"
method = "POST"

[[path_param]]
name = "dashboard_id"
description = "The unique identifier of the dashboard."
required = true
type = "integer"

[[body_param]]
name = "name"
description = "The name of the section."
required = true
type = "string"

[[body_param]]
name = "y"
description = "The vertical position of the section on the dashboard grid. If omitted, it's placed below all existing items."
required = false
type = "integer"

[[body_param]]
name = "collapsed"
description = "Whether the section should be collapsed by default."
required = false
type = "boolean"
default = "false"

[[header]]
name = "Authorization"
description = "Bearer `$TOKEN`"
required = true
type = "string"
[/endpoint]

[responses]
[[response]]
status = 201
description = "The section was created successfully."
body = '''
{
  "data": {
    "id": "891",
    "type": "section",
    "attributes": {
      "name": "New Section",
      "y": 10,
      "collapsed": false
    }
  }
}
'''

[[response]]
status = 422
description = "Validation failed due to missing required attributes."
body = '''
{
  "errors": "Sorry, you are missing some required attributes",
  "required_attributes": [
    "name"
  ]
}
'''
[/responses]

[warning]
If the new section's position overlaps with existing items, the layout will be automatically consolidated after a short delay.
[/warning]

## Example request

```shell
[label cURL]
curl --request POST \
  --url https://telemetry.betterstack.com/api/v2/dashboards/1234/sections \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
    "name": "New Section",
    "y": 10
  }'
```
