Create Location

post/v1/locations

Create a new address/location with geographic coordinates and associate it with people, companies, or workspaces.

Requires a bearer token: Authorization: Bearer <token>.

Request

cURL
curl -X POST https://api.wellapp.ai/v1/locations \
  -H "Authorization: Bearer $WELL_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "location",
  "attributes": {
    "address_line1": "123 Turing Way",
    "address_line2": "",
    "city": "London",
    "region": "Greater London",
    "postal_code": "E1 6AN",
    "country": "GB",
    "latitude": 37.7749,
    "longitude": -122.4194,
    "is_primary": true,
    "is_registered": true
  },
  "relationships": {
    "persons": {
      "data": [
        {
          "type": "people",
          "id": "people1"
        }
      ]
    },
    "companies": {
      "data": [
        {
          "type": "company",
          "id": "company_tenant"
        }
      ]
    },
    "workspaces": {
      "data": [
        {
          "type": "workspace",
          "id": "workspace_tenant"
        }
      ]
    }
  }
}'
Request body
{
  "type": "location",
  "attributes": {
    "address_line1": "123 Turing Way",
    "address_line2": "",
    "city": "London",
    "region": "Greater London",
    "postal_code": "E1 6AN",
    "country": "GB",
    "latitude": 37.7749,
    "longitude": -122.4194,
    "is_primary": true,
    "is_registered": true
  },
  "relationships": {
    "persons": {
      "data": [
        {
          "type": "people",
          "id": "people1"
        }
      ]
    },
    "companies": {
      "data": [
        {
          "type": "company",
          "id": "company_tenant"
        }
      ]
    },
    "workspaces": {
      "data": [
        {
          "type": "workspace",
          "id": "workspace_tenant"
        }
      ]
    }
  }
}

Responses

201Location created successfully

{
  "data": {
    "type": "location",
    "id": "loc1",
    "attributes": {
      "full_address": "123 Turing Way, London, Greater London, E1 6AN, GB",
      "address_line1": "123 Turing Way",
      "address_line2": "",
      "city": "London",
      "region": "Greater London",
      "postal_code": "E1 6AN",
      "country": "GB",
      "latitude": 37.7749,
      "longitude": -122.4194,
      "is_primary": true,
      "is_registered": true,
      "created_at": "2025-06-01T10:00:00Z",
      "updated_at": "2025-06-01T10:00:00Z"
    },
    "relationships": {
      "persons": {
        "data": [
          {
            "type": "people",
            "id": "people1"
          }
        ]
      },
      "companies": {
        "data": [
          {
            "type": "company",
            "id": "company_tenant"
          }
        ]
      },
      "workspaces": {
        "data": [
          {
            "type": "workspace",
            "id": "workspace_tenant"
          }
        ]
      }
    }
  },
  "included": [
    {
      "type": "people",
      "id": "people1",
      "attributes": {
        "first_name": "Alan",
        "last_name": "Turing",
        "full_name": "Alan Turing",
        "created_at": "2025-06-01T09:00:00Z",
        "updated_at": "2025-06-01T09:00:00Z"
      },
      "relationships": {
        "company_locations": {
          "data": [
            {
              "type": "company_location",
              "id": "00000000-0000-4000-8000-000000000001"
            }
          ]
        },
        "person_locations": {
          "data": [
            {
              "type": "person_location",
              "id": "00000000-0000-4000-8000-000000000001"
            }
          ]
        }
      }
    },
    {
      "type": "company",
      "id": "company_tenant",
      "attributes": {
        "name": "Tech Innovations Ltd",
        "description": "Leading technology research company",
        "locale": "en",
        "domain_name_primary_link_url": "techinnovations.com",
        "tax_id": {
          "value": "GB123456789",
          "type": "VAT"
        },
        "registration": {
          "trade_name": "Tech Innovations",
          "registered_name": "Tech Innovations Limited"
        },
        "registration_number": {
          "business_type": "Ltd",
          "value": "12345678",
          "registry_name": "Companies House",
          "registry_country": "GB"
        },
        "created_at": "2025-05-15T08:00:00Z",
        "updated_at": "2025-05-15T08:00:00Z"
      },
      "relationships": {
        "company_locations": {
          "data": [
            {
              "type": "company_location",
              "id": "00000000-0000-4000-8000-000000000001"
            }
          ]
        },
        "person_locations": {
          "data": [
            {
              "type": "person_location",
              "id": "00000000-0000-4000-8000-000000000001"
            }
          ]
        }
      }
    },
    {
      "type": "workspace",
      "id": "workspace_tenant",
      "attributes": {
        "name": "UK Operations Workspace",
        "description": "Workspace for UK-based operations and teams",
        "avatar_color": "#2E86AB",
        "external_workspace_id": "uk_ops_ws_001",
        "auto_extract_enabled": true,
        "created_at": "2025-05-20T10:00:00Z",
        "updated_at": "2025-05-20T10:00:00Z"
      },
      "relationships": {
        "company_locations": {
          "data": [
            {
              "type": "company_location",
              "id": "00000000-0000-4000-8000-000000000001"
            }
          ]
        },
        "person_locations": {
          "data": [
            {
              "type": "person_location",
              "id": "00000000-0000-4000-8000-000000000001"
            }
          ]
        }
      }
    }
  ]
}

400Bad request - invalid data

{
  "code": "BAD_REQUEST",
  "status": 400,
  "title": "Bad Request",
  "message": "See title.",
  "meta": {
    "trace_id": "a1b2c3",
    "log_id": "a1b2c3"
  }
}

401Unauthorized - invalid API key

{
  "code": "UNAUTHORIZED",
  "status": 401,
  "title": "Unauthorized",
  "message": "See title.",
  "meta": {
    "trace_id": "a1b2c3",
    "log_id": "a1b2c3"
  }
}