Skip to content

APNSMessage#collapse_id parameter rejected in create_campaign despite being documented #3324

Description

@Migoo

Describe the bug

When using Aws::Pinpoint::Client#create_campaign with an apns_message containing collapse_id, the SDK raises an ArgumentError even though collapse_id is a documented parameter for APNSMessage.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

The collapse_id parameter should be accepted and passed to the Pinpoint API, which would then set the apns-collapse-id header when sending the push notification to APNs.

Current Behavior

The SDK raises an ArgumentError before making the API call:

unexpected value at params[:write_campaign_request][:message_configuration][:apns_message][:collapse_id] (ArgumentError)
    raise ArgumentError, error_messages(errors) unless errors.empty?

Reproduction Steps

require 'aws-sdk-pinpoint'

client = Aws::Pinpoint::Client.new(region: 'eu-west-1')

client.create_campaign({
  application_id: "my-app-id",
  write_campaign_request: {
    name: "test",
    segment_id: "my-segment-id",
    message_configuration: {
      apns_message: {
        action: "OPEN_APP",
        silent_push: false,
        raw_content: '{"aps":{"alert":{"title":"Test","body":"Test body"}}}',
        collapse_id: "offer-85817"
      }
    },
    schedule: {
      start_time: "IMMEDIATE"
    }
  }
})

Possible Solution

No response

Additional Information/Context

The CollapseId parameter is documented in the AWS Pinpoint API reference for APNSMessage
The collapse_id parameter works correctly with send_messages endpoint
The parameter is essential for iOS notification grouping/replacement via the apns-collapse-id APNs header

Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version

aws-sdk-pinpoint 1.116.0

Environment details (Version of Ruby, OS environment)

ruby 3.4.7, multiple env (osX, linux)

Activity

  1. added
    bugThis issue is a bug.
    needs-triageThis issue or PR still needs to be triaged.
    on Dec 11, 2025
  2. jterapin commented on Dec 11, 2025

    @jterapin
    Contributor

    Hi! Thanks for submitting this issue. We'll investigate. Did the previous version of pinpoint accept the collapse_id param?

  3. added
    investigatingIssue is being investigated
    and removed
    needs-triageThis issue or PR still needs to be triaged.
    on Dec 11, 2025
  4. Migoo commented on Dec 11, 2025

    @Migoo
    Author

    Hi! Thanks for submitting this issue. We'll investigate. Did the previous version of pinpoint accept the collapse_id param?

    Hello, thanks.
    We try only on the 103 and 116 release.

  5. jterapin commented on Dec 11, 2025

    @jterapin
    Contributor

    Hi! The CreateCampaign parameters come from the service team's model that we use to generate the SDK.

    I noticed the Campaign documentation doesn't show CollapseId under APNSMessage, but the Message documentation does include it under APNSMessage. I'll cut a ticket to the service team to clarify this discrepancy and get back to you.

  6. jterapin commented on Dec 30, 2025

    @jterapin
    Contributor

    Hi! I received a response from the Pinpoint service regarding this issue:

    This is expected behavior. Campaigns do not support the collapse_id parameter, whereas direct messages do. These are two different resources/APIs with different capabilities. Additionally, campaign functionality is on the path to deprecation, so this support will not be considered.
    We recommend migrating to the newer messaging APIs: https://docs.aws.amazon.com/pinpoint/latest/userguide/migrate.html

    Hope this clarifies the discrepancy. If you have additional questions about Pinpoint service
    functionality, you can reach out to the service through via Contact Us in the migration guide linked above.

  7. added
    service-apiGeneral API label for AWS Services.
    response-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.
    and removed
    investigatingIssue is being investigated
    bugThis issue is a bug.
    on Dec 30, 2025
  8. github-actions commented on Jan 10, 2026

    @github-actions

    This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.

  9. added
    closing-soonThis issue will automatically close in 4 days unless further comments are made.
    on Jan 10, 2026
  10. Migoo commented on Jan 12, 2026

    @Migoo
    Author

    Hello @jterapin,

    That's more clear now !

    Thanks for the investigation.

  11. github-actions commented on Jan 12, 2026

    @github-actions

    This issue is now closed. Comments on closed issues are hard for our team to see.
    If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    closing-soonThis issue will automatically close in 4 days unless further comments are made.response-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.service-apiGeneral API label for AWS Services.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions