POST
/api/public/v1/locations

Create a location

Create a new location in your company.

Required scope

The access token must carry this scope. A token missing it gets 403 Forbidden. Grant them to an API client under Dev Tools → API, to an assistant or CLI sign-in when you approve or edit it under Dev Tools, and to a teammate under Employee → Permissions.

locations:write

Request Body

PropertyTypeDescription
referencestringDisplay name.
subdomainstringFree subdomain.
taglinestringTagline.
codestringInternal reference code.
POSTExample request
curl
curl -X POST "https://www.pxb.app/api/public/v1/locations" \
  -H "Authorization: Bearer your_access_token" \
  -H "Content-Type: application/json" \
  -d '{
    "reference": "Acme Corp",
    "subdomain": "acme",
    "tagline": "We build things"
  }'
200Example response
json
{
  "message": "Location created successfully!",
  "content": {
    "location": {
      "id": "loc_abc123"
    }
  }
}

In the console

The same thing done by hand, for anyone comparing the API against the screen they already use.

Company menu → Locations → Add location
/dashboard
  1. Open the company menu → Locations.
  2. Add location.
  3. Give it a reference (and, optionally, a code). It takes on the company’s industry.