Skip to content

feat: add internal flag to Endpoint create params (VT-9534) - #318

Closed
revanth-plivo wants to merge 2 commits into
masterfrom
VT-9534-add-internal-endpoint-flag
Closed

feat: add internal flag to Endpoint create params (VT-9534)#318
revanth-plivo wants to merge 2 commits into
masterfrom
VT-9534-add-internal-endpoint-flag

Conversation

@revanth-plivo

Copy link
Copy Markdown
Contributor

Summary

Adds an optional isInternal (bool?) parameter to EndpointInterface.Create and CreateAsync so 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 internal column on the endpoint model + defaults the List API to exclude internal endpoints (commit cea50cf / d425930 on trace). What's missing is the ability for the auto-create call (Hodor) to actually mark endpoints as internal=true at creation time. This SDK change unblocks that.

Change

  • src/Plivo/Resource/Endpoint/EndpointInterface.cs — one new optional parameter on both Create and CreateAsync: bool? isInternal = null.
  • When isInternal.HasValue, the value is added directly to the outgoing request dictionary under the wire key internal (lowercase) — bypassing the anonymous-object -> snake_case conversion done by CreateData, which would otherwise emit is_internal.

C# reserved-keyword workaround

internal is a C# keyword and cannot be used as a parameter identifier, so the SDK-facing parameter is isInternal. The value is stamped onto the request body with data["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. When isInternal is null, the key is omitted from the request body entirely — every existing caller sees identical wire behavior. Only callers that explicitly pass isInternal: true opt into the new path.

Test plan

  • dotnet build src/Plivo/Plivo.csproj clean (not runnable in this env — no local dotnet installed; verify in CI)
  • Existing Endpoint tests pass
  • End-to-end sanity: call Endpoint Create with isInternal: true against api.plivo.com from a test account and verify subscriber.internal = true on the row (validated separately by the CX team's integration)

Related

  • JIRA: VT-9534
  • Slack: [thread on Pylon #2460]
  • Companion PRs across other SDKs: plivo-go version fix #250, plivo-python, plivo-node, plivo-ruby, plivo-java, plivo-php (following this pattern)

Generated with Claude Code

revanth-plivo and others added 2 commits July 27, 2026 17:46
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
revanth-plivo force-pushed the VT-9534-add-internal-endpoint-flag branch from 230c5d3 to 9fc3139 Compare July 27, 2026 12:32
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