Update a phone number
curl --request PATCH \
--url https://dev-public-api.openphone.dev/phone-numbers/{phoneNumberId} \
--header 'Content-Type: application/json' \
--header 'Quo-Api-Version: <quo-api-version>' \
--data '
{
"name": "My phone number",
"businessHours": {
"enabled": true,
"timezone": "America/New_York",
"schedule": {
"monday": {
"start": "0900",
"end": "0900"
},
"tuesday": {
"start": "0900",
"end": "0900"
},
"wednesday": {
"start": "0900",
"end": "0900"
},
"thursday": {
"start": "0900",
"end": "0900"
},
"friday": {
"start": "0900",
"end": "0900"
},
"saturday": {
"start": "0900",
"end": "0900"
},
"sunday": {
"start": "0900",
"end": "0900"
}
}
}
}
'{
"data": {
"id": "PNlja6rrtI",
"groupId": "GRcei8k90o",
"name": "My phone number",
"phoneNumber": "+15555555555",
"formattedNumber": "(555) 555-5555",
"forward": "+15555555555",
"portRequestId": "123abc",
"portingStatus": "completed",
"symbol": "🏡",
"createdAt": "2022-01-01T00:00:00Z",
"updatedAt": "2022-01-01T00:00:00Z",
"restrictions": {
"calling": {
"CA": "unrestricted",
"Intl": "unrestricted",
"US": "unrestricted"
},
"messaging": {
"CA": "unrestricted",
"Intl": "unrestricted",
"US": "unrestricted"
}
},
"businessHours": {
"enabled": true,
"timezone": "America/New_York",
"schedule": {
"monday": {
"start": "0900",
"end": "0900"
},
"tuesday": {
"start": "0900",
"end": "0900"
},
"wednesday": {
"start": "0900",
"end": "0900"
},
"thursday": {
"start": "0900",
"end": "0900"
},
"friday": {
"start": "0900",
"end": "0900"
},
"saturday": {
"start": "0900",
"end": "0900"
},
"sunday": {
"start": "0900",
"end": "0900"
}
}
}
}
}Phone Numbers
Update a phone number
Update the name and business hours of a phone number. Only the fields in the request change; a field left out keeps its stored value, and the body must name at least one field. With a user token, only the number’s owners and admins can update it: a member assigned to it gets 403 Forbidden, and a user not assigned to it gets 404 Not Found. The response is the updated phone number with its businessHours, as GET /phone-numbers/{phoneNumberId}?include=businessHours returns it.
PATCH
/
phone-numbers
/
{phoneNumberId}
Update a phone number
curl --request PATCH \
--url https://dev-public-api.openphone.dev/phone-numbers/{phoneNumberId} \
--header 'Content-Type: application/json' \
--header 'Quo-Api-Version: <quo-api-version>' \
--data '
{
"name": "My phone number",
"businessHours": {
"enabled": true,
"timezone": "America/New_York",
"schedule": {
"monday": {
"start": "0900",
"end": "0900"
},
"tuesday": {
"start": "0900",
"end": "0900"
},
"wednesday": {
"start": "0900",
"end": "0900"
},
"thursday": {
"start": "0900",
"end": "0900"
},
"friday": {
"start": "0900",
"end": "0900"
},
"saturday": {
"start": "0900",
"end": "0900"
},
"sunday": {
"start": "0900",
"end": "0900"
}
}
}
}
'{
"data": {
"id": "PNlja6rrtI",
"groupId": "GRcei8k90o",
"name": "My phone number",
"phoneNumber": "+15555555555",
"formattedNumber": "(555) 555-5555",
"forward": "+15555555555",
"portRequestId": "123abc",
"portingStatus": "completed",
"symbol": "🏡",
"createdAt": "2022-01-01T00:00:00Z",
"updatedAt": "2022-01-01T00:00:00Z",
"restrictions": {
"calling": {
"CA": "unrestricted",
"Intl": "unrestricted",
"US": "unrestricted"
},
"messaging": {
"CA": "unrestricted",
"Intl": "unrestricted",
"US": "unrestricted"
}
},
"businessHours": {
"enabled": true,
"timezone": "America/New_York",
"schedule": {
"monday": {
"start": "0900",
"end": "0900"
},
"tuesday": {
"start": "0900",
"end": "0900"
},
"wednesday": {
"start": "0900",
"end": "0900"
},
"thursday": {
"start": "0900",
"end": "0900"
},
"friday": {
"start": "0900",
"end": "0900"
},
"saturday": {
"start": "0900",
"end": "0900"
},
"sunday": {
"start": "0900",
"end": "0900"
}
}
}
}
}Headers
Path Parameters
Body
application/json
Was this page helpful?