Configure Mureka API account

January 19, 2026 (July 14, 2026)

Table of contents

  1. Request Headers
  2. Request Body
  3. Responses
  4. Model
  5. Examples
  6. Try It

Configure your Mureka account for API access with the token and refresh_token copied from your browser when you sign in to Mureka. This enables fully browserless automatic token refresh — when your Mureka session token expires, the API refreshes it with the refresh token, with no browser and no Google involved.

See Setup Mureka for step-by-step instructions on copying the two tokens.

https://api.useapi.net/v1/mureka/accounts

Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
Request Body
{
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...secured...E7jlw8",
    "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...secured...hNvmuU"
}
  • token is required. The access_token from the Mureka.ai login response (a JWT starting with eyJ…, ~390 characters).
  • refresh_token is optional but recommended. The refresh_token from the same login response (a JWT starting with eyJ…, ~350 characters). With it, the API keeps your session alive automatically. Without it, the account works for about 30 days (until the token expires) and then must be re-added — no auto-refresh.

When you add the account, the API immediately performs one refresh — this proves the tokens work, takes the session over from your browser, and stores the API’s own rotated pair. It adds roughly ten seconds to the request. If the refresh fails, the account is not saved and the error explains why.

Responses
  • 200 OK

    Account configured successfully with browserless auto-refresh enabled. Token values are masked in the response.

    {
        "123456789012345": {
            "account": "123456789012345",
            "token": "eyJ…secured…",
            "refresh_token": "eyJ…secured…",
            "authMode": "email",
            "token_expires": 1786579200000,
            "refresh_expires": 1789171200000,
            "updated": 1783987200000,
            "email": "[email protected]",
            "hasAutoRefresh": true,
            "tokenIssuedDaysAgo": 0,
            "updatedUTC": "2026-07-14T00:00:00.000Z",
            "tokenExpiresUTC": "2026-08-13T00:00:00.000Z",
            "refreshExpiresUTC": "2026-09-12T00:00:00.000Z"
        }
    }
    
  • 400 Bad Request

    Sent with a refresh_token, but the captured token was rejected — re-capture a fresh one (and if the account is signed in on another browser or device, sign out there first):

    {
      "error": "Could not establish a refreshable Mureka session: Mureka refresh failed (code=2, msg=invalid refresh token). Re-capture a fresh session and try again — if this Mureka account is signed in on another browser or device, sign out of it there first.",
      "code": 400
    }
    
  • 429 Too Many Requests

    The onboarding refresh was rate-limited by Mureka. Wait ~20 seconds and try again.

    {
      "error": "Could not establish a refreshable Mureka session — Mureka refresh rate-limited (9008) — retry shortly. Wait ~20 seconds and try again.",
      "code": 429
    }
    
  • 401 Unauthorized

    {
      "error": "Unauthorized",
      "code": 401
    }
    
Model
{ // TypeScript, all fields are optional
  [account: string]: {
    account: string
    token: string              // masked
    refresh_token: string      // masked
    authMode: "email"
    token_expires: number      // access-token expiry, epoch ms (~30 days out)
    refresh_expires: number    // refresh-token expiry, epoch ms (~60 days out)
    updated: number
    email?: string
    hasAutoRefresh: boolean
    tokenIssuedDaysAgo: number
    updatedUTC: string
    tokenExpiresUTC: string
    refreshExpiresUTC: string
  }
  error: string
  code: number
}
Examples
  • curl -H "Accept: application/json" \
         -H "Content-Type: application/json" \
         -H "Authorization: Bearer …" \
         -X POST https://api.useapi.net/v1/mureka/accounts \
         -d '{"token": "eyJ…YOUR_ACCESS_TOKEN…", "refresh_token": "eyJ…YOUR_REFRESH_TOKEN…"}'
    
  • const apiUrl = 'https://api.useapi.net/v1/mureka/accounts';
    const api_token = "API token";
    const token = "eyJ…YOUR_ACCESS_TOKEN…";          // access_token from the Mureka.ai login response
    const refresh_token = "eyJ…YOUR_REFRESH_TOKEN…"; // refresh_token from the Mureka.ai login response
    
    const response = await fetch(apiUrl, {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${api_token}`,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({ token, refresh_token })
    });
    
    const result = await response.json();
    console.log("response", {response, result});
    
  • import requests
    
    apiUrl = "https://api.useapi.net/v1/mureka/accounts"
    api_token = "API token"
    token = "eyJ…YOUR_ACCESS_TOKEN…"          # access_token from the Mureka.ai login response
    refresh_token = "eyJ…YOUR_REFRESH_TOKEN…" # refresh_token from the Mureka.ai login response
    
    headers = {
        "Content-Type": "application/json",
        "Authorization": f"Bearer {api_token}"
    }
    body = {
        "token": token,
        "refresh_token": refresh_token
    }
    
    response = requests.post(apiUrl, headers=headers, json=body)
    print(response, response.json())
    
Try It