dados.gov.pt Users API

User related operations

GitHub OpenAPI

Operations 13

GET /users/ List all users #
POST /users/ Create a new object #
GET /users/roles/ List all possible user roles #
GET /users/suggest/ Suggest users by name, email or slug #
DELETE /users/{id}/followers/ Unfollow an object given its ID #
GET /users/{id}/followers/ List all followers of a given user (authenticated only) #
POST /users/{id}/followers/ Follow a user given its ID #
DELETE /users/{user}/ Delete a user given its identifier #
GET /users/{user}/ Get a user given its identifier #
PUT /users/{user}/ Update a user given its identifier #
POST /users/{user}/avatar/ Upload a new avatar for a given user #
GET /users/{user}/contacts/ List all user contact points #
GET /users/{user}/following/ List all objects followed by a given user #

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-users-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-users-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: uData API
  title: uData Users API
  version: '1.0'
servers:
- url: /api/1
tags:
- description: User related operations
  name: Users
paths:
  /users/:
    get:
      operationId: list_users
      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:
          - last_name
          - first_name
          - datasets
          - reuses
          - followers
          - views
          - created
          - -last_name
          - -first_name
          - -datasets
          - -reuses
          - -followers
          - -views
          - -created
      - 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: 'Filter by profile role: ''admin'' or ''editor'''
        in: query
        name: role
        schema:
          type: string
      - 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/UserPage'
      summary: List all users
      tags:
      - Users
    post:
      operationId: create_user
      parameters:
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '400':
          description: Validation error
      summary: Create a new object
      tags:
      - Users
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/User'
        required: true
  /users/roles/:
    get:
      operationId: user_roles
      parameters:
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/UserRole'
                type: array
      summary: List all possible user roles
      tags:
      - Users
  /users/suggest/:
    get:
      description: Empty query lists recent users.
      operationId: suggest_users
      parameters:
      - description: The string to autocomplete/suggest. Empty returns the most recent users.
        in: query
        name: q
        schema:
          type: string
          default: ''
      - description: The amount of suggestion to fetch (between 1 and 50)
        in: query
        name: size
        schema:
          type: string
          default: 10
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/UserSuggestion'
                type: array
      summary: Suggest users by name, email or slug
      tags:
      - Users
  /users/{id}/followers/:
    parameters:
    - in: path
      name: id
      required: true
      schema:
        type: string
    delete:
      description: Returns the number of followers left after the operation
      operationId: unfollow_user
      responses:
        '200':
          description: Success
      summary: Unfollow an object given its ID
      tags:
      - Users
    get:
      operationId: list_user_followers
      responses:
        '200':
          description: Success
      summary: List all followers of a given user (authenticated only)
      tags:
      - Users
    post:
      operationId: follow_user
      responses:
        '403':
          description: When trying to follow yourself
      summary: Follow a user given its ID
      tags:
      - Users
  /users/{user}/:
    parameters:
    - in: path
      name: user
      required: true
      schema:
        type: string
    delete:
      operationId: delete_user
      parameters:
      - description: Send formal legal notice with appeal information to owner (admin only)
        in: query
        name: send_legal_notice
        schema:
          type: boolean
          default: false
      - description: 'Do not send the simple deletion notification email. Note: automatically set to True when send_legal_notice=True to avoid sending duplicate emails.'
        in: query
        name: no_mail
        schema:
          type: boolean
          default: false
      - description: Delete comments posted by the user upon user deletion
        in: query
        name: delete_comments
        schema:
          type: boolean
          default: false
      responses:
        '204':
          description: Object deleted
        '403':
          description: When trying to delete yourself
        '404':
          description: User not found
        '410':
          description: User is not active or has been deleted
      summary: Delete a user given its identifier
      tags:
      - Users
    get:
      operationId: get_user
      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/User'
        '404':
          description: User not found
        '410':
          description: User is not active or has been deleted
      summary: Get a user given its identifier
      tags:
      - Users
    put:
      operationId: update_user
      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/User'
        '400':
          description: Validation error
        '404':
          description: User not found
        '410':
          description: User is not active or has been deleted
      summary: Update a user given its identifier
      tags:
      - Users
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/User'
        required: true
  /users/{user}/avatar/:
    parameters:
    - in: path
      name: user
      required: true
      schema:
        type: string
    post:
      operationId: user_avatar
      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/UploadedImage'
      summary: Upload a new avatar for a given user
      tags:
      - Users
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                bbox:
                  type: string
  /users/{user}/contacts/:
    parameters:
    - in: path
      name: user
      required: true
      schema:
        type: string
    get:
      operationId: get_user_contact_point
      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/ContactPointPage'
      summary: List all user contact points
      tags:
      - Users
  /users/{user}/following/:
    parameters:
    - in: path
      name: user
      required: true
      schema:
        type: string
    get:
      operationId: user_following
      responses:
        '404':
          description: User not found
      summary: List all objects followed by a given user
      tags:
      - Users
