Companies

Companies represent the organization to which lead records belong. Leads are added to a
Company by populating their corresponding externalCompanyId field. Leads linked to a company record will directly inherit the values from a company record as though the values existed on the lead’s own record.

Company APIs are only exposed for subscriptions which do not have a native CRM sync enabled.

Describe

Describing the company object will give you all the information you need to interact with them.

Request

1

GET/rest/v1/companies/describe.json

Response(Truncated)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

{

"success":true,

"requestId":"5847#14d44113ad7",

"result":[

{

"name":"Company",

"description":"Company object",

"createdAt":"2015-05-11T17:11:32Z",

"updatedAt":"2015-05-11T17:11:32Z",

"idField":"id",

"dedupeFields":[

"externalCompanyId"

],

"searchableFields":[

[

"externalCompanyId"

],

[

"id"

],

[

"company"

]

],

"fields":[

{

"name":"createdAt",

"displayName":"Created At",

"dataType":"datetime",

"updateable":false

},

{

"name":"externalCompanyId",

"displayName":"External Company Id",

"dataType":"string",

"length":100,

"updateable":false

},

{

"name":"id",

"displayName":"Id",

"dataType":"integer",

"updateable":false

},

{

"name":"updatedAt",

"displayName":"Updated At",

"dataType":"datetime",

"updateable":false

},

{

"name":"annualRevenue",

"displayName":"Annual Revenue",

"dataType":"currency",

"updateable":true

}

{

"name":"company",

"displayName":"Company Name",

"dataType":"string",

"length":255,

"updateable":true

}

]

}

]

}

Query

The pattern for querying companies closely follows that of the leads API with the added restriction that the filterType parameter accepts the fields listed in the searchableFields array of the Describe Companies call, or dedupeFields.

filterType and filterValues are required query parameters. fields, nextPageToken, and batchSize are optional parameters. The parameters function just like the corresponding parameters in the Leads and Opportunities APIs.

If the fields parameter is omitted, the default set of fields returned is:

id

dedupeFields

updatedAt

createdAt

Request

1

GET/rest/v1/companies.json?filterType=id&filterValues=3433,5345

Response

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

{

"requestId":"e42b#14272d07d78",

"success":true,

"result":[

{

"seq":0,

"id":3433,

"externalCompanyId":"19UYA31581L000000",

"company":"Google"

},

{

"seq":1,

"id":5345,

"externalCompanyId":"29UYA31581L000000",

"company":"Yahoo"

}

]

}

Create and Update

Just like opportunities, there are three modes for creating and updating companies: createOnly, updateOnly, and createOrUpdate. Modes are specified in the action parameter of the request. Both the dedupeBy and action parameters are optional, and default to the dedupeFields and the createOrUpdate modes respectively.

Request

1

POST/rest/v1/companies.json

Header

1

Content-Type:application/json

Body

1

2

3

4

5

6

7

8

9

10

11

12

13

14

{

"action":"createOrUpdate",

"dedupeBy":"dedupeFields",

"input":[

{

"externalCompanyId":"19UYA31581L000000",

"company":"Google"

},

{

"externalCompanyId":"29UYA31581L000000",

"company":"Yahoo"

}

]

}

Response

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

{

"requestId":"e42b#14272d07d78",

"success":true,

"result":[

{

"seq":0,

"status":"updated",

"id":1232

},

{

"seq":1,

"status":"created",

"id":1323

}

]

}

Delete

The deletion criteria is specified in the input array, which contains a list of search values. The deletion method is specified in the deleteBy parameter. Permissible values are: dedupeFields, idField. Default is dedupeFields.

Latest Blog Posts

Keep up with what's new in the developer world

Important Change to Activity Records in Marketo APIs March 1, 2017 Note: This post will be updated to reflect changes made to activity records returned by the API due to migration to new infrastructure.
With the rollout of Marketo’s next-generation Activity Service beginning in September 2017, we will be unable to enforce the uniqueness or presence of the integer “id” field in activities, data value changes, or lead ... Read More >

Spring 2018 Updates June 29, 2018 In the Spring 2018 release we are releasing new REST APIs, and web tracking privacy enhancements. See the full list of updates below.
REST API
Static List CRUD
Allows users to remotely Create, Read, Update, and Delete Static List Records. Enables management of the entire lifecycle of a static list through REST APIs, including populating and maintaining membership. ... Read More >

Winter 2018 Updates March 2, 2018 In the Winter 2018 release, we are releasing a few enhancements to our APIs. See the full list of updates below.
Asset APIs
Activate/Deactivate Trigger Campaigns
We have added the ability to activate and deactivate trigger campaigns, which can simplify the process of automating your program templates. This is achieved by calling two newly added endpoints: Activate Smart Campaign, Deactivate ... Read More >