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

# Publish a market

> Publish discovered companies and trigger comprehensive market analysis and enrichment.

## Overview

This endpoint publishes your discovered companies and triggers comprehensive analysis including financial data, ESG
metrics, news analysis, and competitive insights.

> [!NOTE]
>
> **Workflow Step**: This is Step 4 of the [Discovery
> Workflow](https://docs.forestreet.com/api-reference/guides/platform-discovery.md#phase-4-market-analysis--publishing).

> [!WARNING]
>
> Important: This is an asynchronous process that can take 45-60 minutes to complete. Use the status endpoint to monitor
> progress

## Usage

The endpoint accepts pipeline configuration options to control which analysis steps are performed:

* **Pipeline Choices**: Configure which analysis steps to run
* **Response**: Job IDs for monitoring the publishing process

> [!TIP]
>
> **Pipeline Configuration**: Choose analysis steps based on your research goals. Each step adds valuable insights but
> increases processing time.

## Pipeline Steps

The publishing process includes several analysis steps:

* **Reverse Geocoding**: Convert company addresses to geographic coordinates
* **DUNS Mapper**: Map companies to DUNS numbers for enhanced data
* **People**: Extract and analyse key personnel information
* **News**: Gather and analyse recent news and media coverage
* **ESG**: Collect Environmental, Social, and Governance data
* **Momentum Score**: Calculate market momentum and sentiment scores
* **Market Radar**: Generate competitive landscape analysis
* **Topic Analysis**: Identify key themes and topics in the market
* **Phrase Explorer**: Analyse market terminology and language patterns
* **Feature Map**: Generate visual feature maps for market insights
* **Publish Email**: Send notification emails upon completion

## Monitoring Progress

After starting the publishing process, you can monitor progress using the same status endpoint:

```bash theme={null}
GET /v2/markets/{marketId}/services/publish/status
```

## Accessing Published Data

Once publishing is complete, you can access your market data through various endpoints:

```bash theme={null}
  # Get companies in the market
  GET /v2/markets/12345/companies

  # Get ESG data
  GET /v2/markets/12345/esg
```

## Best Practices

> [!TIP]
>
> **For Better Results**: - Ensure discovery is fully completed before publishing - Choose pipeline steps relevant to
> your research goals - Consider the review step for quality control

> [!WARNING]
>
> **Important Notes**: - Only one publishing process can run per market at a time - The process cannot be interrupted
> once started


## OpenAPI

````yaml post /v2/discovery/{marketId}/publish
openapi: 3.0.0
info:
  title: Forestreet API
  version: 1.0.0
  description: API documentation for Forestreet API
servers:
  - url: http://localhost:4000
    description: Local server
  - url: https://rest-dev.forestreet.com
    description: Development server
security:
  - apiKeyAuth: []
  - bearerAuth: []
  - sessionIdQuery: []
tags: []
paths:
  /v2/discovery/{marketId}/publish:
    post:
      tags:
        - Discovery
      summary: Publish a market
      description: >-
        Publish discovered companies and trigger comprehensive market analysis
        and enrichment.
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            description: Unique identifier for the market study.
          required: true
          description: Unique identifier for the market study.
          name: marketId
          in: path
        - schema:
            type: number
            nullable: true
            description: Unique identifier for the team.
          required: false
          description: Unique identifier for the team.
          name: teamId
          in: query
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - type: object
                  properties:
                    pipelineChoices:
                      type: object
                      properties:
                        skipDiscoveryReview:
                          type: boolean
                          default: false
                          description: Skip the discovery review step.
                        runReverseGeocoding:
                          type: boolean
                          default: true
                          description: Run reverse geocoding step.
                        runDunsMapper:
                          type: boolean
                          default: true
                          description: Run DUNS mapper step.
                        runPeople:
                          type: boolean
                          default: true
                          description: Run people step.
                        runNews:
                          type: boolean
                          default: true
                          description: Run news step.
                        runEsg:
                          type: boolean
                          default: true
                          description: Run ESG step.
                        runMomentumScore:
                          type: boolean
                          default: true
                          description: Run momentum score step.
                        runMarketRadar:
                          type: boolean
                          default: false
                          description: Run market radar step.
                        runTopicAnalysis:
                          type: boolean
                          default: true
                          description: Run topic analysis step.
                        runPhraseExplorer:
                          type: boolean
                          default: true
                          description: Run phrase explorer step.
                        runGenerateFeatureMap:
                          type: boolean
                          default: true
                          description: Run generate feature map step.
                        sendPublishEmail:
                          type: boolean
                          default: true
                          description: Run send publish email step.
                - nullable: true
      responses:
        '200':
          description: Publish a market in discovery workflow response
          content:
            application/json:
              examples:
                publish-success:
                  summary: Publish Success Response
                  description: Example response when market is successfully published
                  value:
                    metadata:
                      marketId: 12345
                    data:
                      jobIds:
                        - >-
                          publish-platform::publish-study::2026-01-07T11:26:50.406Z::04cda5
                        - >-
                          publish-platform::python-scrape::2026-01-07T11:26:50.406Z::b12a9f
                        - >-
                          publish-platform::python-web-traffic::2026-01-07T11:26:50.406Z::c07be2
              schema:
                type: object
                properties:
                  metadata:
                    type: object
                    properties:
                      marketId:
                        type: number
                        description: Unique identifier for the market study.
                    required:
                      - marketId
                  data:
                    type: object
                    properties:
                      jobIds:
                        type: array
                        items:
                          type: string
                          description: >-
                            Unique identifier for the job associated with the
                            study or agent in the format
                            '<workflowName/execution_mode>::<isoUtc>::<token>'.
                        description: List of publish job IDs associated with the market.
                    required:
                      - jobIds
                required:
                  - metadata
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              examples:
                INVALID_INPUT:
                  value:
                    success: false
                    errorCode: INVALID_INPUT
                    message: Bad Request
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  errorCode:
                    type: string
                    enum:
                      - USER_NOT_CONFIRMED
                      - INVALID_CREDENTIALS
                      - INCOMPLETE_CREDENTIALS
                      - INVALID_SESSION_TOKEN
                      - FORCE_CHANGE_PASSWORD
                      - PASSWORD_RESET_REQUIRED
                      - PASSWORD_EXPIRED
                      - CODE_EXPIRED
                      - SESSION_EXPIRED
                      - UNAUTHORISED
                      - AUTHENTICATOR_ERROR
                      - SSO_ACCOUNT
                      - FORBIDDEN
                      - METHOD_NOT_ALLOWED
                      - INVALID_INPUT
                      - PATH_VALIDATION_FAILED
                      - QUERY_VALIDATION_FAILED
                      - BODY_VALIDATION_FAILED
                      - RESPONSE_VALIDATION_FAILED
                      - INVALID_OR_MALFORMED_JSON
                      - INTERNAL_SERVER_ERROR
                      - CONFIGURATION_ERROR
                      - SERVICE_UNAVAILABLE
                      - NOT_FOUND
                      - CONFLICT
                      - LIMIT_EXCEEDED
                      - REVIEW_ALREADY_PENDING
                      - REVIEW_NOT_PENDING
                      - REVIEW_PENDING
                      - REVIEW_INSUFFICIENT_DOMAINS
                      - QUOTA_EXCEEDED
                      - UNSUPPORTED_ENDPOINT_VERSION
                      - ENDPOINT_NOT_FOUND
                      - ENDPOINT_ALREADY_EXISTS
                  message:
                    type: string
                  detail:
                    type: object
                    additionalProperties:
                      nullable: true
                required:
                  - success
                  - errorCode
        '403':
          description: Forbidden
          content:
            application/json:
              examples:
                FORBIDDEN:
                  value:
                    success: false
                    errorCode: FORBIDDEN
                    message: Forbidden
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  errorCode:
                    type: string
                    enum:
                      - USER_NOT_CONFIRMED
                      - INVALID_CREDENTIALS
                      - INCOMPLETE_CREDENTIALS
                      - INVALID_SESSION_TOKEN
                      - FORCE_CHANGE_PASSWORD
                      - PASSWORD_RESET_REQUIRED
                      - PASSWORD_EXPIRED
                      - CODE_EXPIRED
                      - SESSION_EXPIRED
                      - UNAUTHORISED
                      - AUTHENTICATOR_ERROR
                      - SSO_ACCOUNT
                      - FORBIDDEN
                      - METHOD_NOT_ALLOWED
                      - INVALID_INPUT
                      - PATH_VALIDATION_FAILED
                      - QUERY_VALIDATION_FAILED
                      - BODY_VALIDATION_FAILED
                      - RESPONSE_VALIDATION_FAILED
                      - INVALID_OR_MALFORMED_JSON
                      - INTERNAL_SERVER_ERROR
                      - CONFIGURATION_ERROR
                      - SERVICE_UNAVAILABLE
                      - NOT_FOUND
                      - CONFLICT
                      - LIMIT_EXCEEDED
                      - REVIEW_ALREADY_PENDING
                      - REVIEW_NOT_PENDING
                      - REVIEW_PENDING
                      - REVIEW_INSUFFICIENT_DOMAINS
                      - QUOTA_EXCEEDED
                      - UNSUPPORTED_ENDPOINT_VERSION
                      - ENDPOINT_NOT_FOUND
                      - ENDPOINT_ALREADY_EXISTS
                  message:
                    type: string
                  detail:
                    type: object
                    additionalProperties:
                      nullable: true
                required:
                  - success
                  - errorCode
        '404':
          description: Not Found
          content:
            application/json:
              examples:
                NOT_FOUND:
                  value:
                    success: false
                    errorCode: NOT_FOUND
                    message: Not Found
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  errorCode:
                    type: string
                    enum:
                      - USER_NOT_CONFIRMED
                      - INVALID_CREDENTIALS
                      - INCOMPLETE_CREDENTIALS
                      - INVALID_SESSION_TOKEN
                      - FORCE_CHANGE_PASSWORD
                      - PASSWORD_RESET_REQUIRED
                      - PASSWORD_EXPIRED
                      - CODE_EXPIRED
                      - SESSION_EXPIRED
                      - UNAUTHORISED
                      - AUTHENTICATOR_ERROR
                      - SSO_ACCOUNT
                      - FORBIDDEN
                      - METHOD_NOT_ALLOWED
                      - INVALID_INPUT
                      - PATH_VALIDATION_FAILED
                      - QUERY_VALIDATION_FAILED
                      - BODY_VALIDATION_FAILED
                      - RESPONSE_VALIDATION_FAILED
                      - INVALID_OR_MALFORMED_JSON
                      - INTERNAL_SERVER_ERROR
                      - CONFIGURATION_ERROR
                      - SERVICE_UNAVAILABLE
                      - NOT_FOUND
                      - CONFLICT
                      - LIMIT_EXCEEDED
                      - REVIEW_ALREADY_PENDING
                      - REVIEW_NOT_PENDING
                      - REVIEW_PENDING
                      - REVIEW_INSUFFICIENT_DOMAINS
                      - QUOTA_EXCEEDED
                      - UNSUPPORTED_ENDPOINT_VERSION
                      - ENDPOINT_NOT_FOUND
                      - ENDPOINT_ALREADY_EXISTS
                  message:
                    type: string
                  detail:
                    type: object
                    additionalProperties:
                      nullable: true
                required:
                  - success
                  - errorCode
        '500':
          description: Internal Server Error
          content:
            application/json:
              examples:
                INTERNAL_SERVER_ERROR:
                  value:
                    success: false
                    errorCode: INTERNAL_SERVER_ERROR
                    message: Internal Server Error
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  errorCode:
                    type: string
                    enum:
                      - USER_NOT_CONFIRMED
                      - INVALID_CREDENTIALS
                      - INCOMPLETE_CREDENTIALS
                      - INVALID_SESSION_TOKEN
                      - FORCE_CHANGE_PASSWORD
                      - PASSWORD_RESET_REQUIRED
                      - PASSWORD_EXPIRED
                      - CODE_EXPIRED
                      - SESSION_EXPIRED
                      - UNAUTHORISED
                      - AUTHENTICATOR_ERROR
                      - SSO_ACCOUNT
                      - FORBIDDEN
                      - METHOD_NOT_ALLOWED
                      - INVALID_INPUT
                      - PATH_VALIDATION_FAILED
                      - QUERY_VALIDATION_FAILED
                      - BODY_VALIDATION_FAILED
                      - RESPONSE_VALIDATION_FAILED
                      - INVALID_OR_MALFORMED_JSON
                      - INTERNAL_SERVER_ERROR
                      - CONFIGURATION_ERROR
                      - SERVICE_UNAVAILABLE
                      - NOT_FOUND
                      - CONFLICT
                      - LIMIT_EXCEEDED
                      - REVIEW_ALREADY_PENDING
                      - REVIEW_NOT_PENDING
                      - REVIEW_PENDING
                      - REVIEW_INSUFFICIENT_DOMAINS
                      - QUOTA_EXCEEDED
                      - UNSUPPORTED_ENDPOINT_VERSION
                      - ENDPOINT_NOT_FOUND
                      - ENDPOINT_ALREADY_EXISTS
                  message:
                    type: string
                  detail:
                    type: object
                    additionalProperties:
                      nullable: true
                required:
                  - success
                  - errorCode
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Pass a static API key for every request, provided by your customer
        support.
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token authentication, using a sessionId generated by `GET
        /v2/auth/session`.
    sessionIdQuery:
      type: apiKey
      in: query
      name: sessionId
      description: >-
        Session ID passed as a query parameter for authentication, provided by
        `GET /v2/auth/session`.

````

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