---
title: "Handle TradingView webhook"
method: POST
path: "/rest/api/v1/webhooks/tradingview/accounts/{accountId}"
tags: ["TradingView Webhook API"]
---

# Handle TradingView webhook

`POST /rest/api/v1/webhooks/tradingview/accounts/{accountId}`

## Request

- Base URL: `https://api.metacopier.io`
- URL: `https://api.metacopier.io/rest/api/v1/webhooks/tradingview/accounts/{accountId}`
- Auth: API key in header `X-API-KEY`
- TypeScript: <https://skmtc.dev/metacopier/apis/metacopier-api/docs/rest/api/v1/webhooks/tradingview/accounts/:accountId/post.ts> (a function with typed inputs; its response is checked against the schema)

Receives webhook alerts from TradingView and queues them for asynchronous processing. Returns 202 Accepted with a requestId that can be used to check status.

## Path parameters

- `accountId` string, uuid, required

## Request body

- string

## Response `200`

OK

- TradingViewWebhookResponseDTO: Response from TradingView webhook endpoint
  - `attemptCount` integer: Number of processing attempts (for queued requests)
  - `cached` boolean: Whether this is a cached response from idempotency
  - `closedPositions` ClosedPositionInfo[]: List of closed positions (for close operations)
    - `error` string: Error message if close failed
    - `positionId` string: Broker position ID
    - `success` boolean: Whether the close was successful
    - `symbol` string: Symbol
  - `code` string: Error code for failed requests
  - `data` object: Additional data returned with the response
  - `hint` string: Hint for resolving errors
  - `matchCount` integer: Number of positions matched (for close/modify operations)
  - `message` string: Human-readable message describing the result
  - `originalRequestId` string: Original request ID if this is a cached response
  - `requestId` string: Unique request ID for tracking and debugging
  - `status` string: Processing status (for queued requests)
  - `success` boolean: Whether the request was successful
  - `timestamp` string, date-time: Response timestamp

## Changes

- **2026-08-10** `5c1371d2c0b2`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/metacopier/apis/metacopier-api/changes/rest/api/v1/webhooks/tradingview/accounts/:accountId/post.md)

---

[API](https://skmtc.dev/metacopier/apis/metacopier-api.md) - [All operations](https://skmtc.dev/metacopier/apis/metacopier-api/llms.txt) - [OpenAPI document](https://skmtc.dev/metacopier/apis/metacopier-api/revisions/2ac6d7461345?raw)
