Skip to main content

Create Activity

POST 

/api/crm/activities

Log an activity that happened, or plan one. Optionally creates a follow-up task, records the visit's check-in and check-out, or repeats a planned visit every few weeks.

Required scope: customers:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Authentication: Requires Bearer token with the customers scope and the crm_activities.create permission. Logging an activity (or a follow-up task) for another user needs the crm_activities.assign permission.

Idempotency: send an Idempotency-Key header to make retries safe. The same key from the same user within 24 hours returns the activity the first request created instead of creating a second one.

Body fields:

  • type (required): visit, call, meeting, email, note or task
  • status (optional): planned, completed or cancelled. Default: a task is planned; anything else is planned when starts_at is in the future, otherwise completed (and gets a start time of now when none is sent)
  • customer_id (integer; required unless type is task): one of your customers (unless you may see all customers), not archived
  • contact_id (integer, optional): must be one of the customer's contacts
  • owner_user_id (integer, optional): defaults to you; another user needs crm_activities.assign and must be on the account. The activity's sales rep is the owner's active sales rep, else the customer's default sales rep
  • subject (string, optional, max 255)
  • notes (string, optional, max 20,000)
  • outcome (string, optional): one of the outcome keys in CRM settings. Kept for visits, calls and meetings only
  • next_step (string, optional, max 500), next_step_on (YYYY-MM-DD, optional)
  • starts_at, ends_at (ISO-8601 date-times, optional; ends_at on or after starts_at). Ignored for tasks. When ends_at is omitted it defaults to starts_at plus the account's default visit length for a visit, or 30 minutes for a call or meeting
  • timezone (IANA zone, optional): defaults to the account timezone
  • all_day (boolean, optional): defaults to true for a task, false otherwise
  • due_on (YYYY-MM-DD, optional): a task's due date; defaults to today for a task
  • cancel_reason (string, optional, max 255): with status cancelled
  • follow_up (object, optional): creates a planned task linked to this activity
    • follow_up.due_on (YYYY-MM-DD, required with follow_up)
    • follow_up.subject (string, optional, max 255): defaults to next_step, else "Follow up: {customer}"
    • follow_up.owner_user_id (integer, optional): defaults to the activity owner; another user needs crm_activities.assign
  • checkin (object, optional): the check-in of a visit, call or meeting logged after the fact
    • checkin.lat (-90 to 90), checkin.lng (-180 to 180), checkin.accuracy_m (metres, >= 0): optional location. The distance to the customer's geocoded shipping address is worked out when the accuracy is 250 m or better
    • checkin.checked_in_at (date-time, optional): defaults to starts_at for a completed activity, else now. Also used as starts_at when starts_at is omitted
    • checkin.checked_out_at (date-time, optional, on or after checked_in_at): also used as ends_at when ends_at is omitted
  • recurrence (object, optional): repeat a planned visit. Only a planned visit with starts_at can repeat
    • recurrence.interval_weeks (integer 1-52, required with recurrence)
    • recurrence.until (YYYY-MM-DD, required with recurrence): last day of the series, on or after the first visit. Up to 26 future occurrences are created ahead and the series is topped up daily until this date

Returns the saved activity.

Request​

Responses​

OK

Response Headers
    Content-Type