Confluence REST API "Add member to group by groupId" returns generic 500 instead of meaningful error when license pool is depleted

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Low
    • Component/s: User - API
    • None
    • 1
    • Severity 3 - Minor

      Issue Summary

      The Confluence Cloud REST API endpointAdd member to group by groupId should return a meaningful HTTP error code and message when the operation fails due to a depleted license pool, instead of a generic 500 Internal server Error.

       

      curl --request POST \
        --url 'https://your-domain.atlassian.net/wiki/rest/api/group/userByGroupId?groupId={groupId}' \
        --user 'email@example.com:<api_token>' \
        --header 'Content-Type: application/json' \
        --data '{
        "accountId": "<string>"
      }'

       

      Steps to Reproduce

      1. Have a Confluence Cloud site with centralized user management enabled
      1. Exhaust the available license pool (all seats allocated)
      1. Call POST /wiki/rest/api/group/userByGroupId?groupId={groupId} with a valid accountId in the body
      1. Observe: 500 error with HystrixRuntimeException instead of a meaningful license-exceeded error

      Expected Results

      The endpoint should return an appropriate HTTP status code (e.g., 409 Conflict or 403 Forbidden) with a clear, actionable error message such as:
       

      {
        "statusCode": 409,
        "message": "Cannot add user to group: Product license limit exceeded. Please free up licenses or upgrade your plan.",
        "errorType": "LicenceExceeded"
      } 

      This is consistent with how the newer Atlassian Administration API (POST /admin/v1/orgs/{orgId}/directory/groups/{groupId}/memberships) already handles this scenario — returning a proper 409 with title "Product License Limit Exceeded".

      Actual Results

      When a customer's license pool is exhausted, and they attempt to add a user to a group via the REST API, the endpoint returns:
       
       

      {
        "statusCode": 500,
        "message": "com.netflix.hystrix.exception.HystrixRuntimeException: AddUserToGroupsIdentityPlatformCommand failed and no fallback available."
      }

      Workaround

      Alternatively, customers can use the Atlassian Administration API, which already returns proper error codes for this scenario, but this requires a different authentication model and API integration.

      the newer Atlassian Administration API (POST /admin/v1/orgs/{orgId}/directory/groups/{groupId}/memberships) does handle this scenario correctly and returns a proper 409 status with a "Product License Limit Exceeded" message. However, I understand you'd prefer not to switch APIs at this time, and that's completely fine.

              Assignee:
              David Skudra
              Reporter:
              Renan Andrade (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: