How to Import XML Into HubSpot (and Export It Back Out)

HubSpot can't import an XML file directly. Convert it to CSV for a one-off load, parse it and push it through the CRM API for a recurring feed, and export CSV and convert when you need XML back out.

Pixel-art flat sheet beside a CRM board, XML records converted into rows a CRM can import.

HubSpot can't import XML. Its import tool accepts only .csv, .xlsx and .xls files. To load XML data, convert it to CSV, flatten the nested fields, map the columns to HubSpot properties and import. For a feed that keeps coming, parse the XML in a script and upsert records through the CRM API in batches of 100.

XML shows up in GTM work more than you'd think. An old CRM exports in XML. A billing tool or ERP sends a nightly XML file. A partner shares leads as an XML feed. An events platform gives you attendees in XML and nothing else. In each case, the data is fine. The format is the problem.

This playbook covers four routes. Convert to CSV and import. Load through the API. Feed XML or RSS into HubSpot content with HubDB, RSS email and the RSS Listing module. And get XML back out. It ends with a field map, a validation checklist and the ways each route breaks.

Key takeaways

  • XML isn't an import format. HubSpot imports take CSV, XLSX and XLS files, so every XML route starts with a conversion.
  • Flatten before you map. Nested fields become columns, and repeating fields get joined, split into rows or dropped on purpose.
  • Use the API for feeds. A recurring XML file is better parsed by a script that upserts 100 records per call.
  • Dedupe by a real key. Email, company domain, Record ID or a unique custom property keeps the import from making copies.
  • Exports are CSV too. To get XML out, export CSV and convert it, or build the XML from the API.

Can HubSpot import XML files?

No. HubSpot's import file guide says the file must "Be a .csv, .xlsx, or .xls file" and "Contain only one sheet." XML isn't on the list, and there's no setting to turn it on.

That leaves you with four routes, depending on where the XML comes from and how often:

Your situation Best route Why
One XML file, flat records, under a few thousand rows Convert to CSV and import Fastest, no code, a human checks the file
One XML file with nesting, like contacts with orders Python script to CSV, then import You control how each nested field flattens
XML that arrives daily or weekly Script that parses and upserts through the API No manual step, runs on a schedule
XML or RSS feed of posts or listings for your site HubDB, RSS email or the RSS Listing module Content, not CRM records
You need XML out of HubSpot Export CSV and convert, or build from the API HubSpot exports don't offer XML

My default for a one-off is the CSV route. It's boring, it's visible, and the import screen catches most mapping errors before anything lands. I move to the API route only when someone would otherwise have to repeat the CSV work every week.

Which route fits your team?

Here are three worked examples. The companies are made up, but the shapes are common.

A seed-stage startup after its first event. The events platform hands over 400 attendees as XML. There's one founder and one marketer, and HubSpot is on Starter. This is a one-off with flat records. Paste it into a converter, rename six headers, import with Create and update on email. Total time is under an hour, and no code is needed.

A Series B SaaS company with a billing system that only speaks XML. Every night it drops a file with 50,000 accounts and their plan, seats and MRR. RevOps wants MRR on the company record by morning. Nobody should touch that by hand. This is the API route: a script on a schedule, an External ID on every record, and a log line each night with counts.

A D2C brand with 60 retail stockists. A distributor sends the list as XML each month, with store name, address and hours. Sales doesn't need these as contacts. The website needs a store finder. This is HubDB: convert to CSV, import to a draft table, check it, publish.

The question to ask each time is simple. Is this CRM data or site content, and will it come again? Those two answers pick the route.

Route 1: How do you convert XML to CSV for a HubSpot import?

A CSV import wants one row per record and one column per field. XML is a tree. The job is to turn the tree into a table without losing the fields you need.

What does the sample XML look like?

Here's a trimmed example of a contacts export from another system. The data is fake.

