Could not add activity (500)

Hey!

I have an app that creates activities to our users’ Pipedrive. For some mysterious reason, I’m getting 500 "Could not add activity" error as a response when calling for POST /activities for one Pipedrive account. Other API calls work for that account as well, but creating new activity does not.

The same query works perfectly for other accounts → I have tried to track the issue to Activities and its required/accepted values. I’m suspecting this has something to do with type field that has non-default options, as for example email has been deleted. I’m trying to create a new Activity with type mail. Here’s the type property from /activityFields API:

    'id': 3,
    'key': 'type',
    'name': 'Type',
    'order_nr': 3,
    'field_type': 'enum',
    'json_column_flag': False,
    'add_time': '2015-11-09 11:11:11',
    'update_time': None,
    'active_flag': True,
    'edit_flag': False,
    'index_visible_flag': True,
    'details_visible_flag': True,
    'add_visible_flag': False,
    'important_flag': False,
    'bulk_edit_allowed': True,
    'searchable_flag': False,
    'filtering_allowed': True,
    'sortable_flag': True,
    'options': [
        {'id': 'call', 'label': 'Call'},
        {'id': 'task', 'label': 'Task'},
        {'id': 'meeting', 'label': 'New meeting'},
        {'id': 'mail', 'label': 'Message'}
        ],
    'options_deleted': {
        'deadline': 'Deadline',
        'email': 'Email',
        'lunch': 'Lunch'
        },
  'mandatory_flag': True
}

I’ve tried many different things, one by one, to debug what is causing this:

  • Dropped out org_id
  • Dropped out person_id
  • Dropped out user_id
  • Tried different type values
  • Used very short strings in subject and note
  • Added due_date and due_time properties to payload
  • Added done property to payload

I tried creating an Activity with the most simple parameters as possible to another Pipedrive account that has email as ActivityType:

{'subject': 'Test', 'note': 'Content', 'type': 'email'}

→ this returned 201

Then, I tried the same with this problematic account (with type: 'mail'):

{'subject': 'Test', 'note': 'Content', 'type': 'mail'}

→ this returned 500

What am I missing?

Hi @alehti
Welcome to the community :wave: and thanks for sharing this in detail.

Does it happen sporadically / regularly for the said account? Ive reached out to you via DM to get account-specific details.