components:
  schemas:
    User:
      properties:
        about:
          description: The user self description
          format: markdown
          type: string
        active:
          type: boolean
        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
        datasets_count:
          description: Number of visible datasets owned by the user (live count).
          readOnly: true
          type: integer
        email:
          description: The user email
          readOnly: true
          type: object
        first_name:
          description: The user first name
          type: string
        id:
          description: The user identifier
          readOnly: true
          type: string
        last_login_at:
          description: The user last connection date (only present for global admins and on /me)
          readOnly: true
          type: object
        last_name:
          description: The user last name
          type: string
        metrics:
          description: The user metrics
          readOnly: true
          type: object
        migration_invite:
          description: 'True when this account is being invited (optionally) to link a CMD/eIDAS identity: the invite is enabled, linking is not mandatory, the account signs in with a password and holds no identity yet, and the invite has not been dismissed recently. Only present on the caller''s own user'
          readOnly: true
          type: object
        migration_link_available:
          description: 'True when this account can still link a CMD/eIDAS identity: the invite is enabled, linking is not mandatory, and the account signs in with a password and holds no identity yet. Unlike migration_invite this stays true after the notice has been dismissed, so the entry point in the profile does not disappear with it. Only present on the caller''s own user'
          readOnly: true
          type: object
        organizations:
          description: The organization the user belongs to
          items:
            $ref: '#/components/schemas/OrganizationReference'
          type: array
        page:
          description: The user web page URL
          readOnly: true
          type: string
        pending_registration:
          description: True while the account still has a minted saml-* placeholder email; the user must provide a real email to complete registration (only present for global admins and on /me)
          readOnly: true
          type: object
        pending_registration_email:
          description: The email address the CMD assertion carried, offered as a prefill on the registration completion screen. Null for eIDAS (the Minimum Data Set has no email attribute), for a CMD assertion that carried none, and on any user other than the caller
          readOnly: true
          type: object
        reuses_count:
          description: Number of reuses owned by the user (live count).
          readOnly: true
          type: integer
        roles:
          description: Site wide user roles
          items:
            type: string
          type: array
        saml_login:
          description: Whether the current session was authenticated via SAML (only present on the caller's own user, e.g. /me)
          readOnly: true
          type: object
        since:
          description: The registeration date
          format: date-time
          type: string
        slug:
          description: The user permalink string
          readOnly: true
          type: string
        uri:
          description: The API URI for this user
          readOnly: true
          type: string
        website:
          description: The user website
          type: string
      required:
      - first_name
      - last_name
      - since
      type: object
    UserRole:
      properties:
        name:
          description: The role name
          readOnly: true
          type: string
      type: object
    Badge__read:
      properties:
        kind:
          type: string
      required:
      - kind
      type: object
    UserSuggestion:
      properties:
        avatar_url:
          description: The user avatar URL
          readOnly: true
          type: string
        email:
          description: The user email (only the domain for non-admin user)
          readOnly: true
          type: object
        first_name:
          description: The user first name
          readOnly: true
          type: string
        id:
          description: The user identifier
          readOnly: true
          type: string
        last_name:
          description: The user last name
          readOnly: true
          type: string
        slug:
          description: The user permalink string
          readOnly: true
          type: string
      type: object
    UserPage:
      properties:
        data:
          description: The page data
          items:
            $ref: '#/components/schemas/User'
          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
    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
    UploadedImage:
      properties:
        image:
          type: string
        success:
          default: true
          description: Whether the upload succeeded or not.
          readOnly: true
          type: boolean
      type: object
    ContactPointPage:
      properties:
        data:
          description: The page data
          items:
            $ref: '#/components/schemas/ContactPoint__read'
          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
      x-mask: '{data{id,name,email,contact_form,role},*}'
    OrganizationPermissions:
      properties:
        delete:
          type: boolean
        edit:
          type: boolean
        harvest:
          type: boolean
        members:
          type: boolean
        private:
          type: boolean
      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
    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
    ContactPoint__read:
      properties:
        contact_form:
          type: string
        email:
          maxLength: 255
          type: string
        id:
          readOnly: true
          type: string
        name:
          maxLength: 255
          type: string
        organization:
          allOf:
          - $ref: '#/components/schemas/OrganizationReference'
          description: Only present if owner is not set. Can only be set to an organization of the current authenticated user.
        owner:
          allOf:
          - $ref: '#/components/schemas/UserReference'
          description: Only present if organization is not set. Can only be set to the current authenticated user.
        role:
          enum:
          - contact
          - creator
          - publisher
          - rightsHolder
          - custodian
          - distributor
          - originator
          - principalInvestigator
          - processor
          - resourceProvider
          - user
          example: contact
          type: string
      required:
      - id
      - name
      - role
      type: object
      x-mask: '{id,name,email,contact_form,role}'
  securitySchemes:
    apikey:
      in: header
      name: X-API-KEY
      type: apiKey