<?xml version="1.0" encoding="UTF-8"?>
<contacts exported="2026-11-20T14:05:00Z">
  <contact id="EV-1042">
    <email>Jane.Doe@Example.com </email>
    <name><first>Jane</first><last>Doe</last></name>
    <company>
      <name>Example Labs</name>
      <domain>example.com</domain>
    </company>
    <stage>lead</stage>
    <signedUp>2026-10-03T09:12:44Z</signedUp>
    <billing><mrr currency="USD">1250.00</mrr></billing>
    <tags>
      <tag>webinar</tag>
      <tag>pricing</tag>
    </tags>
  </contact>
  <contact id="EV-1043">
    <email>sam.lee@example.org</email>
    <name><first>Sam</first><last>Lee</last></name>
    <company>
      <name>Example Org</name>
      <domain>example.org</domain>
    </company>
    <stage>opportunity</stage>
    <signedUp>2026-09-18T16:40:02Z</signedUp>
    <billing><mrr currency="USD">400.00</mrr></billing>
    <tags>
      <tag>trial</tag>
    </tags>
  </contact>
</contacts>

Four things in that file need a decision. The ID is an attribute, not an element. Name and company are nested. The signup date carries a time and a time zone. And tags repeat, with a different count per contact.

How do you flatten nested and repeating elements?

Use these rules. They cover almost every XML export you'll meet.

XML shape Example How to flatten HubSpot column
Attribute on the record <contact id="EV-1042"> Pull it into its own column external_id
Nested single value <name><first> One column per leaf firstname, lastname
Nested object <company><name> Columns for the fields you need, or a separate companies file company, domain
Repeating value, few options <tag> Join with a semicolon, no spaces interests as multiple checkboxes
Repeating object Several <order> per contact One row per child in a second file, linked by the parent key A deals or orders import
Value with a unit attribute <mrr currency="USD"> Keep the number, check the unit is the same for all rows plan_mrr
Timestamp 2026-10-03T09:12:44Z Cut to the date for a date property signup_date

The semicolon rule comes from HubSpot's import file guide. Multiple checkbox values go in one cell as "value 1;value 2" with no spaces. Each option must already exist on the property, so add webinar, pricing and trial as options before you import. A picklist that's missing an option is a common reason a column fails.

For repeating objects, don't cram them into one cell. Three orders in one cell can't be reported on. Put them in a second file with one row per order and the contact's email or ID in each row. Then import that file as its own object.

Option A: the XML to CSV converter

For a flat or lightly nested file, paste it into the XML to CSV converter. Pick the repeating record element, here contact. It flattens the fields into columns you can download as a CSV. It runs in your browser, so the file doesn't leave your machine.

Then rename the headers to match HubSpot property names. HubSpot's import guide says each header should match a property, so this step saves you mapping time later.

Option B: Excel's XML import

Excel can open XML as a table. Microsoft's Import XML data guide lists the paths, as of November 2026:

  • Power Query, Microsoft 365: Data, then Get Data, then From File, then From XML. Pick the file and click Open.
  • XML table: Developer, then Import. Choose the file, then pick XML table in new worksheet.
  • Open directly: File, then Open, pick the file, then choose As an XML table.

If the Developer tab is hidden, Microsoft says to turn it on under File, Options, Customize Ribbon. Power Query is the best of the three for nested files. It lets you expand each nested column and choose which child fields to keep. Save the result as .xlsx or .csv and import that.

Option C: a short Python script

For nesting, repeating fields or files you'll convert more than once, a script beats clicking. This one uses Python's built-in ElementTree and writes a HubSpot-ready CSV.

# xml_to_hubspot_csv.py  usage: python xml_to_hubspot_csv.py contacts.xml contacts.csv
import csv
import sys
import xml.etree.ElementTree as ET  # for files you don't trust, use defusedxml instead

src, out = sys.argv[1], sys.argv[2]
root = ET.parse(src).getroot()

