import Surge from '@surgeapi/node';const client = new Surge({ apiKey: process.env['SURGE_API_KEY'], // This is the default and can be omitted});const phoneNumber = await client.phoneNumbers.update('pn_01jsjwe4d9fx3tpymgtg958d9w');console.log(phoneNumber.id);
import os
from surge import Surge
client = Surge(
api_key=os.environ.get("SURGE_API_KEY"), # This is the default and can be omitted
)
phone_number = client.phone_numbers.update(
id="pn_01jsjwe4d9fx3tpymgtg958d9w",
)
print(phone_number.id)
require "surge_api"
surge = SurgeAPI::Client.new(api_key: "My API Key")
phone_number = surge.phone_numbers.update("pn_01jsjwe4d9fx3tpymgtg958d9w")
puts(phone_number)
{
"error": {
"message": "The requested resource could not be found.",
"type": "not_found"
}
}
Phone numbers
Update phone number
Updates a phone number’s details.
PATCH
/
phone_numbers
/
{id}
JavaScript
import Surge from '@surgeapi/node';const client = new Surge({ apiKey: process.env['SURGE_API_KEY'], // This is the default and can be omitted});const phoneNumber = await client.phoneNumbers.update('pn_01jsjwe4d9fx3tpymgtg958d9w');console.log(phoneNumber.id);
import os
from surge import Surge
client = Surge(
api_key=os.environ.get("SURGE_API_KEY"), # This is the default and can be omitted
)
phone_number = client.phone_numbers.update(
id="pn_01jsjwe4d9fx3tpymgtg958d9w",
)
print(phone_number.id)
require "surge_api"
surge = SurgeAPI::Client.new(api_key: "My API Key")
phone_number = surge.phone_numbers.update("pn_01jsjwe4d9fx3tpymgtg958d9w")
puts(phone_number)
Whether the phone number is local, toll-free, or short code
Available options:
local,
short_code,
toll_free
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Surge","colors":{"primary":"#8200ff","light":"#a684ff","dark":"#7f22fe"},"logo":{"light":"https://mintcdn.com/surge-67d47b03/1YdD2Aq20HHnJtCK/logo.svg?fit=max\u0026auto=format\u0026n=1YdD2Aq20HHnJtCK\u0026q=85\u0026s=fb53e91d462980a01e9b7c046c98f339","dark":"https://mintcdn.com/surge-67d47b03/1YdD2Aq20HHnJtCK/logo.svg?fit=max\u0026auto=format\u0026n=1YdD2Aq20HHnJtCK\u0026q=85\u0026s=fb53e91d462980a01e9b7c046c98f339"},"favicon":"https://mintcdn.com/surge-67d47b03/TCCrlfgdQylYa0Zn/favicon.png?fit=max\u0026auto=format\u0026n=TCCrlfgdQylYa0Zn\u0026q=85\u0026s=9026e6be7d30dc29237a92585de3ae74","api":{"openapi":"openapi.documented.json"},"navbar":{"links":[{"href":"mailto:support@surge.app","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://hq.surge.app"}},"footer":{"socials":{"x":"https://x.com/surgeapi","github":"https://github.com/surgeapi","linkedin":"https://www.linkedin.com/company/surgeapi"}},"seo":{"metatags":{"og:image":"https://surgemsg.com/images/surge-preview-9b01c93f5b24bb5128b47c354c371546.jpg?vsn=d"},"indexing":"navigable"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"surge-67d47b03","hasAudioNarration":false,"actualSubdomain":"surge-67d47b03","customDomains":["docs.surge.app"],"gitSource":{"type":"github","owner":"surgeapi","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6af4b0d04b5da1d1ca43892e","clientVersion":"0.0.4124","searchFilterCounts":[{"language":"default","tag":"API Reference","count":64},{"language":"default","tag":"Endpoints","count":45},{"language":"default","tag":"Documentation","count":38},{"language":"default","tag":"Webhooks","count":16},{"language":"default","tag":"Events","count":14},{"language":"default","tag":"Phone numbers","count":10},{"language":"default","tag":"SDKs","count":10},{"language":"default","tag":"Register your business","count":9},{"language":"default","tag":"Accounts","count":6},{"language":"default","tag":"Users","count":6}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".nav-logo{height:2rem}"}],"page":{"pagePath":"api-reference/endpoint/phone-numbers/update","slug":"/api-reference/endpoint/phone-numbers/update","pageMetadata":{"title":"Update phone number","openapi":"PATCH /phone_numbers/{id}","description":"Updates a phone number's details.","href":"/api-reference/endpoint/phone-numbers/update"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Updates a phone number’s details.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Update phone number","openapi":"PATCH /phone_numbers/{id}","description":"Updates a phone number's details.","href":"/api-reference/endpoint/phone-numbers/update"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Phone numbers"],"responses":{"200":"138452e1-fab2-40aa-8f58-bf9e2c21cfd3","default":"3b991600-b612-41bf-a1e1-b63fee1d0b55"},"description":"Updates a phone number's details.","operationId":"UpdatePhoneNumber","parameters":["b5d459ca-210b-4964-9836-b615a1a2b8da"],"requestBody":"12035a71-5a02-472d-9eb2-c9fcd9709297","summary":"Update a phone number","x-codeSamples":[{"lang":"JavaScript","source":"import Surge from '@surgeapi/node';\n\nconst client = new Surge({\n apiKey: process.env['SURGE_API_KEY'], // This is the default and can be omitted\n});\n\nconst phoneNumber = await client.phoneNumbers.update('pn_01jsjwe4d9fx3tpymgtg958d9w');\n\nconsole.log(phoneNumber.id);"},{"lang":"Python","source":"import os\nfrom surge import Surge\n\nclient = Surge(\n api_key=os.environ.get(\"SURGE_API_KEY\"), # This is the default and can be omitted\n)\nphone_number = client.phone_numbers.update(\n id=\"pn_01jsjwe4d9fx3tpymgtg958d9w\",\n)\nprint(phone_number.id)"},{"lang":"Ruby","source":"require \"surge_api\"\n\nsurge = SurgeAPI::Client.new(api_key: \"My API Key\")\n\nphone_number = surge.phone_numbers.update(\"pn_01jsjwe4d9fx3tpymgtg958d9w\")\n\nputs(phone_number)"}],"method":"patch","type":"path","servers":["e57117fb-d785-48af-9e4e-135b2696c50b"],"security":["efd1bd9d-ebc2-4498-93ae-729be344cc09"],"path":"/phone_numbers/{id}","baseUrlOptions":["https://api.surge.app"],"title":"Update a phone number","codeSamples":[{"lang":"JavaScript","source":"import Surge from '@surgeapi/node';\n\nconst client = new Surge({\n apiKey: process.env['SURGE_API_KEY'], // This is the default and can be omitted\n});\n\nconst phoneNumber = await client.phoneNumbers.update('pn_01jsjwe4d9fx3tpymgtg958d9w');\n\nconsole.log(phoneNumber.id);"},{"lang":"Python","source":"import os\nfrom surge import Surge\n\nclient = Surge(\n api_key=os.environ.get(\"SURGE_API_KEY\"), # This is the default and can be omitted\n)\nphone_number = client.phone_numbers.update(\n id=\"pn_01jsjwe4d9fx3tpymgtg958d9w\",\n)\nprint(phone_number.id)"},{"lang":"Ruby","source":"require \"surge_api\"\n\nsurge = SurgeAPI::Client.new(api_key: \"My API Key\")\n\nphone_number = surge.phone_numbers.update(\"pn_01jsjwe4d9fx3tpymgtg958d9w\")\n\nputs(phone_number)"}],"requiredOnlyExamples":false,"requestExampleType":"codeSamples","responseExampleType":"generated"},"dependencies":{"parameters":{"b5d459ca-210b-4964-9836-b615a1a2b8da":{"in":"path","name":"id","required":true,"schema":{"description":"The ID of the phone number to update.","example":"pn_01jsjwe4d9fx3tpymgtg958d9w","type":"string","isRequired":true,"uniqueKey":"","typeLabel":"string"}}},"requestBody":{"content":{"application/json":{"schema":{"title":"PhoneNumberUpdateParams","description":"Updates a phone number's details.","example":{"campaign_id":"cpn_01jjnn7s0zfx5tdcsxjfy93et2","metadata":{"location":"Downtown store"},"name":"Letty's Main Line"},"properties":{"campaign_id":{"description":"Campaign ID to attach this number to (`cpn_...`).","example":"cpn_01jjnn7s0zfx5tdcsxjfy93et2","type":"string","uniqueKey":"campaign_id","typeLabel":"string"},"metadata":{"title":"Metadata","additionalProperties":{"maxLength":500,"type":"string","uniqueKey":"metadata.additionalProperties","typeLabel":"string"},"description":"Set of key-value pairs that will be stored with the object.","maxProperties":50,"properties":{},"type":"object","uniqueKey":"metadata","typeLabel":"Metadata · object"},"name":{"description":"A human-readable name for the phone number.","example":"Letty's Main Line","type":"string","uniqueKey":"name","typeLabel":"string"}},"required":[],"type":"object","uniqueKey":"","typeLabel":"PhoneNumberUpdateParams · object"},"examples":{"Example":{"title":"Example","value":{"campaign_id":"cpn_01jjnn7s0zfx5tdcsxjfy93et2","metadata":{"location":"Downtown store"},"name":"Letty's Main Line"}}},"exampleType":"generated"}},"required":true,"exampleType":"generated"},"responses":{"138452e1-fab2-40aa-8f58-bf9e2c21cfd3":{"content":{"application/json":{"schema":{"title":"PhoneNumber","description":"A phone number that can be used to send and receive messages and calls","example":{"campaign":{"attachment_status":"attached","id":"cpn_01jjnn7s0zfx5tdcsxjfy93et2"},"campaign_id":"cpn_01jjnn7s0zfx5tdcsxjfy93et2","id":"pn_01jsjwe4d9fx3tpymgtg958d9w","metadata":{"location":"Downtown store"},"name":"(801) 555-1234","number":"+18015551234","type":"local"},"properties":{"campaign":{"oneOf":[{"type":"object","title":"PhoneNumberCampaign","description":"Campaign attachment details for domestic local numbers, or null for other types of numbers and local numbers without a campaign","required":["id","attachment_status"],"example":{"attachment_status":"attached","id":"cpn_01jjnn7s0zfx5tdcsxjfy93et2"},"properties":{"attachment_status":{"description":"The current campaign attachment status for this phone number.","enum":["attached","attachment_pending","detached","detachment_pending"],"type":"string","isRequired":true,"uniqueKey":"campaign.oneOf.0.attachment_status","typeLabel":"enum\u003cstring>"},"id":{"description":"The unique identifier of the campaign this phone number is attached to","type":"string","isRequired":true,"uniqueKey":"campaign.oneOf.0.id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"campaign.oneOf.0","typeLabel":"PhoneNumberCampaign · object"},{"type":"null","description":"Campaign attachment details for domestic local numbers, or null for other types of numbers and local numbers without a campaign","isRequired":true,"uniqueKey":"campaign.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"campaign","typeLabel":"PhoneNumberCampaign · object | null"},"campaign_id":{"oneOf":[{"deprecated":true,"description":"Deprecated. The unique identifier of the campaign this phone number is attached to, if any","type":"string","x-stainless-deprecation-message":"Use `campaign.id` instead.","isRequired":true,"uniqueKey":"campaign_id.oneOf.0","typeLabel":"string"},{"deprecated":true,"description":"Deprecated. The unique identifier of the campaign this phone number is attached to, if any","type":"null","x-stainless-deprecation-message":"Use `campaign.id` instead.","isRequired":true,"uniqueKey":"campaign_id.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"campaign_id","typeLabel":"string | null"},"id":{"description":"Unique identifier for the phone number","type":"string","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"metadata":{"title":"Metadata","additionalProperties":{"maxLength":500,"type":"string","uniqueKey":"metadata.additionalProperties","typeLabel":"string"},"description":"Set of key-value pairs that will be stored with the object.","maxProperties":50,"properties":{},"type":"object","isRequired":true,"uniqueKey":"metadata","typeLabel":"Metadata · object"},"name":{"oneOf":[{"description":"A human-readable name for the phone number","type":"string","isRequired":true,"uniqueKey":"name.oneOf.0","typeLabel":"string"},{"description":"A human-readable name for the phone number","type":"null","isRequired":true,"uniqueKey":"name.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"name","typeLabel":"string | null"},"number":{"description":"The phone number in E.164 format","example":"+18015551234","format":"phone-number","pattern":"^\\+[1-9]\\d{6,14}$","type":"string","isRequired":true,"uniqueKey":"number","typeLabel":"string\u003cphone-number>"},"type":{"description":"Whether the phone number is local, toll-free, or short code","enum":["local","short_code","toll_free"],"type":"string","isRequired":true,"uniqueKey":"type","typeLabel":"enum\u003cstring>"}},"required":["id","metadata","name","number","type","campaign","campaign_id"],"type":"object","uniqueKey":"","typeLabel":"PhoneNumber · object"},"examples":{"Example":{"title":"Example","value":{"campaign":{"attachment_status":"attached","id":"cpn_01jjnn7s0zfx5tdcsxjfy93et2"},"campaign_id":"cpn_01jjnn7s0zfx5tdcsxjfy93et2","id":"pn_01jsjwe4d9fx3tpymgtg958d9w","metadata":{"location":"Downtown store"},"name":"(801) 555-1234","number":"+18015551234","type":"local"}}},"exampleType":"generated"}},"description":"Updated phone number","exampleType":"generated"},"3b991600-b612-41bf-a1e1-b63fee1d0b55":{"content":{"application/json":{"schema":{"title":"ErrorResponse","description":"An error response","example":{"error":{"message":"The requested resource could not be found.","type":"not_found"}},"properties":{"error":{"title":"Error","description":"An error response","example":{"message":"The requested resource was not found.","type":"not_found"},"properties":{"message":{"description":"A human-readable error message.","example":"The requested resource was not found.","type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"description":"A unique error code.","example":"not_found","type":"string","isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"detail":{"additionalProperties":true,"description":"Additional details about the error.","type":"object","uniqueKey":"error.detail","typeLabel":"object"}},"required":["type","message"],"type":"object","isRequired":true,"uniqueKey":"error","typeLabel":"Error · object"}},"required":["error"],"type":"object","uniqueKey":"","typeLabel":"ErrorResponse · object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"The requested resource could not be found.","type":"not_found"}}}},"exampleType":"generated"}},"description":"Error","exampleType":"generated"}},"security":{"efd1bd9d-ebc2-4498-93ae-729be344cc09":{"authorization":{"bearerFormat":"Surge API token","scheme":"bearer","type":"http","scopes":[],"schemeName":"authorization"}}},"servers":{"e57117fb-d785-48af-9e4e-135b2696c50b":{"url":"https://api.surge.app"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"bearerFormat":"Surge API token","scheme":"bearer","type":"http","scopes":[],"schemeName":"authorization"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"authorization","name":"Authorization"}],"title":"authorization"}]},"originalFileLocation":"openapi.documented.json"},"subdomain":"surge-67d47b03","siteName":"Surge","title":"Update phone number - Surge","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-06-30T22:56:51.446Z","originalFileLocation":"api-reference/endpoint/phone-numbers/update.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Updates a phone number\u0026#x27;s details.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Surge\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/surge-67d47b03/sXzShSiekorghOlZ/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/surge-67d47b03/sXzShSiekorghOlZ/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/surge-67d47b03/sXzShSiekorghOlZ/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/surge-67d47b03/sXzShSiekorghOlZ/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/surge-67d47b03/sXzShSiekorghOlZ/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/surge-67d47b03/sXzShSiekorghOlZ/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/surge-67d47b03/sXzShSiekorghOlZ/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/surge-67d47b03/sXzShSiekorghOlZ/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/surge-67d47b03/sXzShSiekorghOlZ/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Update phone number - Surge\">\u003cmeta data-mint-head property=\"og:description\" content=\"Updates a phone number\u0026#x27;s details.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Surge\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.surge.app/api-reference/endpoint/phone-numbers/update\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://surgemsg.com/images/surge-preview-9b01c93f5b24bb5128b47c354c371546.jpg?vsn=d\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Update phone number - Surge\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Updates a phone number\u0026#x27;s details.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://surgemsg.com/images/surge-preview-9b01c93f5b24bb5128b47c354c371546.jpg?vsn=d\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/surge-67d47b03/sXzShSiekorghOlZ/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Surge\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#8200ff\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.surge.app/api-reference/endpoint/phone-numbers/update\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/endpoint/phone-numbers/update.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.surge.app/#organization\",\"name\":\"Surge\",\"url\":\"https://docs.surge.app\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/surge-67d47b03/1YdD2Aq20HHnJtCK/logo.svg?fit=max\u0026auto=format\u0026n=1YdD2Aq20HHnJtCK\u0026q=85\u0026s=fb53e91d462980a01e9b7c046c98f339\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.surge.app#website\",\"name\":\"Surge\",\"url\":\"https://docs.surge.app\",\"publisher\":{\"@id\":\"https://docs.surge.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.surge.app/api-reference/endpoint/phone-numbers/update#webpage\",\"url\":\"https://docs.surge.app/api-reference/endpoint/phone-numbers/update\",\"name\":\"Update phone number\",\"description\":\"Updates a phone number's details.\",\"dateModified\":\"2026-06-30T22:56:51.446Z\",\"isPartOf\":{\"@id\":\"https://docs.surge.app#website\"},\"breadcrumb\":{\"@id\":\"https://docs.surge.app/api-reference/endpoint/phone-numbers/update#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.surge.app/api-reference/endpoint/phone-numbers/update#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Endpoints\",\"item\":\"https://docs.surge.app/api-reference/endpoint/accounts/create\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Phone numbers\",\"item\":\"https://docs.surge.app/api-reference/endpoint/phone-numbers/purchase\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Update phone number\",\"item\":\"https://docs.surge.app/api-reference/endpoint/phone-numbers/update\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.surge.app/api-reference/endpoint/phone-numbers/update#apireference\",\"headline\":\"Update phone number\",\"name\":\"Update phone number\",\"description\":\"Updates a phone number's details.\",\"url\":\"https://docs.surge.app/api-reference/endpoint/phone-numbers/update\",\"mainEntityOfPage\":{\"@id\":\"https://docs.surge.app/api-reference/endpoint/phone-numbers/update#webpage\"},\"image\":\"https://surgemsg.com/images/surge-preview-9b01c93f5b24bb5128b47c354c371546.jpg?vsn=d\",\"dateModified\":\"2026-06-30T22:56:51.446Z\",\"publisher\":{\"@id\":\"https://docs.surge.app/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.surge.app#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Surge\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Surge\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/endpoint/phone-numbers/update.md","siteName":"Surge","nav":{"global":null,"anchors":[{"anchor":"Documentation","icon":"book-open","pages":[{"title":"Documentation","href":"/overview/what-is-surge"}]},{"anchor":"SDKs","icon":"code","pages":[{"title":"SDKs","href":"/sdks"}]},{"anchor":"API Reference","icon":"terminal","groups":[{"group":"Getting started","pages":[{"title":"Introduction","href":"/api-reference/introduction"},{"title":"Authentication","href":"/api-reference/authentication"},{"title":"Error Reference","href":"/api-reference/errors"}]},{"group":"Endpoints","pages":[{"group":"Accounts","pages":[{"title":"Create account","openapi":"POST /accounts","href":"/api-reference/endpoint/accounts/create"},{"title":"List accounts","openapi":"GET /accounts","href":"/api-reference/endpoint/accounts/list"},{"title":"Retrieve account","openapi":"GET /accounts/{id}","href":"/api-reference/endpoint/accounts/get"},{"title":"Check account status","openapi":"GET /accounts/{account_id}/status","href":"/api-reference/endpoint/accounts/check-status"},{"title":"Update account","openapi":"PATCH /accounts/{id}","href":"/api-reference/endpoint/accounts/update"},{"title":"Archive account","openapi":"DELETE /accounts/{id}","href":"/api-reference/endpoint/accounts/archive"}]},{"group":"Attachments","pages":[{"title":"Retrieve attachment file","openapi":"GET /attachments/{attachment_id}/file","href":"/api-reference/endpoint/attachments/get-file"}]},{"group":"Audiences","pages":[{"title":"Create audience","openapi":"POST /accounts/{account_id}/audiences","href":"/api-reference/endpoint/audiences/create"},{"title":"Add contact to audience","openapi":"POST /audiences/{audience_id}/contacts","href":"/api-reference/endpoint/audiences/add-contact"},{"title":"List audience contacts","openapi":"GET /audiences/{audience_id}/contacts","href":"/api-reference/endpoint/audiences/list-contacts"}]},{"group":"Blasts","pages":[{"title":"Create blast","openapi":"POST /accounts/{account_id}/blasts","href":"/api-reference/endpoint/blasts/create"}]},{"group":"Campaigns","pages":[{"title":"Create campaign","openapi":"POST /accounts/{account_id}/campaigns","href":"/api-reference/endpoint/campaigns/create"},{"title":"List campaigns","openapi":"GET /accounts/{account_id}/campaigns","href":"/api-reference/endpoint/campaigns/list"},{"title":"Retrieve campaign","openapi":"GET /campaigns/{id}","href":"/api-reference/endpoint/campaigns/get"},{"title":"Update campaign","openapi":"PATCH /campaigns/{id}","href":"/api-reference/endpoint/campaigns/update"},{"title":"Resend brand verification OTP","openapi":"POST /accounts/{account_id}/brand_verification_messages","href":"/api-reference/endpoint/campaigns/resend-brand-verification-message"}]},{"group":"Contacts","pages":[{"title":"Create contact","openapi":"POST /accounts/{account_id}/contacts","href":"/api-reference/endpoint/contacts/create"},{"title":"List contacts","openapi":"GET /accounts/{account_id}/contacts","href":"/api-reference/endpoint/contacts/list"},{"title":"Retrieve contact","openapi":"GET /contacts/{id}","href":"/api-reference/endpoint/contacts/get"},{"title":"Update contact","openapi":"PATCH /contacts/{id}","href":"/api-reference/endpoint/contacts/update"}]},{"group":"Messages","pages":[{"title":"Send message","openapi":"POST /accounts/{account_id}/messages","href":"/api-reference/endpoint/messages/create"},{"title":"List messages","openapi":"GET /accounts/{account_id}/messages","href":"/api-reference/endpoint/messages/list"},{"title":"Retrieve message","openapi":"GET /messages/{id}","href":"/api-reference/endpoint/messages/get"}]},{"group":"Phone numbers","pages":[{"title":"Purchase phone number","openapi":"POST /accounts/{account_id}/phone_numbers","href":"/api-reference/endpoint/phone-numbers/purchase"},{"title":"List phone numbers","openapi":"GET /accounts/{account_id}/phone_numbers","href":"/api-reference/endpoint/phone-numbers/list"},{"title":"Retrieve phone number","openapi":"GET /phone_numbers/{id}","description":"Retrieves a PhoneNumber object.","href":"/api-reference/endpoint/phone-numbers/get"},{"title":"Update phone number","openapi":"PATCH /phone_numbers/{id}","href":"/api-reference/endpoint/phone-numbers/update"},{"title":"Release phone number","openapi":"DELETE /phone_numbers/{id}","description":"Releases a phone number from the account.","href":"/api-reference/endpoint/phone-numbers/release"},{"title":"List available numbers","openapi":"GET /accounts/{account_id}/available_phone_numbers","href":"/api-reference/endpoint/phone-numbers/list-available-numbers"}]},{"group":"Recordings","pages":[{"title":"List recordings","openapi":"GET /accounts/{account_id}/recordings","href":"/api-reference/endpoint/recordings/list"},{"title":"Retrieve recording","openapi":"GET /recordings/{id}","href":"/api-reference/endpoint/recordings/get"},{"title":"Delete recording","openapi":"DELETE /recordings/{id}","href":"/api-reference/endpoint/recordings/delete"},{"title":"Download recording file","openapi":"GET /recordings/{recording_id}/file","href":"/api-reference/endpoint/recordings/get-file"}]},{"group":"Toll-free Campaigns","pages":[{"title":"Create toll-free campaign","openapi":"POST /accounts/{account_id}/toll_free_campaigns","href":"/api-reference/endpoint/toll-free-campaigns/create"},{"title":"List toll-free campaigns","openapi":"GET /accounts/{account_id}/toll_free_campaigns","href":"/api-reference/endpoint/toll-free-campaigns/list"},{"title":"Retrieve toll-free campaign","openapi":"GET /toll_free_campaigns/{campaign_id}","href":"/api-reference/endpoint/toll-free-campaigns/get"},{"title":"Update toll-free campaign","openapi":"PATCH /toll_free_campaigns/{campaign_id}","href":"/api-reference/endpoint/toll-free-campaigns/update"}]},{"group":"Users","pages":[{"title":"Create user","openapi":"POST /accounts/{account_id}/users","href":"/api-reference/endpoint/users/create"},{"title":"List users","openapi":"GET /accounts/{account_id}/users","href":"/api-reference/endpoint/users/list"},{"title":"Retrieve user","openapi":"GET /users/{id}","href":"/api-reference/endpoint/users/get"},{"title":"Update user","openapi":"PATCH /users/{id}","href":"/api-reference/endpoint/users/update"},{"title":"Delete user","openapi":"DELETE /users/{id}","href":"/api-reference/endpoint/users/delete"},{"title":"Create user token","openapi":"POST /users/{user_id}/tokens","href":"/api-reference/endpoint/users/create-token"}]},{"group":"Verifications","pages":[{"title":"Create verification","openapi":"POST /accounts/{account_id}/verifications","href":"/api-reference/endpoint/verifications/create"},{"title":"Check verification","openapi":"POST /verifications/{id}/checks","href":"/api-reference/endpoint/verifications/check"}]}]},{"group":"Webhooks","pages":[{"title":"Webhooks Overview","href":"/api-reference/webhooks/intro"},{"title":"Signature Verification","href":"/api-reference/webhooks/signature-validation"},{"group":"Events","pages":[{"title":"message.sent","openapi":"webhook messageSent","href":"/api-reference/webhooks/message/sent"},{"title":"message.delivered","openapi":"webhook messageDelivered","href":"/api-reference/webhooks/message/delivered"},{"title":"message.failed","openapi":"webhook messageFailed","href":"/api-reference/webhooks/message/failed"},{"title":"message.received","openapi":"webhook messageReceived","href":"/api-reference/webhooks/message/received"},{"title":"contact.opted_in","openapi":"webhook contactOptedIn","href":"/api-reference/webhooks/contact/opted_in"},{"title":"contact.opted_out","openapi":"webhook contactOptedOut","href":"/api-reference/webhooks/contact/opted_out"},{"title":"conversation.created","openapi":"webhook conversationCreated","href":"/api-reference/webhooks/conversation/created"},{"title":"campaign.approved","openapi":"webhook campaignApproved","href":"/api-reference/webhooks/campaign/approved"},{"title":"phone_number.imported","openapi":"webhook phoneNumberImported","href":"/api-reference/webhooks/phone_number/imported"},{"title":"phone_number.attached_to_campaign","openapi":"webhook phoneNumberAttachedToCampaign","href":"/api-reference/webhooks/phone_number/attached_to_campaign"},{"title":"link.followed","openapi":"webhook linkFollowed","href":"/api-reference/webhooks/link/followed"},{"title":"call.ended","openapi":"webhook callEnded","href":"/api-reference/webhooks/call/ended"},{"title":"recording.completed","openapi":"webhook recordingCompleted","href":"/api-reference/webhooks/recording/completed"},{"title":"voicemail.received","openapi":"webhook voicemailReceived","href":"/api-reference/webhooks/voicemail/received"}]}]}]},{"anchor":"Resources","icon":"folder-open","pages":[{"title":"Resources","href":"/resources/hipaa"}]}]},"basePath":"","title":"Update phone number - Surge","buildId":"dpl_8hoxaqFTU7hTr6A2fUraxAyjuiZo","deploymentId":"dpl_8hoxaqFTU7hTr6A2fUraxAyjuiZo","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CDiBsYGW.js","utils-KF9rPlmF.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-C26urKTX.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-BdjmJAC1.js","snippetPresets-3IpDBjt3.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-D4x_2vvo.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BIWdc5Pa.js","shallow-LQqfiMNd.js","getApiPlaygroundDisplay-DryzlOZG.js","CodeSnippet-tcJujU4r.js","CodeSnippets-BHp0nVLL.js","Page-1CZdsdAn.js","getPastedJson-DU-1ayUv.js","icon-CZK2hPr4.js","MethodPill-DOaqmTFC.js","DuplicateIcon-B5-nUxxl.js","createIcon-CDP_U77G.js","DynamicMarkdown-GHvayGOn.js","SectionHeading-BYvpkmUD.js","axios-vUo_bRtp.js","Markdown-uxhlayGT.js","clsx-B35qUV0p.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-BvrGG8gU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-CAf0yVYe.js"]}