import requests
import json


def call_refresh_api(refresh_token: str) -> dict:
    """
    Refresh IdToken

    Parameters
    ----------
    refresh_token : str
        refresh token.

    Returns
    -------
    out : dict

    """
    headers = {"accept": "application/json"}
    data = {"refresh-token": refresh_token}

    response = requests.post(
        "https://api.jpx-jquants.com/refresh",
        headers=headers,
        data=json.dumps(data),
    )

    out = json.loads(response.text)
    return out