POST
/
field_mappings
import { Panora } from "@panora/sdk";
import { CustomFieldCreateDtoDataType, CustomFieldCreateDtoObjectTypeOwner } from "@panora/sdk/models/components";

const panora = new Panora({
  apiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const result = await panora.fieldMappings.defineCustomField({
    objectTypeOwner: CustomFieldCreateDtoObjectTypeOwner.Company,
    name: "my_favorite_dish",
    description: "Favorite Dish",
    dataType: CustomFieldCreateDtoDataType.String,
    sourceCustomFieldId: "id_1",
    sourceProvider: "hubspot",
    linkedUserId: "801f9ede-c698-4e66-a7fc-48d19eebaa4f",
  });
  
  // Handle the result
  console.log(result)
}

run();
{
  "id_attribute": "801f9ede-c698-4e66-a7fc-48d19eebaa4f",
  "status": "",
  "ressource_owner_type": "",
  "slug": "fav_dish",
  "description": "My favorite dish",
  "data_type": "string",
  "remote_id": "id_1",
  "source": "hubspot",
  "id_entity": "801f9ede-c698-4e66-a7fc-48d19eebaa4f",
  "id_project": "801f9ede-c698-4e66-a7fc-48d19eebaa4f",
  "scope": "",
  "id_consumer": "801f9ede-c698-4e66-a7fc-48d19eebaa4f",
  "created_at": "2024-10-01T12:00:00Z",
  "modified_at": "2024-10-01T12:00:00Z"
}

Authorizations

x-api-key
string
header
required

Body

application/json
object_type_owner
enum<string> | null
required
Available options:
company,
contact,
deal,
lead,
note,
task,
engagement,
stage,
user
Example:

"company"

name
string | null
required

The name of the custom field

Example:

"my_favorite_dish"

description
string | null
required

The description of the custom field

Example:

"Favorite Dish"

data_type
enum<string> | null
required

The data type of the custom field

Available options:
string,
number
Example:

"string"

source_custom_field_id
string | null
required

The source custom field ID

Example:

"id_1"

source_provider
string | null
required

The name of the source software/provider

Example:

"hubspot"

linked_user_id
string | null
required

The linked user ID

Example:

"801f9ede-c698-4e66-a7fc-48d19eebaa4f"

Response

201 - application/json
id_attribute
string | null
required

Attribute Id

Example:

"801f9ede-c698-4e66-a7fc-48d19eebaa4f"

status
string | null
required

Attribute Status

Example:

""

ressource_owner_type
string | null
required

Attribute Ressource Owner Type

Example:

""

slug
string | null
required

Attribute Slug

Example:

"fav_dish"

description
string | null
required

Attribute Description

Example:

"My favorite dish"

data_type
enum<string> | null
required

Attribute Data Type

Available options:
string,
number
Example:

"string"

remote_id
string | null
required

Attribute Remote Id

Example:

"id_1"

source
string | null
required

Attribute Source

Example:

"hubspot"

id_entity
string | null
required

Attribute Entity Id

Example:

"801f9ede-c698-4e66-a7fc-48d19eebaa4f"

id_project
string | null
required

Attribute Project Id

Example:

"801f9ede-c698-4e66-a7fc-48d19eebaa4f"

scope
string | null
required

Attribute Scope

Example:

""

id_consumer
string | null
required

Attribute Consumer Id

Example:

"801f9ede-c698-4e66-a7fc-48d19eebaa4f"

created_at
string | null
required

Attribute Created Date

Example:

"2024-10-01T12:00:00Z"

modified_at
string | null
required

Attribute Modified Date

Example:

"2024-10-01T12:00:00Z"