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

# List relations of an entity

> Lists the relations between a threat intelligence entity and other entities, optionally restricted to related entities of given types and to relations of given types, such as `uses` or `targets`. Each relation gives its two entities, its type and its sources. To paginate, pass the `next` value of a response as `from` in the following request, and stop when `next` is `null`. `404 NOT_FOUND` is returned when no entity has this ID, or when it is an application, industry or organization entity and the industries and locations feature is not enabled for the caller; without that feature, relations with application, industry and organization entities are left out.

> [!NOTE]
>
> Access to Flare CTI is required for this feature.
> Please contact your Customer Success Manager for more details.


## OpenAPI

````yaml firework-v4-openapi post /firework/v4/entities/{id}/relations
openapi: 3.1.0
info:
  title: Firework API
  version: v4
servers:
  - url: https://api.flare.io
security:
  - BearerAuth: []
tags:
  - name: Audit Logs
    description: Audit trail of actions performed in the platform.
  - name: Credentials
    description: >-
      Leaked credentials: search across all sources or within a tenant, and
      remediate or ignore them.
  - name: Entities
    description: >-
      Threat intelligence entities such as actors, chat channels, forum threads
      and domains, and the relations between them.
  - name: Events
    description: >-
      Events collected by Flare: global search, tenant and identifier feeds,
      event details, actions and saved feed views.
  - name: Identifiers
    description: >-
      Identifiers are the assets a tenant monitors, such as domains, keywords
      and email addresses. Includes recommendations and authorization of
      sensitive identifiers.
  - name: Matching Policies
    description: >-
      Matching policies refine which events match identifiers. Manage policies
      and their assignment to identifiers.
  - name: Sandbox
    description: File uploads and their sandbox analysis.
  - name: Threat Flow
    description: >-
      Threat Flow intelligence requests, generated reports and conversation
      summaries.
