Files
tgex-frontend/api.json

2610 lines
65 KiB
JSON

{
"openapi": "3.1.0",
"info": {
"title": "FastAPI",
"version": "unknown"
},
"paths": {
"/api/v1/auth/complete": {
"get": {
"tags": ["auth"],
"summary": "Complete Auth",
"operationId": "complete_auth_api_v1_auth_complete_get",
"parameters": [
{
"name": "token",
"in": "query",
"required": true,
"schema": {
"type": "string",
"title": "Token"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidateLoginTokenOutput"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/v1/auth/me": {
"get": {
"tags": ["auth"],
"summary": "Get Me",
"operationId": "get_me_api_v1_auth_me_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserOutput"
}
}
}
}
},
"security": [
{
"HTTPBearer": []
}
]
}
},
"/api/v1/target_channels": {
"get": {
"tags": ["target_channels"],
"summary": "Get User Target Chans",
"operationId": "get_user_target_chans_api_v1_target_channels_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GetUserTargetChansOutput"
}
}
}
}
},
"security": [
{
"HTTPBearer": []
}
]
}
},
"/api/v1/target_channels/{channel_id}": {
"delete": {
"tags": ["target_channels"],
"summary": "Disconnect Target Chan",
"operationId": "disconnect_target_chan_api_v1_target_channels__channel_id__delete",
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "channel_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"title": "Channel Id"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/v1/external_channels/target/{target_channel_id}": {
"get": {
"tags": ["external_channels"],
"summary": "Get External Channels",
"description": "Get all external channels for a specific target channel.",
"operationId": "get_external_channels_api_v1_external_channels_target__target_channel_id__get",
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "target_channel_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"title": "Target Channel Id"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GetExternalChannelsOutput"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/v1/external_channels": {
"post": {
"tags": ["external_channels"],
"summary": "Create External Channel",
"description": "Create a new external channel and link it to target channels.",
"operationId": "create_external_channel_api_v1_external_channels_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateExternalChannelInput"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ExternalChannelOutput"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
},
"security": [
{
"HTTPBearer": []
}
]
}
},
"/api/v1/external_channels/{channel_id}": {
"patch": {
"tags": ["external_channels"],
"summary": "Update External Channel",
"description": "Update external channel fields (title, username, description, subscribers_count).",
"operationId": "update_external_channel_api_v1_external_channels__channel_id__patch",
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "channel_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"title": "Channel Id"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateExternalChannelInput"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ExternalChannelOutput"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
},
"delete": {
"tags": ["external_channels"],
"summary": "Delete External Channel",
"description": "Delete an external channel.",
"operationId": "delete_external_channel_api_v1_external_channels__channel_id__delete",
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "channel_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"title": "Channel Id"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/v1/external_channels/{channel_id}/links": {
"patch": {
"tags": ["external_channels"],
"summary": "Update External Channel Links",
"description": "Update target channel links for an existing external channel.\n\nYou can add new target channels, remove existing ones, or both in a single request.",
"operationId": "update_external_channel_links_api_v1_external_channels__channel_id__links_patch",
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "channel_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"title": "Channel Id"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateExternalChannelLinksInput"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ExternalChannelOutput"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/v1/creatives": {
"get": {
"tags": ["creatives"],
"summary": "List Creatives",
"operationId": "list_creatives_api_v1_creatives_get",
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "target_channel_id",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Target Channel Id"
}
},
{
"name": "include_archived",
"in": "query",
"required": false,
"schema": {
"type": "boolean",
"default": false,
"title": "Include Archived"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GetCreativesOutput"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
},
"post": {
"tags": ["creatives"],
"summary": "Create Creative",
"operationId": "create_creative_api_v1_creatives_post",
"security": [
{
"HTTPBearer": []
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateCreativeInput"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreativeOutput"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/v1/creatives/{creative_id}": {
"get": {
"tags": ["creatives"],
"summary": "Get Creative",
"operationId": "get_creative_api_v1_creatives__creative_id__get",
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "creative_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"title": "Creative Id"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreativeOutput"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
},
"patch": {
"tags": ["creatives"],
"summary": "Update Creative",
"operationId": "update_creative_api_v1_creatives__creative_id__patch",
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "creative_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"title": "Creative Id"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateCreativeInput"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreativeOutput"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
},
"delete": {
"tags": ["creatives"],
"summary": "Delete Creative",
"operationId": "delete_creative_api_v1_creatives__creative_id__delete",
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "creative_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"title": "Creative Id"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/v1/placements": {
"get": {
"tags": ["placements"],
"summary": "List Placements",
"operationId": "list_placements_api_v1_placements_get",
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "target_channel_id",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Target Channel Id"
}
},
{
"name": "external_channel_id",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "External Channel Id"
}
},
{
"name": "creative_id",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Creative Id"
}
},
{
"name": "include_archived",
"in": "query",
"required": false,
"schema": {
"type": "boolean",
"default": false,
"title": "Include Archived"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GetPlacementsOutput"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
},
"post": {
"tags": ["placements"],
"summary": "Create Placement",
"operationId": "create_placement_api_v1_placements_post",
"security": [
{
"HTTPBearer": []
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreatePlacementInput"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PlacementOutput"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/v1/placements/{placement_id}": {
"get": {
"tags": ["placements"],
"summary": "Get Placement",
"operationId": "get_placement_api_v1_placements__placement_id__get",
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "placement_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"title": "Placement Id"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PlacementOutput"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
},
"patch": {
"tags": ["placements"],
"summary": "Update Placement",
"operationId": "update_placement_api_v1_placements__placement_id__patch",
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "placement_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"title": "Placement Id"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdatePlacementInput"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PlacementOutput"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
},
"delete": {
"tags": ["placements"],
"summary": "Delete Placement",
"operationId": "delete_placement_api_v1_placements__placement_id__delete",
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "placement_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"title": "Placement Id"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/v1/placements/{placement_id}/views/history": {
"get": {
"tags": ["views"],
"summary": "Get Views History",
"description": "Получить историю просмотров для закупа.",
"operationId": "get_views_history_api_v1_placements__placement_id__views_history_get",
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "placement_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"title": "Placement Id"
}
},
{
"name": "from_date",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "From Date"
}
},
{
"name": "to_date",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "To Date"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GetViewsHistoryOutput"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/v1/placements/{placement_id}/views/fetch": {
"post": {
"tags": ["views"],
"summary": "Fetch Views",
"description": "Получить актуальные просмотры через Telegram API.",
"operationId": "fetch_views_api_v1_placements__placement_id__views_fetch_post",
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "placement_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"title": "Placement Id"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FetchViewsManuallyOutput"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/v1/placements/{placement_id}/views/manual": {
"post": {
"tags": ["views"],
"summary": "Update Views Manually",
"description": "Обновить просмотры вручную.",
"operationId": "update_views_manually_api_v1_placements__placement_id__views_manual_post",
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "placement_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"title": "Placement Id"
}
},
{
"name": "views_count",
"in": "query",
"required": true,
"schema": {
"type": "integer",
"title": "Views Count"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PlacementOutput"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/v1/analytics/placements": {
"get": {
"tags": ["analytics"],
"summary": "Get Placements Analytics",
"operationId": "get_placements_analytics_api_v1_analytics_placements_get",
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "target_channel_id",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Target Channel Id"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GetPlacementsAnalyticsOutput"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/v1/analytics/creatives": {
"get": {
"tags": ["analytics"],
"summary": "Get Creatives Analytics",
"operationId": "get_creatives_analytics_api_v1_analytics_creatives_get",
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "target_channel_id",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Target Channel Id"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GetCreativesAnalyticsOutput"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/v1/analytics/external-channels": {
"get": {
"tags": ["analytics"],
"summary": "Get External Channels Analytics",
"operationId": "get_external_channels_analytics_api_v1_analytics_external_channels_get",
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "target_channel_id",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Target Channel Id"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GetExternalChannelsAnalyticsOutput"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/v1/analytics/spending": {
"get": {
"tags": ["analytics"],
"summary": "Get Spending Analytics",
"operationId": "get_spending_analytics_api_v1_analytics_spending_get",
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "target_channel_id",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Target Channel Id"
}
},
{
"name": "date_from",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Date From"
}
},
{
"name": "date_to",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Date To"
}
},
{
"name": "grouping",
"in": "query",
"required": false,
"schema": {
"$ref": "#/components/schemas/DateGrouping",
"default": "day"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GetSpendingAnalyticsOutput"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"ConnectTargetChanOutput": {
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"telegram_id": {
"type": "integer",
"title": "Telegram Id"
},
"title": {
"type": "string",
"title": "Title"
},
"username": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Username"
},
"is_active": {
"type": "boolean",
"title": "Is Active"
}
},
"type": "object",
"required": ["id", "telegram_id", "title", "username", "is_active"],
"title": "ConnectTargetChanOutput"
},
"CreateCreativeInput": {
"properties": {
"name": {
"type": "string",
"title": "Name"
},
"text": {
"type": "string",
"title": "Text"
},
"target_channel_id": {
"type": "string",
"format": "uuid",
"title": "Target Channel Id"
}
},
"type": "object",
"required": ["name", "text", "target_channel_id"],
"title": "CreateCreativeInput"
},
"CreateExternalChannelInput": {
"properties": {
"telegram_id": {
"type": "integer",
"title": "Telegram Id"
},
"title": {
"type": "string",
"title": "Title"
},
"username": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Username"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Description"
},
"subscribers_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Subscribers Count"
},
"target_channel_ids": {
"items": {
"type": "string",
"format": "uuid"
},
"type": "array",
"title": "Target Channel Ids"
}
},
"type": "object",
"required": ["telegram_id", "title", "target_channel_ids"],
"title": "CreateExternalChannelInput"
},
"CreatePlacementInput": {
"properties": {
"target_channel_id": {
"type": "string",
"format": "uuid",
"title": "Target Channel Id"
},
"external_channel_id": {
"type": "string",
"format": "uuid",
"title": "External Channel Id"
},
"creative_id": {
"type": "string",
"format": "uuid",
"title": "Creative Id"
},
"placement_date": {
"type": "string",
"format": "date-time",
"title": "Placement Date"
},
"cost": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Cost"
},
"comment": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Comment"
},
"ad_post_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Ad Post Url"
},
"invite_link_type": {
"$ref": "#/components/schemas/InviteLinkType",
"default": "public"
}
},
"type": "object",
"required": [
"target_channel_id",
"external_channel_id",
"creative_id",
"placement_date"
],
"title": "CreatePlacementInput"
},
"CreativeAnalyticsOutput": {
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"name": {
"type": "string",
"title": "Name"
},
"placements_count": {
"type": "integer",
"title": "Placements Count"
},
"total_cost": {
"type": "number",
"title": "Total Cost"
},
"total_subscriptions": {
"type": "integer",
"title": "Total Subscriptions"
},
"total_views": {
"type": "integer",
"title": "Total Views"
},
"avg_cpf": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Avg Cpf"
},
"avg_cpm": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Avg Cpm"
}
},
"type": "object",
"required": [
"id",
"name",
"placements_count",
"total_cost",
"total_subscriptions",
"total_views",
"avg_cpf",
"avg_cpm"
],
"title": "CreativeAnalyticsOutput"
},
"CreativeOutput": {
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"name": {
"type": "string",
"title": "Name"
},
"text": {
"type": "string",
"title": "Text"
},
"target_channel_id": {
"type": "string",
"format": "uuid",
"title": "Target Channel Id"
},
"target_channel_title": {
"type": "string",
"title": "Target Channel Title"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"status": {
"$ref": "#/components/schemas/CreativeStatus"
},
"placements_count": {
"type": "integer",
"title": "Placements Count"
}
},
"type": "object",
"required": [
"id",
"name",
"text",
"target_channel_id",
"target_channel_title",
"created_at",
"status",
"placements_count"
],
"title": "CreativeOutput"
},
"CreativeStatus": {
"type": "string",
"enum": ["active", "archived"],
"title": "CreativeStatus"
},
"DateGrouping": {
"type": "string",
"enum": ["day", "week", "month", "quarter", "year"],
"title": "DateGrouping"
},
"ExternalChannelAnalyticsOutput": {
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"title": {
"type": "string",
"title": "Title"
},
"username": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Username"
},
"placements_count": {
"type": "integer",
"title": "Placements Count"
},
"total_cost": {
"type": "number",
"title": "Total Cost"
},
"total_subscriptions": {
"type": "integer",
"title": "Total Subscriptions"
},
"total_views": {
"type": "integer",
"title": "Total Views"
},
"avg_cpf": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Avg Cpf"
},
"avg_cpm": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Avg Cpm"
}
},
"type": "object",
"required": [
"id",
"title",
"username",
"placements_count",
"total_cost",
"total_subscriptions",
"total_views",
"avg_cpf",
"avg_cpm"
],
"title": "ExternalChannelAnalyticsOutput"
},
"ExternalChannelOutput": {
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"telegram_id": {
"type": "integer",
"title": "Telegram Id"
},
"title": {
"type": "string",
"title": "Title"
},
"username": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Username"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Description"
},
"subscribers_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Subscribers Count"
}
},
"type": "object",
"required": [
"id",
"telegram_id",
"title",
"username",
"description",
"subscribers_count"
],
"title": "ExternalChannelOutput"
},
"FetchViewsManuallyOutput": {
"properties": {
"placement_id": {
"type": "string",
"format": "uuid",
"title": "Placement Id"
},
"views_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Views Count"
},
"views_availability": {
"$ref": "#/components/schemas/PostViewsAvailability"
},
"fetched_at": {
"type": "string",
"format": "date-time",
"title": "Fetched At"
},
"error_message": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Error Message"
}
},
"type": "object",
"required": [
"placement_id",
"views_count",
"views_availability",
"fetched_at"
],
"title": "FetchViewsManuallyOutput"
},
"GetCreativesAnalyticsOutput": {
"properties": {
"creatives": {
"items": {
"$ref": "#/components/schemas/CreativeAnalyticsOutput"
},
"type": "array",
"title": "Creatives"
}
},
"type": "object",
"required": ["creatives"],
"title": "GetCreativesAnalyticsOutput"
},
"GetCreativesOutput": {
"properties": {
"creatives": {
"items": {
"$ref": "#/components/schemas/CreativeOutput"
},
"type": "array",
"title": "Creatives"
}
},
"type": "object",
"required": ["creatives"],
"title": "GetCreativesOutput"
},
"GetExternalChannelsAnalyticsOutput": {
"properties": {
"external_channels": {
"items": {
"$ref": "#/components/schemas/ExternalChannelAnalyticsOutput"
},
"type": "array",
"title": "External Channels"
}
},
"type": "object",
"required": ["external_channels"],
"title": "GetExternalChannelsAnalyticsOutput"
},
"GetExternalChannelsOutput": {
"properties": {
"external_channels": {
"items": {
"$ref": "#/components/schemas/ExternalChannelOutput"
},
"type": "array",
"title": "External Channels"
}
},
"type": "object",
"required": ["external_channels"],
"title": "GetExternalChannelsOutput"
},
"GetPlacementsAnalyticsOutput": {
"properties": {
"placements": {
"items": {
"$ref": "#/components/schemas/PlacementAnalyticsOutput"
},
"type": "array",
"title": "Placements"
}
},
"type": "object",
"required": ["placements"],
"title": "GetPlacementsAnalyticsOutput"
},
"GetPlacementsOutput": {
"properties": {
"placements": {
"items": {
"$ref": "#/components/schemas/PlacementOutput"
},
"type": "array",
"title": "Placements"
}
},
"type": "object",
"required": ["placements"],
"title": "GetPlacementsOutput"
},
"GetSpendingAnalyticsOutput": {
"properties": {
"total_cost": {
"type": "number",
"title": "Total Cost"
},
"total_subscriptions": {
"type": "integer",
"title": "Total Subscriptions"
},
"total_views": {
"type": "integer",
"title": "Total Views"
},
"avg_cpf": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Avg Cpf"
},
"avg_cpm": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Avg Cpm"
},
"chart_data": {
"items": {
"$ref": "#/components/schemas/SpendingDataPoint"
},
"type": "array",
"title": "Chart Data"
}
},
"type": "object",
"required": [
"total_cost",
"total_subscriptions",
"total_views",
"avg_cpf",
"avg_cpm",
"chart_data"
],
"title": "GetSpendingAnalyticsOutput"
},
"GetUserTargetChansOutput": {
"properties": {
"target_channels": {
"items": {
"$ref": "#/components/schemas/ConnectTargetChanOutput"
},
"type": "array",
"title": "Target Channels"
}
},
"type": "object",
"required": ["target_channels"],
"title": "GetUserTargetChansOutput"
},
"GetViewsHistoryOutput": {
"properties": {
"histories": {
"items": {
"$ref": "#/components/schemas/PlacementViewsHistoryOutput"
},
"type": "array",
"title": "Histories"
}
},
"type": "object",
"required": ["histories"],
"title": "GetViewsHistoryOutput",
"description": "История просмотров."
},
"HTTPValidationError": {
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
},
"InviteLinkType": {
"type": "string",
"enum": ["public", "approval"],
"title": "InviteLinkType"
},
"PlacementAnalyticsOutput": {
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"target_channel_id": {
"type": "string",
"format": "uuid",
"title": "Target Channel Id"
},
"target_channel_title": {
"type": "string",
"title": "Target Channel Title"
},
"external_channel_id": {
"type": "string",
"format": "uuid",
"title": "External Channel Id"
},
"external_channel_title": {
"type": "string",
"title": "External Channel Title"
},
"creative_id": {
"type": "string",
"format": "uuid",
"title": "Creative Id"
},
"creative_name": {
"type": "string",
"title": "Creative Name"
},
"placement_date": {
"type": "string",
"format": "date-time",
"title": "Placement Date"
},
"cost": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Cost"
},
"subscriptions_count": {
"type": "integer",
"title": "Subscriptions Count"
},
"views_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Views Count"
},
"cpf": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Cpf"
},
"cpm": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Cpm"
}
},
"type": "object",
"required": [
"id",
"target_channel_id",
"target_channel_title",
"external_channel_id",
"external_channel_title",
"creative_id",
"creative_name",
"placement_date",
"cost",
"subscriptions_count",
"views_count",
"cpf",
"cpm"
],
"title": "PlacementAnalyticsOutput"
},
"PlacementOutput": {
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"target_channel_id": {
"type": "string",
"format": "uuid",
"title": "Target Channel Id"
},
"target_channel_title": {
"type": "string",
"title": "Target Channel Title"
},
"external_channel_id": {
"type": "string",
"format": "uuid",
"title": "External Channel Id"
},
"external_channel_title": {
"type": "string",
"title": "External Channel Title"
},
"creative_id": {
"type": "string",
"format": "uuid",
"title": "Creative Id"
},
"creative_name": {
"type": "string",
"title": "Creative Name"
},
"placement_date": {
"type": "string",
"format": "date-time",
"title": "Placement Date"
},
"cost": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Cost"
},
"comment": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Comment"
},
"ad_post_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Ad Post Url"
},
"invite_link_type": {
"$ref": "#/components/schemas/InviteLinkType"
},
"invite_link": {
"type": "string",
"title": "Invite Link"
},
"status": {
"$ref": "#/components/schemas/PlacementStatus"
},
"subscriptions_count": {
"type": "integer",
"title": "Subscriptions Count"
},
"views_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Views Count"
},
"views_availability": {
"$ref": "#/components/schemas/PostViewsAvailability"
},
"last_views_fetch_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Last Views Fetch At"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
}
},
"type": "object",
"required": [
"id",
"target_channel_id",
"target_channel_title",
"external_channel_id",
"external_channel_title",
"creative_id",
"creative_name",
"placement_date",
"cost",
"comment",
"ad_post_url",
"invite_link_type",
"invite_link",
"status",
"subscriptions_count",
"views_count",
"views_availability",
"last_views_fetch_at",
"created_at"
],
"title": "PlacementOutput"
},
"PlacementStatus": {
"type": "string",
"enum": ["active", "archived"],
"title": "PlacementStatus"
},
"PlacementViewsHistoryOutput": {
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"placement_id": {
"type": "string",
"format": "uuid",
"title": "Placement Id"
},
"views_count": {
"type": "integer",
"title": "Views Count"
},
"fetched_at": {
"type": "string",
"format": "date-time",
"title": "Fetched At"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
}
},
"type": "object",
"required": [
"id",
"placement_id",
"views_count",
"fetched_at",
"created_at"
],
"title": "PlacementViewsHistoryOutput",
"description": "История просмотров placement."
},
"PostViewsAvailability": {
"type": "string",
"enum": ["unknown", "available", "unavailable", "manual"],
"title": "PostViewsAvailability",
"description": "Статус доступности получения просмотров поста."
},
"SpendingDataPoint": {
"properties": {
"period": {
"type": "string",
"title": "Period"
},
"cost": {
"type": "number",
"title": "Cost"
},
"subscriptions": {
"type": "integer",
"title": "Subscriptions"
},
"views": {
"type": "integer",
"title": "Views"
},
"cpf": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Cpf"
},
"cpm": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Cpm"
}
},
"type": "object",
"required": ["period", "cost", "subscriptions", "views", "cpf", "cpm"],
"title": "SpendingDataPoint"
},
"UpdateCreativeInput": {
"properties": {
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Name"
},
"text": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Text"
},
"status": {
"anyOf": [
{
"$ref": "#/components/schemas/CreativeStatus"
},
{
"type": "null"
}
]
}
},
"type": "object",
"title": "UpdateCreativeInput"
},
"UpdateExternalChannelInput": {
"properties": {
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Title"
},
"username": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Username"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Description"
},
"subscribers_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Subscribers Count"
}
},
"type": "object",
"title": "UpdateExternalChannelInput"
},
"UpdateExternalChannelLinksInput": {
"properties": {
"add_target_channel_ids": {
"items": {
"type": "string",
"format": "uuid"
},
"type": "array",
"title": "Add Target Channel Ids",
"default": []
},
"remove_target_channel_ids": {
"items": {
"type": "string",
"format": "uuid"
},
"type": "array",
"title": "Remove Target Channel Ids",
"default": []
}
},
"type": "object",
"title": "UpdateExternalChannelLinksInput"
},
"UpdatePlacementInput": {
"properties": {
"placement_date": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Placement Date"
},
"cost": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Cost"
},
"comment": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Comment"
},
"status": {
"anyOf": [
{
"$ref": "#/components/schemas/PlacementStatus"
},
{
"type": "null"
}
]
}
},
"type": "object",
"title": "UpdatePlacementInput"
},
"UserOutput": {
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"telegram_id": {
"type": "integer",
"title": "Telegram Id"
},
"username": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Username"
}
},
"type": "object",
"required": ["id", "telegram_id", "username"],
"title": "UserOutput"
},
"ValidateLoginTokenOutput": {
"properties": {
"access_token": {
"type": "string",
"title": "Access Token"
}
},
"type": "object",
"required": ["access_token"],
"title": "ValidateLoginTokenOutput"
},
"ValidationError": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": ["loc", "msg", "type"],
"title": "ValidationError"
}
},
"securitySchemes": {
"HTTPBearer": {
"type": "http",
"scheme": "bearer"
}
}
}
}