---
title: "Put Opportunities Data"
method: POST
path: "/opportunities/"
tags: ["OPPORTUNITIES"]
---

# Put Opportunities Data

`POST /opportunities/`

Update opportunities data in both PostgreSQL and ClickHouse databases and OS(TODO: to be removed).

Args:
    db: Database session for PostgreSQL access
    auth: Authentication token containing user info
    tenant: Tenant identifier
    tenant_alias: Alias for the tenant
    opportunities_data_request: Request containing opportunity changes
    client: OpenSearch client for legacy updates (TODO: to be removed)
    clickhouse_client: ClickHouse client for updating global_opportunities_aggregated table
    is_operation_allowed: Flag indicating if operation is allowed for tenant

Returns:
    StandardResponse with status and optional message

## Headers

- `x-tenant` string, required

## Request body

- PutOpportunitiesDataRequest
  - `changes` Changes[], required
    - `opportunity_id` string, required
    - `status` string, nullable
    - `owner` union
      - integer
      - string
  - `user_id` integer, nullable
  - `start_date` string, date-time, nullable
  - `end_date` string, date-time, nullable

## Response `200`

Successful Response

- StandardResponse
  - `ok` boolean, required

## Other responses

- `400` — Not supported for public user
- `403` — Not supported for public user
- `422` — Validation Error

---

[API](https://skmtc.net/myaltimate/apis/fastapi.md) · [All operations](https://skmtc.net/myaltimate/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/myaltimate/fastapi/versions/aab3fe5c9f05/schema)
