> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hopae.com/llms.txt
> Use this file to discover all available pages before exploring further.

# User

> User object shape and copy‑paste types for OIDC/REST /userinfo responses.

**Scope**

* OIDC: `GET /userinfo`
* REST API: `GET /verifications/{id}/userinfo`

## User (shape)

```ts theme={null}
// TS-like structural shape (snake_case keys)
type UserShape = {
  // Profile
  name?: string
  given_name?: string
  family_name?: string
  middle_name?: string
  preferred_username?: string
  nickname?: string
  picture?: string

  // Personal details
  birthdate?: string // YYYY-MM-DD
  gender?: string
  nationality?: string // ISO-3166-1 alpha-2

  // Contacts
  email?: string
  email_verified?: boolean
  phone_number?: string // E.164
  phone_number_verified?: boolean

  // Address (OIDC Address Claim)
  address?: {
    formatted?: string
    street_address?: string
    locality?: string
    region?: string
    postal_code?: string
    country?: string
    [k: string]: unknown // provider-specific extensions
  }

  [k: string]: unknown // provider-specific extensions
}
```

## Copy & Paste Types

<Tabs>
  <Tab title="TypeScript">
    ```ts theme={null}
    export interface User {
      // Profile
      name?: string
      given_name?: string
      family_name?: string
      middle_name?: string
      preferred_username?: string
      nickname?: string
      picture?: string

      // Personal details
      birthdate?: string // YYYY-MM-DD
      gender?: string
      nationality?: string // ISO-3166-1 alpha-2

      // Contacts
      email?: string
      email_verified?: boolean
      phone_number?: string
      phone_number_verified?: boolean

      // Address (OIDC Address Claim)
      address?: {
        formatted?: string
        street_address?: string
        locality?: string
        region?: string
        postal_code?: string
        country?: string
        [key: string]: any
      }

      [key: string]: any
    }
    ```
  </Tab>

  <Tab title="Go">
    ```go theme={null}
    package models

    type User struct {
      // Profile
      Name              string `json:"name,omitempty"`
      GivenName         string `json:"given_name,omitempty"`
      FamilyName        string `json:"family_name,omitempty"`
      MiddleName        string `json:"middle_name,omitempty"`
      PreferredUsername string `json:"preferred_username,omitempty"`
      Nickname          string `json:"nickname,omitempty"`
      Picture           string `json:"picture,omitempty"`

      // Personal details
      Birthdate   string `json:"birthdate,omitempty"`
      Gender      string `json:"gender,omitempty"`
      Nationality string `json:"nationality,omitempty"`

      // Contacts
      Email               string `json:"email,omitempty"`
      EmailVerified       *bool  `json:"email_verified,omitempty"`
      PhoneNumber         string `json:"phone_number,omitempty"`
      PhoneNumberVerified *bool  `json:"phone_number_verified,omitempty"`

      // Address
      Address *Address `json:"address,omitempty"`
    }

    type Address struct {
      Formatted     string `json:"formatted,omitempty"`
      StreetAddress string `json:"street_address,omitempty"`
      Locality      string `json:"locality,omitempty"`
      Region        string `json:"region,omitempty"`
      PostalCode    string `json:"postal_code,omitempty"`
      Country       string `json:"country,omitempty"`
    }
    ```
  </Tab>

  <Tab title="C#">
    ```csharp theme={null}
    using System.Text.Json.Serialization;

    public class User {
      // Profile
      [JsonPropertyName("name")] public string? Name { get; set; }
      [JsonPropertyName("given_name")] public string? GivenName { get; set; }
      [JsonPropertyName("family_name")] public string? FamilyName { get; set; }
      [JsonPropertyName("middle_name")] public string? MiddleName { get; set; }
      [JsonPropertyName("preferred_username")] public string? PreferredUsername { get; set; }
      [JsonPropertyName("nickname")] public string? Nickname { get; set; }
      [JsonPropertyName("picture")] public string? Picture { get; set; }

      // Personal details
      [JsonPropertyName("birthdate")] public string? Birthdate { get; set; }
      [JsonPropertyName("gender")] public string? Gender { get; set; }
      [JsonPropertyName("nationality")] public string? Nationality { get; set; }

      // Contacts
      [JsonPropertyName("email")] public string? Email { get; set; }
      [JsonPropertyName("email_verified")] public bool? EmailVerified { get; set; }
      [JsonPropertyName("phone_number")] public string? PhoneNumber { get; set; }
      [JsonPropertyName("phone_number_verified")] public bool? PhoneNumberVerified { get; set; }

      // Address
      [JsonPropertyName("address")] public Address? Address { get; set; }
    }

    public class Address {
      [JsonPropertyName("formatted")] public string? Formatted { get; set; }
      [JsonPropertyName("street_address")] public string? StreetAddress { get; set; }
      [JsonPropertyName("locality")] public string? Locality { get; set; }
      [JsonPropertyName("region")] public string? Region { get; set; }
      [JsonPropertyName("postal_code")] public string? PostalCode { get; set; }
      [JsonPropertyName("country")] public string? Country { get; set; }
    }
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    public class User {
      // Profile
      public String name;
      public String given_name;
      public String family_name;
      public String middle_name;
      public String preferred_username;
      public String nickname;
      public String picture;

      // Personal details
      public String birthdate;       // YYYY-MM-DD
      public String gender;
      public String nationality;     // ISO-3166-1 alpha-2

      // Contacts
      public String email;
      public Boolean email_verified;
      public String phone_number;
      public Boolean phone_number_verified;

      // Address
      public static class Address {
        public String formatted;
        public String street_address;
        public String locality;
        public String region;
        public String postal_code;
        public String country;
      }
      public Address address;
    }
    ```
  </Tab>
</Tabs>

## Notes

* Providers may include additional properties under `user.*`.
