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

# Get User Demographics

> Retrieve user info latest via the Junction API. Requires authentication with your team API key.

<Card horizontal icon="person-digging" color="#57164A">
  This feature is in **closed beta**.

  Interested in this feature? Get in touch with your Customer Success Manager.
</Card>

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
       --url {{BASE_URL}}/v2/user/{user_id}/info/latest \
       --header 'Accept: application/json' \
       --header 'x-vital-api-key: <API_KEY>' \
       --header 'Content-Type: application/json' \
  ```

  ```typescript TypeScript theme={null}
  import { JunctionClient, JunctionEnvironment } from "@junction-api/sdk";

  const client = new JunctionClient({
      apiKey: "YOUR_API_KEY",
      environment: JunctionEnvironment.Sandbox,
  });

  const data = await client.user.getLatestUserInfo({ userId: "<user_id>" });
  ```

  ```python Python theme={null}
  from junction import Junction
  from junction.environment import JunctionEnvironment

  client = Junction(
      api_key="YOUR_API_KEY",
      environment=JunctionEnvironment.SANDBOX,
  )

  data = client.user.get_latest_user_info("<user_id>")
  ```

  ```java Java theme={null}
  import com.junction.api.Junction;
  import com.junction.api.core.Environment;

  Junction client = Junction.builder()
      .apiKey("YOUR_API_KEY")
      .environment(Environment.SANDBOX)
      .build();

  var data = client.user().getLatestUserInfo("<user_id>");
  ```

  ```go Go theme={null}
  import (
      "context"

      junction "github.com/junction-api/junction-go"
      "github.com/junction-api/junction-go/client"
      "github.com/junction-api/junction-go/option"
  )

  c := client.NewClient(
      option.WithApiKey("YOUR_API_KEY"),
      option.WithBaseURL(junction.Environments.Sandbox),
  )

  response, err := c.User.GetLatestUserInfo(context.TODO(), &junction.GetLatestUserInfoUserRequest{
      UserId: "<user_id>",
  })
  if err != nil {
      return err
  }
  fmt.Printf("Received data %s\n", response)
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "first_name": "John",
    "last_name": "Doe", 
    "email": "john@email.com", 
    "phone_number":"+1123123123",
    "gender": "Male", 
    "dob": "1999-01-01", 
    "address": {
  	  "first_line": "Some Street", 
  	  "second_line": null,
      "zip_code": "85004",
      "state": "AZ",
      "city": "Phoenix"
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /v2/user/{user_id}/info/latest
openapi: 3.1.0
info:
  title: Junction API
  description: https://docs.junction.com/
  version: 0.4.483
servers:
  - url: https://api.us.junction.com
    x-fern-server-name: Production
  - url: https://api.eu.junction.com
    x-fern-server-name: ProductionEU
  - url: https://api.sandbox.us.junction.com
    x-fern-server-name: Sandbox
  - url: https://api.sandbox.eu.junction.com
    x-fern-server-name: SandboxEU
security:
  - apiKeyAuth: []
paths:
  /v2/user/{user_id}/info/latest:
    get:
      tags:
        - user
      summary: Get User Demographcis
      operationId: get_user_demographcis_v2_user__user_id__info_latest_get
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            title: User Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserInfo'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UserInfo:
      properties:
        first_name:
          type: string
          title: First Name
        last_name:
          type: string
          title: Last Name
        email:
          type: string
          title: Email
        phone_number:
          type: string
          title: Phone Number
        gender:
          type: string
          title: Gender
        dob:
          type: string
          format: date
          title: Dob
        address:
          $ref: '#/components/schemas/UserAddress'
        medical_proxy:
          anyOf:
            - $ref: '#/components/schemas/GuarantorDetails'
            - type: 'null'
        race:
          anyOf:
            - $ref: '#/components/schemas/Race'
            - type: 'null'
          description: ℹ️ This enum is non-exhaustive.
        ethnicity:
          anyOf:
            - $ref: '#/components/schemas/Ethnicity'
            - type: 'null'
          description: ℹ️ This enum is non-exhaustive.
        sexual_orientation:
          anyOf:
            - $ref: '#/components/schemas/SexualOrientation'
            - type: 'null'
          description: ℹ️ This enum is non-exhaustive.
        gender_identity:
          anyOf:
            - $ref: '#/components/schemas/GenderIdentity'
            - type: 'null'
          description: ℹ️ This enum is non-exhaustive.
      type: object
      required:
        - first_name
        - last_name
        - email
        - phone_number
        - gender
        - dob
        - address
      title: UserInfo
    HTTPValidationError:
      properties:
        detail:
          title: Detail
      type: object
      title: HTTPValidationError
    UserAddress:
      properties:
        first_line:
          type: string
          title: First Line
        second_line:
          anyOf:
            - type: string
            - type: 'null'
          title: Second Line
          default: ''
        country:
          type: string
          title: Country
        zip:
          type: string
          title: Zip
        city:
          type: string
          title: City
        state:
          type: string
          title: State
        access_notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Access Notes
      type: object
      required:
        - first_line
        - country
        - zip
        - city
        - state
      title: UserAddress
    GuarantorDetails:
      properties:
        first_name:
          type: string
          title: First Name
        last_name:
          type: string
          title: Last Name
        address:
          $ref: '#/components/schemas/Address'
        phone_number:
          type: string
          title: Phone Number
        household_income:
          anyOf:
            - type: integer
            - type: 'null'
          title: Household Income
        household_size:
          anyOf:
            - type: integer
            - type: 'null'
          title: Household Size
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
      type: object
      required:
        - first_name
        - last_name
        - address
        - phone_number
      title: GuarantorDetails
    Race:
      type: string
      enum:
        - african_american_or_black
        - asian
        - indigenous_native_american_alaska_native
        - other
        - pacific_islander_or_hawaiian
        - white_caucasian
      title: Race
      description: ℹ️ This enum is non-exhaustive.
    Ethnicity:
      type: string
      enum:
        - hispanic
        - non_hispanic
        - ashkenazi_jewish
        - other
      title: Ethnicity
      description: ℹ️ This enum is non-exhaustive.
    SexualOrientation:
      type: string
      enum:
        - lesbian_gay_or_homosexual
        - heterosexual_or_straight
        - bisexual
        - dont_know
        - other
      title: SexualOrientation
      description: ℹ️ This enum is non-exhaustive.
    GenderIdentity:
      type: string
      enum:
        - male
        - female
        - female_to_male_ftm_transgender_male_trans_man
        - male_to_female_mtf_transgender_female_trans_woman
        - genderqueer
        - other
      title: GenderIdentity
      description: ℹ️ This enum is non-exhaustive.
    Address:
      properties:
        first_line:
          type: string
          title: First Line
        second_line:
          anyOf:
            - type: string
            - type: 'null'
          title: Second Line
          default: ''
        country:
          type: string
          title: Country
        zip:
          type: string
          title: Zip
        city:
          type: string
          title: City
        state:
          type: string
          title: State
        access_notes:
          anyOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          title: Access Notes
      type: object
      required:
        - first_line
        - country
        - zip
        - city
        - state
      title: Address
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-vital-api-key
      description: Vital Team API Key

````