addMembership

View as MarkdownOpen in Claude

Add a phone number to a group.

Path parameters

NumberGroupIdstringRequiredformat: "uuid"
Unique ID of the number group.

Request

phone_number_idstringRequiredformat: "uuid"
The phone number ID to add to the group.

Response

idstringRequiredformat: "uuid"
The unique identifier of the Number Group Membership on SignalWire. This can be used to delete the membership programmatically.
number_group_idstringRequiredformat: "uuid"
The unique identifier of the Number Group this membership is associated with.
phone_numberobjectRequired
A representation of the phone number this membership is associated with.
created_atstringRequired
The date and time when the membership was created.
updated_atstringRequired
The date and time when the membership was last updated.

Response Example

Response
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"number_group_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"phone_number": {
"id": "string",
"name": "Jenny",
"number": "+15558675309",
"capabilities": [
"voice",
"sms",
"mms",
"fax"
]
},
"created_at": "2023-01-15T10:30:00Z",
"updated_at": "2023-01-15T10:30:00Z"
}

Example

import { RestClient } from "@signalwire/sdk";
const client = new RestClient({
project: "your-project-id",
token: "your-api-token",
host: "your-space.signalwire.com"
});
const membership = await client.numberGroups.addMembership("group-id", {
phone_number_id: "phone-number-id",
});
console.log("Membership ID:", membership.id);