---
title: "Move a resource into a namespace"
method: POST
path: "/v1/namespaces/{id}/resources"
tags: ["Namespaces"]
---

# Move a resource into a namespace

`POST /v1/namespaces/{id}/resources`

## Request

- Base URL: `https://api.samva.dev`
- URL: `https://api.samva.dev/v1/namespaces/{id}/resources`
- Auth: API key in header `x-api-key`

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.

## Path parameters

- `id` string, required

## Request body

- AssignNamespaceResourcePayload
  - `type` 'domain' | 'sender' | 'contact' | 'template', required
  - `resourceId` string, required: The resource's id, such as `dom_...` for a domain.

## Response `200`

NamespaceResource

- NamespaceResource
  - `type` 'domain' | 'sender' | 'contact' | 'template', required
  - `id` string, required
  - `namespaceId` string, required

## Other responses

- `401`: UnauthorizedError
- `403`: ForbiddenError
- `404`: ResourceNotFoundError
- `409`: ConflictError
- `422`: ValidationError
- `500`: InternalError
- `504`: GatewayTimeoutError

---

[API](https://skmtc.dev/samva/apis/samva-api.md) · [All operations](https://skmtc.dev/samva/apis/samva-api/llms.txt) · [OpenAPI document](https://skmtc.dev/samva/apis/samva-api/revisions/a99408542cc3?raw)
