feat: add internal flag to Endpoint create params (VT-9534) - #318
Closed
revanth-plivo wants to merge 2 commits into
Closed
feat: add internal flag to Endpoint create params (VT-9534)#318revanth-plivo wants to merge 2 commits into
revanth-plivo wants to merge 2 commits into
Conversation
Adds an optional `isInternal` (bool?) parameter to `EndpointInterface.Create` and `CreateAsync` so callers can mark newly created SIP endpoints as internal at creation time. C# reserved-keyword workaround: `internal` is a C# keyword and cannot be used as a parameter identifier, so the SDK-facing parameter is named `isInternal`. The value is added directly to the outgoing request dictionary with the wire key `internal` (lowercase), matching the Trace backend contract - bypassing the anonymous-object -> snake_case conversion in CreateData that would otherwise produce `is_internal`. Backwards-compatible: when `isInternal` is null (the default), the key is omitted from the request body entirely - every existing caller sees identical wire behavior. Only callers that explicitly pass `isInternal: true` opt in. Unblocks Plivo CX (Contacto) tagging auto-created browser-SDK endpoints so they stop leaking into customer consoles (Pylon #2460). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
revanth-plivo
force-pushed
the
VT-9534-add-internal-endpoint-flag
branch
from
July 27, 2026 12:32
230c5d3 to
9fc3139
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an optional
isInternal(bool?) parameter toEndpointInterface.CreateandCreateAsyncso callers can mark newly created SIP endpoints as internal at creation time.Why
Plivo CX (Contacto) auto-creates a SIP endpoint per AOM during user invite for browser-SDK playback. These internal endpoints currently leak into the customer's Endpoints tab in the console (Pylon #2460), causing confusion, prod alerts (customers try to register the SIP from third-party clients), and a security concern (customer can silently change creds).
The trace service already supports an
internalcolumn on the endpoint model + defaults the List API to exclude internal endpoints (commitcea50cf/d425930on trace). What's missing is the ability for the auto-create call (Hodor) to actually mark endpoints asinternal=trueat creation time. This SDK change unblocks that.Change
src/Plivo/Resource/Endpoint/EndpointInterface.cs— one new optional parameter on bothCreateandCreateAsync:bool? isInternal = null.isInternal.HasValue, the value is added directly to the outgoing request dictionary under the wire keyinternal(lowercase) — bypassing the anonymous-object -> snake_case conversion done byCreateData, which would otherwise emitis_internal.C# reserved-keyword workaround
internalis a C# keyword and cannot be used as a parameter identifier, so the SDK-facing parameter isisInternal. The value is stamped onto the request body withdata["internal"] = isInternal.Value;so the wire contract (internal) still matches the Trace backend and the other-language SDKs.Backwards-compatibility
Optional nullable parameter, default
null. WhenisInternalisnull, the key is omitted from the request body entirely — every existing caller sees identical wire behavior. Only callers that explicitly passisInternal: trueopt into the new path.Test plan
dotnet build src/Plivo/Plivo.csprojclean (not runnable in this env — no local dotnet installed; verify in CI)CreatewithisInternal: trueagainstapi.plivo.comfrom a test account and verifysubscriber.internal = trueon the row (validated separately by the CX team's integration)Related
Generated with Claude Code