APIs & Integrations

westhan
Participant

API name for all default contact properties

SOLVE

TL;DR: Is there any exhastive list of contact properties that also includes the API name of each one?

 

I'm building a node app using hubspot's v3 api to pull hubspot contact data. I want to pull properties like "Last Page Seen" and "Fist Page Seen" but cannot find any documentation on the API name of each contact property.

 

The contact properties documentation lists these and many other fields and is referenced in the v3 contacts documentation but does not give the API name.

 

Some of these values can be found looking through the legacy documentation but not an exhastive list and since the naming convention doesn't seem consistant it is hard to infer the names of other properties based on the examples given. 

0 Upvotes
1 Accepted solution
westhan
Solution
Participant

API name for all default contact properties

SOLVE

Thanks @coldrickjack, your method seems easier than mine. I ended up using the API to pull all properties like this:

const API_KEY - 'your-api-key'
const fs = require('fs');
const hubspot = require('@hubspot/api-client');

const hubspotClient = new hubspot.Client({"accessToken":API_KEY});

const main = function() {
    getProperties();
}

const getProperties = async function() {
    const objectType = "contacts";
    
    try {
        const apiResponse = await hubspotClient.crm.properties.coreApi.getAll(objectType);
        fs.writeFile('properties.json', JSON.stringify(apiResponse.results, null, 4), (err) => {
            if (err) throw err;
            console.log('The file has been saved!');
          });
    } catch (e) {
        e.message === 'HTTP request failed' ? console.error(JSON.stringify(e.response, null, 2)) : console.error(e)
    }
}

main();

 

 I still think @hubspot should provide this in documentation. seems silly not to list the API name when they have the list published anyway. Thanks again.

 

View solution in original post

3 Replies 3
coldrickjack
Guide

API name for all default contact properties

SOLVE

Hey @westhan,

 

I had a similar requirement a few weeks back, what I did was created a test portal and just exported all of the default properties. You can do that by going into "Settings > Properties" and clicking on "Export all properties"👍 I included the file below to save you having to do this but handy to know if you ever need to!

westhan
Solution
Participant

API name for all default contact properties

SOLVE

Thanks @coldrickjack, your method seems easier than mine. I ended up using the API to pull all properties like this:

const API_KEY - 'your-api-key'
const fs = require('fs');
const hubspot = require('@hubspot/api-client');

const hubspotClient = new hubspot.Client({"accessToken":API_KEY});

const main = function() {
    getProperties();
}

const getProperties = async function() {
    const objectType = "contacts";
    
    try {
        const apiResponse = await hubspotClient.crm.properties.coreApi.getAll(objectType);
        fs.writeFile('properties.json', JSON.stringify(apiResponse.results, null, 4), (err) => {
            if (err) throw err;
            console.log('The file has been saved!');
          });
    } catch (e) {
        e.message === 'HTTP request failed' ? console.error(JSON.stringify(e.response, null, 2)) : console.error(e)
    }
}

main();

 

 I still think @hubspot should provide this in documentation. seems silly not to list the API name when they have the list published anyway. Thanks again.

 

coldrickjack
Guide

API name for all default contact properties

SOLVE

I'll leave this here for anyone else who might stumble across this thread: https://knowledge.hubspot.com/crm-setup/organize-and-export-properties#export-all-properties  

Users with Export permissions can export a list of all properties across all of your account’s objects. The exported file will contain basic information including each property’s name, internal name, type, description, group, and if applicable, its options. To view property values instead, you can export an individual property’s history or view historical data for a property on a record.