Move a resource into a namespace
Moves a resource from organization level or another namespace into this one.
POST
Moves a resource from organization level or another namespace into this one. A domain brings its senders; a sender on a domain cannot move alone (assign the domain); a contact brings its identities; a template brings every template in its project. A moved resource stops being a default. An address or external id the namespace already holds conflicts. Keys scoped to the old namespace stop reaching the resource at once. Mailboxes, API keys, and webhook endpoints keep the namespace they were created in.
apiKeyheader
x-api-key<token>id*stringMatch
^ns_[0-9a-hjkmnp-tv-z]{16,24}$application/json- body
type*NamespaceResourceTypeValue in
"domain""sender""whatsappNumber""smsNumber""contact""template"resourceId*stringThe resource's id, such as dom_... for a domain.
NamespaceResource
application/json- response
type*NamespaceResourceTypeValue in
"domain""sender""whatsappNumber""smsNumber""contact""template"id*stringnamespaceId*|nullimport { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.namespaces.assignResource({
"id": "example",
"type": "domain",
"resourceId": "example"
});Example Response
{
"type": "domain",
"id": "string",
"namespaceId": "string"
}