API documentation

Activities

Overview

The Activity object represents activities made with one or more contacts. Use it to keep track of what you've done. An activity can't be orphan - it needs to be linked to at least one contact.

When retrieving an activity, we always also return some basic information about the related contact(s).

List all the activities in your account

GET /activities/

Parameters

Name Type Description
limit integer Indicates the page size.
page integer Indicates the page to return.

Response

{
  "data": [
    {
      "id": 1,
      "object": "activity",
      "summary": "",
      "description": "On a mangé avec papi et mamie au restaurant indien.",
      "happened_at": "2016-10-04",
      "activity_type": {
                "id": 12,
                "object": "activityType",
                "name": "návštěva zápasu",
                "location_type": null,
                "activity_type_category": {
                    "id": 4,
                    "object": "activityTypeCategory",
                    "name": "Cultural activities",
                    "account": {
                        "id": 1
                    },
                    "created_at": null,
                    "updated_at": null
                },
                "account": {
                    "id": 1
                },
                "created_at": null,
                "updated_at": null
            },
      "attendees": {
        "total": 1,
        "contacts": [
          {
            "id": 1,
            "object": "contact",
            "hash_id": "h:X5LOkAdWNDqgVomKPv",
            "first_name": "Henri",
            "last_name": "Troyat",
            "nickname": "",
            "complete_name": "Henri Troyat",
            "initials": "HT",
            "gender": "Female",
            "gender_type": "F",
            "is_partial": false,
            "is_dead": false,
            "is_me": false,
            "information": {
              "dates": [
                {
                  "name": "birthdate",
                  "is_birthdate_approximate": "exact",
                  "birthdate": "1983-10-23T19:10:42Z"
                }
              ]
            },
            "account": {
              "id": 1
            }
          }
        ]
      },
      "account": {
        "id": 1
      },
      "created_at": "2016-10-07T11:59:14Z",
      "updated_at": "2017-05-03T01:42:28Z"
    },
    {
      "id": 2,
      "object": "activity",
      "summary": "Lunch with Dwight",
      "description": "We play handball and it was just awesome. He told me about a new girl he likes Cathy Simms, so he has to be careful.",
      "happened_at": "2016-10-18",
      "activity_type": {
                "id": 12,
                "object": "activityType",
                "name": "návštěva zápasu",
                "location_type": null,
                "activity_type_category": {
                    "id": 4,
                    "object": "activityTypeCategory",
                    "name": "Cultural activities",
                    "account": {
                        "id": 1
                    },
                    "created_at": null,
                    "updated_at": null
                },
                "account": {
                    "id": 1
                },
                "created_at": null,
                "updated_at": null
            },
      "attendees": {
        "total": 1,
        "contacts": [
          {
            "id": 8,
            "object": "contact",
            "hash_id": "h:AlKmTUoPDqgVomKPv",
            "first_name": "Jim",
            "last_name": "Halpert",
            "nickname": "",
            "complete_name": "Jim Halpert",
            "initials": "JH",
            "gender": "Male",
            "gender_type": "M",
            "is_partial": false,
            "is_dead": false,
            "is_me": false,
            "information": {
              "dates": [
                {
                  "name": "birthdate",
                  "is_birthdate_approximate": "exact",
                  "birthdate": "1978-10-01T16:20:55Z"
                }
              ]
            },
            "account": {
              "id": 1
            }
          }
        ]
      },
      "account": {
        "id": 1
      },
      "created_at": "2016-10-18T23:58:18Z",
      "updated_at": "2017-06-07T13:09:47Z"
    },
    {
      "id": 42,
      "object": "activity",
      "summary": "",
      "description": null,
      "happened_at": "2017-02-18",
      "activity_type": {
                "id": 12,
                "object": "activityType",
                "name": "návštěva zápasu",
                "location_type": null,
                "activity_type_category": {
                    "id": 4,
                    "object": "activityTypeCategory",
                    "name": "Cultural activities",
                    "account": {
                        "id": 1
                    },
                    "created_at": null,
                    "updated_at": null
                },
                "account": {
                    "id": 1
                },
                "created_at": null,
                "updated_at": null
            },
      "attendees": {
        "total": 1,
        "contacts": [
          {
            "id": 1,
            "object": "contact",
            "hash_id": "h:X5LOkAdWNDqgVomKPv",
            "first_name": "Henri",
            "last_name": "Troyat",
            "nickname": "",
            "complete_name": "Henri Troyat",
            "initials": "HT",
            "gender": "Female",
            "gender_type": "F",
            "is_partial": false,
            "is_dead": false,
            "is_me": false,
            "information": {
              "dates": [
                {
                  "name": "birthdate",
                  "is_birthdate_approximate": "exact",
                  "birthdate": "1983-10-23T19:10:42Z"
                }
              ]
            },
            "account": {
              "id": 1
            }
          }
        ]
      },
      "account": {
        "id": 1
      },
      "created_at": "2017-02-18T23:59:47Z",
      "updated_at": "2017-02-18T23:59:47Z"
    },
    {
      "id": 4667,
      "object": "activity",
      "summary": "Theater",
      "description": "We had such an incredible time doing all this.",
      "happened_at": "2017-10-25",
      "activity_type": null,
      "attendees": {
        "total": 3,
        "contacts": [
          {
            "id": 7,
            "object": "contact",
            "hash_id": "h:Vlu8z3PDqgVomKPv",
            "first_name": "Alexandre",
            "last_name": "Trioi",
            "nickname": "",
            "complete_name": "Alexandre Trioi",
            "initials": "AT",
            "gender": "Male",
            "gender_type": "M",
            "is_partial": false,
            "is_dead": false,
            "is_me": false,
            "information": {
              "dates": [
                {
                  "name": "birthdate",
                  "is_birthdate_approximate": "unknown",
                  "birthdate": null
                }
              ]
            },
            "account": {
              "id": 1
            }
          },
          {
            "id": 1,
            "object": "contact",
            "hash_id": "h:X5LOkAdWNDqgVomKPv",
            "first_name": "Henri",
            "last_name": "Troyat",
            "nickname": "",
            "complete_name": "Henri Troyat",
            "initials": "HT",
            "gender": "Female",
            "gender_type": "F",
            "is_partial": false,
            "is_dead": false,
            "is_me": false,
            "information": {
              "dates": [
                {
                  "name": "birthdate",
                  "is_birthdate_approximate": "exact",
                  "birthdate": "1983-10-23T19:10:42Z"
                }
              ]
            },
            "account": {
              "id": 1
            }
          },
          {
            "id": 79120,
            "object": "contact",
            "first_name": "Cecelia Marie",
            "last_name": null,
            "gender": "female",
            "is_partial": true,
            "information": {
              "dates": [
                {
                  "name": "birthdate",
                  "is_birthdate_approximate": "approximate",
                  "birthdate": "2013-01-01T23:55:58Z"
                }
              ]
            },
            "account": {
              "id": 1
            }
          }
        ]
      },
      "account": {
        "id": 1
      },
      "created_at": "2017-10-25T11:12:20Z",
      "updated_at": "2017-10-25T11:12:20Z"
    },
    {
      "id": 4669,
      "object": "activity",
      "summary": "We ate at an awesome restaurant.",
      "description": "We ate way too much, we had fun and we promised we'd see each other again in a couple of weeks.",
      "happened_at": "2018-02-02",
      "activity_type": {
                "id": 12,
                "object": "activityType",
                "name": "návštěva zápasu",
                "location_type": null,
                "activity_type_category": {
                    "id": 4,
                    "object": "activityTypeCategory",
                    "name": "Cultural activities",
                    "account": {
                        "id": 1
                    },
                    "created_at": null,
                    "updated_at": null
                },
                "account": {
                    "id": 1
                },
                "created_at": null,
                "updated_at": null
            },
      "attendees": {
        "total": 1,
        "contacts": [
          {
            "id": 1,
            "object": "contact",
            "hash_id": "h:X5LOkAdWNDqgVomKPv",
            "first_name": "Henri",
            "last_name": "Troyat",
            "nickname": "",
            "complete_name": "Henri Troyat",
            "initials": "HT",
            "gender": "Female",
            "gender_type": "F",
            "is_partial": false,
            "is_dead": false,
            "is_me": false,
            "information": {
              "dates": [
                {
                  "name": "birthdate",
                  "is_birthdate_approximate": "exact",
                  "birthdate": "1983-10-23T19:10:42Z"
                }
              ]
            },
            "account": {
              "id": 1
            }
          }
        ]
      },
      "account": {
        "id": 1
      },
      "created_at": "2017-10-25T11:44:49Z",
      "updated_at": "2017-10-25T11:44:49Z"
    }
  ],
  "links": {
    "first": "https:\/\/app.monicahq.com\/api\/activities?page=1",
    "last": "https:\/\/app.monicahq.com\/api\/activities?page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "path": "https:\/\/app.monicahq.com\/api\/activities",
    "per_page": 10,
    "to": 5,
    "total": 5
  }
}

