slog.sheaflabs.com

enhance / api / update org name

[2022-12-12] #code #enhance


ECP is your control panel URL.

APIKEY can be acquired from $ECP/settings/access-tokens.

ORGID can be acquired by API or by browser URL after clicking from $ECP/customers.

NEWNAME is what you want to rename the org to.

export ECP='cp.some.ext'
export APIKEY=123
export ORGID=123
export NEWNAME='new org'

curl -s -X GET https://$ECP/api/orgs/$ORGID -H "Accept: application/json" -H "Authorization: Bearer $APIKEY" | jq .

curl -X 'PATCH' \
  'https://$ECP/api/orgs/$ORGID' \
	 -H "Authorization: Bearer $APIKEY" \
  -H 'accept: */*' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "$NEWNAME"
}'

← back to index