> ## 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.

# Update user

> Partially update user via the Junction API. Requires authentication with your team API key.

<RequestExample>
  ```bash cURL theme={null}
  curl --request PATCH \
       --url {{BASE_URL}}/v2/user/{user_id} \
       --header 'Accept: application/json' \
       --header 'x-vital-api-key: <API_KEY>' \
       --header 'Content-Type: application/json' \
       --data '
  {
       "fallback_time_zone": "Europe/London",
       "fallback_birth_date": "1980-03-13"
  }
  '
  ```

  ```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.patch({
      userId: "<user_id>",
      fallbackTimeZone: "Europe/London",
      fallbackBirthDate: "1980-03-13",
  });
  ```

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

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

  client.user.patch(
      "<user_id>",
      fallback_time_zone="Europe/London",
      fallback_birth_date="1980-03-13",
  )
  ```

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

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

  client.user().patch(
      "<user_id>",
      UserPatchBody.builder()
          .fallbackTimeZone("Europe/London")
          .fallbackBirthDate("1980-03-13")
          .build()
  );
  ```

  ```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),
  )

  fallbackTimeZone := "Europe/London"
  fallbackBirthDate := "1980-03-13"
  err := c.User.Patch(context.TODO(), &junction.UserPatchBody{
      UserId:            "<user_id>",
      FallbackTimeZone:  &fallbackTimeZone,
      FallbackBirthDate: &fallbackBirthDate,
  })
  if err != nil {
      return err
  }
  ```
</RequestExample>


## OpenAPI

````yaml PATCH /v2/user/{user_id}
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}:
    patch:
      tags:
        - user
      summary: Patch User
      operationId: patch_user_v2_user__user_id__patch
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: User Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserPatchBody'
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UserPatchBody:
      properties:
        fallback_time_zone:
          anyOf:
            - type: string
            - type: 'null'
          title: Fallback Time Zone
          description: |2-

                Fallback time zone of the user, in the form of a valid IANA tzdatabase identifier (e.g., `Europe/London` or `America/Los_Angeles`).
                Used when pulling data from sources that are completely time zone agnostic (e.g., all time is relative to UTC clock, without any time zone attributions on data points).
                
        fallback_birth_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Fallback Birth Date
          description: >-
            Fallback date of birth of the user, in YYYY-mm-dd format. Used for
            calculating max heartrate for providers that don not provide users'
            age.
        ingestion_start:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Ingestion Start
          description: >-
            Starting bound for user [data ingestion
            bounds](https://docs.tryvital.io/wearables/providers/data-ingestion-bounds).
        ingestion_end:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Ingestion End
          description: >-
            Ending bound for user [data ingestion
            bounds](https://docs.tryvital.io/wearables/providers/data-ingestion-bounds).
        client_user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Client User Id
          description: >-
            A unique ID representing the end user. Typically this will be a user
            ID from your application. Personally identifiable information, such
            as an email address or phone number, should not be used in the
            client_user_id.
      type: object
      title: UserPatchBody
    HTTPValidationError:
      properties:
        detail:
          title: Detail
      type: object
      title: HTTPValidationError
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-vital-api-key
      description: Vital Team API Key

````