List all the activities of a specific contact

GET /contacts/:id/activities

Response

{
  "data": [
    {
      "id": 2,
      "object": "activity",
      "summary": "Lunch with Dwight",
      "description": "We play handball and it was just awesome. He told me about a new girl he likes Cathy Simms, so he has to be careful.",
      "happened_at": "2016-10-18",
      "activity_type": {
                "id": 12,
                "object": "activityType",
                "name": "návštěva zápasu",
                "location_type": null,
                "activity_type_category": {
                    "id": 4,
                    "object": "activityTypeCategory",
                    "name": "Cultural activities",
                    "account": {
                        "id": 1
                    },
                    "created_at": null,
                    "updated_at": null
                },
                "account": {
                    "id": 1
                },
                "created_at": null,
                "updated_at": null
            },
      "attendees": {
        "total": 1,
        "contacts": [
          {
            "id": 8,
            "object": "contact",
            "hash_id": "h:AlKmTUoPDqgVomKPv",
            "first_name": "Jim",
            "last_name": "Halpert",
            "nickname": "",
            "complete_name": "Jim Halpert",
            "initials": "JH",
            "gender": "Male",
            "gender_type": "M",
            "is_partial": false,
            "is_dead": false,
            "is_me": false,
            "information": {
              "dates": [
                {
                  "name": "birthdate",
                  "is_birthdate_approximate": "exact",
                  "birthdate": "1978-10-01T16:20:55Z"
                }
              ]
            },
            "account": {
              "id": 1
            }
          }
        ]
      },
      "account": {
        "id": 1
      },
      "created_at": "2016-10-18T23:58:18Z",
      "updated_at": "2017-06-07T13:09:47Z"
    }
  ],
  "links": {
    "first": "https:\/\/app.monicahq.com\/api\/contacts\/8\/activities?page=1",
    "last": "https:\/\/app.monicahq.com\/api\/contacts\/8\/activities?page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "path": "https:\/\/app.monicahq.com\/api\/contacts\/8\/activities",
    "per_page": 10,
    "to": 1,
    "total": 1
  }
}

