Skip to content

Send si=true when reading and updating an SSO integration - #99

Merged
kenzo0107 merged 1 commit into
mainfrom
fix/sso-integration-si
Sep 29, 2026
Merged

kenzo0107 merged 1 commit into
mainfrom
fix/sso-integration-si

Conversation

@kenzo0107

@kenzo0107 kenzo0107 commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • GET /v3/sso/integrations/{id} and PATCH /v3/sso/integrations/{id} only include completed_integration in the response when the si=true query parameter is set. GetSSOIntegration / UpdateSSOIntegration never sent it, so CompletedIntegration always decoded as false.
  • In terraform-provider-sendgrid this false ends up in state and is sent back in the next PATCH, which resets the integration's completed flag (reported in fix: sso_integration Update reads unknown plan ID, causing resource not found terraform-provider-sendgrid#212).
  • Both methods now always send si=true. The method signatures stay the same.
  • GetSSOIntegrations built the si query but never assigned it to u.RawQuery, so Si: true had no effect. Fixed.

References

The SendGrid API reference describes the si query parameter as:

If this parameter is set to true, the response will include the completed_integration field.

It is defined for GET /v3/sso/integrations, GET /v3/sso/integrations/{id} and PATCH /v3/sso/integrations/{id} (not for POST).

Test plan

  • go test ./... (the new si query assertions fail without the fix and pass with it)
  • terraform-provider-sendgrid builds and go test ./internal/provider/ passes when using this branch through a replace directive

🤖 Generated with Claude Code

- GetSSOIntegration and UpdateSSOIntegration always send si=true; without it SendGrid omits completed_integration and it decodes as false
- GetSSOIntegrations now actually puts si in the query string

The SendGrid API reference describes the si query parameter as "If this
parameter is set to `true`, the response will include the
`completed_integration` field." It is defined for GET /v3/sso/integrations,
GET /v3/sso/integrations/{id} and PATCH /v3/sso/integrations/{id}.

- https://www.twilio.com/docs/sendgrid/api-reference/single-sign-on-settings/get-an-sso-integration
- https://github.com/twilio/sendgrid-oai/blob/8898f95ba784888ec9c29cfd6fab26806eed408c/spec/json/tsg_sso_v3.json#L414-L500

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant