API Reference / Steam friends
Change a Steam friend relationship
Send, accept or ignore a friend invite, remove a friend or cancel a sent invite, or unblock a user, through the account live Steam session. The action is routed to the account session, not applied. The resulting relationship arrives through FriendsListUpdated.
/ steam. v1. Steam/ ApplyFriendActionRequest body
application/jsonRequired
Request to change a workspace account's relationship with another Steam user.
accountNamestringThe workspace's Steam account that acts.
actionstringThe change to make.
Value in"FRIEND_"FRIEND_"FRIEND_"FRIEND_"FRIEND_
partnerSteamIdstringThe other user's 64-bit SteamID, as a decimal string.
Response body
application/json
Success
requestId?stringServer-generated correlation id for the asynchronous outcome.
application/json
The request was malformed, such as a missing required field or an unparseable cursor.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
application/json
The request lacks a valid API key in the Authorization header.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
application/json
The API key is not allowed to perform this action on this workspace.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
application/json
The requested resource does not exist in this workspace.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
application/json
An internal server error occurred.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
curl -X POST "https://api.goldmine.to/steam.v1.Steam/ApplyFriendAction" \
-H "Authorization: Bearer $CSTRADER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"accountName": "trader_bot_01",
"partnerSteamId": "76561198044443322",
"action": "FRIEND_ACTION_ACCEPT_INVITE"
}'const res = await fetch("https://api.goldmine.to/steam.v1.Steam/ApplyFriendAction", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CSTRADER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"accountName": "trader_bot_01",
"partnerSteamId": "76561198044443322",
"action": "FRIEND_ACTION_ACCEPT_INVITE"
}),
});
const data = await res.json();body := strings.NewReader(`{
"accountName": "trader_bot_01",
"partnerSteamId": "76561198044443322",
"action": "FRIEND_ACTION_ACCEPT_INVITE"
}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.goldmine.to/steam.v1.Steam/ApplyFriendAction", body)
if err != nil {
return err
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CSTRADER_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)import os, requests
res = requests.post(
"https://api.goldmine.to/steam.v1.Steam/ApplyFriendAction",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={
"accountName": "trader_bot_01",
"partnerSteamId": "76561198044443322",
"action": "FRIEND_ACTION_ACCEPT_INVITE"
},
)
data = res.json(){
"requestId": "0193a0f2-6c1e-7a51-9d0e-2f4b6c8d1e3a"
}{
"code": "invalid_argument",
"message": "The request was malformed, such as a missing required field or an unparseable cursor."
}{
"code": "unauthenticated",
"message": "The request lacks a valid API key in the Authorization header."
}{
"code": "permission_denied",
"message": "The API key is not allowed to perform this action on this workspace."
}{
"code": "not_found",
"message": "The requested resource does not exist in this workspace."
}{
"code": "internal",
"message": "An internal server error occurred."
}