Login and/or Get Current User Info
This endpoint does the following two operations:
- Checks if you are already logged in by looking for a valid
auth
cookie. If you are have a valid auth cookie then no additional auth-related actions are taken. If you are not logged in then it will log you in with theAuthorization
header and set theauth
cookie. Theauth
cookie will only be sent once. - If logged in, this function will also return the CurrentUser object containing detailed information about the currently logged in user.
The auth string after Authorization: Basic {string}
is a base64-encoded string of the username and password, both individually url-encoded, and then joined with a colon.
base64(urlencode(username):urlencode(password))
WARNING: Session Limit: Each authentication with login credentials counts as a separate session, out of which you have a limited amount. Make sure to save and reuse the auth
cookie if you are often restarting the program. The provided API libraries automatically save cookies during runtime, but does not persist during restart. While it can be fine to use username/password during development, expect in production to very fast run into the rate-limit and be temporarily blocked from making new sessions until older ones expire. The exact number of simultaneous sessions is unknown/undisclosed.
Requests made through this page are proxied through an intermediary server due to Cross-Origin Resource Sharing restrictions.
Auth token via Header
In: header
Response Body
curl -X GET "https://api.vrchat.cloud/api/1/auth/user"
fetch("https://api.vrchat.cloud/api/1/auth/user")
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.vrchat.cloud/api/1/auth/user"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
import requests
url = "https://api.vrchat.cloud/api/1/auth/user"
response = requests.request("GET", url)
print(response.text)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.time.Duration;
HttpClient client = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(10))
.build();
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
.uri(URI.create("https://api.vrchat.cloud/api/1/auth/user"))
.GET()
.build();
try {
HttpResponse<String> response = client.send(requestBuilder.build(), BodyHandlers.ofString());
System.out.println("Status code: " + response.statusCode());
System.out.println("Response body: " + response.body());
} catch (Exception e) {
e.printStackTrace();
}
using System;
using System.Net.Http;
using System.Text;
var client = new HttpClient();
var response = await client.GetAsync("https://api.vrchat.cloud/api/1/auth/user");
var responseBody = await response.Content.ReadAsStringAsync();
{
"acceptedTOSVersion": 7,
"acceptedPrivacyVersion": 0,
"accountDeletionDate": "2019-08-24",
"accountDeletionLog": [
{
"message": "Deletion requested",
"deletionScheduled": "2019-08-24T14:15:22Z",
"dateTime": "2019-08-24T14:15:22Z"
}
],
"activeFriends": [
"usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469"
],
"ageVerificationStatus": "hidden",
"ageVerified": true,
"allowAvatarCopying": true,
"authToken": "string",
"badges": [
{
"assignedAt": "2019-08-24T14:15:22Z",
"badgeDescription": "string",
"badgeId": "bdg_a60e514a-8cb7-4702-8f24-2786992be1a8",
"badgeImageUrl": "string",
"badgeName": "string",
"hidden": true,
"showcased": true,
"updatedAt": "2019-08-24T14:15:22Z"
}
],
"bio": "string",
"bioLinks": [
"string"
],
"contentFilters": [
"string"
],
"currentAvatar": "avtr_912d66a4-4714-43b8-8407-7de2cafbf55b",
"currentAvatarImageUrl": "https://api.vrchat.cloud/api/1/file/file_ae46d521-7281-4b38-b365-804b32a1d6a7/1/file",
"currentAvatarThumbnailImageUrl": "https://api.vrchat.cloud/api/1/image/file_aae83ed9-d42d-4d72-9f4b-9f1e41ed17e1/1/256",
"currentAvatarTags": [
"string"
],
"date_joined": "2019-08-24",
"developerType": "none",
"displayName": "string",
"emailVerified": true,
"fallbackAvatar": "avtr_912d66a4-4714-43b8-8407-7de2cafbf55b",
"friendGroupNames": [
"string"
],
"friendKey": "string",
"friends": [
"usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469"
],
"hasBirthday": true,
"hideContentFilterSettings": true,
"userLanguage": "string",
"userLanguageCode": "string",
"hasEmail": true,
"hasLoggedInFromClient": true,
"hasPendingEmail": true,
"homeLocation": "wrld_ba913a96-fac4-4048-a062-9aa5db092812",
"id": "usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469",
"isAdult": true,
"isBoopingEnabled": true,
"isFriend": false,
"last_activity": "2019-08-24T14:15:22Z",
"last_login": "2019-08-24T14:15:22Z",
"last_mobile": "2019-08-24T14:15:22Z",
"last_platform": "standalonewindows",
"obfuscatedEmail": "string",
"obfuscatedPendingEmail": "string",
"oculusId": "string",
"googleId": "string",
"googleDetails": {},
"picoId": "string",
"viveId": "string",
"offlineFriends": [
"usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469"
],
"onlineFriends": [
"usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469"
],
"pastDisplayNames": [
{
"displayName": "string",
"updated_at": "2019-08-24T14:15:22Z"
}
],
"presence": {
"avatarThumbnail": "string",
"currentAvatarTags": "string",
"displayName": "string",
"debugflag": "string",
"groups": [
"grp_71a7ff59-112c-4e78-a990-c7cc650776e5"
],
"id": "usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469",
"instance": "string",
"instanceType": "string",
"isRejoining": "string",
"platform": "string",
"profilePicOverride": "string",
"status": "string",
"travelingToInstance": "string",
"travelingToWorld": "wrld_ba913a96-fac4-4048-a062-9aa5db092812",
"userIcon": "string",
"world": "wrld_ba913a96-fac4-4048-a062-9aa5db092812"
},
"platform_history": [
{
"isMobile": true,
"platform": "string",
"recorded": "2019-08-24T14:15:22Z"
}
],
"profilePicOverride": "string",
"profilePicOverrideThumbnail": "string",
"pronouns": "string",
"queuedInstance": "string",
"receiveMobileInvitations": true,
"state": "offline",
"status": "active",
"statusDescription": "string",
"statusFirstTime": true,
"statusHistory": [
"string"
],
"steamDetails": {},
"steamId": "string",
"tags": [
"string"
],
"twoFactorAuthEnabled": true,
"twoFactorAuthEnabledDate": "2019-08-24T14:15:22Z",
"unsubscribe": true,
"updated_at": "2019-08-24T14:15:22Z",
"userIcon": "string",
"username": "string"
}
{
"error": {
"message": "\"Missing Credentials\"",
"status_code": 401
}
}