dados.gov.pt Discussions API

Discussion related operations

GitHub OpenAPI

Operations 9

GET /discussions/ List all Discussions #
POST /discussions/ Create a new Discussion #
DELETE /discussions/{id}/ Delete a discussion given its ID #
GET /discussions/{id}/ Get a discussion given its ID #
POST /discussions/{id}/ Add comment and optionally close a discussion given its ID #
PUT /discussions/{id}/ Update a discussion given its ID #
DELETE /discussions/{id}/comments/{cidx}/ Delete a comment given its index #
PUT /discussions/{id}/comments/{cidx}/ Edit a comment given its index #
GET /discussions/search/ List or search all discussions #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/open-government-portugal:open-government-portugal-discussions-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

open-government-portugal-discussions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Open Government Portugal Discussions API
  version: '1.0'
  description: 'Operations tagged discussions across 2 of this provider''s published API definitions: dados-gov-pt-api-v1-swagger.json, dados-gov-pt-api-v2-swagger.json. Each path carries the servers of the definition it was published in.'
servers:
- url: /api/1
- url: /api/2
tags:
- description: Discussion related operations
  name: Discussions
paths:
  /discussions/:
    get:
      operationId: list_discussions
      parameters:
      - description: The search query
        in: query
        name: q
        schema:
          type: string
      - description: The field (and direction) on which sorting apply
        in: query
        name: sort
        schema:
          type: string
          enum:
          - created
          - title
          - closed
          - discussion.posted_on
          - -created
          - -title
          - -closed
          - -discussion.posted_on
          default: -created
      - description: Filters discussions on their closed status if specified
        in: query
        name: closed
        schema:
          type: boolean
      - description: Filter discussions for a given subject
        in: query
        name: for
        style: form
        explode: true
        schema:
          type: array
          items:
            type: string
      - description: Filter discussions for a given organization
        in: query
        name: org
        schema:
          type: string
      - description: Filter discussions created by a user
        in: query
        name: user
        schema:
          type: string
      - description: The page to fetch
        in: query
        name: page
        schema:
          type: integer
          default: 1
      - description: The page size to fetch
        in: query
        name: page_size
        schema:
          type: integer
          default: 20
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscussionPage'
      summary: List all Discussions
      tags:
      - Discussions
    post:
      operationId: create_discussion
      parameters:
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Discussion'
        '400':
          description: Validation error
        '409':
          description: Duplicate discussion recently submitted
        '429':
          description: Rate limit exceeded
      summary: Create a new Discussion
      tags:
      - Discussions
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DiscussionStart'
        required: true
    servers:
    - url: /api/1
  /discussions/{id}/:
    parameters:
    - in: path
      name: id
      required: true
      schema:
        type: string
    delete:
      operationId: delete_discussion
      parameters:
      - description: Send formal legal notice with appeal information to owner (admin only)
        in: query
        name: send_legal_notice
        schema:
          type: boolean
          default: false
      responses:
        '403':
          description: Not allowed to delete this discussion
      summary: Delete a discussion given its ID
      tags:
      - Discussions
    get:
      operationId: get_discussion
      parameters:
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Discussion'
      summary: Get a discussion given its ID
      tags:
      - Discussions
    post:
      operationId: comment_discussion
      parameters:
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Discussion'
        '403':
          description: Not allowed to close this discussion OR can't add comments on a closed discussion
      summary: Add comment and optionally close a discussion given its ID
      tags:
      - Discussions
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DiscussionResponse'
        required: true
    put:
      operationId: update_discussion
      parameters:
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Discussion'
        '403':
          description: Not allowed to update this discussion
      summary: Update a discussion given its ID
      tags:
      - Discussions
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DiscussionEditComment'
        required: true
    servers:
    - url: /api/1
  /discussions/{id}/comments/{cidx}/:
    parameters:
    - in: path
      name: id
      required: true
      schema:
        type: string
    - in: path
      name: cidx
      required: true
      schema:
        type: integer
    delete:
      operationId: delete_discussion_comment
      parameters:
      - description: Send formal legal notice with appeal information to owner (admin only)
        in: query
        name: send_legal_notice
        schema:
          type: boolean
          default: false
      responses:
        '403':
          description: Not allowed to delete this comment
      summary: Delete a comment given its index
      tags:
      - Discussions
    put:
      operationId: edit_discussion_comment
      parameters:
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Discussion'
        '403':
          description: Not allowed to edit this comment
      summary: Edit a comment given its index
      tags:
      - Discussions
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DiscussionEditComment'
        required: true
    servers:
    - url: /api/1
  /discussions/search/:
    get:
      operationId: search_discussions
      parameters:
      - description: The search query
        in: query
        name: q
        schema:
          type: string
      - in: query
        name: closed
        schema:
          type: boolean
      - in: query
        name: last_update_range
        schema:
          type: string
          enum:
          - last_30_days
          - last_12_months
          - last_3_years
      - description: The field (and direction) on which sorting apply
        in: query
        name: sort
        schema:
          type: string
          enum:
          - created
          - closed
          - -created
          - -closed
      - description: The page to display
        in: query
        name: page
        schema:
          type: integer
          default: 1
      - description: The page size
        in: query
        name: page_size
        schema:
          type: integer
          default: 20
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscussionPage_2'
      summary: List or search all discussions
      tags:
      - Discussions
    servers:
    - url: /api/2