rows = []
for c in root.iter("contact"):
    email = (c.findtext("email") or "").strip().lower()
    if not email:
        continue  # no key, no row: log these separately
    tags = [t.text.strip() for t in c.findall("tags/tag") if t.text]
    rows.append({
        "external_id": c.get("id", ""),
        "email": email,
        "firstname": (c.findtext("name/first") or "").strip(),
        "lastname": (c.findtext("name/last") or "").strip(),
        "company": (c.findtext("company/name") or "").strip(),
        "domain": (c.findtext("company/domain") or "").strip().lower(),
        "lifecyclestage": (c.findtext("stage") or "").strip(),
        "signup_date": (c.findtext("signedUp") or "")[:10],  # 2026-10-03
        "plan_mrr": (c.findtext("billing/mrr") or "").strip(),
        "interests": ";".join(tags),  # multiple checkbox: no spaces
    })

with open(out, "w", newline="", encoding="utf-8") as f:
    writer = csv.DictWriter(f, fieldnames=list(rows[0].keys()))
    writer.writeheader()
    writer.writerows(rows)

print(f"Wrote {len(rows)} rows to {out}")

A note on safety. Python's XML docs warn that an attacker can abuse XML features when you parse a file they control. They suggest checking that your Expat version is 2.7.2 or later. If the XML comes from outside your company, I'd also use defusedxml, a hardened drop-in for the same calls. If you prefer lxml, the findtext and iter calls work the same way.

What does the resulting CSV look like?

Run the script on the sample and you get this:

external_id,email,firstname,lastname,company,domain,lifecyclestage,signup_date,plan_mrr,interests
EV-1042,jane.doe@example.com,Jane,Doe,Example Labs,example.com,lead,2026-10-03,1250.00,webinar;pricing
EV-1043,sam.lee@example.org,Sam,Lee,Example Org,example.org,opportunity,2026-09-18,400.00,trial

Notice what changed. The email lost its trailing space and capital letters. The date lost its time. The tags became one cell. And the ID moved out of an attribute into a real column you can dedupe on later.

How do you map XML fields to HubSpot properties?

Write the field map down before you import. It's the document you'll want when someone asks in six months where a value came from.

XML path CSV column HubSpot property Type Notes
contact/@id external_id External ID (custom) Single-line text, unique values Create it first with Require unique values
email email Email Email Trim and lowercase
name/first firstname First name Text
name/last lastname Last name Text
company/name company Company name Text Contact property, not the company record
company/domain domain Company domain name Text Import as a company to create company records
stage lifecyclestage Lifecycle stage Dropdown Values must match HubSpot's internal stage values
signedUp signup_date Signup date (custom) Date picker Cut to yyyy-mm-dd
billing/mrr plan_mrr Plan MRR (custom) Number No currency sign or commas
tags/tag interests Interests (custom) Multiple checkboxes Options must exist; join with ;

The External ID row is worth the setup. HubSpot's validation rules doc says you can create up to ten unique value properties per object, and only when you first create the property. With one in place, every later import or API call can match on the old system's ID, not just email.

What date and number formats does HubSpot accept?

HubSpot's import file guide is flexible on dates and strict on numbers, as of November 2026:

Field type What HubSpot accepts What to send from XML
Date Slashes, hyphens or periods; day-month-year, month-day-year or year-month-day 2026-10-03, year first, so nobody mixes up days and months
Date and time hh:mm after the date; no time means midnight Keep the time only if the property needs it
Currency Decimals, like 123.45 1250.00, no $ and no thousands commas
Percentage "25%" or ".25" Pick one style for the whole file
Phone "+11234567890 ext123", with country code Add the country code if the XML lacks it
Multiple checkboxes "value 1;value 2", no spaces Join repeating tags with ;

Year-month-day is the one I'd always use. XML exports from European and US systems can disagree on day and month order. A year-first date can't be read two ways. This kind of data normalization is cheap in a script and painful after import.

What are HubSpot's import limits?

From HubSpot's import file guide, as of November 2026. Limits run on a rolling 24 hours.

Limit Free tools Smart CRM, Starter, Professional, Enterprise
File types .csv, .xlsx, .xls, one sheet Same
Columns per file Fewer than 1,000 Same
File size Up to 20MB Up to 512 MB
Rows per day Up to 500,000 Up to 10,000,000
Rows per file Not stated Up to 1,048,576
Imports per day Up to 50 Up to 500
Imports at once Up to 3 Up to 3

If your XML has more rows than one file allows, split the CSV. Keep the header row on every part.

How do you run the import?

HubSpot's import guide gives this path, as of November 2026:

  1. Click More, then Data Management, then Data Integration. Or click Import on any object's index page.
  2. In Import a file, click Import data, then Advanced imports (all objects).
  3. Pick the object, upload the CSV, and set Choose how to import to Create and update.
  4. On the mapping screen, map each column with the HubSpot Property dropdown. Set any column you don't want to Don't import column.
  5. Map the key. Email for contacts, Company Domain Name for companies, Record ID for any object, or your unique External ID.
  6. If you mapped more than one unique property, choose one in Property to use to find existing [objects].
  7. Click [x] errors if any show, fix them in Edit errored values, and finish.

For a first run, import 20 rows. Open three of the new records and check every mapped field. Then import the rest. Duplicates are the most common way these imports go wrong, and HubSpot imports without duplicates covers that in depth, along with the wider rules of deduplication.

Route 2: How do you load XML into HubSpot through the API?

When the XML arrives on a schedule, skip the CSV. Parse the file in a script and send the records to HubSpot's CRM API. HubSpot's REST API has batch endpoints built for this.

Which HubSpot endpoints do you use?

HubSpot's contacts API guide lists these, as of November 2026:

Job Endpoint Notes
Create many POST /crm/objects/2026-09/contacts/batch/create For records you know are new
Create or update many POST /crm/objects/2026-09/contacts/batch/upsert Match on email or a unique custom property
Batch size 100 records per request "Batch operations are limited to 100 records at a time"

Use upsert for feeds. It creates new records and updates existing ones in one call, so a rerun doesn't make copies. That's idempotency in practice: sending the same file twice leaves HubSpot in the same state.

One caveat from the same guide: "Partial upserts are not supported when using email as the idProperty for contacts." If you need partial upserts, match on a custom unique property like External ID instead.

The path format is new. HubSpot moved to date-based versions on March 30, 2026. Its migration guide says legacy paths like /crm/v3/ stop being supported in September 2027. Build new scripts on the dated paths now.

What are HubSpot's API rate limits?

From HubSpot's usage guidelines, as of November 2026:

Bar chart of API requests to load 50,000 contacts: 50,000 sent one record at a time versus 500 in batches of 100.Bar chart of API requests to load 50,000 contacts: 50,000 sent one record at a time versus 500 in batches of 100.
A worked example: the same nightly file takes 100 times fewer calls with HubSpot's 100-record batch limit, leaving daily API budget for other tools. Worked example from this guide.
App type and tier Per 10 seconds Per day
Private app, Free and Starter 100 per app 250,000 per account
Private app, Professional 190 per app 625,000 per account
Private app, Enterprise 190 per app 1,000,000 per account
Private app with API Limit Increase 250 per app Plus 1,000,000 per increase
Public OAuth app 110 per installing account Not listed

The daily cap is shared by every app in the account. A heavy import script competes with your other integrations for the same budget. Over the API rate limit, HubSpot returns a 429. The guide says to treat high-volume 5xx errors the same way, and to watch X-HubSpot-RateLimit-Remaining in each response.

What does the Node script look like?

This script reads the sample XML, maps each contact to HubSpot properties, and upserts in batches of 100. It uses the fast-xml-parser package and Node's built-in fetch. It waits and retries on a 429 or a 5xx.

// upsert-contacts.mjs  usage: HUBSPOT_TOKEN=... node upsert-contacts.mjs contacts.xml
import fs from "node:fs";
import { XMLParser } from "fast-xml-parser";

const TOKEN = process.env.HUBSPOT_TOKEN; // app token with crm.objects.contacts.write
const URL = "https://api.hubapi.com/crm/objects/2026-09/contacts/batch/upsert";
const BATCH = 100;