paths:
  /firework/v4/entities/{id}/relations:
    post:
      tags:
        - Entities
      summary: List relations of an entity
      description: >-
        Lists the relations between a threat intelligence entity and other
        entities, optionally restricted to related entities of given types and
        to relations of given types, such as `uses` or `targets`. Each relation
        gives its two entities, its type and its sources. To paginate, pass the
        `next` value of a response as `from` in the following request, and stop
        when `next` is `null`. `404 NOT_FOUND` is returned when no entity has
        this ID, or when it is an application, industry or organization entity
        and the industries and locations feature is not enabled for the caller;
        without that feature, relations with application, industry and
        organization entities are left out.
      operationId: list_entity_relations_entities__id__relations_post
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: >-
              Unique identifier (UUID) of the entity, as returned in
              `metadata.id` by the entity search.
            title: Id
          description: >-
            Unique identifier (UUID) of the entity, as returned in `metadata.id`
            by the entity search.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EntityRelationsSearchParamsPayload'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PaginatedResults_EntityRelationshipResponse_str_
        '401':
          description: UNAUTHORIZED
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    properties:
                      code:
                        type: string
                        enum:
                          - UNAUTHORIZED
                      data:
                        anyOf:
                          - additionalProperties: true
                            type: object
                          - type: 'null'
                        title: Data
                      message:
                        anyOf:
                          - type: string
                          - items: {}
                            type: array
                          - type: 'null'
                        title: Message
                    required:
                      - code
                      - data
                      - message
                    title: HTTPError
                    type: object
                required:
                  - error
        '404':
          description: NOT_FOUND
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    properties:
                      code:
                        type: string
                        enum:
                          - NOT_FOUND
                      data:
                        anyOf:
                          - additionalProperties: true
                            type: object
                          - type: 'null'
                        title: Data
                      message:
                        anyOf:
                          - type: string
                          - items: {}
                            type: array
                          - type: 'null'
                        title: Message
                    required:
                      - code
                      - data
                      - message
                    title: HTTPError
                    type: object
                required:
                  - error
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    EntityRelationsSearchParamsPayload:
      properties:
        filters:
          $ref: '#/components/schemas/EntityRelationsSearchFilters'
          description: Filters applied to the relations.
        from:
          anyOf:
            - anyOf:
                - type: string
                - type: 'null'
              description: >-
                Pagination cursor: pass the `next` value of the previous
                response to get the following page, omit it for the first page.
            - type: 'null'
          title: From
          description: Cursor to start from; the `next` value of a response.
        size:
          type: integer
          maximum: 1000
          title: Size
          description: Maximum number of items to return.
          default: 10
      type: object
      title: EntityRelationsSearchParamsPayload
    PaginatedResults_EntityRelationshipResponse_str_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/EntityRelationshipResponse'
          type: array
          title: Items
          description: Results of the current page.
        next:
          anyOf:
            - type: string
            - type: 'null'
          title: Next
          description: >-
            Cursor to send in the next request to continue after this page, or
            `null` when no further page is available.
      type: object
      required:
        - items
        - next
      title: PaginatedResults[EntityRelationshipResponse, str]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    EntityRelationsSearchFilters:
      properties:
        types:
          anyOf:
            - items:
                $ref: '#/components/schemas/EntityType'
              type: array
            - type: 'null'
          title: Types
          description: >-
            Only return relations with entities of these types; all available
            types when omitted or empty.
        relation_types:
          anyOf:
            - items:
                $ref: '#/components/schemas/AssetRelationType'
              type: array
            - type: 'null'
          title: Relation Types
          description: >-
            Only return relations of these types (for example `uses` or
            `targets`); all relation types when omitted or empty.
      type: object
      title: EntityRelationsSearchFilters
    EntityRelationshipResponse:
      properties:
        source_entity:
          $ref: '#/components/schemas/EntityData'
          description: Entity the relation originates from.
        target_entity:
          $ref: '#/components/schemas/EntityData'
          description: Entity the relation points to.
        relation_type:
          $ref: '#/components/schemas/AssetRelationType'
          description: Type of the relation, read from `source_entity` to `target_entity`.
        sources:
          items:
            $ref: '#/components/schemas/EntitySourceAPIResponse'
          type: array
          title: Sources
          description: Sources of the relation.
        modified_at:
          type: string
          format: date-time
          title: Modified At
          description: Time the relation was last modified.
        valid_from:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Valid From
          description: Start of the period during which the relation is valid, when known.
        valid_until:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Valid Until
          description: End of the period during which the relation is valid, when known.
      type: object
      required:
        - source_entity
        - target_entity
        - relation_type
        - sources
        - modified_at
      title: EntityRelationshipResponse
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    EntityType:
      type: string
      enum:
        - attack_pattern
        - actor
        - application
        - campaign
        - chat_channel
        - external_report
        - forum_thread
        - identity
        - indicator
        - industry
        - infrastructure
        - domain
        - location
        - malware
        - organization
        - secret
        - threat_actor
        - threat_actor_group
        - tool
        - vulnerability
      title: EntityType
    AssetRelationType:
      type: string
      enum:
        - analysis_of
        - attributed_to
        - authored_by
        - based_on
        - beacons_to
        - characterizes
        - commits_with
        - communicates_with
        - compromises
        - consists_of
        - contributed_to
        - controls
        - delivers
        - downloads
        - drops
        - duplicate_of
        - dynamic_analysis_of
        - exfiltrates_to
        - exploits
        - found_from
        - has
        - has_account_on
        - has_favicon
        - has_screenshot
        - hosts
        - impersonates
        - indicates
        - investigates
        - links_to_azure_tenant
        - located_at
        - looks_like
        - mentioned_in
        - mitigates
        - operates_in
        - originates_from
        - owns
        - related_to
        - remediates
        - resolves_to
        - revoked_by
        - static_analysis_of
        - subdomain_of
        - subtechnique_of
        - targets
        - uses
        - variant_of
      title: AssetRelationType
    EntityData:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier (UUID) of the entity.
        entity_type:
          $ref: '#/components/schemas/EntityType'
          description: Type of the entity.
        name:
          type: string
          title: Name
          description: Name of the entity.
        confidence:
          type: integer
          title: Confidence
          description: Confidence score of the entity, `0` when it has none.
      type: object
      required:
        - id
        - entity_type
        - name
        - confidence
      title: EntityData
    EntitySourceAPIResponse:
      properties:
        id:
          type: string
          title: Id
          description: Identifier of the source.
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Display name of the source, `null` when it could not be resolved.
        confidence:
          anyOf:
            - type: integer
            - type: 'null'
          title: Confidence
          description: Confidence score of the source, when known.
      type: object
      required:
        - id
      title: EntitySourceAPIResponse
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

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