components:
  schemas:
    DiscussionEditComment:
      properties:
        comment:
          description: The new comment
          type: string
      required:
      - comment
      type: object
    Badge__read:
      properties:
        kind:
          type: string
      required:
      - kind
      type: object
    DiscussionPermissions:
      properties:
        close:
          type: boolean
        delete:
          type: boolean
        edit:
          type: boolean
      type: object
    DiscussionResponse:
      properties:
        close:
          description: Is this a closing response. Only subject owner can close
          type: boolean
        comment:
          description: The comment to submit
          type: string
      required:
      - comment
      type: object
    BaseReference:
      discriminator:
        propertyName: class
      properties:
        class:
          description: The object class
          type: string
        id:
          description: The object unique identifier
          type: string
      required:
      - class
      - id
      type: object
    Discussion:
      discriminator:
        propertyName: class
      properties:
        class:
          description: The object class
          type: string
        closed:
          description: The discussion closing date
          format: date-time
          type: string
        closed_by:
          allOf:
          - $ref: '#/components/schemas/UserReference'
          description: The user who closed the discussion
        closed_by_organization:
          allOf:
          - $ref: '#/components/schemas/OrganizationReference'
          description: The organization who closed the discussion
        created:
          description: The discussion creation date
          format: date-time
          type: string
        discussion:
          $ref: '#/components/schemas/DiscussionMessage'
        extras:
          description: Extra attributes as key-value pairs
          type: object
        id:
          description: The discussion identifier
          type: string
        organization:
          allOf:
          - $ref: '#/components/schemas/OrganizationReference'
          description: The discussion author
        permissions:
          $ref: '#/components/schemas/DiscussionPermissions'
        self_web_url:
          description: The discussion web URL
          type: string
        subject:
          allOf:
          - $ref: '#/components/schemas/ModelReference'
          description: The discussion target object
        title:
          description: The discussion title
          type: string
        url:
          description: The discussion API URI
          type: string
        user:
          allOf:
          - $ref: '#/components/schemas/UserReference'
          description: The discussion author
      required:
      - class
      type: object
    UserReference:
      allOf:
      - $ref: '#/components/schemas/BaseReference'
      - properties:
          avatar:
            description: The user avatar URL
            type: string
          avatar_thumbnail:
            description: The user avatar thumbnail URL. This is the square (500x500) and cropped version.
            type: string
          first_name:
            description: The user first name
            readOnly: true
            type: string
          last_name:
            description: The user larst name
            readOnly: true
            type: string
          page:
            description: The user web page URL
            readOnly: true
            type: string
          slug:
            description: The user permalink string
            readOnly: true
            type: string
          uri:
            description: The API URI for this user
            readOnly: true
            type: string
        type: object
    DiscussionMessagePermissions:
      properties:
        delete:
          type: boolean
        edit:
          type: boolean
      type: object
    DiscussionMessage:
      properties:
        content:
          description: The message body
          type: string
        id:
          description: The message identifier
          type: string
        last_modified_at:
          description: The message last edit date
          format: date-time
          type: string
        permissions:
          $ref: '#/components/schemas/DiscussionMessagePermissions'
        posted_by:
          allOf:
          - $ref: '#/components/schemas/UserReference'
          description: The message author
        posted_by_organization:
          allOf:
          - $ref: '#/components/schemas/OrganizationReference'
          description: The organization to show to users
        posted_on:
          description: The message posting date
          format: date-time
          type: string
      type: object
    OrganizationPermissions:
      properties:
        delete:
          type: boolean
        edit:
          type: boolean
        harvest:
          type: boolean
        members:
          type: boolean
        private:
          type: boolean
      type: object
    DiscussionPage:
      properties:
        data:
          description: The page data
          items:
            $ref: '#/components/schemas/Discussion'
          type: array
        next_page:
          description: The next page URL if exists
          type: string
        page:
          description: The current page
          minimum: 1
          type: integer
        page_size:
          description: The page size used for pagination
          minimum: 0
          type: integer
        previous_page:
          description: The previous page URL if exists
          type: string
        total:
          description: The total paginated items
          minimum: 0
          type: integer
      required:
      - page
      - page_size
      - total
      type: object
    OrganizationReference:
      allOf:
      - $ref: '#/components/schemas/BaseReference'
      - properties:
          acronym:
            description: The organization acronym
            type: string
          badges:
            description: The organization badges
            items:
              $ref: '#/components/schemas/Badge__read'
            readOnly: true
            type: array
          logo:
            description: The organization logo URL
            type: string
          logo_thumbnail:
            description: The organization logo thumbnail URL. This is the square (100x100) and cropped version.
            type: string
          name:
            description: The organization name
            readOnly: true
            type: string
          page:
            description: The organization web page URL
            readOnly: true
            type: string
          permissions:
            allOf:
            - $ref: '#/components/schemas/OrganizationPermissions'
            readOnly: true
          slug:
            description: The organization string used as permalink
            readOnly: true
            type: string
          uri:
            description: The API URI for this organization
            readOnly: true
            type: string
        type: object
    ModelReference:
      properties:
        class:
          description: The model class
          type: string
        id:
          description: The object identifier
          type: string
      required:
      - class
      - id
      type: object
    DiscussionStart:
      properties:
        comment:
          description: The content of the initial comment
          type: string
        extras:
          description: Extras attributes as key-value pairs
          type: object
        organization:
          allOf:
          - $ref: '#/components/schemas/OrganizationReference'
          description: Publish in the name of this organization
        subject:
          allOf:
          - $ref: '#/components/schemas/ModelReference'
          description: The discussion target object
        title:
          description: The title of the discussion to open
          type: string
      required:
      - comment
      - subject
      - title
      type: object
    UserReference_2:
      properties:
        avatar:
          description: The user avatar URL
          type: string
        avatar_thumbnail:
          description: The user avatar thumbnail URL. This is the square (500x500) and cropped version.
          type: string
        first_name:
          description: The user first name
          readOnly: true
          type: string
        last_name:
          description: The user larst name
          readOnly: true
          type: string
        page:
          description: The user web page URL
          readOnly: true
          type: string
        slug:
          description: The user permalink string
          readOnly: true
          type: string
        uri:
          description: The API URI for this user
          readOnly: true
          type: string
      type: object
    DiscussionPage_2:
      properties:
        data:
          description: The page data
          items:
            $ref: '#/components/schemas/Discussion'
          type: array
        facets:
          description: Facets/aggregations for filtering
          type: object
        next_page:
          description: The next page URL if exists
          type: string
        page:
          description: The current page
          minimum: 1
          type: integer
        page_size:
          description: The page size used for pagination
          minimum: 0
          type: integer
        previous_page:
          description: The previous page URL if exists
          type: string
        total:
          description: The total paginated items
          minimum: 0
          type: integer
      required:
      - page
      - page_size
      - total
      type: object
    OrganizationReference_2:
      properties:
        acronym:
          description: The organization acronym
          type: string
        badges:
          description: The organization badges
          items:
            $ref: '#/components/schemas/Badge__read'
          readOnly: true
          type: array
        logo:
          description: The organization logo URL
          type: string
        logo_thumbnail:
          description: The organization logo thumbnail URL. This is the square (100x100) and cropped version.
          type: string
        name:
          description: The organization name
          readOnly: true
          type: string
        page:
          description: The organization web page URL
          readOnly: true
          type: string
        permissions:
          allOf:
          - $ref: '#/components/schemas/OrganizationPermissions'
          readOnly: true
        slug:
          description: The organization string used as permalink
          readOnly: true
          type: string
        uri:
          description: The API URI for this organization
          readOnly: true
          type: string
      type: object
  securitySchemes:
    apikey:
      in: header
      name: X-API-KEY
      type: apiKey
x-refined-from:
- dados-gov-pt-api-v1-swagger.json
- dados-gov-pt-api-v2-swagger.json