const parser = new XMLParser({
  ignoreAttributes: false,
  attributeNamePrefix: "@_",
  isArray: (name) => name === "contact" || name === "tag",
});
const doc = parser.parse(fs.readFileSync(process.argv[2], "utf8"));

const inputs = [];
const skipped = [];
for (const c of doc.contacts.contact) {
  const email = String(c.email ?? "").trim().toLowerCase();
  if (!email) { skipped.push(c["@_id"]); continue; }
  inputs.push({
    idProperty: "email",
    id: email,
    properties: {
      external_id: c["@_id"],
      firstname: c.name?.first ?? "",
      lastname: c.name?.last ?? "",
      company: c.company?.name ?? "",
      lifecyclestage: c.stage ?? "",
      signup_date: String(c.signedUp ?? "").slice(0, 10),
      plan_mrr: String(c.billing?.mrr?.["#text"] ?? c.billing?.mrr ?? ""),
      interests: (c.tags?.tag ?? []).join(";"),
    },
  });
}

const sleep = (ms) => new Promise((r) => setTimeout(r, ms));

async function send(batch, attempt = 1) {
  const res = await fetch(URL, {
    method: "POST",
    headers: { Authorization: `Bearer ${TOKEN}`, "Content-Type": "application/json" },
    body: JSON.stringify({ inputs: batch }),
  });
  if (res.status === 429 || res.status >= 500) {
    if (attempt >= 5) throw new Error(`Gave up after ${attempt} tries: ${res.status}`);
    await sleep(2 ** attempt * 1000); // 2s, 4s, 8s, 16s
    return send(batch, attempt + 1);
  }
  if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
  return res.json();
}

for (let i = 0; i < inputs.length; i += BATCH) {
  const out = await send(inputs.slice(i, i + BATCH));
  console.log(`Batch ${i / BATCH + 1}: ${out.results?.length ?? 0} records`);
  await sleep(150); // stays well under 100 requests per 10 seconds
}
console.log(`Done. Sent ${inputs.length}, skipped ${skipped.length} with no email.`);

A few choices in there are deliberate:

  • The token lives in an environment variable. Never paste it into the script or commit it.
  • Rows with no email are skipped and counted. Send that list to whoever owns the source system.
  • The retry waits longer each time. That's standard retry logic, and it stops after five tries so a bad night fails loudly.
  • There's a short pause between batches. It keeps the script polite to the shared daily cap.

Run it from a scheduler, like a cron job or a serverless function, right after the XML lands. Log the counts each night. If you'd rather trigger it from an event, webhooks for GTM covers the receiving side.

You can build the same flow in Zapier, Make or n8n. For one small feed, that's fine. For thousands of records a night, I'd still write the script. It's about 60 lines, it batches properly, and it's easy to read when it breaks.

Route 3: How do you get XML or RSS feeds into HubSpot content?

Not every XML file is CRM data. Product lists, job posts, locations and blog feeds belong in your content, not your contacts. HubSpot gives you three tools for that.

HubDB tables

HubDB is HubSpot's built-in database for site content, like a directory or a list of locations. HubSpot's HubDB guide says to open the table, click Actions and select Import, then upload a CSV. It names CSV as the import format. It also says Content Hub Professional or Enterprise is required to use HubDB for dynamic pages.

The API is even clearer. HubSpot's HubDB API guide says "Only CSV is supported" for table imports. The import goes to the table's draft, so you publish after. Here's a trimmed config for the import call:

{
  "skipRows": 1,
  "separator": ",",
  "resetTable": false,
  "columnMappings": [
    { "source": 1, "target": "name" },
    { "source": 2, "target": "city" },
    { "source": 3, "target": "zip_code" }
  ],
  "primaryKeyColumn": "name",
  "encoding": "utf-8",
  "format": "csv"
}

So the flow is the same as Route 1. Convert the XML to CSV, then import. Set primaryKeyColumn so a rerun updates rows instead of adding copies. Be careful with resetTable: true. The guide says it deletes rows that aren't in the file.

