User
Get Current User
Returns the authenticated user’s profile, remaining credits or balance, and billing details.
GET
/
v3
/
users
/
me
Get Current User
curl --request GET \
--url https://api.heygen.com/v3/users/me \
--header 'x-api-key: <api-key>'import requests
url = "https://api.heygen.com/v3/users/me"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.heygen.com/v3/users/me', 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.heygen.com/v3/users/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.heygen.com/v3/users/me"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.heygen.com/v3/users/me")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.heygen.com/v3/users/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"username": "<string>",
"email": "user@example.com",
"first_name": "Jane",
"last_name": "Doe",
"billing_type": "wallet",
"wallet": {
"remaining_balance": 125.5,
"auto_reload": {
"enabled": true,
"threshold_usd": 10,
"amount_usd": 50
}
},
"subscription": {
"credits": {
"premium_credits": {
"remaining": 500,
"resets_at": "2024-05-01T00:00:00Z"
},
"add_on_credits": {
"remaining": 500,
"resets_at": "2024-05-01T00:00:00Z"
}
}
},
"usage_based": {
"spending_current_usd": 42.5,
"spending_cap_usd": 100,
"included_credits": 4444,
"remaining_credits": 4426.9
}
}
}{
"error": {
"code": "invalid_parameter",
"message": "Video not found",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "authentication_failed",
"message": "Invalid or expired API key. Verify your x-api-key header.",
"param": null,
"doc_url": null
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Retry after the duration specified in the Retry-After header.",
"param": null,
"doc_url": null
}
}Previous
List webhook event typesReturns all available webhook event types with human-readable descriptions.
Next
⌘I
Get Current User
curl --request GET \
--url https://api.heygen.com/v3/users/me \
--header 'x-api-key: <api-key>'import requests
url = "https://api.heygen.com/v3/users/me"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.heygen.com/v3/users/me', 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.heygen.com/v3/users/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.heygen.com/v3/users/me"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.heygen.com/v3/users/me")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.heygen.com/v3/users/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"username": "<string>",
"email": "user@example.com",
"first_name": "Jane",
"last_name": "Doe",
"billing_type": "wallet",
"wallet": {
"remaining_balance": 125.5,
"auto_reload": {
"enabled": true,
"threshold_usd": 10,
"amount_usd": 50
}
},
"subscription": {
"credits": {
"premium_credits": {
"remaining": 500,
"resets_at": "2024-05-01T00:00:00Z"
},
"add_on_credits": {
"remaining": 500,
"resets_at": "2024-05-01T00:00:00Z"
}
}
},
"usage_based": {
"spending_current_usd": 42.5,
"spending_cap_usd": 100,
"included_credits": 4444,
"remaining_credits": 4426.9
}
}
}{
"error": {
"code": "invalid_parameter",
"message": "Video not found",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "authentication_failed",
"message": "Invalid or expired API key. Verify your x-api-key header.",
"param": null,
"doc_url": null
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Retry after the duration specified in the Retry-After header.",
"param": null,
"doc_url": null
}
}
