Skip to Content

Move a resource into a namespace

Moves a resource from organization level or another namespace into this one.

POST
/v1/namespaces/{id}/resources

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.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

id*string
Match^ns_[0-9a-hjkmnp-tv-z]{16,24}$

Request Body

application/json
  1. body
type*NamespaceResourceType
Value in"domain""sender""whatsappNumber""smsNumber""contact""template"
resourceId*string

The resource's id, such as dom_... for a domain.

Response Body

NamespaceResource

application/json
  1. response
type*NamespaceResourceType
Value in"domain""sender""whatsappNumber""smsNumber""contact""template"
id*string
namespaceId*|null
Example Request
import { 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"
}

Related documentation