curl --request PUT \
--url https://hpay-api.host-sl.com/api/v1/users/user_abc123/ \
--header 'api-key: YOUR_API_KEY' \
--header 'secret-key: YOUR_SECRET_KEY' \
--header 'Content-Type: application/json' \
--data '{
"app_user_id": "1",
"name": "John Updated Doe",
"email": "john.new@example.com",
"phone_number": "+23279123456"
}'
from hostpay import HostPay
client = HostPay(api_key="YOUR_API_KEY", secret_key="YOUR_SECRET_KEY")
user = client.users.update(
"user_abc123",
app_user_id="1", # must match the existing value (immutable)
name="John Updated Doe",
email="john.new@example.com",
phone_number="+23279123456",
)
print(user["name"])
import { HostPay } from "@hostpay/sdk";
const client = new HostPay({ apiKey: "YOUR_API_KEY", secretKey: "YOUR_SECRET_KEY" });
const user = await client.users.update("user_abc123", {
appUserId: "1", // must match the existing value (immutable)
name: "John Updated Doe",
email: "john.new@example.com",
phoneNumber: "+23279123456",
});
console.log(user.name);
{
"id": "user_abc123",
"app_user_id": "1",
"name": "John Updated Doe",
"email": "john.new@example.com",
"phone_number": "+23279123456",
"is_active": true,
"updated_at": "2025-01-18T14:20:00Z"
}
{
"detail": "App user ID cannot be changed"
}
{
"detail": "User not found"
}
Users
Update User
Update an existing user’s information
PUT
/
api
/
v1
/
users
/
{user_id}
/
curl --request PUT \
--url https://hpay-api.host-sl.com/api/v1/users/user_abc123/ \
--header 'api-key: YOUR_API_KEY' \
--header 'secret-key: YOUR_SECRET_KEY' \
--header 'Content-Type: application/json' \
--data '{
"app_user_id": "1",
"name": "John Updated Doe",
"email": "john.new@example.com",
"phone_number": "+23279123456"
}'
from hostpay import HostPay
client = HostPay(api_key="YOUR_API_KEY", secret_key="YOUR_SECRET_KEY")
user = client.users.update(
"user_abc123",
app_user_id="1", # must match the existing value (immutable)
name="John Updated Doe",
email="john.new@example.com",
phone_number="+23279123456",
)
print(user["name"])
import { HostPay } from "@hostpay/sdk";
const client = new HostPay({ apiKey: "YOUR_API_KEY", secretKey: "YOUR_SECRET_KEY" });
const user = await client.users.update("user_abc123", {
appUserId: "1", // must match the existing value (immutable)
name: "John Updated Doe",
email: "john.new@example.com",
phoneNumber: "+23279123456",
});
console.log(user.name);
{
"id": "user_abc123",
"app_user_id": "1",
"name": "John Updated Doe",
"email": "john.new@example.com",
"phone_number": "+23279123456",
"is_active": true,
"updated_at": "2025-01-18T14:20:00Z"
}
{
"detail": "App user ID cannot be changed"
}
{
"detail": "User not found"
}
Endpoint
PUT /api/v1/users/{user_id}/
Path Parameters
string
required
The unique identifier of the user to update
Headers
string
required
Your application API key
string
required
Your application secret key
Body Parameters
string
required
The current user ID from your application. Note: This field is required but cannot be changed during update.
string
required
Updated full name of the user
string
Updated email address
string
Updated username
string
required
Updated phone number
boolean
Update whether the user account is active
Response
string
Unique identifier for the user
string
The user ID from your application
string
User’s updated full name
string
User’s updated email address
string
User’s updated phone number
boolean
Whether the user account is active
string
ISO 8601 timestamp of update
curl --request PUT \
--url https://hpay-api.host-sl.com/api/v1/users/user_abc123/ \
--header 'api-key: YOUR_API_KEY' \
--header 'secret-key: YOUR_SECRET_KEY' \
--header 'Content-Type: application/json' \
--data '{
"app_user_id": "1",
"name": "John Updated Doe",
"email": "john.new@example.com",
"phone_number": "+23279123456"
}'
from hostpay import HostPay
client = HostPay(api_key="YOUR_API_KEY", secret_key="YOUR_SECRET_KEY")
user = client.users.update(
"user_abc123",
app_user_id="1", # must match the existing value (immutable)
name="John Updated Doe",
email="john.new@example.com",
phone_number="+23279123456",
)
print(user["name"])
import { HostPay } from "@hostpay/sdk";
const client = new HostPay({ apiKey: "YOUR_API_KEY", secretKey: "YOUR_SECRET_KEY" });
const user = await client.users.update("user_abc123", {
appUserId: "1", // must match the existing value (immutable)
name: "John Updated Doe",
email: "john.new@example.com",
phoneNumber: "+23279123456",
});
console.log(user.name);
{
"id": "user_abc123",
"app_user_id": "1",
"name": "John Updated Doe",
"email": "john.new@example.com",
"phone_number": "+23279123456",
"is_active": true,
"updated_at": "2025-01-18T14:20:00Z"
}
{
"detail": "App user ID cannot be changed"
}
{
"detail": "User not found"
}
You must include the
app_user_id in the request body, and it must match the
id assigned when the user was created. Changing this id will result in a 400 Bad
Request error.