Configure Mureka API account with auto-refresh
January 19, 2026
Table of contents
Configure your Mureka account for API access using Google OAuth cookies. This method enables automatic token refresh - when your Mureka session expires, the API will automatically refresh it using Google One Tap authentication.
See Setup Mureka for detailed instructions.
Looking for the legacy method with manual token setup?
https://api.useapi.net/v1/mureka/accounts
Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
# Alternatively you can use multipart/form-data
# Content-Type: multipart/form-data
API tokenis required, see Setup useapi.net for details.
Request Body
Option 1: Tab-separated format (paste cookie as copied from DevTools)
{
"sessionCookie": "__Secure-3PSID<TAB>g.a0...secured...076<TAB>.google.com<TAB>/<TAB>2027-02-23T04:38:16.033Z<TAB>167<TAB>✓<TAB>✓<TAB>None<TAB><TAB><TAB>High"
}
Where <TAB> represents actual tab characters as copied from Chrome DevTools.
Option 2: Minimal JSON format
{
"sessionCookie": {"value": "g.a0...secured...076", "expires": "2027-02-23T04:38:16.033Z"}
}
sessionCookieis required. The__Secure-3PSIDcookie fromaccounts.google.com. Accepts:- Tab-separated format (copied directly from Chrome DevTools)
- Minimal JSON:
{"value": "g.a0...secured...076", "expires": "2027-02-23T04:38:16.033Z"} - Full JSON cookie object
Responses
-
Account configured successfully with auto-refresh enabled.
{ "64532357578753": { "account": "64532357578753", "token": "JfE...secured...2sWc", "hasAutoRefresh": true, "tokenIssuedDaysAgo": 0, "updatedUTC": "2026-01-19T04:38:16.000Z", "sessionCookie": { "name": "__Secure-3PSID", "value": "g.a0005wi...secured...90076", "domain": ".google.com", "path": "/", "expires": "2027-02-23T04:38:16.033Z", "httpOnly": true, "secure": true, "sameSite": "None", "added": "2026-01-19T04:38:16.000Z" }, "user": { "id": "64532357578753", "name": "User", "avatar": "https://...", "gold": 40, "vip_type": 2 } } } -
Cookie validation failed or expired.
{ "error": "Google cookie expired on 2025-01-19T04:38:16.033Z. Please provide a fresh cookie.", "code": 597 }Or if the cookie is not found:
{ "error": "Required cookie __Secure-3PSID not found in sessionCookie", "code": 400 } -
{ "error": "Unauthorized", "code": 401 }
Model
{ // TypeScript, all fields are optional
[account: string]: {
account: string
token: string
hasAutoRefresh: boolean
tokenIssuedDaysAgo: number
updatedUTC: string
sessionCookie: {
name: string
value: string
domain: string
path: string
expires: string
httpOnly: boolean
secure: boolean
sameSite: string
added: string
}
user: {
id: string
name: string
avatar: string
gold: number
vip_type: number
}
}
error: string
code: number
}
Automatic Token Refresh
When configured with this endpoint, your Mureka account benefits from automatic token refresh:
- The
__Secure-3PSIDGoogle cookie is valid for approximately 13 months - When your Mureka session token expires (typically after 30 days), the API automatically refreshes it using Google One Tap
- You will receive email notifications when:
- A token refresh is initiated
- The refresh succeeds
- The refresh fails (manual re-setup required)
If automatic refresh fails (e.g., Google invalidated the cookie), you will need to repeat the setup process with fresh cookies.
Examples
-
curl -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer …" \ -X POST https://api.useapi.net/v1/mureka/accounts \ -d '{"sessionCookie": {"value": "g.a0...YOUR_COOKIE_VALUE...076", "expires": "2027-02-23T04:38:16.033Z"}}' -
const apiUrl = 'https://api.useapi.net/v1/mureka/accounts'; const api_token = "API token"; // Option 1: Tab-separated format (paste directly from DevTools) // const sessionCookie = "paste tab-separated cookie row from DevTools here"; // Option 2: Minimal JSON format const sessionCookie = {value: "g.a0...secured...076", expires: "2027-02-23T04:38:16.033Z"}; const response = await fetch(apiUrl, { method: 'POST', headers: { 'Authorization': `Bearer ${api_token}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ sessionCookie }) }); const result = await response.json(); console.log("response", {response, result}); -
import requests apiUrl = "https://api.useapi.net/v1/mureka/accounts" api_token = "API token" # Option 1: Tab-separated format (paste directly from DevTools) # sessionCookie = "paste tab-separated cookie row from DevTools here" # Option 2: Minimal JSON format sessionCookie = {"value": "g.a0...secured...076", "expires": "2027-02-23T04:38:16.033Z"} headers = { "Content-Type": "application/json", "Authorization": f"Bearer {api_token}" } body = { "sessionCookie": sessionCookie } response = requests.post(apiUrl, headers=headers, json=body) print(response, response.json())