Manage your account preferences and API keys. Use the preferences endpoints to configure timezone, language, and theme settings. Use the API keys endpoints to create, list, regenerate, and revoke access tokens for programmatic access.
Preferences
GET/v1/profile/preferencesRequires Auth
Get Preferences
Get Preferences
Retrieve the authenticated user's account preferences including timezone, language, and theme settings.
Retrieve all API keys associated with the authenticated account. Returns key metadata including name, creation date, last usage, and abilities. The plain-text token value is not included.
req, _ := http.NewRequest("GET", "https://api.proxyhat.com/v1/profile/api-keys", nil)
req.Header.Set("Authorization", "Bearer __API_KEY__")
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
var keys []map[string]interface{}
json.NewDecoder(resp.Body).Decode(&keys)
for _, k := range keys {
fmt.Printf("%s — last used: %s\n", k["name"], k["last_used_at"])
}
Response200
[
{
"id": 1,
"name": "My API Key",
"created_at": "2026-01-21T10:30:00Z",
"last_used_at": "2026-01-21T15:45:00Z",
"abilities": ["*"]
}
]
Response
POST/v1/profile/api-keysRequires Auth
Create API Key
Create API Key
Create a new API key for the authenticated account. The response includes the plain-text token value which you must store securely — it cannot be retrieved again after this response.
Request Body
Name
Type
Required
Description
name
string
Optional
A friendly name to identify the key (e.g. "Production Key", "CI/CD"). Defaults to "My API Key" if omitted.
import requests
response = requests.post(
"https://api.proxyhat.com/v1/profile/api-keys",
headers={
"Authorization": "Bearer __API_KEY__",
"Content-Type": "application/json",
"Accept": "application/json",
},
json={
"name": "Production Key",
},
)
key = response.json()
# Store this token securely — it will not be shown again
print(f"Token: {key[\"plain_text_token\"]}")
const response = await fetch("https://api.proxyhat.com/v1/profile/api-keys", {
method: "POST",
headers: {
"Authorization": "Bearer __API_KEY__",
"Content-Type": "application/json",
"Accept": "application/json",
},
body: JSON.stringify({
name: "Production Key",
}),
});
const key = await response.json();
// Store this token securely — it will not be shown again
console.log(`Token: ${key.plain_text_token}`);
payload := strings.NewReader(`{
"name": "Production Key"
}`)
req, _ := http.NewRequest("POST", "https://api.proxyhat.com/v1/profile/api-keys", payload)
req.Header.Set("Authorization", "Bearer __API_KEY__")
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
var key map[string]interface{}
json.NewDecoder(resp.Body).Decode(&key)
// Store this token securely — it will not be shown again
fmt.Println("Token:", key["plain_text_token"])
Response200
{
"id": 2,
"name": "My API Key",
"plain_text_token": "2|abc123xyz...",
"created_at": "2026-01-21T10:30:00Z"
}
Response
Important: The plain_text_token value is only returned once at creation time. Store it in a secure location immediately. If you lose it, you will need to regenerate the key to obtain a new token.
DELETE/v1/profile/api-keys/{id}Requires Auth
Delete API Key
Delete API Key
Permanently revoke and delete an API key by its ID. Any requests using this key's token will immediately stop working.
Regenerate an existing API key. The old token is immediately revoked and a new plain-text token is returned. Store the new token securely — it cannot be retrieved again after this response.
import requests
key_id = 1
response = requests.post(
f"https://api.proxyhat.com/v1/profile/api-keys/{key_id}/regenerate",
headers={
"Authorization": "Bearer __API_KEY__",
"Accept": "application/json",
},
)
key = response.json()
# Store this new token securely — it will not be shown again
print(f"New token: {key[\"plain_text_token\"]}")
const keyId = 1;
const response = await fetch(`https://api.proxyhat.com/v1/profile/api-keys/${keyId}/regenerate`, {
method: "POST",
headers: {
"Authorization": "Bearer __API_KEY__",
"Accept": "application/json",
},
});
const key = await response.json();
// Store this new token securely — it will not be shown again
console.log(`New token: ${key.plain_text_token}`);
keyID := 1
url := fmt.Sprintf("https://api.proxyhat.com/v1/profile/api-keys/%d/regenerate", keyID)
req, _ := http.NewRequest("POST", url, nil)
req.Header.Set("Authorization", "Bearer __API_KEY__")
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
var key map[string]interface{}
json.NewDecoder(resp.Body).Decode(&key)
// Store this new token securely — it will not be shown again
fmt.Println("New token:", key["plain_text_token"])
Response200
{
"id": 3,
"name": "My API Key",
"plain_text_token": "3|newtoken...",
"created_at": "2026-01-21T12:00:00Z"
}