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

# Retrieve relationships

## Scope and credits

| Requirement     | Value                 |
| --------------- | --------------------- |
| Required scopes | `read:relationships`  |
| Credits         | 3 credits per request |

## IOC relationship behavior

`/v2/relationships` accepts IOC subjects with concrete `entity_type` values: `ip`, `domain`, `url`, `hash`, or `email`.

For IOC subjects, request `relationship_types: ["ioc"]` to retrieve related indicators from event-correlation context. You may also request `actor`, `campaign`, or `malware` relationships for attribution-style context, `sector` relationships for targeted industries, and `country` relationships for targeted countries when available.

Do not use `ioc` as a subject `entity_type`; use the concrete observable type.


## OpenAPI

````yaml POST /v2/relationships
openapi: 3.1.0
info:
  description: Deterministic, evidence-backed threat assessment API for machine consumers.
  title: Threat Investigator API v2
  version: 0.1.0
servers: []
security: []
paths:
  /v2/relationships:
    post:
      tags:
        - Relationships
      summary: Bounded relationship retrieval for canonical entities
      operationId: relationships_v2_relationships_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RelationshipRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RelationshipResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - ApiKeyAuth: []
components:
  schemas:
    RelationshipRequest:
      additionalProperties: false
      properties:
        agent_context:
          anyOf:
            - $ref: '#/components/schemas/AgentContext'
            - type: 'null'
        context:
          anyOf:
            - $ref: '#/components/schemas/ClaimEvidenceContext'
            - type: 'null'
        cursor:
          anyOf:
            - maxLength: 512
              type: string
            - type: 'null'
          title: Cursor
        expected_types:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Expected Types
        max_results:
          default: 10
          maximum: 50
          minimum: 1
          title: Max Results
          type: integer
        query:
          anyOf:
            - maxLength: 1024
              type: string
            - type: 'null'
          title: Query
        relationship_types:
          anyOf:
            - items:
                enum:
                  - actor
                  - campaign
                  - malware
                  - sector
                  - country
                  - ioc
                  - technique
                type: string
              type: array
            - type: 'null'
          title: Relationship Types
        resolution:
          anyOf:
            - $ref: '#/components/schemas/ResolutionOptions'
            - type: 'null'
        subject:
          anyOf:
            - $ref: '#/components/schemas/AssessmentSubject'
            - type: 'null'
      title: RelationshipRequest
      type: object
    RelationshipResponse:
      properties:
        input_mode:
          enum:
            - subject
            - query
          title: Input Mode
          type: string
        items:
          items:
            $ref: '#/components/schemas/RelationshipItem'
          title: Items
          type: array
        max_results:
          title: Max Results
          type: integer
        metadata:
          additionalProperties: true
          title: Metadata
          type: object
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
        relationship_types:
          items:
            enum:
              - actor
              - campaign
              - malware
              - sector
              - country
              - ioc
              - technique
            type: string
          title: Relationship Types
          type: array
        resolution:
          $ref: '#/components/schemas/ResolutionResult'
        status:
          enum:
            - ok
            - no_relationships
          title: Status
          type: string
        subject:
          anyOf:
            - $ref: '#/components/schemas/AssessmentSubject'
            - type: 'null'
      required:
        - status
        - input_mode
        - resolution
        - relationship_types
        - max_results
        - items
        - metadata
      title: RelationshipResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    AgentContext:
      additionalProperties: false
      properties:
        client:
          anyOf:
            - $ref: '#/components/schemas/AgentClientInfo'
            - type: 'null'
        constraints:
          anyOf:
            - $ref: '#/components/schemas/AgentConstraints'
            - type: 'null'
        objective:
          maxLength: 280
          minLength: 8
          title: Objective
          type: string
        parent_step_id:
          anyOf:
            - maxLength: 64
              type: string
            - type: 'null'
          title: Parent Step Id
        priority:
          anyOf:
            - enum:
                - low
                - normal
                - high
                - urgent
              type: string
            - type: 'null'
          title: Priority
        requested_outcome:
          maxLength: 280
          minLength: 3
          title: Requested Outcome
          type: string
        run_id:
          maxLength: 64
          minLength: 4
          title: Run Id
          type: string
        step_id:
          maxLength: 64
          minLength: 1
          title: Step Id
          type: string
        tags:
          anyOf:
            - items:
                type: string
              maxItems: 12
              type: array
            - type: 'null'
          title: Tags
        workflow_stage:
          enum:
            - resolve
            - evidence
            - relationships
            - assessment
            - hunt
            - hydrate
            - batch
            - finalize
            - other
          title: Workflow Stage
          type: string
      required:
        - objective
        - requested_outcome
        - workflow_stage
        - run_id
        - step_id
      title: AgentContext
      type: object
    ClaimEvidenceContext:
      additionalProperties: false
      properties:
        sector:
          anyOf:
            - type: string
            - type: 'null'
          title: Sector
      title: ClaimEvidenceContext
      type: object
    ResolutionOptions:
      additionalProperties: false
      properties:
        include_aliases:
          default: false
          title: Include Aliases
          type: boolean
        include_metadata:
          default: false
          title: Include Metadata
          type: boolean
        max_results:
          default: 5
          maximum: 25
          minimum: 1
          title: Max Results
          type: integer
      title: ResolutionOptions
      type: object
    AssessmentSubject:
      additionalProperties: false
      properties:
        canonical_id:
          title: Canonical Id
          type: string
        canonical_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Canonical Name
        entity_type:
          title: Entity Type
          type: string
      required:
        - entity_type
        - canonical_id
      title: AssessmentSubject
      type: object
    RelationshipItem:
      properties:
        canonical_id:
          title: Canonical Id
          type: string
        canonical_name:
          title: Canonical Name
          type: string
        evidence_count:
          title: Evidence Count
          type: integer
        last_seen:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Seen
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
        relationship_type:
          enum:
            - actor
            - campaign
            - malware
            - sector
            - country
            - ioc
            - technique
          title: Relationship Type
          type: string
        score:
          title: Score
          type: number
        target_entity_type:
          title: Target Entity Type
          type: string
      required:
        - relationship_type
        - target_entity_type
        - canonical_id
        - canonical_name
        - score
        - evidence_count
      title: RelationshipItem
      type: object
    ResolutionResult:
      properties:
        candidates:
          items:
            $ref: '#/components/schemas/EntityResolutionCandidate'
          title: Candidates
          type: array
        canonical_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Canonical Id
        canonical_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Canonical Name
        entity_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Entity Type
        input_mode:
          anyOf:
            - enum:
                - subject
                - query
              type: string
            - type: 'null'
          title: Input Mode
        resolution_confidence:
          anyOf:
            - type: number
            - type: 'null'
          title: Resolution Confidence
        status:
          enum:
            - resolved
            - ambiguous
            - not_found
            - not_applicable
          title: Status
          type: string
      required:
        - status
      title: ResolutionResult
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    AgentClientInfo:
      additionalProperties: false
      properties:
        agent_name:
          anyOf:
            - maxLength: 64
              type: string
            - type: 'null'
          title: Agent Name
        agent_version:
          anyOf:
            - maxLength: 32
              type: string
            - type: 'null'
          title: Agent Version
        framework:
          anyOf:
            - maxLength: 32
              type: string
            - type: 'null'
          title: Framework
      title: AgentClientInfo
      type: object
    AgentConstraints:
      additionalProperties: false
      properties:
        latency_budget_ms:
          anyOf:
            - maximum: 30000
              minimum: 50
              type: integer
            - type: 'null'
          title: Latency Budget Ms
        max_results_budget:
          anyOf:
            - maximum: 200
              minimum: 1
              type: integer
            - type: 'null'
          title: Max Results Budget
        min_resolution_confidence:
          anyOf:
            - maximum: 1
              minimum: 0
              type: number
            - type: 'null'
          title: Min Resolution Confidence
        strict_mode:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Strict Mode
      title: AgentConstraints
      type: object
    EntityResolutionCandidate:
      properties:
        aliases:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Aliases
        canonical_id:
          title: Canonical Id
          type: string
        canonical_name:
          title: Canonical Name
          type: string
        entity_type:
          title: Entity Type
          type: string
        match_type:
          title: Match Type
          type: string
        matched_on:
          anyOf:
            - type: string
            - type: 'null'
          title: Matched On
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
        score:
          title: Score
          type: number
      required:
        - entity_type
        - canonical_id
        - canonical_name
        - match_type
        - score
      title: EntityResolutionCandidate
      type: object
  securitySchemes:
    ApiKeyAuth:
      description: ApiKey <key_id>:<secret>
      in: header
      name: Authorization
      type: apiKey

````