DW Alliance app

API overview for app.dwalliance.com. Create an account, start a session, then upload an HTML page and its related files.

Modules

/account_setup/ Create a person, email, optional company, and a new brand. No session required.
  • POST email. Response is id. A 6-character confirmation code is emailed and expires after 30 minutes.
  • POST id, confirmation_id, first_name, last_name, and optional company_name.
  • Writes a person, email, optional company, and a brand. The brand code is emailed only, never returned in JSON.
/session/ Email a one-time session id for an email + brand. Response is ok and mailed only.
  • POST email and brand (the brand code).
  • If they match, a session id is emailed. The HTTP body is only ok and mailed.
/crm/ Create, update, and delete people and companies. Needs a session, brand, and CRM CRUD.
  • create_person - first_name, last_name. Writes a person on the session brand.
  • update_person - person_id, first_name, last_name.
  • delete_person - person_id. Also removes that person's relation rows on this brand.
  • create_company - name. Writes a company on the session brand.
  • update_company - company_id, name.
  • delete_company - company_id. Also removes relation rows for that company on this brand.
/relation/ Create, update, delete, and read a person's link to a company. Needs a session, brand, and CRM CRUD.
  • create - person_id, company_id.
  • update - id, and person_id and/or company_id.
  • delete - id.
  • read - id, or person_id, or company_id.
/dns/ Create, update, delete, and read DNS records for a company. Needs a session, brand, DNS right, and company_id. The zone must be claimed first with /domain.
  • create - company_id, domain, rr_type, rr_fqdn, and the fields that type uses. The zone must already belong to this company.
  • update - company_id, rr_id, and any fields to replace.
  • delete - company_id and rr_id.
  • read - company_id. Optional rr_id or domain.
  • Claim the zone first with /domain/; /dns/ no longer claims names.
/domain/ Claim, read, and release a domain and its www for a company. Needs a session, brand, DOMAIN right, and company_id.
  • create - company_id and domain_name. Claims the name and www. the name.
  • read - company_id. Optional domain_name. Lists names this company has claimed on this brand.
  • delete - company_id and domain_name. Releases the name and its www after its DNS records are deleted.
  • After a claim, add and change the zone's records with /dns/. Release is refused while /dns/ still has records in the zone.
/permissions/ Per-domain editor switch, domain EDITOR grants, and SUPER_ADMIN grants. Needs a session and SUPER_ADMIN on the brand. Open the admin UI.
  • list - domains of the brand with editor_enabled, editors per domain, and super admins.
  • set_editor_enabled - domain, enabled (true/false). Per-domain editor switch; off by default.
  • grant_editor - domain, email. Grants EDITOR for that domain only.
  • revoke_editor - domain, email.
  • grant_super_admin - email. Brand-wide SUPER_ADMIN.
  • revoke_super_admin - email. Refused if it would remove the last SUPER_ADMIN.
  • Admin UI is GET /permissions/. API help is POST with an empty body.
/files/ Create, update, delete, read, and search files. Uploads need a session with FILE rights. Search returns only files that person uploaded.
  • create - needs FILE CREATE or SUPER_ADMIN. Multipart file or JSON file_data as base64.
  • update - needs FILE UPDATE or SUPER_ADMIN, and id.
  • delete - needs FILE DELETE or SUPER_ADMIN, and id.
  • read - needs id. A PUBLIC file needs no session.
  • search - needs FILE READ. Optional filters: file name, type, size, or created date.
/notes/ Create, update, delete, read, and search notes with optional GPS. Needs a session with NOTE rights. Only that person's notes on the session brand.
  • create - needs NOTE CREATE or SUPER_ADMIN. note is required; gps is optional.
  • update - needs NOTE UPDATE or SUPER_ADMIN, and id.
  • delete - needs NOTE DELETE or SUPER_ADMIN, and id. Also removes the note_files links for that note.
  • read - needs NOTE READ or SUPER_ADMIN, and id.
  • search - needs NOTE READ. Optional filters: note text or created date.
/note_files/ Link your notes to your files: create, update, delete, read, and search by note_id or file_id. Needs a session with NOTE rights.
  • create - needs NOTE CREATE or SUPER_ADMIN. note_id and file_id are required; both must be yours on this brand.
  • update - needs NOTE UPDATE or SUPER_ADMIN, and id. Optional note_id and/or file_id.
  • delete - needs NOTE DELETE or SUPER_ADMIN, and id. Removes only the link, not the note or file.
  • read - needs NOTE READ or SUPER_ADMIN, and id.
  • search - needs NOTE READ. Optional exact note_id or file_id.
/end_user_account_setup/ Your customers sign up on your own domain (not on app.dwalliance.com). The brand comes from the domain name. US only; VPN and Tor are blocked; rate limited.
  • request_code - email. A 6-character code is emailed (30 minutes). The response is id; the code is never in JSON.
  • verify - id and the emailed confirmation_id. Creates the customer and signs them in for 30 days on that domain.
  • profile - after verify: first_name, last_name, optional middle_name, company_name, telephone {phone_number, line_type}, and shipping / billing address objects.
  • status - shows the signed-in customer's sign-up. Unfinished sign-ups are deleted after 90 days.
/customer_session/ Returning customers sign in on your domain with an emailed code. Separate from staff /session/.
  • request_code - email. Always the same answer, whether or not the email is a customer.
  • verify - the id from request_code and the emailed code. Sets a secure cookie for that domain, valid 30 days. No session id is ever in JSON.
  • whoami and logout.
/address/ Create, edit, delete, read, and list addresses. Customers manage their own on your domain; staff manage people and companies on their brand with CRM rights. Every change is kept in history.
  • Create an address
    • POST action create with line_1, city, state, zipcode.
    • Optional line_2, line_3, country (default US), address_type Billing, Shipping, or Other (default Shipping).
    • Staff also send session, brand, owner_type (PRSN or CMPNY) and owner_id; needs CRM CREATE or SUPER_ADMIN.
    • The answer is address_id.
  • Edit an address
    • POST action update with address_id and only the fields to change.
    • Send an empty string to clear line_2 or line_3. Required fields cannot be cleared.
    • Staff need CRM UPDATE or SUPER_ADMIN.
  • Delete an address
    • POST action delete with address_id. Staff need CRM DELETE or SUPER_ADMIN.
    • Orders already placed keep their own copy of the address, so deleting never changes an order.
  • Find addresses
    • read with address_id, or list (customers: their own; staff: owner_type + owner_id). Optional address_type filter.
/store/ Online store for every brand: products, variants, categories, carts, checkout, invoices, payment records, and shipments. US dollars only. Customers shop on your own domain; staff manage it with a session. Read the full store guide.
  • Browse (public, on your domain)
    • /store/products/ - list (optional company_id, category_id) and read (product_id or slug).
    • /store/products/categories/ - list categories.
    • /store/search/ - q: products whose name or description contains it.
  • Manage the catalog (staff: session + brand; SUPER_ADMIN, a STORE right, or EDITOR of the company's domain)
    • /store/product/ - create (company_id, name, price; a Default variant is made too), update, delete, claim, unclaim.
    • /store/product/variants/ - list, create, update, delete (price, stock, position).
    • /store/product/description/ - one description per used_location.
    • /store/product/categories/ - company categories: create, update, delete, link, unlink.
    • /store/product/images/ - attach a /files/ file to a product, variant, or category.
  • Buy (customers, on your domain)
    • /store/cart/ - add returns a server-made cart_id; update, remove, read, mine, delete. One line per variant.
    • /store/checkout/ - signed-in customer, cart_id, shipping_address_id, optional billing_address_id (from /address/). Makes a PENDING invoice.
  • After the order
    • /store/invoice/ - read, list; staff update tax, shipping, or status.
    • /store/invoice/payment/ - record payments; PAID when the total is covered. Online card/PayPal processing is not connected yet: customer requests are recorded as PENDING and no charge is made.
    • /store/shipment/ - staff ship order lines (partial shipments allowed) with carrier and tracking; customers can read them.
  • Every create, update, and delete is kept in history.

Brand SUPER_ADMINs manage the Suggest-an-edit tool per domain with /permissions/ (turn the editor on, grant domain editors, grant or revoke super admins). Suggested edits are emailed to that brand’s super admins.

If you are creating a website and want a shared menu system, include a menu.json. On your own domain, every site also gets an automatic /sitemap.xml and /robots.txt (see Search engines).

1. Create an account

  1. POST JSON to /account_setup/ with {"email":"you@example.com"}. You get back id. A 6-character confirmation code is emailed from support@dwalliance.com. It expires after 30 minutes.
  2. POST JSON again with id, confirmation_id, first_name, last_name, and optional company_name.
  3. Success returns ok, person_id, company_id, relation_id, and brand_emailed. A second email delivers your brand code. Keep that code; it is not in the JSON.
// step 1
await fetch('/account_setup/', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ email: 'you@example.com' })
}).then(r => r.json());

// step 2
await fetch('/account_setup/', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    id: 'SETUP_ID',
    confirmation_id: 'xxxxxx',
    first_name: 'Ada',
    last_name: 'Lovelace',
    company_name: 'Example LLC'
  })
}).then(r => r.json());

New brands get default data_access for LOGIN (READ) and CREATE/READ/UPDATE/DELETE on FILE, CRM, NOTE, DNS, and DOMAIN.

2. Start a session

  1. POST JSON to /session/ with your email and brand code.
  2. If they match, a session id is emailed. The HTTP body is only {"ok":true,"mailed":true}.
  3. Send that session id later as JSON field session or cookie session.
await fetch('/session/', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ email: 'you@example.com', brand: 'BRANDCODE' })
}).then(r => r.json());

3. Upload an HTML document and its files

Use /files/ with action create. Set public_private to PUBLIC for pages browsers should open. Keep related assets under the same brand and a shared file_path.

  1. Upload index.html (or any page) with file_path like site.
  2. Upload CSS, JS, images, fonts the same way. Match the relative paths your HTML uses.
  3. Open the public URL: /BRANDCODE/file_path/file_name. Example: /BRANDCODE/site/index.html.

Shared menu

A site with only a few pages should still keep the navigation in one PUBLIC menu.json next to those pages. Each page loads that file and fills its nav from it. Adding a page or removing one is an update to menu.json. The other HTML files stay as they are.

[
  {"label": "Home", "href": "index.html"},
  {"label": "About", "href": "about.html"},
  {"label": "Contact", "href": "contact.html"},
  {"label": "Sitemap", "href": "/sitemap.xml"}
]

Add the Sitemap item so people and search engines can find every page. /sitemap.xml works on your own domain from any folder; see Search engines.

JSON create (base64)

const html = btoa('Hello');
await fetch('/files/', {
  method: 'POST',
  credentials: 'include',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    action: 'create',
    session: 'SESSION_ID_FROM_EMAIL',
    file_name: 'index.html',
    file_path: 'site',
    file_type: 'HTML',
    public_private: 'PUBLIC',
    file_data: html
  })
}).then(r => r.json());

Multipart create

const body = new FormData();
body.append('action', 'create');
body.append('session', 'SESSION_ID_FROM_EMAIL');
body.append('file_name', 'hero.png');
body.append('file_path', 'site');
body.append('public_private', 'PUBLIC');
body.append('file', fileInput.files[0]);
await fetch('/files/', { method: 'POST', credentials: 'include', body }).then(r => r.json());

Also supported: update, delete, read, and search. Search matches file name, file type, exact file size, or created date. Set order to ascend or descend, and limit from 1 to 100. Search returns only files that person uploaded. PUBLIC files can be read without a session. Max upload size is about 10 MB. GET each module path with no body for its live help JSON.

4. Edit DNS

POST JSON to /dns/. Send session, brand, and company_id. The person must belong to that company. Claim the zone first with /domain/. /dns/ only changes records in zones that company has claimed.

await fetch('/dns/', {
  method: 'POST',
  credentials: 'include',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    action: 'create',
    session: 'SESSION_ID',
    brand: 'BRANDCODE',
    company_id: 'COMPANY_ID',
    domain: 'example.com',
    rr_type: '+',
    rr_fqdn: 'www.example.com',
    rr_ip: '192.0.2.10'
  })
}).then(r => r.json());

Record types are + = C @ . & ^ Z and ' for TXT. rr_ttl defaults to 600. The response for read is records with rr_id. GET /dns/ with no body for the live field list.

Protected for every brand: app.dwalliance.com, ns1.dwalliance.com, ns2.dwalliance.com, ns3.dwalliance.com, mail.dwalliance.com, store.dwalliance.com, every name under them, and the MX, NS, and SOA records of dwalliance.com. /dns/ refuses to create, update, or delete them, and /domain/ refuses to claim them.

5. Claim a domain

POST JSON to /domain/ with action create, session, brand, company_id, and domain_name. It claims the name and www. the name for your company and brand. Names another company or brand already holds are refused, and so are app.dwalliance.com, IP addresses, and localhost. Action read lists your names. Action delete releases a name and its www after its DNS records are deleted.

await fetch('/domain/', {
  method: 'POST',
  credentials: 'include',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    action: 'create',
    session: 'SESSION_ID',
    brand: 'BRANDCODE',
    company_id: 'COMPANY_ID',
    domain_name: 'example.com'
  })
}).then(r => r.json());

The response lists domain_id, domain_name, and status (created or already_owned) for each name.

6. Host a website

Your brand can host a static website from its PUBLIC files. Upload every page and asset with /files/ action create and public_private set to PUBLIC. Leave file_path empty for files at the top of the site, or set a folder such as about. A top-level index.html is your homepage.

  1. Upload index.html with an empty file_path.
  2. Upload the other pages, CSS, JS, images, and fonts the same way. Use relative links that match each file's file_path and file_name. Do not name a top-level file or folder after a module path such as lib, files, session, account_setup, relation, crm, dns, domain, notes, note_files, docs, or skill; on your own domain those paths reach the platform, not your files.
  3. To change a file, send update with its id and the new file. To remove it, send delete with its id.
const body = new FormData();
body.append('action', 'create');
body.append('session', 'SESSION_ID_FROM_EMAIL');
body.append('file_name', 'index.html');
body.append('file_path', '');
body.append('file_type', 'HTML');
body.append('public_private', 'PUBLIC');
body.append('file', fileInput.files[0]);
await fetch('/files/', { method: 'POST', credentials: 'include', body }).then(r => r.json());

7. Use your own domain

Your site can answer on your own domain, such as example.com and www.example.com, with no brand code in the address.

  1. Point the domain here. At your registrar, either set the nameservers to ns1.dwalliance.com, ns2.dwalliance.com, and ns3.dwalliance.com, or keep your DNS host and add A records for example.com and www.example.com to 64.62.211.170.
  2. Claim the domain with /domain/ action create. That claims example.com and www.example.com for your company and brand.
  3. If you use our nameservers, create those A records with /dns/.
  4. Ask DW Alliance to turn on hosting for the domain. We connect it to your brand and enable HTTPS for it. This step is not self-serve yet.
await fetch('/dns/', {
  method: 'POST',
  credentials: 'include',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    action: 'create',
    session: 'SESSION_ID',
    brand: 'BRANDCODE',
    company_id: 'COMPANY_ID',
    domain: 'example.com',
    rr_type: '+',
    rr_fqdn: 'www.example.com',
    rr_ip: '64.62.211.170'
  })
}).then(r => r.json());

Send the same create again with rr_fqdn set to example.com for the bare domain. Once hosting is on, https://example.com/ shows your top-level index.html, and https://example.com/{file_path}/{file_name} shows any other PUBLIC file. A folder address ending in / shows that folder's index.html, so https://example.com/about/ shows about/index.html. Missing files return 404, and PHP files are never served.

