{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/open-government-portugal/json-schema/open-government-portugal-user-schema.json",
  "title": "User",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/open-government-portugal-me-api-openapi.yml#/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": "#/$defs/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",
  "$defs": {
    "Badge__read": {
      "properties": {
        "kind": {
          "type": "string"
        }
      },
      "required": [
        "kind"
      ],
      "type": "object"
    },
    "BaseReference": {
      "properties": {
        "class": {
          "description": "The object class",
          "type": "string"
        },
        "id": {
          "description": "The object unique identifier",
          "type": "string"
        }
      },
      "required": [
        "class",
        "id"
      ],
      "type": "object"
    },
    "OrganizationPermissions": {
      "properties": {
        "delete": {
          "type": "boolean"
        },
        "edit": {
          "type": "boolean"
        },
        "harvest": {
          "type": "boolean"
        },
        "members": {
          "type": "boolean"
        },
        "private": {
          "type": "boolean"
        }
      },
      "type": "object"
    },
    "OrganizationReference": {
      "allOf": [
        {
          "$ref": "#/$defs/BaseReference"
        },
        {
          "properties": {
            "acronym": {
              "description": "The organization acronym",
              "type": "string"
            },
            "badges": {
              "description": "The organization badges",
              "items": {
                "$ref": "#/$defs/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": "#/$defs/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"
        }
      ]
    }
  }
}