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

# Refresh User Data

> Create or submit user refresh via the Junction API. Requires authentication with your team API key.

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

  ```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.refresh({ 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.refresh("<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().refresh("<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.Refresh(context.TODO(), &junction.RefreshUserRequest{
      UserId: "<user_id>",
  })
  if err != nil {
      return err
  }
  fmt.Printf("Received data %s\n", response)
  ```
</RequestExample>


## OpenAPI

````yaml POST /v2/user/refresh/{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/refresh/{user_id}:
    post:
      tags:
        - user
      summary: Refresh User Id
      description: Trigger a manual refresh for a specific user
      operationId: refresh_user_id_v2_user_refresh__user_id__post
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: User Id
        - name: timeout
          in: query
          required: false
          schema:
            type: number
            maximum: 60
            minimum: 5
            default: 10
            title: Timeout
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserRefreshSuccessResponse'
                title: Response Refresh User Id V2 User Refresh  User Id  Post
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserRefreshSuccessResponse'
          description: Accepted
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserRefreshErrorResponse'
          description: Bad Request
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UserRefreshSuccessResponse:
      properties:
        success:
          type: boolean
          const: true
          title: Success
          description: Whether operation was successful or not
        user_id:
          type: string
          format: uuid
          title: 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.
        refreshed_sources:
          items:
            type: string
          type: array
          title: Refreshed Sources
        in_progress_sources:
          items:
            type: string
          type: array
          title: In Progress Sources
        failed_sources:
          items:
            type: string
          type: array
          title: Failed Sources
      type: object
      required:
        - success
        - user_id
        - refreshed_sources
        - in_progress_sources
        - failed_sources
      title: UserRefreshSuccessResponse
      example:
        failed_sources:
          - oura/sleep
        in_progress_sources: []
        refreshed_sources:
          - withings/workouts
          - withings/sleep
          - withings/body
          - withings/vitals/blood_pressure
          - withings/activity
        success: true
        user_id: 1449752e-0d8a-40e0-9206-91ab099b2537
    UserRefreshErrorResponse:
      properties:
        success:
          type: boolean
          const: false
          title: Success
          description: Whether operation was successful or not
        user_id:
          type: string
          format: uuid
          title: 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.
        error:
          type: string
          title: Error
        failed_sources:
          items:
            type: string
          type: array
          title: Failed Sources
      type: object
      required:
        - success
        - user_id
        - error
      title: UserRefreshErrorResponse
      example:
        error: user has no connected sources
        failed_sources: []
        success: false
        user_id: 1449752e-0d8a-40e0-9206-91ab099b2537
    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

````