8. Search engines: sitemap.xml and robots.txt

Once your own domain is on, it gets two files automatically. You do not upload anything.

Replace example.com with your domain; www.example.com works the same way and lists www addresses. For example, the DW Alliance site itself is at https://dwalliance.com/sitemap.xml and https://dwalliance.com/robots.txt. The default robots.txt is:

# Default robots.txt from DW Alliance. Upload your own robots.txt (PUBLIC, top of the site) to replace it.
User-agent: *
Allow: /

Sitemap: https://example.com/sitemap.xml

A sitemap looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url><loc>https://example.com/</loc><lastmod>2026-10-29T17:39:10Z</lastmod></url>
  <url><loc>https://example.com/contact.html</loc><lastmod>2026-10-28T04:06:49Z</lastmod></url>
</urlset>

The sitemap is built the first time someone asks for it and then cached. Creating, updating or deleting any of your files clears it, and the next request builds a fresh one. To keep a page out of it, make the file PRIVATE or add a noindex robots meta tag. Sites with more than 50,000 pages get a sitemap index at /sitemap.xml that points to /sitemap-1.xml, /sitemap-2.xml, and so on.

Use your own instead

Upload a PUBLIC file named robots.txt or sitemap.xml with an empty file_path, and your file is served instead of the automatic one. Delete it to go back to the automatic file. Keep a Sitemap: line in your own robots.txt.

const body = new FormData();
body.append('action', 'create');
body.append('session', 'SESSION_ID_FROM_EMAIL');
body.append('file_name', 'robots.txt');
body.append('file_path', '');
body.append('public_private', 'PUBLIC');
body.append('file', new Blob(['User-agent: *\nDisallow: /drafts/\n\nSitemap: https://example.com/sitemap.xml\n'], { type: 'text/plain' }));
await fetch('https://app.dwalliance.com/files/', { method: 'POST', credentials: 'include', body }).then(r => r.json());

Link your sitemap

Add {"label": "Sitemap", "href": "/sitemap.xml"} to your menu.json (or a link in your footer) so visitors and crawlers can reach it. Then submit https://example.com/sitemap.xml in Google Search Console and Bing Webmaster Tools. The automatic files are only on your own domain, not on https://app.dwalliance.com/BRANDCODE/... addresses.

9. Create, edit, and delete addresses

Use your own domain for customer calls (the cookie from /customer_session/ or /end_user_account_setup/ is sent automatically by the browser). Staff can call https://app.dwalliance.com/address/ with session and brand.

  1. Create
    • Customer: {"action":"create","line_1":"75-5660 Palani Rd","city":"Kailua-Kona","state":"HI","zipcode":"96740","address_type":"Shipping"}
    • Staff: add "session", "brand", "owner_type":"PRSN" (or "CMPNY") and "owner_id".
    • Keep the address_id from the answer.
  2. Edit
    • {"action":"update","address_id":"...","line_2":"Suite 3"} changes just that field.
    • "line_2":"" clears it. line_1, city, state, and zipcode cannot be cleared.
  3. Delete
    • {"action":"delete","address_id":"..."}.
    • Past orders are not affected; each order keeps its own shipping and billing copy.
  4. List
    • {"action":"list"} for a customer, or with owner_type and owner_id for staff. Add "address_type":"Shipping" to filter.

Every create, update, and delete writes address_history (edits and deletes keep the old row), so changes can be traced. Checkout uses one shipping address and one billing address from this list.

Public URLs

After a PUBLIC file is created, the first request for /{brand}/{file_path}/{file_name} writes a cache on the app node and serves it. Files with an empty file_path are at /{brand}/{file_name}, so a homepage is /{brand}/index.html. On your own domain the same file is at /{file_path}/{file_name}. Updates and deletes clear that cache automatically, and any create, update or delete also clears your cached sitemap.xml.