Skip to content

Conversation

@salmanbshah
Copy link
Contributor

@salmanbshah salmanbshah commented Nov 6, 2025

Summary

Adds OpenAPI documentation for the team_assignment_limit_change activity type to API version 2.14.

This activity type tracks when team assignment limits are changed by admins, allowing developers to monitor team capacity management changes through the Admin Activity Logs API.


Scope

Version: 2.14 only (not in Unstable/unreleased version)

API Endpoint: GET /admins/activity_logs


Changes

Activity Type Enum

Adds team_assignment_limit_change to the activity_type enum in the activity_log schema.

Metadata Fields

Adds the following fields to activity_log_metadata:

  • team (object, nullable)

    • id (integer): The ID of the team
    • name (string): The name of the team
  • team_assignment_limit (integer, nullable)

    • The team assignment limit value
    • null if the limit was removed/unset

Example API Response

{
  "type": "admin_activity_log_event",
  "id": "f7bd54f5-3d7e-460b-a5de-9d7ca46c4f51",
  "performed_by": {
    "type": "admin",
    "id": "293",
    "email": "admin@example.com",
    "ip": "172.253.116.141"
  },
  "metadata": {
    "team": {
      "id": 295,
      "name": "Support Team"
    },
    "team_assignment_limit": 10
  },
  "created_at": 1762790574,
  "activity_type": "team_assignment_limit_change",
  "activity_description": "Admin changed team assignment limit to 10 for team Support Team."
}

Unsetting a Limit

When a limit is removed, team_assignment_limit is null:

{
  "metadata": {
    "team": {
      "id": 295,
      "name": "Support Team"
    },
    "team_assignment_limit": null
  },
  "activity_type": "team_assignment_limit_change",
  "activity_description": "Admin unset team assignment limit for team Support Team."
}

Pattern Alignment

This follows the established pattern used by similar assignment limit activity types:

  • admin_conversation_assignment_limit_change with conversation_assignment_limit field
  • admin_ticket_assignment_limit_change with ticket_assignment_limit field

All assignment limit metadata fields store only the current/new value (not old and new), as a single nullable integer.


Verification

✅ Tested with API version 2.14:

curl 'http://api.intercom.test/admins/activity_logs' \
  -H 'Intercom-Version: 2.14'

Related PRs

Intercom Monolith:

  • intercom/intercom#446612 - Updated API presenter implementation (simplified metadata structure)
  • intercom/intercom#445742 - Initial API presenter implementation
  • intercom/intercom#445704 - Event infrastructure and audit logging

Related Issue:

  • intercom/intercom#445916 - Team Data Foundations consultation

Review Notes

  • This is an additive, non-breaking change
  • Only affects version 2.14 (not Unstable)
  • Follows existing assignment limit patterns
  • API response verified in local testing

@salmanbshah
Copy link
Contributor Author

Yes, this is for the activity logs endpoint - specifically the activity_log_metadata schema used in the Admin Activity Logs API (/admins/activity_logs).

@salmanbshah salmanbshah force-pushed the add-team-assignment-limit-activity-log-docs branch 3 times, most recently from c75bfc6 to 011e890 Compare November 10, 2025 16:28
Adds OpenAPI documentation for team assignment limit changes in activity logs API for version 2.14 only.

Changes (version 2.14 only):
- Adds team_assignment_limit_change to activity_type enum (in alphabetical order)
- Adds team (object with id and name) metadata field
- Adds team_assignment_limit (nullable integer) metadata field

The metadata structure follows the pattern of conversation_assignment_limit and ticket_assignment_limit,
storing only the current value rather than both old and new values.

Note: This feature is available in version 2.14, not in the unreleased/unstable version.

Related PRs:
- intercom/intercom#446612 (Updated API presenter implementation)
- intercom/intercom#445742 (Initial API presenter implementation)
- intercom/intercom#445704 (Event infrastructure)

Related Issue: intercom/intercom#445916
@salmanbshah salmanbshah force-pushed the add-team-assignment-limit-activity-log-docs branch from 011e890 to 33c16a0 Compare November 10, 2025 16:54
@salmanbshah
Copy link
Contributor Author

Fixed! Moved team_assignment_limit_change to the correct alphabetical position in the enum. It's now between security_settings_change and temporary_expectation_change (line 14107) as per the alphabetical ordering of the list.

Copy link
Contributor

@junaid-zaidi-intercom junaid-zaidi-intercom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@salmanbshah salmanbshah merged commit ee39121 into main Nov 10, 2025
6 checks passed
@salmanbshah salmanbshah deleted the add-team-assignment-limit-activity-log-docs branch November 10, 2025 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants