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

# Create customer relationships

> Creates a relationship between two customers within the same organization



## OpenAPI

````yaml /openAPI/openapi-20240301.json post /customers/{customer_id}/relationships
openapi: 3.1.0
info:
  title: zenskar
  version: 2.0.0
servers:
  - url: https://api.zenskar.com
security:
  - ApiTokenAuth: []
    OrganisationAuth: []
paths:
  /customers/{customer_id}/relationships:
    post:
      tags:
        - Customers
      summary: Create customer relationships
      description: >-
        Creates a relationship between two customers within the same
        organization
      operationId: Create-customer-relationships
      parameters:
        - name: customer_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Customer Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCustomerRelationshipRequestSchema'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCustomerRelationshipResponseSchema'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CreateCustomerRelationshipRequestSchema:
      properties:
        related_customer_id:
          type: string
          format: uuid
          title: Related Customer Id
          description: Related Customer Id
        relationship_type_id:
          type: string
          format: uuid
          title: Relationship Type Id
          description: Relationship Type Id
      type: object
      required:
        - related_customer_id
        - relationship_type_id
      title: CreateCustomerRelationshipRequestSchema
      description: Create Customer Relationship Request Schema
    CreateCustomerRelationshipResponseSchema:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: Relationship Id
        customer_id:
          type: string
          format: uuid
          title: Customer Id
          description: Customer Id
        related_customer_id:
          type: string
          format: uuid
          title: Related Customer Id
          description: Related Customer Id
        relationship_type_id:
          type: string
          format: uuid
          title: Relationship Type Id
          description: Relationship Type Id
      type: object
      required:
        - id
        - customer_id
        - related_customer_id
        - relationship_type_id
      title: CreateCustomerRelationshipResponseSchema
      description: Create Customer Relationship Response Schema
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiTokenAuth:
      type: apiKey
      in: header
      name: x-api-key
      x-default: <your-api-key>
    OrganisationAuth:
      type: apiKey
      in: header
      name: organisation
      x-default: <your-organisation-id>

````