Get a specific activity

GET /activities/:id

Response

{
  "data": {
    "id": 2,
    "object": "activity",
    "summary": "Lunch with Dwight",
    "description": "We play handball and it was just awesome. He told me about a new girl he likes Cathy Simms, so he has to be careful.",
    "happened_at": "2016-10-18",
    "activity_type": {
                "id": 12,
                "object": "activityType",
                "name": "návštěva zápasu",
                "location_type": null,
                "activity_type_category": {
                    "id": 4,
                    "object": "activityTypeCategory",
                    "name": "Cultural activities",
                    "account": {
                        "id": 1
                    },
                    "created_at": null,
                    "updated_at": null
                },
                "account": {
                    "id": 1
                },
                "created_at": null,
                "updated_at": null
            },
    "attendees": {
      "total": 1,
      "contacts": [
        {
          "id": 8,
          "object": "contact",
          "hash_id": "h:AlKmTUoPDqgVomKPv",
          "first_name": "Jim",
          "last_name": "Halpert",
          "nickname": "",
          "complete_name": "Jim Halpert",
          "initials": "JH",
          "gender": "Male",
          "gender_type": "M",
          "is_partial": false,
          "is_dead": false,
          "is_me": false,
          "information": {
            "dates": [
              {
                "name": "birthdate",
                "is_birthdate_approximate": "exact",
                "birthdate": "1978-10-01T16:20:55Z"
              }
            ]
          },
          "account": {
            "id": 1
          }
        }
      ]
    },
    "account": {
      "id": 1
    },
    "created_at": "2016-10-18T23:58:18Z",
    "updated_at": "2017-06-07T13:09:47Z"
  }
}

Create an activity

POST /activities/

Input

Name Type Description
activity_type_id integer Required. The ID of the type of activity that the activity is associated with.
summary string Required. A short description of the activity. Max 255 characters.
description string An optional comment to add more details on what happened. Max 1000000 characters.
happened_at string Required. The date the event happened. Can be in the past or future - the latter being dumb, but well. Format: YYYY-MM-DD.
contacts array Required. The ID of contacts the activity is associated with.
emotions array The ID of emotions the activity is associated with.

Example

{
  "activity_type_id": 2,
  "summary": "We ate at an awesome restaurant.",
  "description": "We ate way too much, we had fun and we promised we'd see each other again in a couple of weeks.",
  "happened_at": "2018-02-02",
  "contacts": [1,3,5]
}

Response

The API call returns an Activity object if the call succeeds.