RSS email

If the XML is an RSS feed of blog posts, HubSpot can email it. HubSpot's RSS email guide says this needs Marketing Hub Professional or Enterprise. The path, as of November 2026:

  1. Go to Marketing, then Email, and click Create email.
  2. Select Blog/RSS, then Next.
  3. Select RSS feed and enter the feed URL.
  4. Pick a template, name it, and click Create email.
  5. Set the frequency to daily, weekly or monthly.

Only posts published since the last send go out. HubSpot's RSS troubleshooting guide says each post needs a GUID and a link. The feed must be public, and the URL must be the feed itself, not a page that links to it. The HubSpot RSS feed guide covers building and fixing feeds in more depth.

The RSS Listing module

To show a feed on a page, use the RSS Listing module. HubSpot's RSS module guide says it pulls from a HubSpot blog or an outside feed URL. It's available on Marketing Hub or Content Hub Professional or Enterprise. You add it in Content, then Design Manager, by searching for "rss listing" in the template's + Add menu. The default is five posts.

How do you get XML out of HubSpot?

HubSpot doesn't export XML either. Its export guide lists CSV, XLS and XLSX. Only CSV can include all associated records. The download link arrives by email and expires after 30 days.

So you have two ways to produce XML:

  • Export and convert. Export CSV, then run a short script to write XML. This is fine for a one-time hand-off to a partner.
  • Build from the API. Read records from the CRM API and write the XML directly. This is the route for a recurring feed, since there's no manual export step.

Here's the convert script. It turns any HubSpot CSV export into simple XML, one element per row.

# csv_to_xml.py  usage: python csv_to_xml.py hubspot-export.csv contacts.xml
import csv
import re
import sys
import xml.etree.ElementTree as ET

src, out = sys.argv[1], sys.argv[2]
root = ET.Element("contacts")

with open(src, newline="", encoding="utf-8-sig") as f:
    for row in csv.DictReader(f):
        rec = ET.SubElement(root, "contact")
        for header, value in row.items():
            tag = re.sub(r"[^a-z0-9_]", "_", header.strip().lower()) or "field"
            if tag[0].isdigit():
                tag = "f_" + tag
            ET.SubElement(rec, tag).text = value

ET.indent(root)  # Python 3.9+
ET.ElementTree(root).write(out, encoding="utf-8", xml_declaration=True)

The tag cleanup matters. HubSpot export headers are labels like "First Name" or "Create Date," and XML element names can't hold spaces or start with a digit. The script turns those into first_name and create_date.

One more XML source is already sitting in HubSpot. Each HubSpot-hosted domain publishes a sitemap, and each blog publishes an RSS feed. If a partner wants "an XML list of your pages," the HubSpot XML sitemap may already be the answer.

How does a HubSpot XML import break?

These are the failure modes that show up most, by route.

What breaks Route Why it happens Fix
Duplicate contacts CSV and API Emails differ by case or a trailing space Trim and lowercase in the script
Column won't map CSV Header doesn't match any property Rename to the internal property name
Checkbox values dropped CSV and API Option doesn't exist on the property Add the options first
Days and months swapped CSV Source used day-month, HubSpot read month-day Convert to yyyy-mm-dd
MRR imported as 0 or blank CSV Currency sign or thousands comma in the value Strip to digits and one decimal point
Only the first tag survives CSV Converter kept the first repeating child Join repeating values with ;
Orders lost CSV Repeating objects squeezed into one cell Separate file, one row per order
Script stalls at night API 429s with no retry Back off and retry, log the count
Old records overwritten API Upsert by email after an email change Match on a unique External ID
Garbled names CSV File not saved as UTF-8 Save as UTF-8; HubSpot asks for it with foreign characters
HubDB rows deleted HubDB resetTable set to true Leave it false unless you mean it

The last one is the scariest, because it's quiet. A reset import that's missing rows removes them from the table, and the page they powered goes blank. Test HubDB imports on a copy of the table first.

