Activities API

Learn how to manage activities and calendar events in AchieveApex using the REST API.

Overview

The Activities API allows you to manage calendar events, tasks, calls, and other activities within your organization. You can list, retrieve, create, update, and delete activities, as well as mark them as complete.

Base Endpoint

/activities

Activity Object

The activity object contains information about a calendar event, task, call, or other activity.

Activity Object
{
  "id": 123,
  "organization_id": 27,
  "created_by_user_id": 45,
  "assigned_to_user_id": 46,
  "subject": "Sales Follow-up Call",
  "note": "Discuss new product features and pricing",
  "public_description": "Brief call to discuss product updates",
  "location": "Online - Zoom",
  "location_geocoded": {
    "lat": 37.7749,
    "lng": -122.4194,
    "address": "San Francisco, CA"
  },
  "start_date": "2025-04-15",
  "start_time": "14:30:00",
  "end_date": "2025-04-15",
  "end_time": "15:00:00",
  "duration": 30,
  "deal_id": 789,
  "contact_id": 456,
  "company_id": 345,
  "activity_type": "call",
  "done": false,
  "created_at": "2025-03-28T09:30:15.391Z",
  "updated_at": "2025-03-28T09:30:15.391Z",
  "deleted_at": null,
  "created_by_user": {
    "id": 45,
    "full_name": "Jane Smith"
  },
  "assigned_to_user": {
    "id": 46,
    "full_name": "John Doe"
  },
  "deal": {
    "id": 789,
    "name": "Enterprise Solution"
  },
  "contact": {
    "id": 456,
    "full_name": "Alex Johnson"
  },
  "company": {
    "id": 345,
    "name": "Acme Corp"
  }
}

List Activities

Retrieve a list of activities in your organization with optional filtering and pagination.

Request
GET /activities

curl -X GET https://api.achieveapex.com/activities \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "query": {
      "organization_id": 27,
      "$limit": 10,
      "$skip": 0,
      "$sort": { "start_date": 1, "start_time": 1 },
      "assigned_to_user_id": 46,
      "done": false
    }
  }'
Response
{
  "total": 2,
  "limit": 10,
  "skip": 0,
  "data": [
    {
      "id": 123,
      "organization_id": 27,
      "created_by_user_id": 45,
      "assigned_to_user_id": 46,
      "subject": "Sales Follow-up Call",
      "note": "Discuss new product features and pricing",
      "public_description": "Brief call to discuss product updates",
      "location": "Online - Zoom",
      "location_geocoded": {
        "lat": 37.7749,
        "lng": -122.4194,
        "address": "San Francisco, CA"
      },
      "start_date": "2025-04-15",
      "start_time": "14:30:00",
      "end_date": "2025-04-15",
      "end_time": "15:00:00",
      "duration": 30,
      "deal_id": 789,
      "contact_id": 456,
      "company_id": 345,
      "activity_type": "call",
      "done": false,
      "created_at": "2025-03-28T09:30:15.391Z",
      "updated_at": "2025-03-28T09:30:15.391Z",
      "deleted_at": null
    },
    {
      "id": 124,
      "organization_id": 27,
      "created_by_user_id": 45,
      "assigned_to_user_id": 46,
      "subject": "Product Demo",
      "note": "Show premium features to potential client",
      "public_description": "Product demonstration",
      "location": "Client Office",
      "location_geocoded": {
        "lat": 40.7128,
        "lng": -74.0060,
        "address": "New York, NY"
      },
      "start_date": "2025-04-16",
      "start_time": "10:00:00",
      "end_date": "2025-04-16",
      "end_time": "11:30:00",
      "duration": 90,
      "deal_id": 790,
      "contact_id": 457,
      "company_id": 346,
      "activity_type": "meeting",
      "done": false,
      "created_at": "2025-03-28T15:45:20.817Z",
      "updated_at": "2025-03-28T15:45:20.817Z",
      "deleted_at": null
    }
  ]
}

Query Parameters

ParameterTypeDescription
organization_idNumberID of the organization (required)
assigned_to_user_idNumberFilter by the user the activity is assigned to
created_by_user_idNumberFilter by the user who created the activity
deal_idNumberFilter by associated deal ID
contact_idNumberFilter by associated contact ID
company_idNumberFilter by associated company ID
activity_typeStringFilter by activity type (e.g., 'call', 'meeting', 'task')
doneBooleanFilter by completion status
start_dateObjectFilter by start date range, e.g., { "$gte": "2025-04-01", "$lte": "2025-04-30" }
subjectStringFilter by subject (supports partial matching)
$limitNumberNumber of activities to return (default: 10)
$skipNumberNumber of activities to skip (for pagination)
$sortObjectSort criteria (e.g., { "start_date": 1, "start_time": 1 } for ascending order)
fastJoinForActivityListBooleanInclude related data (users, deals, contacts, companies) in a more efficient format for listing

Get an Activity

Retrieve a single activity by ID.

Request
GET /activities/:id

curl -X GET https://api.achieveapex.com/activities/123 \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json"
Response
{
  "id": 123,
  "organization_id": 27,
  "created_by_user_id": 45,
  "assigned_to_user_id": 46,
  "subject": "Sales Follow-up Call",
  "note": "Discuss new product features and pricing",
  "public_description": "Brief call to discuss product updates",
  "location": "Online - Zoom",
  "location_geocoded": {
    "lat": 37.7749,
    "lng": -122.4194,
    "address": "San Francisco, CA"
  },
  "start_date": "2025-04-15",
  "start_time": "14:30:00",
  "end_date": "2025-04-15",
  "end_time": "15:00:00",
  "duration": 30,
  "deal_id": 789,
  "contact_id": 456,
  "company_id": 345,
  "activity_type": "call",
  "done": false,
  "created_at": "2025-03-28T09:30:15.391Z",
  "updated_at": "2025-03-28T09:30:15.391Z",
  "deleted_at": null,
  "created_by_user": {
    "id": 45,
    "full_name": "Jane Smith",
    "email": "jane.smith@example.com"
  },
  "assigned_to_user": {
    "id": 46,
    "full_name": "John Doe",
    "email": "john.doe@example.com"
  },
  "deal": {
    "id": 789,
    "name": "Enterprise Solution",
    "stage": "Proposal"
  },
  "contact": {
    "id": 456,
    "full_name": "Alex Johnson",
    "email": "alex.johnson@acmecorp.com"
  },
  "company": {
    "id": 345,
    "name": "Acme Corp",
    "website": "https://acmecorp.com"
  }
}

Create an Activity

Create a new activity in your organization.

Request
POST /activities

curl -X POST https://api.achieveapex.com/activities \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "organization_id": 27,
    "assigned_to_user_id": 46,
    "subject": "Onboarding Call",
    "note": "Initial onboarding for new client",
    "public_description": "Welcome to our service",
    "location": "Zoom Meeting",
    "start_date": "2025-05-01",
    "start_time": "10:00:00",
    "end_date": "2025-05-01",
    "end_time": "10:30:00",
    "duration": 30,
    "deal_id": 791,
    "contact_id": 458,
    "activity_type": "call",
    "done": false
  }'
Response
{
  "id": 125,
  "organization_id": 27,
  "created_by_user_id": 45,
  "assigned_to_user_id": 46,
  "subject": "Onboarding Call",
  "note": "Initial onboarding for new client",
  "public_description": "Welcome to our service",
  "location": "Zoom Meeting",
  "location_geocoded": null,
  "start_date": "2025-05-01",
  "start_time": "10:00:00",
  "end_date": "2025-05-01",
  "end_time": "10:30:00",
  "duration": 30,
  "deal_id": 791,
  "contact_id": 458,
  "company_id": null,
  "activity_type": "call",
  "done": false,
  "created_at": "2025-04-01T14:22:17.562Z",
  "updated_at": "2025-04-01T14:22:17.562Z",
  "deleted_at": null
}

Update an Activity

Update an existing activity in your organization.

Request
PATCH /activities/:id

