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

# Link two entities in the KYB graph

> Create one ownership edge pointing from the owner to the owned entity.



## OpenAPI

````yaml /openapi.json post /api/v1/kyb/b2b/kyb/relationships
openapi: 3.1.0
info:
  title: HEVN API
  description: Backend API for HEVN mobile neobank
  version: 0.1.2
servers: []
security: []
paths:
  /api/v1/kyb/b2b/kyb/relationships:
    post:
      tags:
        - B2B
        - kyb
      summary: Link two entities in the KYB graph
      description: Create one ownership edge pointing from the owner to the owned entity.
      operationId: >-
        create_kyb_relationship_package_alias_api_v1_kyb_b2b_kyb_relationships_post
      parameters:
        - name: x-api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EntityRelationshipDraftWrite'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EntityRelationshipDraftData'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    EntityRelationshipDraftWrite:
      properties:
        ownershipPercentage:
          anyOf:
            - type: number
              maximum: 100
              exclusiveMinimum: 0
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Ownershippercentage
        id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Id
        sourceEntityId:
          type: string
          format: uuid
          title: Sourceentityid
        targetEntityId:
          type: string
          format: uuid
          title: Targetentityid
        hasControl:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Hascontrol
        isDirector:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Isdirector
        isSigner:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Issigner
        title:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Title
          description: Office held in the target company, for example 'Director'.
      type: object
      required:
        - sourceEntityId
        - targetEntityId
      title: EntityRelationshipDraftWrite
      description: Create or partially update a relationship in the KYB graph.
    EntityRelationshipDraftData:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        sourceEntityId:
          type: string
          format: uuid
          title: Sourceentityid
        targetEntityId:
          type: string
          format: uuid
          title: Targetentityid
        ownershipPercentage:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Ownershippercentage
        hasControl:
          type: boolean
          title: Hascontrol
        isDirector:
          type: boolean
          title: Isdirector
        isSigner:
          type: boolean
          title: Issigner
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        status:
          $ref: '#/components/schemas/EntityRelationshipStatus'
          default: active
        verifications:
          items:
            $ref: '#/components/schemas/EntityProviderVerificationData'
          type: array
          title: Verifications
      type: object
      required:
        - id
        - sourceEntityId
        - targetEntityId
        - hasControl
        - isDirector
        - isSigner
      title: EntityRelationshipDraftData
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    EntityRelationshipStatus:
      type: string
      enum:
        - pending
        - active
        - revoked
      title: EntityRelationshipStatus
      description: Consent state for a KYB ownership or authority relationship.
    EntityProviderVerificationData:
      properties:
        id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Id
        provider:
          $ref: '#/components/schemas/FiatProvider'
        externalId:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalid
        status:
          type: string
          title: Status
        kycLink:
          anyOf:
            - type: string
            - type: 'null'
          title: Kyclink
        kycLinkState:
          anyOf:
            - type: string
            - type: 'null'
          title: Kyclinkstate
        kycLinkExpiresAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Kyclinkexpiresat
      type: object
      required:
        - provider
        - status
      title: EntityProviderVerificationData
    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
    FiatProvider:
      type: string
      enum:
        - swipelux
        - align
        - dakota
        - mcp
        - wirex
        - conduit_fiat
        - conduit_crypto
        - due
      title: FiatProvider
      description: Supported fiat payment providers.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````