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

# Network Mapper

> Map connections across the partner network. Partner permission required.

<Warning>
  **Partner permission required.** Calls from an API key not tied to a team with the partner permission in Stripe return **403 Forbidden**.
</Warning>

The Network Mapper (Partner) endpoint maps connections across the partner network. It is only available to teams with partner permissions.

For team-owned connections, use the free [Relationships](/docs/endpoints/v3/relationships) endpoint instead.

## Pricing

| Response           | Cost                      |
| ------------------ | ------------------------- |
| Non-empty response | **1 credit per response** |
| Empty response     | Free                      |

Usage is reported under [`GET /credits/usage`](/docs/api-reference/credits-usage).

## Permissions

| Caller                                                   | Behavior                  |
| -------------------------------------------------------- | ------------------------- |
| API key tied to a team with partner permission in Stripe | Endpoint available        |
| Any other API key                                        | Returns **403 Forbidden** |

If you believe your team should have partner access, contact [support@theswarm.com](mailto:support@theswarm.com).

## Responses

In addition to the standard error responses, this endpoint may return:

* **`402 Payment Required`** — your team's API credit allowance has been exceeded. Top up or upgrade your plan to continue. See [Credits & Usage](/docs/api-reference/credits-usage).

## Response schema

See [Models > Network Mapper Partner](/docs/intelligence/network-mapper).

## Task status

Long-running queries can be polled with the [Network Mapper Status](/docs/endpoints/v3/network-mapper-status) endpoint.


## OpenAPI

````yaml openapi.json POST /v3/network-mapper
openapi: 3.1.0
info:
  title: Swarm API
  version: 1.0.0
  contact:
    name: The Swarm
    url: https://theswarm.com
    email: hello@theswarm.com
servers:
  - url: https://bee.theswarm.com
security:
  - ApiKeyAuth: []
tags:
  - name: profiles
    description: Operations related to profiles
  - name: companies
    description: Operations related to companies
  - name: teams
    description: Operations for managing teams and connectors
  - name: social
    description: Operations related to social media posts and interactions
  - name: mcp
    description: Model Context Protocol endpoint for AI assistant integrations
  - name: credits
    description: Operations related to credit usage
  - name: network-mapper
    description: Operations for mapping connections and relationships across your network
paths:
  /v3/network-mapper:
    post:
      tags:
        - network-mapper
      summary: Network Mapper (Partner) — v3
      description: >-
        Partner-permission endpoint for mapping connections across the partner
        network. Calls from API keys not tied to a team with the partner
        permission in Stripe return 403 Forbidden. Costs 1 credit per non-empty
        response.
      operationId: postPartnerNetworkV3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  type: object
                  description: >-
                    Search query in the [ElasticSearch Query
                    DSL](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html)
                    format. [Find mapping
                    here](https://docs.theswarm.com/docs/mappings/profile-v2)
                mapping_company_website:
                  type: string
                  description: Website of the company to map network for
                callback_url:
                  type: string
                  description: URL to call when async mapping completes
              required:
                - query
                - mapping_company_website
      responses:
        '200':
          description: Mapping data returned immediately
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/NetworkMapperItem'
                  count:
                    type: integer
                  total_count:
                    type: integer
                required:
                  - items
                  - count
                  - total_count
        '202':
          description: >-
            Mapping task started; poll /v3/network-mapper/status with the
            returned task_id
          content:
            application/json:
              schema:
                type: object
                properties:
                  task_id:
                    type: string
                    description: Task ID to poll for results
                required:
                  - task_id
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '402':
          $ref: '#/components/responses/402'
        '403':
          description: >-
            Forbidden — the API key is not tied to a team with partner
            permission.
        '404':
          description: Company not found for the given mapping_company_website
        5XX:
          $ref: '#/components/responses/5XX'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    NetworkMapperItem:
      type: object
      properties:
        profile:
          $ref: '#/components/schemas/NetworkMapperProfile'
        connections:
          type: array
          items:
            $ref: '#/components/schemas/NetworkMapperConnection'
    NetworkMapperProfile:
      type: object
      properties:
        id:
          type: string
          format: uuid
        full_name:
          type: string
        current_title:
          type: string
        linkedin_url:
          type: string
        work_email:
          type: string
        current_company_name:
          type: string
        current_company_website:
          type: string
      required:
        - full_name
    NetworkMapperConnection:
      type: object
      properties:
        connector_id:
          type: string
          format: uuid
        connector_name:
          type: string
        connector_linkedin_url:
          type: string
        connector_current_title:
          type: string
        connector_current_company_name:
          type: string
        connection_strength_normalized:
          type: integer
        connection_strength:
          type: number
          format: float
        manual_strength:
          type: number
          format: float
        sources:
          type: array
          items:
            $ref: '#/components/schemas/NetworkMapperConnectionSource'
    ErrorResponse:
      type: object
      properties:
        code:
          description: Error status code
          type: integer
        errors:
          type: array
          items:
            type:
              - string
              - object
      required:
        - code
    NetworkMapperConnectionSource:
      type: object
      properties:
        origin:
          type: string
          enum:
            - linkedin_connection
            - work_overlap
            - email_contact
            - calendar_events
            - manual_import
            - education_overlap
            - shared_investor
        shared_company:
          type: string
          description: Name of the shared company from work overlap
        shared_company_id:
          type: string
          format: uuid
          description: ID of the shared company from work overlap
        shared_company_website:
          type: string
          description: Website of the shared company from work overlap
        shared_company_linkedin_slug:
          type: string
          description: Linkedin Slug of the shared company from work overlap
        overlap_start_date:
          type: string
          description: Start Date of work overlap
        overlap_end_date:
          type: string
          description: End Date of work overlap
        overlap_duration_months:
          type: integer
          description: Months Duration of work overlap
        shared_school:
          type: string
          description: Name of school from education overlap
        shared_major:
          type: string
          description: Name of major from education overlap
        graduation_year:
          type: string
          description: Graduation year from education overlap
        investor:
          type: string
          description: Name of common investor from investor overlap
        portfolio_company:
          type: string
          description: Name of portfolio company from investor overlap
      required:
        - origin
      description: Source of connection, only properties that describe given source are set
  responses:
    '400':
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    '401':
      description: Unauthorized
    '402':
      description: Payment required - the team's API credit allowance has been exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    5XX:
      description: Unexpected error
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````