# Organization routes: merge

URL: /code/api/organization/verbs · Id: `page:code/api/organization/verbs`

> The Organization Verbs merge as api.sb routes, with inputs, result, refusals and an example.

Reference for [Organization](/business/nouns/organization), one group of [Organization routes](/code/api/organization).

### Organization.merge
Merge joins a duplicate Organization into another, keeping every Contact, Deal and Event on the one that remains. [Verb page](/business/nouns/organization/merge?interface=api).

```text
POST /{namespace}/organizations/{organization}/merge
```

Path: `organization`. Body, as JSON: the other inputs. Emits [`Organization.merged`](/business/events/Organization.merged).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `organization` | [Organization](/business/nouns/organization) | Yes | The duplicate. |
| `into` | [Organization](/business/nouns/organization) | Yes | The Organization that remains. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `organization` | [Organization](/business/nouns/organization) | Yes | The remaining Organization. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |

**Example**

```bash
curl -X POST https://api.sb/leaseline.app/organizations/organization_v0SkRLrXCN/merge \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"into":"organization_v0SkRLrXCN"}'
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "organization": {
    "$id": "https://api.sb/leaseline.app/organizations/organization_v0SkRLrXCN",
    "$type": "Organization",
    "name": "Riverside Property"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Organization.merge",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```