---
title: "Create Custom Object Schema"
method: POST
path: "/api/v3/crm/{integration_id}/custom-object-schemas/{schema_key}"
tags: ["CRM Automation Push"]
---

# Create Custom Object Schema

`POST /api/v3/crm/{integration_id}/custom-object-schemas/{schema_key}`

Create a custom object schema in the user's CRM workspace.

The `schema_key` determines which NationGraph schema to create.
Currently supported schemas:
- **`vendor_contract`**: Creates a NationGraph Vendor Contract custom object
  with fields for vendor, product, ACV, dates, summary, institution,
  and a link back to NationGraph. Associated with CRM companies/accounts.

**HubSpot**: Creates a custom object schema with all properties and
company associations via the schemas API.

**Salesforce**: Creates a custom object via the Tooling API, then adds
each custom field individually, including an Account lookup.

This endpoint is idempotent-safe — call the check endpoint first to
verify the schema doesn't already exist.

## Path parameters

- `integration_id` string, uuid, required — The CRM integration ID
- `schema_key` string, required — Schema identifier (e.g. 'vendor_contract')

## Request body

- CustomObjectSchemaCreateRequest — Request body for creating a custom object schema.
  - `account_layout_name` string, nullable — Account page layout API name to add the related list to. Use the account-layouts endpoint to discover available layouts. If omitted, the related list is not added to any layout.

## Response `201`

Successful Response

- CustomObjectSchemaCreateResponse — Response after creating a custom object schema in the CRM.
  - `schema_key` string, required — The schema key that was created
  - `provider` string, required — CRM provider (hubspot or salesforce)
  - `object_type_id` string, required — Provider-specific object type identifier
  - `fields_created` integer, required — Number of fields created

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/nationgraph/apis/nationgraph-api.md) · [All operations](https://skmtc.dev/nationgraph/apis/nationgraph-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nationgraph/nationgraph-api/revisions/85804e68d86d/schema)
