curl --request PATCH \
--url https://api.upstackdata.com/accounts/api/account \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-pixel-id: <api-key>' \
--data '
{
"accountName": "Upstack Data"
}
'import requests
url = "https://api.upstackdata.com/accounts/api/account"
payload = { "accountName": "Upstack Data" }
headers = {
"x-api-key": "<api-key>",
"x-pixel-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'x-api-key': '<api-key>',
'x-pixel-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({accountName: 'Upstack Data'})
};
fetch('https://api.upstackdata.com/accounts/api/account', 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.upstackdata.com/accounts/api/account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'accountName' => 'Upstack Data'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-pixel-id: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.upstackdata.com/accounts/api/account"
payload := strings.NewReader("{\n \"accountName\": \"Upstack Data\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-pixel-id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.upstackdata.com/accounts/api/account")
.header("x-api-key", "<api-key>")
.header("x-pixel-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"accountName\": \"Upstack Data\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upstackdata.com/accounts/api/account")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["x-pixel-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountName\": \"Upstack Data\"\n}"
response = http.request(request)
puts response.read_body{
"account": {
"accountName": "Upstack Data",
"createdAt": "2023-11-07T05:31:56Z",
"owners": [
{
"email": "jsmith@example.com",
"firstName": "<string>",
"lastName": "<string>"
}
],
"admins": [
{
"email": "jsmith@example.com",
"firstName": "<string>",
"lastName": "<string>"
}
],
"subscription": {
"plan": {
"name": "Growth",
"displayPrice": "$49/mo",
"currency": "USD",
"discountedDisplayPrice": "$39/mo",
"discount": {
"code": "LAUNCH20",
"value": 123,
"appliesUntil": "2023-11-07T05:31:56Z",
"appliesForBillingIntervals": 123
}
},
"status": "<string>",
"trialEndsOn": "2023-11-07T05:31:56Z",
"currentPeriodEnd": "2023-11-07T05:31:56Z",
"cancelAtPeriodEnd": true
}
}
}{
"message": "<string>",
"errors": [
{
"message": "<string>",
"key": "<string>",
"path": [
"<string>"
]
}
]
}{
"message": "<string>",
"errors": [
{
"message": "<string>",
"key": "<string>",
"path": [
"<string>"
]
}
]
}{
"message": "<string>",
"errors": [
{
"message": "<string>",
"key": "<string>",
"path": [
"<string>"
]
}
]
}{
"message": "<string>",
"errors": [
{
"message": "<string>",
"key": "<string>",
"path": [
"<string>"
]
}
]
}Rename the account
Rename the account that owns this API key. Single-field strict
allowlist — accountName is the only accepted field; any other key in
the body is rejected with 400.
Emits an accountUpdated EventBridge event with actor: cli:{apiKeyPk}
so downstream consumers can distinguish UI vs API-key mutations.
Required scope: account:write.
curl --request PATCH \
--url https://api.upstackdata.com/accounts/api/account \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-pixel-id: <api-key>' \
--data '
{
"accountName": "Upstack Data"
}
'import requests
url = "https://api.upstackdata.com/accounts/api/account"
payload = { "accountName": "Upstack Data" }
headers = {
"x-api-key": "<api-key>",
"x-pixel-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'x-api-key': '<api-key>',
'x-pixel-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({accountName: 'Upstack Data'})
};
fetch('https://api.upstackdata.com/accounts/api/account', 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.upstackdata.com/accounts/api/account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'accountName' => 'Upstack Data'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-pixel-id: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.upstackdata.com/accounts/api/account"
payload := strings.NewReader("{\n \"accountName\": \"Upstack Data\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-pixel-id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.upstackdata.com/accounts/api/account")
.header("x-api-key", "<api-key>")
.header("x-pixel-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"accountName\": \"Upstack Data\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upstackdata.com/accounts/api/account")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["x-pixel-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountName\": \"Upstack Data\"\n}"
response = http.request(request)
puts response.read_body{
"account": {
"accountName": "Upstack Data",
"createdAt": "2023-11-07T05:31:56Z",
"owners": [
{
"email": "jsmith@example.com",
"firstName": "<string>",
"lastName": "<string>"
}
],
"admins": [
{
"email": "jsmith@example.com",
"firstName": "<string>",
"lastName": "<string>"
}
],
"subscription": {
"plan": {
"name": "Growth",
"displayPrice": "$49/mo",
"currency": "USD",
"discountedDisplayPrice": "$39/mo",
"discount": {
"code": "LAUNCH20",
"value": 123,
"appliesUntil": "2023-11-07T05:31:56Z",
"appliesForBillingIntervals": 123
}
},
"status": "<string>",
"trialEndsOn": "2023-11-07T05:31:56Z",
"currentPeriodEnd": "2023-11-07T05:31:56Z",
"cancelAtPeriodEnd": true
}
}
}{
"message": "<string>",
"errors": [
{
"message": "<string>",
"key": "<string>",
"path": [
"<string>"
]
}
]
}{
"message": "<string>",
"errors": [
{
"message": "<string>",
"key": "<string>",
"path": [
"<string>"
]
}
]
}{
"message": "<string>",
"errors": [
{
"message": "<string>",
"key": "<string>",
"path": [
"<string>"
]
}
]
}{
"message": "<string>",
"errors": [
{
"message": "<string>",
"key": "<string>",
"path": [
"<string>"
]
}
]
}Authorizations
Your Upstack API key. Starts with upstack_.
The pixel id the request targets.
Body
Strict allowlist — accountName is the only accepted field. Any other key
in the body is rejected with 400. Control / zero-width / bidi characters
are rejected; unicode letters, marks, digits, punctuation, and emoji are
accepted. Trimmed; leading/trailing whitespace rejected.
1 - 100"Upstack Data"
Response
The renamed account projection.
Slim public projection of an account — display name, creation date, active owners and admins, optional subscription summary.
Internal fields are deliberately omitted: id, ownerId, companyName,
primaryEmail, settings.*, pixels, subscriptionId, every Stripe ID,
planUsage, usageBillingRecords, last12Months*, and similar
implementation details.
Show child attributes
Show child attributes
Was this page helpful?