{
  "data": {
    "id": 4670,
    "object": "activity",
    "summary": "We ate at an awesome restaurant.",
    "description": "We ate way too much, we had fun and we promised we'd see each other again in a couple of weeks.",
    "happened_at": "2018-02-02",
    "activity_type": {
                "id": 12,
                "object": "activityType",
                "name": "návštěva zápasu",
                "location_type": null,
                "activity_type_category": {
                    "id": 4,
                    "object": "activityTypeCategory",
                    "name": "Cultural activities",
                    "account": {
                        "id": 1
                    },
                    "created_at": null,
                    "updated_at": null
                },
                "account": {
                    "id": 1
                },
                "created_at": null,
                "updated_at": null
            },
    "attendees": {
      "total": 3,
      "contacts": [
        {
          "id": 1,
          "object": "contact",
          "hash_id": "h:X5LOkAdWNDqgVomKPv",
          "first_name": "Henri",
          "last_name": "Troyat",
          "nickname": "",
          "complete_name": "Henri Troyat",
          "initials": "HT",
          "gender": "Female",
          "gender_type": "F",
          "is_partial": false,
          "is_dead": false,
          "is_me": false,
          "information": {
            "dates": [
              {
                "name": "birthdate",
                "is_birthdate_approximate": "exact",
                "birthdate": "1983-10-23T19:10:42Z"
              }
            ]
          },
          "account": {
            "id": 1
          }
        },
        {
          "id": 2,
          "object": "contact",
          "first_name": "Nicolas",
          "last_name": "Loriu",
          "gender": "male",
          "is_partial": false,
          "information": {
            "dates": [
              {
                "name": "birthdate",
                "is_birthdate_approximate": "unknown",
                "birthdate": null
              }
            ]
          },
          "account": {
            "id": 1
          }
        },
        {
          "id": 7,
          "object": "contact",
          "first_name": "Alexandre",
          "last_name": "Loap",
          "gender": "male",
          "is_partial": false,
          "information": {
            "dates": [
              {
                "name": "birthdate",
                "is_birthdate_approximate": "unknown",
                "birthdate": null
              }
            ]
          },
          "account": {
            "id": 1
          }
        }
      ]
    },
    "account": {
      "id": 1
    },
    "created_at": "2017-10-25T12:46:55Z",
    "updated_at": "2017-10-25T12:46:55Z"
  }
}

Update an activity

PUT /activities/:id

Input

Name Type Description
activity_type_id integer Required. The ID of the type of activity that the activity is associated with.
summary string Required. A short description of the activity. Max 255 characters.
description string An optional comment to add more details on what happened. Max 1000000 characters.
happened_at string Required. The date the event happened. Can be in the past or future - the latter being dumb, but well. Format: YYYY-MM-DD.
contacts array Required. The ID of contacts the activity is associated with.
emotions array The ID of emotions the activity is associated with.

Example

{
  "activity_type_id": 2,
  "summary": "We ate at an awesome restaurant.",
  "description": "We ate way too much, we had fun and we promised we'd see each other again in a couple of weeks.",
  "happened_at": "2018-02-02",
  "contacts": [1,3]
}

Response

{
  "data": {
    "id": 4670,
    "object": "activity",
    "summary": "We ate at an awesome restaurant.",
    "description": "We ate way too much, we had fun and we promised we'd see each other again in a couple of weeks.",
    "happened_at": "2018-02-02",
    "activity_type": {
                "id": 12,
                "object": "activityType",
                "name": "návštěva zápasu",
                "location_type": null,
                "activity_type_category": {
                    "id": 4,
                    "object": "activityTypeCategory",
                    "name": "Cultural activities",
                    "account": {
                        "id": 1
                    },
                    "created_at": null,
                    "updated_at": null
                },
                "account": {
                    "id": 1
                },
                "created_at": null,
                "updated_at": null
            },
    "attendees": {
      "total": 2,
      "contacts": [
        {
          "id": 1,
          "object": "contact",
          "hash_id": "h:X5LOkAdWNDqgVomKPv",
          "first_name": "Henri",
          "last_name": "Troyat",
          "nickname": "",
          "complete_name": "Henri Troyat",
          "initials": "HT",
          "gender": "Female",
          "gender_type": "F",
          "is_partial": false,
          "is_dead": false,
          "is_me": false,
          "information": {
            "dates": [
              {
                "name": "birthdate",
                "is_birthdate_approximate": "exact",
                "birthdate": "1983-10-23T19:10:42Z"
              }
            ]
          },
          "account": {
            "id": 1
          }
        },
        {
          "id": 3,
          "object": "contact",
          "first_name": "David",
          "last_name": "Calir",
          "gender": "male",
          "is_partial": false,
          "information": {
            "dates": [
              {
                "name": "birthdate",
                "is_birthdate_approximate": "unknown",
                "birthdate": null
              }
            ]
          },
          "account": {
            "id": 1
          }
        }
      ]
    },
    "account": {
      "id": 1
    },
    "created_at": "2017-10-25T12:46:55Z",
    "updated_at": "2017-10-25T12:46:55Z"
  }
}

Delete an activity

DELETE /activities/:id

Response

The response sends back the id that was just deleted.

{
  "deleted": true,
  "id": 31
}

Company

Resources

© 2021

Proudly Canadian