Docs / Create Account
Create Account
Create Account
POST/v1/admin/accounts
- Auth
- X-Admin-Token + X-Admin-Actor
- Cache-Control
no-store- Source of truth
clients/openapi.jsonanddocs/API.md§12
201,no-store. The body is{"email": "<address>", "customer": "<name>"}.- Idempotent: a second call for the same address re-points it at the customer in the body.
- The gate is the same dependency
/v1/admin/keysuses, so503meansNEWS_ADMIN_TOKENis unset and401means the token is wrong. A body that is not a JSON object, or an invalid address, is400.
Description: docs/API.md §12
Parameters
| Name | In | Required | Type | Example | Notes |
|---|---|---|---|---|---|
X-Admin-Token | header | no | string | Operator token (NEWS_ADMIN_TOKEN). A client bearer is refused here. | |
X-Admin-Actor | header | no | string |
Example request
curl -sS -X POST \
'https://vg.tempproject.online/v1/admin/accounts' \
-H "X-Admin-Token: $NEWS_ADMIN_TOKEN" \
-H "X-Admin-Actor: $NEWS_ADMIN_ACTOR" \
-H "Content-Type: application/json" \
-d '{"email": "desk@vg-broker.example", "customer": "vg"}'import json
import os
import urllib.request
URL = "https://vg.tempproject.online/v1/admin/accounts"
def call() -> dict:
req = urllib.request.Request(URL, method="POST", headers={
"X-Admin-Token": os.environ["NEWS_ADMIN_TOKEN"],
"X-Admin-Actor": os.environ["NEWS_ADMIN_ACTOR"],
"Content-Type": "application/json",
}, data=json.dumps({"email": "desk@vg-broker.example", "customer": "vg"}).encode("utf-8"))
with urllib.request.urlopen(req, timeout=15) as res:
print(res.status, res.headers.get("Location"))
text = res.read().decode("utf-8")
return json.loads(text) if text else {}
if __name__ == "__main__":
print(call())const res = await fetch(
"https://vg.tempproject.online/v1/admin/accounts",
{
method: "POST",
headers: {
"x-admin-token": process.env.NEWS_ADMIN_TOKEN!,
"x-admin-actor": process.env.NEWS_ADMIN_ACTOR!,
"content-type": "application/json",
},
body: JSON.stringify({"email": "desk@vg-broker.example", "customer": "vg"}),
},
);
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
console.log(res.headers.get("etag"), await res.json());The requests are generated from the path template and the parameters in clients/openapi.json, so a new parameter appears here without an edit to this site.
Example response
{
"email": "desk@vg-broker.example",
"customer": "vg"
}Response example in docs/API.md §12 (POST /v1/admin/accounts)
Failures
This operation can answer 201, 401, 422, 503. The full envelope for each status, with its body, is on Errors.