XML to HubSpot validation checklist

Run through this before every first import, and keep it for every new XML source.

  1. Confirm the record element. Find the element that repeats once per record, like contact or order.
  2. List every field. Write down each leaf and attribute you need, and the ones you'll drop.
  3. Choose the key. Email, company domain, Record ID or a unique External ID.
  4. Create missing properties. Add custom properties and checkbox options in HubSpot first.
  5. Flatten. Nested values to columns, repeating values joined or split into a second file.
  6. Normalize. Trim and lowercase emails and domains, dates to yyyy-mm-dd, numbers with no symbols.
  7. Check the counts. Records in the XML should equal rows in the CSV, plus your skipped list.
  8. Save as UTF-8. Especially with accented names.
  9. Test 20 rows. Import or upsert a small batch and open three records by hand.
  10. Check limits. File size, rows per file, and daily API budget for your tier.
  11. Run the full load. Use Create and update, or batch upsert.
  12. Reconcile. Compare HubSpot's created and updated counts with your source count.
  13. Write down the field map. Save it where the next person will find it.

If this XML is part of moving off an old system, treat it like any CRM migration. Map first, test small, load once, and keep the old system's IDs. After the load, workflows can take over the follow-up work, and HubSpot workflow recipes has patterns for that. The general shape here, pull data out, reshape it, push it in, is classic ETL.

What to do this week

If you have an XML file waiting, do this.

First, open it and find the repeating record element. Paste a sample into the XML to CSV converter and see what columns come out.

Second, write the field map. Create any missing properties in HubSpot CRM, including a unique External ID.

Third, import 20 rows with Create and update. Check three records by hand. Then load the rest.

Fourth, if the file will come again next week, turn the script above into a scheduled job. Batch it, retry it and log the counts.

If the XML is one piece of a bigger data flow across billing, product and CRM, that's the work we do in GTM engineering.

FAQ

Can HubSpot import XML files?

No. HubSpot's import doc says the file must be a .csv, .xlsx or .xls file with one sheet. XML isn't on the list. To load XML data, convert it to CSV first, open it in Excel and save as XLSX, or parse it with a script and send the records through HubSpot's CRM API. HubDB tables are stricter still: the HubDB API says only CSV is supported.

What's the fastest way to turn XML into a HubSpot import file?

For a one-off file, paste it into an XML to CSV converter, pick the repeating record element, like contact or order, and download the CSV. Then rename the headers to match HubSpot property names and import. For anything nested or repeating, like several tags per contact, a short Python script gives you more control over how each field is flattened.

How do I avoid duplicates when importing converted XML?

Include a unique identifier in every row. For contacts that's email, for companies it's company domain name, and any object can use Record ID or a custom property set to require unique values. Choose Create and update in the import options. Lowercase and trim emails before you import, since stray spaces and mixed case cause most near-duplicates.

How many records can I push through the HubSpot API at once?

HubSpot's contacts API guide says batch operations are limited to 100 records at a time. So 50,000 contacts take 500 batch calls. The rate limit for a private app on Free or Starter is 100 requests every 10 seconds, so pace your script, read the rate limit headers and retry on a 429 with a growing wait.

Can I export HubSpot data as XML?

Not directly. HubSpot's export doc lists CSV, XLS and XLSX as file formats. To get XML, export to CSV and convert it with a short script, or read records from the CRM API and write the XML yourself. HubSpot does publish two kinds of XML on its own: the sitemap for each domain and the RSS feeds for its blogs.

Can I import an RSS or XML feed into a HubSpot page or email?

Yes, in two ways. An RSS email, on Marketing Hub Professional or Enterprise, pulls new posts from any RSS feed URL on a daily, weekly or monthly schedule. The RSS Listing module shows posts from a HubSpot blog or an outside feed on a page. Both need a valid feed where each item has a GUID and a link.

More like this

Startup? Let's talk.

20 minute fit call. You'll leave knowing the first thing we'd fix and roughly what it costs. If we're not the right fit, we'll tell you who is.