Skip to content

Conversation

@kewynakshlley
Copy link
Collaborator

@kewynakshlley kewynakshlley commented Oct 31, 2025

Summary by cubic

Adds support for global contacts not tied to a segment/audience. When no segmentId/audienceId is provided, the SDK now uses /contacts to create, list, get, update, and delete contacts.

  • New Features
    • create() auto-routes to /contacts when no segment/audience is set.
    • Added list() and list(ListParams) for global contacts.
    • Added get(String contactIdOrEmail) for global contacts.
    • Added remove(String contactId) for global contacts (ID only, not email).
    • Updated get/update/remove to pick the correct endpoint based on segment/audience presence.
    • Added tests covering all global contact flows.

Written for commit 6564f53. Summary will update automatically on new commits.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 2 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="src/main/java/com/resend/services/contacts/Contacts.java">

<violation number="1" location="src/main/java/com/resend/services/contacts/Contacts.java:98">
Rule violated: **API Key Permission Check SDK Methods**

Per the API Key Permission Check SDK Methods guideline, these new global contact endpoints (list/get/remove/update against /contacts) introduce additional Resend API operations. Please confirm production API keys have the necessary permissions for these calls to prevent authorization failures post-deploy.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

* @return A ListContactsResponseSuccess containing the list of global contacts.
* @throws ResendException If an error occurs during the contacts list retrieval process.
*/
public ListContactsResponseSuccess list() throws ResendException {
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 31, 2025

Choose a reason for hiding this comment

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

Rule violated: API Key Permission Check SDK Methods

Per the API Key Permission Check SDK Methods guideline, these new global contact endpoints (list/get/remove/update against /contacts) introduce additional Resend API operations. Please confirm production API keys have the necessary permissions for these calls to prevent authorization failures post-deploy.

Prompt for AI agents
Address the following comment on src/main/java/com/resend/services/contacts/Contacts.java at line 98:

<comment>Per the API Key Permission Check SDK Methods guideline, these new global contact endpoints (list/get/remove/update against /contacts) introduce additional Resend API operations. Please confirm production API keys have the necessary permissions for these calls to prevent authorization failures post-deploy.</comment>

<file context>
@@ -83,13 +89,51 @@ public ListContactsResponseSuccess list(String segmentId, ListParams params) thr
+     * @return A ListContactsResponseSuccess containing the list of global contacts.
+     * @throws ResendException If an error occurs during the contacts list retrieval process.
+     */
+    public ListContactsResponseSuccess list() throws ResendException {
+        AbstractHttpResponse&lt;String&gt; response = this.httpClient.perform(&quot;/contacts&quot;, super.apiKey, HttpMethod.GET, null, MediaType.get(&quot;application/json&quot;));
+
</file context>
Fix with Cubic

@kewynakshlley kewynakshlley merged commit 96f60a8 into main Oct 31, 2025
4 checks passed
@kewynakshlley kewynakshlley deleted the feat/global-contacts branch October 31, 2025 03:37
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.

2 participants