Skip to content

Conversation

tanya732
Copy link
Contributor

@tanya732 tanya732 commented Jul 22, 2025

Changes

Added new Endpoints -

Path HTTP Method Method Name
/branding/phone/templates POST createPhoneTemplate
/branding/phone/templates GET getAllPhoneTemplates
/branding/phone/templates/{id} GET getPhoneTemplate
/branding/phone/templates/{id} DELETE deletePhoneTemplate
/branding/phone/templates/{id} UPDATE updatePhoneTemplate
/branding/phone/templates/{id}/reset PATCH resetTemplate

Note - We are not adding endpoint, as it might not require SDK Support.

References

https://auth0.com/docs/api/management/v2/branding/get-phone-templates
https://auth0.com/docs/api/management/v2/branding/create-phone-template
https://auth0.com/docs/api/management/v2/branding/get-phone-template
https://auth0.com/docs/api/management/v2/branding/delete-phone-template
https://auth0.com/docs/api/management/v2/branding/update-phone-template
https://auth0.com/docs/api/management/v2/branding/reset-phone-template

Sample Manual Testing Code

Securely store your Client ID, Client Secret, and Management API token.
Install the SDK: npm install auth0

var auth0 = new ManagementClient({
domain: '{YOUR_TENANT_AND REGION}.auth0.com',
clientId: '{YOUR_CLIENT_ID}',
clientSecret: '{YOUR_CLIENT_SECRET}',
});

// Get All Phone Templates
const getAllPhoneTemplates = await auth0.branding.getAllPhoneTemplates();

// Get Phone Template
  const getPhoneTemplate = await auth0.branding.getPhoneTemplate({ id: '<ID>' });

// Create Phone Template Payload
  const createPhoneTemplatePayload: CreatePhoneTemplateRequestContent = {
    type: "otp_verify",
    disabled: false,
    content: {
      syntax: "Test",
      from: "+9832832",
      body: {
        text: "Hi!!"
      }
    }
  }

// Create Phone Template
  const createPhoneTemplate = await auth0.branding.createPhoneTemplate(createPhoneTemplatePayload);

// Update Phone Template Payload
  const updatePhoneTemplatePayload: UpdatePhoneTemplateRequestContent = {
    content: {
      from: "+1234567890",
      body: {
        text: "Hi!! This is Updated"
      }
    }
  }

// Update Phone Template
  const updatePhoneTemplate = await auth0.branding.updatePhoneTemplate({id: "<ID>"},updatePhoneTemplatePayload);

// Delete Phone Template
  const deletePhoneTemplate = await auth0.branding.deletePhoneTemplate({ id: "<ID>" });

// Reset Template
  const resetTemplate = await auth0.branding.resetTemplate({ id: "<ID>" }, null);

Testing

Please describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.

  • This change adds unit test coverage
  • This change adds integration test coverage

Checklist

@tanya732 tanya732 marked this pull request as ready for review July 22, 2025 06:53
@tanya732 tanya732 requested a review from a team as a code owner July 22, 2025 06:53
@tanya732 tanya732 merged commit cf502a0 into master Jul 22, 2025
8 checks passed
@tanya732 tanya732 deleted the sdk-6198-phone-templates-node-support branch July 22, 2025 07:14
@tanya732 tanya732 mentioned this pull request Aug 4, 2025
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.

3 participants