curl --request GET \
--url https://api.moonkey.fun/v1/auth/users/{user_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.moonkey.fun/v1/auth/users/{user_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.moonkey.fun/v1/auth/users/{user_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.moonkey.fun/v1/auth/users/{user_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.moonkey.fun/v1/auth/users/{user_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.moonkey.fun/v1/auth/users/{user_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moonkey.fun/v1/auth/users/{user_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"user_id": "user_24wFP9pDa9YiMJLun94iKykoZs2",
"first_name": "",
"middle_name": "",
"last_name": "",
"status": "active",
"active": true,
"updated_at": 1646873318,
"created_at": 1646873318,
"emails": [
{
"id": "email_26AjWpEcss2YyqFh1san6Wjjs7o",
"verified": true,
"email": "hello@moonkey.fun",
"updated_at": 1646957196,
"created_at": 1646873318
},
{
"id": "email_24oXBL3PufzHkH1Jzyjc2EXYeo7",
"verified": false,
"email": "sandbox@moonkey.fun",
"updated_at": 1642703333,
"created_at": 1642703333
}
],
"phone_numbers": [
{
"id": "pn_24oXBLRv6BoHXbNZoTAZkAFlRsy",
"verified": false,
"phone_number": "+14152222222",
"updated_at": 1642703333,
"created_at": 1642703333
}
],
"idp_providers": [
{
"id": "idpuser_28SRho5nbD045LGq2btZWXhkdjN",
"provider": "google",
"provider_subject": "100157402424066154830",
"idp_type": "oauth",
"method_id": "email_26AjWpEcss2YyqFh1san6Wjjs7o",
"method_type": "email",
"updated_at": 1651208121,
"created_at": 1651208121
}
],
"wallets": [
{
"id": "wallet_26AjWu075gRWMnjfPglcdoD2PAQ",
"public_address": "0x863c381a56a58370f435b0100faba94e6462b6d1",
"wallet_type": "ethereum",
"verified": true,
"is_default": true,
"is_read_only": false,
"is_imported": false,
"updated_at": 1646873319,
"created_at": 1646873319
}
],
"totps": [],
"webauthn_credentials": []
}Get User
Get a user with their various properties like emails, phone_numbers, and other attached identifiers.
Returns
A successful response returns a User object with linked identifiers such as emails, phone numbers in their corresponding properties.
curl --request GET \
--url https://api.moonkey.fun/v1/auth/users/{user_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.moonkey.fun/v1/auth/users/{user_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.moonkey.fun/v1/auth/users/{user_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.moonkey.fun/v1/auth/users/{user_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.moonkey.fun/v1/auth/users/{user_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.moonkey.fun/v1/auth/users/{user_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moonkey.fun/v1/auth/users/{user_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"user_id": "user_24wFP9pDa9YiMJLun94iKykoZs2",
"first_name": "",
"middle_name": "",
"last_name": "",
"status": "active",
"active": true,
"updated_at": 1646873318,
"created_at": 1646873318,
"emails": [
{
"id": "email_26AjWpEcss2YyqFh1san6Wjjs7o",
"verified": true,
"email": "hello@moonkey.fun",
"updated_at": 1646957196,
"created_at": 1646873318
},
{
"id": "email_24oXBL3PufzHkH1Jzyjc2EXYeo7",
"verified": false,
"email": "sandbox@moonkey.fun",
"updated_at": 1642703333,
"created_at": 1642703333
}
],
"phone_numbers": [
{
"id": "pn_24oXBLRv6BoHXbNZoTAZkAFlRsy",
"verified": false,
"phone_number": "+14152222222",
"updated_at": 1642703333,
"created_at": 1642703333
}
],
"idp_providers": [
{
"id": "idpuser_28SRho5nbD045LGq2btZWXhkdjN",
"provider": "google",
"provider_subject": "100157402424066154830",
"idp_type": "oauth",
"method_id": "email_26AjWpEcss2YyqFh1san6Wjjs7o",
"method_type": "email",
"updated_at": 1651208121,
"created_at": 1651208121
}
],
"wallets": [
{
"id": "wallet_26AjWu075gRWMnjfPglcdoD2PAQ",
"public_address": "0x863c381a56a58370f435b0100faba94e6462b6d1",
"wallet_type": "ethereum",
"verified": true,
"is_default": true,
"is_read_only": false,
"is_imported": false,
"updated_at": 1646873319,
"created_at": 1646873319
}
],
"totps": [],
"webauthn_credentials": []
}Authorizations
Auth Platform API includes all the Auth related features. All Users, Phone Numbers, Emails, and OTPs are associated with an App as the container.
Endpoints only accept App's Secret API keys other than certain endpoints that are used client side or via SDK that accept the public_token.
Authentication using App Api Key
Header:
Authorization: Bearer {api_key}
Authenticated Request
curl \
-X GET https://api.moonkey.fun/v1/auth/users/user_24wFP9pDa9YiMJLun94iKykoZs2 \
-H "Authorization: Bearer sk_test_pRqweh3wvWmJAAVYv7Z0T5iPLzFM4ql0muoyQcjOxGeN3p1r"
Path Parameters
Unique User ID of the user.
"user_24wFP9pDa9YiMJLun94iKykoZs2"
Response
GetUserResp
1Show child attributes
Show child attributes
10Show child attributes
Show child attributes
Show child attributes
Show child attributes
10Show child attributes
Show child attributes
Show child attributes
Show child attributes
A flexible JSON object for storing custom data about a user. You can store any arbitrary data as key-value pairs.
Update Behavior:
- By default, metadata updates are merged at the top level only
- Send
nullvalues for specific fields to delete those fields (merge mode only) - Send
{}(empty object) to clear all metadata - Send
nullfor the metadata field itself will be ignored (as if metadata was not sent) - Deeply nested objects and arrays are NOT merged - they replace the entire top-level key
- Set
replace_metadata: trueto replace all metadata without merging