> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slant.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a related_record

> Create a related record link. The source must belong to book_id and both endpoints must be accessible. Use Household for clients/prospects, and the contact person ID with Person for contact sources.



## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/related_records
openapi: 3.0.1
info:
  title: Slant Public API V1
  version: v1
  description: Public API for creating and managing resources in Slant
  contact:
    name: Slant API Support
    email: api@slant.com
servers:
  - url: https://api.slant.app
security:
  - bearer: []
paths:
  /v1/related_records:
    post:
      tags:
        - Related records
      summary: Create a related_record
      description: >-
        Create a related record link. The source must belong to book_id and both
        endpoints must be accessible. Use Household for clients/prospects, and
        the contact person ID with Person for contact sources.
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
          description: >-
            Unique key to ensure idempotent request handling. If a request with
            the same key was already processed, the original response will be
            returned.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - book_id
                - source_type
                - source_id
                - target_type
                - target_id
              properties:
                book_id:
                  type: string
                source_type:
                  type: string
                  enum:
                    - Household
                    - Person
                    - Business
                    - Trust
                    - User
                source_id:
                  type: string
                target_type:
                  type: string
                  enum:
                    - Household
                    - Person
                    - Business
                    - Trust
                    - User
                    - Contact
                target_id:
                  type: string
                relationship_to_source:
                  type: string
                  nullable: true
                  description: How the source relates to the target
                relationship_to_target:
                  type: string
                  nullable: true
                  description: How the target relates to the source
        required: true
      responses:
        '201':
          description: related_record created
          content:
            application/json:
              schema:
                type: object
                required:
                  - id
                  - book_id
                  - source_type
                  - source_id
                  - target_type
                  - target_id
                properties:
                  id:
                    type: string
                  book_id:
                    type: string
                  source_type:
                    type: string
                  source_id:
                    type: string
                  target_type:
                    type: string
                  target_id:
                    type: string
                  source_label:
                    type: string
                  target_label:
                    type: string
                  relationship_to_source:
                    type: string
                    nullable: true
                  relationship_to_target:
                    type: string
                    nullable: true
                  created_at:
                    type: string
                    format: date-time
                  updated_at:
                    type: string
                    format: date-time
        '401':
          description: unauthorized - missing or invalid token
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - detail
                properties:
                  error:
                    type: string
                    description: Error code
                    enum:
                      - token_missing
                      - token_invalid
                  detail:
                    oneOf:
                      - type: string
                        description: Human-readable error description
                      - type: array
                        items:
                          type: string
                        description: Array of validation error messages
        '422':
          description: unprocessable entity - invalid payload
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - detail
                properties:
                  error:
                    type: string
                    description: Error code
                    enum:
                      - invalid_payload
                      - record_invalid
                      - parameter_missing
                  detail:
                    oneOf:
                      - type: string
                        description: Human-readable error description
                      - type: array
                        items:
                          type: string
                        description: Array of validation error messages
      security:
        - bearer: []
components:
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: OAuth
      description: OAuth 2.0 Bearer Token from Clerk authentication

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.