curl -X PATCH https://api.achieveapex.com/activities/125 \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "subject": "Onboarding and Product Overview Call",
    "duration": 45,
    "end_time": "10:45:00"
  }'
Response
{
  "id": 125,
  "organization_id": 27,
  "created_by_user_id": 45,
  "assigned_to_user_id": 46,
  "subject": "Onboarding and Product Overview Call",
  "note": "Initial onboarding for new client",
  "public_description": "Welcome to our service",
  "location": "Zoom Meeting",
  "location_geocoded": null,
  "start_date": "2025-05-01",
  "start_time": "10:00:00",
  "end_date": "2025-05-01",
  "end_time": "10:45:00",
  "duration": 45,
  "deal_id": 791,
  "contact_id": 458,
  "company_id": null,
  "activity_type": "call",
  "done": false,
  "created_at": "2025-04-01T14:22:17.562Z",
  "updated_at": "2025-04-01T14:30:33.781Z",
  "deleted_at": null
}

Mark Activity as Done

Mark an activity as completed.

Request
PATCH /activities/:id

curl -X PATCH https://api.achieveapex.com/activities/125 \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "done": true
  }'
Response
{
  "id": 125,
  "organization_id": 27,
  "created_by_user_id": 45,
  "assigned_to_user_id": 46,
  "subject": "Onboarding and Product Overview Call",
  "note": "Initial onboarding for new client",
  "public_description": "Welcome to our service",
  "location": "Zoom Meeting",
  "location_geocoded": null,
  "start_date": "2025-05-01",
  "start_time": "10:00:00",
  "end_date": "2025-05-01",
  "end_time": "10:45:00",
  "duration": 45,
  "deal_id": 791,
  "contact_id": 458,
  "company_id": null,
  "activity_type": "call",
  "done": true,
  "created_at": "2025-04-01T14:22:17.562Z",
  "updated_at": "2025-04-01T15:10:05.214Z",
  "deleted_at": null
}

Delete an Activity

Delete an activity from your organization.

Request
DELETE /activities/:id

curl -X DELETE https://api.achieveapex.com/activities/125 \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
Response
{
  "id": 125,
  "organization_id": 27,
  "created_by_user_id": 45,
  "assigned_to_user_id": 46,
  "subject": "Onboarding and Product Overview Call",
  "note": "Initial onboarding for new client",
  "public_description": "Welcome to our service",
  "location": "Zoom Meeting",
  "location_geocoded": null,
  "start_date": "2025-05-01",
  "start_time": "10:00:00",
  "end_date": "2025-05-01",
  "end_time": "10:45:00",
  "duration": 45,
  "deal_id": 791,
  "contact_id": 458,
  "company_id": null,
  "activity_type": "call",
  "done": true,
  "created_at": "2025-04-01T14:22:17.562Z",
  "updated_at": "2025-04-01T15:30:45.876Z",
  "deleted_at": "2025-04-01T15:30:45.876Z"
}

Note on Activity Deletion

When an activity is deleted, the system performs a soft delete by setting the deleted_at timestamp. The activity will no longer appear in standard queries but remains in the database for record-keeping purposes.

Bulk Actions

Perform operations on multiple activities at once.

Bulk Mark as Done

Request
PATCH /activities

curl -X PATCH https://api.achieveapex.com/activities \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "ids": [123, 124],
    "done": true
  }'
Response
{
  "updated": 2,
  "ids": [123, 124]
}

Error Handling

The Activities API returns standard HTTP status codes and error messages.

Error Response
{
  "name": "NotFound",
  "message": "No record found for id '999'",
  "code": 404,
  "className": "not-found"
}
Status CodeDescription
400 Bad RequestInvalid parameters or request
401 UnauthorizedMissing or invalid authentication
403 ForbiddenNot authorized to access this organization's activities
404 Not FoundActivity not found
500 Internal Server ErrorServer error

Related Documentation

For information on defining custom activity types, see the Activity Types API documentation.

Report an issue with this documentation

Please log in to report issues with our documentation.