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

# Get a new userToken with the refreshToken

> Get a new userToken with the refreshToken passed over from sdk/performLogin which matches to the current userToken



## OpenAPI

````yaml openapi/user-controlled-wallets.yaml post /v1/w3s/users/token/refresh
openapi: 3.0.3
info:
  version: '1.0'
  title: User-Controlled Wallets
  description: User-Controlled Wallets API documentation.
servers:
  - url: https://api.circle.com
security:
  - BearerAuth: []
tags:
  - name: Social/ Email Authentication
  - name: PIN Authentication
  - name: Users
  - name: Wallets
  - name: Transactions
  - name: Token Lookup
  - name: Signing
paths:
  /v1/w3s/users/token/refresh:
    post:
      tags:
        - Social/ Email Authentication
      summary: Get a new userToken with the refreshToken
      description: >-
        Get a new userToken with the refreshToken passed over from
        sdk/performLogin which matches to the current userToken
      operationId: refreshUserToken
      parameters:
        - $ref: '#/components/parameters/XUserToken'
        - $ref: '#/components/parameters/XRequestId'
      requestBody:
        $ref: '#/components/requestBodies/RefreshUserToken'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefreshUserToken'
          description: Successfully refreshed the user token.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/NotAuthorized'
      security:
        - BearerAuth: []
components:
  parameters:
    XUserToken:
      name: X-User-Token
      description: Unique system generated JWT session token for specific user.
      required: true
      in: header
      schema:
        type: string
    XRequestId:
      name: X-Request-Id
      in: header
      description: >
        Developer-provided identifier for this request, used for tracing
        requests in Wallets API logs and the Developer Console, and when
        communicating with Circle Support.

        **Must be a UUID to appear in logs.** Non-UUID values are accepted by
        the API but are ignored by logging and tracing systems.
      schema:
        $ref: '#/components/schemas/XRequestId'
  requestBodies:
    RefreshUserToken:
      content:
        application/json:
          schema:
            title: RefreshUserTokenRequest
            type: object
            required:
              - idempotencyKey
              - refreshToken
              - deviceId
            properties:
              idempotencyKey:
                $ref: '#/components/schemas/IdempotencyKey'
              refreshToken:
                $ref: '#/components/schemas/RefreshToken'
              deviceId:
                $ref: '#/components/schemas/DeviceId'
      description: Request body
      required: true
  schemas:
    RefreshUserToken:
      title: RefreshUserTokenResponse
      type: object
      required:
        - data
      properties:
        data:
          type: object
          required:
            - userToken
          properties:
            userToken:
              $ref: '#/components/schemas/UserToken'
            encryptionKey:
              $ref: '#/components/schemas/EncryptionKey'
            userID:
              type: string
              description: Used to identify the user.
              example: ext_user_id
            refreshToken:
              $ref: '#/components/schemas/RefreshToken'
    XRequestId:
      type: string
      format: uuid
      description: >-
        A unique identifier, which can be helpful for identifying a request when
        communicating with Circle support.
      example: 2adba88e-9d63-44bc-b975-9b6ae3440dde
    IdempotencyKey:
      type: string
      description: >-
        Universally unique identifier (UUID v4) idempotency key. This key is
        utilized to ensure exactly-once execution of mutating requests. To
        create a UUIDv4 go to
        [uuidgenerator.net](https://www.uuidgenerator.net). If the same key is
        reused, it will be treated as the same request and the original response
        will be returned.
      example: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11
      format: uuid
    RefreshToken:
      title: RefreshToken
      type: string
      description: >-
        Use the refresh token passed from sdk/performLogin to get a new
        userToken. Each refreshToken has a corresponding userToken for
        verification purposes.
      example: eyJhbGciOiJSUz...kmqSVLDhiI-F8EFYDYjAxIUw
    DeviceId:
      title: DeviceId
      type: string
      description: >-
        Get the device id from SDK, and the deviceToken is bound with this
        device id.
      example: 018d7c79-6b79-71ec-8ad8-ebc2b57a4650
    UserToken:
      type: string
      description: >-
        Unique system generated JWT session token. The token will expire after
        60 minutes.
      example: eyJhbGciOiJS...-F8EFYDYjAxIUw
    EncryptionKey:
      type: string
      description: Encryption key to use with the SDK for initiating user challenges.
      example: 7LcOsm4lUAK2Mg...+6fPjr58=
  headers:
    XRequestId:
      description: >
        Developer-provided header parameter or Circle-generated universally
        unique identifier (UUID v4). Useful for identifying a specific request
        when communicating with Circle Support.
      schema:
        $ref: '#/components/schemas/XRequestId'
  responses:
    BadRequest:
      content:
        application/json:
          schema:
            type: object
            title: BadRequestResponse
            required:
              - code
              - message
            properties:
              code:
                type: integer
                description: Code that corresponds to the error.
              message:
                type: string
                description: Message that describes the error.
            example:
              code: 400
              message: Bad request.
      description: Request cannot be processed due to a client error.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
    NotAuthorized:
      content:
        application/json:
          schema:
            type: object
            title: NotAuthorizedResponse
            required:
              - code
              - message
            properties:
              code:
                type: integer
                description: Code that corresponds to the error.
              message:
                type: string
                description: Message that describes the error.
            example:
              code: 401
              message: Malformed authorization.
      description: >-
        Request has not been applied because it lacks valid authentication
        credentials.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: PREFIX:ID:SECRET
      description: >-
        Circle's API Keys are formatted in the following structure
        "PREFIX:ID:SECRET". All three parts are required to make a successful
        request.

````