> This page is for Unified.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.merge.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server.

# Programmatic Nested Writes with /meta

> How to use the /meta endpoint to build nested write requests that create multiple related objects in one call, with integration-specific field handling.

---

## Overview

In an earlier guide to [Writing Nested Data](../writes/nested), we introduced the concept of **writing new entities nested inside another entity** in a single POST request to Merge, thereby establishing a relation.

Just like how `/meta` can be used to programmatically determine writable fields for a Common Model, `/meta` can also be used to **determine writable fields** for a **nested Common Model**.

> **Info**
>
> Refer to our guide to [Programmatic Writes with /meta](../programmatic-writes-with-meta/introduction) for an introduction to using `/meta`.

---

## Request Schema for Nested Common Models

In your `/meta` response, the `request_schema` object will have similar properties whether it is for the **parent** or **nested Common Model**:

* Common Model fields
* `integration_params` specifying **integration-specific fields**
* `linked_account_params` specifying **Linked Account-specific fields**

> **Info**
>
> Refer to our documentation of [`request_schema`](../programmatic-writes-with-meta/introduction#request_schema) for more information.

### Example - Request Schema

`Candidates` can accept a nested `Application` in its `applications` field.

A GET request to `/candidates/meta/post` will show supported fields for this nesting in its response:

#### Example request\_schema for Candidate with nested Application

```json {32-50}
{
    "request_schema": {
        "type": "object",
        "properties": {
            "model": {
                "type": "object",
                "properties": {
                    "first_name": {
                        "type": "string",
                        "description": "The candidate's first name."
                    },
                    "last_name": {
                        "type": "string",
                        "description": "The candidate's last name."
                    },
                    "email_addresses": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "value": {
                                    "type": "string",
                                },
                                "email_address_type": {
                                    "type": "string",
                                }
                            },
                            "required": ["value"]
                        },
                        "description": "Array of email_addresses objects on ats.Candidate"
                    },
                    "applications": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "applied_at": {
                                    "type": "string",
                                    "description": "When the application was submitted."
                                },
                                "source": {
                                    "type": "string",
                                    "description": "Source of the application."
                                },
                                "integration_params": null,
                                "linked_account_params": null
                            }
                        },
                        "description": "Array of ats.Application objects on ats.Candidate"
                    },
                    "integration_params": null,
                    "linked_account_params": null
                },
                "required": ["first_name", "last_name"]
            }
        }
    }
}
```

### Example - Request Body

In accordance with the response from `/meta` above, the POST request you would form might have a body like this:

#### Example POST request body

```json {15-20}
{
  "model": {
    "first_name": "Jane",
    "last_name": "Doe",
    "email_addresses": [
      {
        "value": "jane@merge.dev",
        "email_address_type": "WORK",
      },
      {
        "value": "jane@gmail.com",
        "email_address_type": "PERSONAL",
      }
    ],
    "applications": [
      {
        "applied_at": "2021-10-15T00:00:00Z",
        "source": "Campus recruiting event"
      }
    ]
  }
}
```