Workspace Activity

Retrieve and monitor workspace activity feeds using the Blue API.


Retrieve Workspace Activity

The activityList query provides access to a comprehensive activity feed for workspaces and organizations. Activities are automatically generated when users perform actions like creating todos, comments, or making workspace changes.

Basic Example

query ProjectActivity {
  activityList(
    projectId: "your-project-id"
    first: 20
    orderBy: createdAt_DESC
  ) {
    activities {
      id
      category
      html
      createdAt
      createdBy {
        id
        name
        email
      }
      project {
        id
        name
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
    totalCount
  }
}

Advanced Example with Filtering

query FilteredActivity {
  activityList(
    companyId: "your-company-id"
    categories: [CREATE_TODO, MARK_TODO_AS_COMPLETE, CREATE_COMMENT]
    userIds: ["user1-id", "user2-id"]
    startDate: "2024-01-01T00:00:00Z"
    endDate: "2024-12-31T23:59:59Z"
    first: 50
    orderBy: createdAt_DESC
  ) {
    activities {
      id
      uid
      category
      html
      createdAt
      updatedAt
      createdBy {
        id
        name
        email
      }
      affectedBy {
        id
        name
      }
      todo {
        id
        title
      }
      comment {
        id
        text
      }
      project {
        id
        name
        slug
      }
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
    totalCount
  }
}

Input Parameters

activityList Query

ParameterTypeRequiredDescription
companyIdStringNoFilter activities by organization ID or slug
projectIdStringNoFilter activities by workspace ID or slug
userIdStringNoFilter activities by a specific user
userIds[String!]NoFilter activities by multiple users
tagIds[String!]NoFilter activities by todo tags
categories[ActivityCategory!]NoFilter by specific activity types
startDateDateTimeNoFilter activities from this date
endDateDateTimeNoFilter activities up to this date
skipIntNoSkip this number of records (offset pagination)
firstIntNoReturn first N records (cursor pagination)
lastIntNoReturn last N records (cursor pagination)
afterStringNoReturn records after this cursor
beforeStringNoReturn records before this cursor
orderByActivityOrderByInputNoSort order for results

ActivityCategory Values

The system tracks various types of activities automatically:

CategoryDescription
CREATE_TODOA new todo/task was created
MARK_TODO_AS_COMPLETEA todo was marked as complete
CREATE_COMMENTA comment was added
CREATE_DISCUSSIONA discussion was started
CREATE_STATUS_UPDATEA status update was posted
CREATE_TODO_LISTA new todo list was created
MOVE_TODOA todo was moved between lists
COPY_TODOA todo was copied
ADD_USER_TO_PROJECTA user was added to the workspace
REMOVE_USER_FROM_PROJECTA user was removed from the workspace
ARCHIVE_PROJECTThe workspace was archived
UNARCHIVE_PROJECTThe workspace was unarchived
CREATE_INVITATIONA user was invited
ACCEPT_INVITATIONAn invitation was accepted
CREATE_CUSTOM_FIELDA custom field was created
RECEIVE_FORMA form submission was received

ActivityOrderByInput Values

ValueDescription
createdAt_DESCMost recent first (default)
createdAt_ASCOldest first
updatedAt_DESCMost recently updated first
updatedAt_ASCLeast recently updated first
category_ASCAlphabetical by category
category_DESCReverse alphabetical by category

Response Fields

Activity Type

FieldTypeDescription
idID!Unique identifier for the activity
uidString!Alternative unique identifier
categoryActivityCategory!Type of activity that occurred
htmlString!Rich HTML description of the activity
createdAtDateTime!When the activity occurred
updatedAtDateTime!When the activity was last updated
createdByUser!User who performed the action
affectedByUserUser who was affected by the action
companyCompanyAssociated organization
projectProjectAssociated workspace
todoTodoAssociated todo (if applicable)
todoListTodoListAssociated todo list (if applicable)
commentCommentAssociated comment (if applicable)
discussionDiscussionAssociated discussion (if applicable)
statusUpdateStatusUpdateAssociated status update (if applicable)
metadataStringAdditional activity metadata

ActivityList Response

FieldTypeDescription
activities[Activity!]!Array of activity records
pageInfoPageInfo!Pagination information
totalCountInt!Total number of activities matching filters

Real-Time Activity Updates

Subscribe to activity changes using the subscribeToActivity subscription:

subscription ActivityUpdates($companyId: String!, $projectId: String) {
  subscribeToActivity(companyId: $companyId, projectId: $projectId) {
    mutation
    node {
      id
      category
      html
      createdAt
      createdBy {
        id
        name
        email
      }
      project {
        id
        name
      }
    }
  }
}

Subscription Parameters

ParameterTypeRequiredDescription
companyIdStringNoSubscribe to organization-wide activities
projectIdStringNoSubscribe to specific workspace activities

The subscription will notify you of:

  • ACTIVITY_CREATED - New activities
  • ACTIVITY_UPDATED - Modified activities
  • ACTIVITY_DELETED - Removed activities

Filtering and Privacy

Automatic Filtering

The activity feed automatically filters results based on:

  • Workspace Settings: Only shows activities from workspaces with activity tracking enabled
  • User Permissions: Different user roles see different activity types
  • Workspace Membership: Users only see activities from workspaces they have access to
  • Organization Membership: Activities are scoped to the user’s organizations

Privacy Considerations

  • CLIENT role users have limited visibility into certain administrative activities
  • Activities respect workspace-level privacy settings
  • Sensitive operations may not generate public activities

Error Responses

Invalid Workspace/Organization

{
  "errors": [{
    "message": "Project not found",
    "extensions": {
      "code": "NOT_FOUND"
    }
  }]
}

Permission Denied

{
  "errors": [{
    "message": "You do not have permission to view activities for this project",
    "extensions": {
      "code": "FORBIDDEN"
    }
  }]
}

Invalid Date Range

{
  "errors": [{
    "message": "Start date must be before end date",
    "extensions": {
      "code": "BAD_USER_INPUT"
    }
  }]
}

Best Practices

  1. Use Pagination: Activity feeds can be large, always use first parameter
  2. Filter by Workspace: Organization-wide activity feeds can be overwhelming
  3. Real-time Updates: Use subscriptions for live activity feeds
  4. Date Filtering: Use date ranges for historical activity analysis
  5. Category Filtering: Filter by specific activity types for focused feeds
  6. User Filtering: Track specific team members’ activities using userIds

Important Notes

  • Activities are automatically generated and cannot be manually created via API
  • Activity text uses HTML formatting for rich display
  • The text field is deprecated in favor of html
  • Activities are permanently stored and provide a complete audit trail
  • Real-time subscriptions require WebSocket connection authentication