Association Types
The Association Type object represents the relationship between two objects.
The AssociationType object
Properties

source_object_classObject
Required

target_object_classesAssociationSubType[]
Required

remote_key_nameString
Optional

display_nameString
Optional

cardinalityEnum
Optional
Possible values include: ONE_TO_ONE, MANY_TO_ONE, MANY_TO_MANY, ONE_TO_MANY, or - in cases where there is no clear mapping - the original value passed through.

is_requiredBoolean
Required

idString
Required

remote_idString
Optional
The third-party API ID of the matching object.

modified_atString
Required
This is the datetime that this object was last updated by Merge

The AssociationType object
JSON
{
"source_object_class": {
"id": "ff1ff4cb-a66b-47dc-8e2a-50388049e602",
"origin_type": "CUSTOM_OBJECT"
},
"target_object_classes": [
{
"id": "Opportunity",
"origin_type": "COMMON_MODEL"
}
],
"remote_key_name": "order_to_opportunity",
"display_name": "Order to Opportunity",
"cardinality": "ONE_TO_MANY",
"is_required": true,
"id": "5bb73c32-3c6c-4757-ab7d-7d3540a1be31",
"remote_id": "93",
"modified_at": "2021-10-16T00:00:00Z"
}

This endpoint is currently supported for Salesforce, Hubspot, and Zendesk Sell. More integrations coming soon!


GET
/custom-object-classes/{custom_object_class_id}/association-types

Returns a list of AssociationType objects.


Header Parameters

AuthorizationString
Required
Token-based authentication with required prefix "Bearer"

X-Account-TokenString
Required
Token identifying the end user.
Query & Path Parameters

created_afterString
Optional
If provided, will only return objects created after this datetime.

created_beforeString
Optional
If provided, will only return objects created before this datetime.

cursorString
Optional
The pagination cursor value.

custom_object_class_idString
Required

expandString
Optional
Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

include_deleted_dataBoolean
Optional
Whether to include data that was marked as deleted by third party webhooks.

include_remote_dataBoolean
Optional
Whether to include the original data Merge fetched from the third-party to produce these models.

modified_afterString
Optional
If provided, only objects synced by Merge after this date time will be returned.

modified_beforeString
Optional
If provided, only objects synced by Merge before this date time will be returned.

page_sizeInteger
Optional
Number of results to return per page.

remote_idString
Optional
The API provider's ID for the given object.

Response
JSON
{
"next": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw",
"previous": "cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ",
"results": [
{
"source_object_class": {
"id": "ff1ff4cb-a66b-47dc-8e2a-50388049e602",
"origin_type": "CUSTOM_OBJECT"
},
"target_object_classes": [
{
"id": "Opportunity",
"origin_type": "COMMON_MODEL"
}
],
"remote_key_name": "order_to_opportunity",
"display_name": "Order to Opportunity",
"cardinality": "ONE_TO_MANY",
"is_required": true,
"id": "5bb73c32-3c6c-4757-ab7d-7d3540a1be31",
"remote_id": "93",
"modified_at": "2021-10-16T00:00:00Z"
}
]
}

This endpoint is currently supported for Salesforce, Hubspot, and Zendesk Sell. More integrations coming soon!

POST
/custom-object-classes/{custom_object_class_id}/association-types

Creates an AssociationType object with the given values.


Header Parameters

AuthorizationString
Required
Token-based authentication with required prefix "Bearer"

X-Account-TokenString
Required
Token identifying the end user.
Query & Path Parameters

custom_object_class_idString
Required

is_debug_modeBoolean
Optional
Whether to include debug fields (such as log file links) in the response.

run_asyncBoolean
Optional
Whether or not third-party updates should be run asynchronously.
Body Parameters

modelObject
Required
Find available fields below under “Model Parameters”.
Model Parameters
View app-specific writable fields under “Field support by platform” in this section.

source_object_classObject

target_object_classesArray

