---
title: "Add comment and optionally close a discussion given its ID"
method: POST
path: "/discussions/{id}/"
tags: ["discussions"]
---

# Add comment and optionally close a discussion given its ID

`POST /discussions/{id}/`

## Request

- Base URL: `https://dados.gov.pt/api/1`
- URL: `https://dados.gov.pt/api/1/discussions/{id}/`
- Auth: none declared

## Headers

- `X-Fields` string, mask

## Request body

- DiscussionResponse
  - `close` boolean: Is this a closing response. Only subject owner can close
  - `comment` string, required: The comment to submit

## Response `200`

Success

- Discussion
  - `class` string, required: The object class
  - `closed` string, date-time: The discussion closing date
  - `closed_by` UserReference
    - `class` string, required: The object class
    - `id` string, required: The object unique identifier
    - `avatar` string: The user avatar URL
    - `avatar_thumbnail` string: The user avatar thumbnail URL. This is the square (500x500) and cropped version.
    - `first_name` string: The user first name
    - `last_name` string: The user larst name
    - `page` string: The user web page URL
    - `slug` string: The user permalink string
    - `uri` string: The API URI for this user
  - `closed_by_organization` OrganizationReference
    - `class` string, required: The object class
    - `id` string, required: The object unique identifier
    - `acronym` string: The organization acronym
    - `badges` BadgeRead[]: The organization badges
      - `kind` string, required
    - `logo` string: The organization logo URL
    - `logo_thumbnail` string: The organization logo thumbnail URL. This is the square (100x100) and cropped version.
    - `name` string: The organization name
    - `page` string: The organization web page URL
    - `permissions` OrganizationPermissions
      - `delete` boolean
      - `edit` boolean
      - `harvest` boolean
      - `members` boolean
      - `private` boolean
    - `slug` string: The organization string used as permalink
    - `uri` string: The API URI for this organization
  - `created` string, date-time: The discussion creation date
  - `discussion` DiscussionMessage
    - `content` string: The message body
    - `id` string: The message identifier
    - `last_modified_at` string, date-time: The message last edit date
    - `permissions` DiscussionMessagePermissions
      - `delete` boolean
      - `edit` boolean
    - `posted_by` UserReference
      - `class` string, required: The object class
      - `id` string, required: The object unique identifier
      - `avatar` string: The user avatar URL
      - `avatar_thumbnail` string: The user avatar thumbnail URL. This is the square (500x500) and cropped version.
      - `first_name` string: The user first name
      - `last_name` string: The user larst name
      - `page` string: The user web page URL
      - `slug` string: The user permalink string
      - `uri` string: The API URI for this user
    - `posted_by_organization` OrganizationReference
      - `class` string, required: The object class
      - `id` string, required: The object unique identifier
      - `acronym` string: The organization acronym
      - `badges` BadgeRead[]: The organization badges
        - `kind` string, required
      - `logo` string: The organization logo URL
      - `logo_thumbnail` string: The organization logo thumbnail URL. This is the square (100x100) and cropped version.
      - `name` string: The organization name
      - `page` string: The organization web page URL
      - `permissions` OrganizationPermissions
        - `delete` boolean
        - `edit` boolean
        - `harvest` boolean
        - `members` boolean
        - `private` boolean
      - `slug` string: The organization string used as permalink
      - `uri` string: The API URI for this organization
    - `posted_on` string, date-time: The message posting date
  - `extras` object: Extra attributes as key-value pairs
  - `id` string: The discussion identifier
  - `organization` OrganizationReference
    - `class` string, required: The object class
    - `id` string, required: The object unique identifier
    - `acronym` string: The organization acronym
    - `badges` BadgeRead[]: The organization badges
      - `kind` string, required
    - `logo` string: The organization logo URL
    - `logo_thumbnail` string: The organization logo thumbnail URL. This is the square (100x100) and cropped version.
    - `name` string: The organization name
    - `page` string: The organization web page URL
    - `permissions` OrganizationPermissions
      - `delete` boolean
      - `edit` boolean
      - `harvest` boolean
      - `members` boolean
      - `private` boolean
    - `slug` string: The organization string used as permalink
    - `uri` string: The API URI for this organization
  - `permissions` DiscussionPermissions
    - `close` boolean
    - `delete` boolean
    - `edit` boolean
  - `self_web_url` string: The discussion web URL
  - `subject` ModelReference
    - `class` string, required: The model class
    - `id` string, required: The object identifier
  - `title` string: The discussion title
  - `url` string: The discussion API URI
  - `user` UserReference
    - `class` string, required: The object class
    - `id` string, required: The object unique identifier
    - `avatar` string: The user avatar URL
    - `avatar_thumbnail` string: The user avatar thumbnail URL. This is the square (500x500) and cropped version.
    - `first_name` string: The user first name
    - `last_name` string: The user larst name
    - `page` string: The user web page URL
    - `slug` string: The user permalink string
    - `uri` string: The API URI for this user

## Other responses

- `403`: Not allowed to close this discussion OR can't add comments on a closed discussion

---

[API](https://skmtc.dev/dados/apis/udata-api.md) - [All operations](https://skmtc.dev/dados/apis/udata-api/llms.txt) - [OpenAPI document](https://skmtc.dev/dados/apis/udata-api/revisions/77edaf8a00ea?raw)