remote_key_nameString

display_nameString

cardinalityString
  • ONE_TO_ONE
    • ONE_TO_ONE

is_requiredBoolean

POST v1/custom-object-classes/{custom_object_class_id}/association-types
JSON
{
"model": {
"source_object_class": {
"id": "string",
"origin_type": "CUSTOM_OBJECT"
},
"target_object_classes": [
{
"id": "string",
"origin_type": "CUSTOM_OBJECT"
}
],
"remote_key_name": "string",
"display_name": "string",
"cardinality": "ONE_TO_ONE",
"is_required": false
}
}
Response
JSON
{
"model": {
"source_object_class": {
"id": "ff1ff4cb-a66b-47dc-8e2a-50388049e602",
"origin_type": "CUSTOM_OBJECT"
},
"target_object_classes": [
{
"id": "Opportunity",
"origin_type": "COMMON_MODEL"
}
],
"remote_key_name": "order_to_opportunity",
"display_name": "Order to Opportunity",
"cardinality": "ONE_TO_MANY",
"is_required": true,
"id": "5bb73c32-3c6c-4757-ab7d-7d3540a1be31",
"remote_id": "93",
"modified_at": "2021-10-16T00:00:00Z"
},
"warnings": [
{
"source": {
"pointer": "/age"
},
"title": "Unrecognized Field",
"detail": "An unrecognized field, age, was passed in with request data.",
"problem_type": "UNRECOGNIZED_FIELD"
}
],
"errors": [
{
"source": {
},
"title": "Missing Required Field",
"problem_type": "MISSING_REQUIRED_FIELD"
}
],
"logs": [
{
"log_id": "99433219-8017-4acd-bb3c-ceb23d663832",
"dashboard_view": "https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832",
"log_summary": {
"url": "https://harvest.greenhouse.io/v1/candidates/",
"method": "POST",
"status_code": 200
}
}
]
}

This endpoint is currently supported for Salesforce, Hubspot, and Zendesk Sell. More integrations coming soon!

GET
/custom-object-classes/{custom_object_class_id}/association-types/{id}

Returns an AssociationType object with the given id.


Header Parameters

AuthorizationString
Required
Token-based authentication with required prefix "Bearer"

X-Account-TokenString
Required
Token identifying the end user.
Query & Path Parameters

custom_object_class_idString
Required

expandString
Optional
Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

idString
Required

include_remote_dataBoolean
Optional
Whether to include the original data Merge fetched from the third-party to produce these models.

Response
JSON
{
"source_object_class": {
"id": "ff1ff4cb-a66b-47dc-8e2a-50388049e602",
"origin_type": "CUSTOM_OBJECT"
},
"target_object_classes": [
{
"id": "Opportunity",
"origin_type": "COMMON_MODEL"
}
],
"remote_key_name": "order_to_opportunity",
"display_name": "Order to Opportunity",
"cardinality": "ONE_TO_MANY",
"is_required": true,
"id": "5bb73c32-3c6c-4757-ab7d-7d3540a1be31",
"remote_id": "93",
"modified_at": "2021-10-16T00:00:00Z"
}

This endpoint is currently supported for Salesforce, Hubspot, and Zendesk Sell. More integrations coming soon!

GET
/custom-object-classes/{custom_object_class_id}/association-types/meta/post

Returns metadata for CRMAssociationType POSTs.


Header Parameters

AuthorizationString
Required
Token-based authentication with required prefix "Bearer"

X-Account-TokenString
Required
Token identifying the end user.
Query & Path Parameters

custom_object_class_idString
Required
Response
JSON
{
"request_schema": {},
"remote_field_classes": {},
"status": {
"linked_account_status": "string",
"can_make_request": true
},
"has_conditional_params": true,
"has_required_linked_account_params": true
}

This endpoint is currently supported for Salesforce, Hubspot, and Zendesk Sell. More integrations coming soon!