> ## Documentation Index > Fetch the complete documentation index at: https://documents.trocco.io/llms.txt > Use this file to discover all available pages before exploring further. # 通知先作成 > 通知先(email、slack_channel または http)を作成します。
`type=email` の場合は `email_config.email` を、
`type=slack_channel` の場合は `slack_channel_config.channel` および `slack_channel_config.webhook_url` を、
`type=http` の場合は `http_config.name` および `http_config.url` を指定してください。 ## OpenAPI ````json POST /api/notification_destinations/{type} { "openapi": "3.0.3", "info": { "title": "trocco APIリファレンス", "description": "trocco APIリファレンス", "version": "0.0.1" }, "servers": [ { "url": "https://trocco.io" } ], "security": [ { "ApiKeyAuth": [] } ], "tags": [ { "name": "users", "description": "ユーザー", "externalDocs": { "url": "https://documents.trocco.io/docs/about-account-user" } }, { "name": "teams", "description": "チーム", "externalDocs": { "url": "https://documents.trocco.io/docs/team" } }, { "name": "connections", "description": "接続情報", "externalDocs": { "url": "https://documents.trocco.io/docs/connection-configurations" } }, { "name": "custom_connectors", "description": "カスタムコネクタ定義" }, { "name": "datamart_definitions", "description": "データマート定義", "externalDocs": { "url": "https://documents.trocco.io/docs/data-mart" } }, { "name": "environment_groups", "description": "環境グループ" }, { "name": "environments", "description": "環境" }, { "name": "jobs", "description": "転送ジョブ", "externalDocs": { "url": "https://documents.trocco.io/docs/etl-configuration" } }, { "name": "pipeline_jobs", "description": "ワークフロージョブ", "externalDocs": { "url": "https://documents.trocco.io/docs/about-workflow" } }, { "name": "resource_groups", "description": "リソースグループ", "externalDocs": { "url": "https://documents.trocco.io/docs/resource-group" } }, { "name": "dbt_git_repositories", "description": "dbt Gitリポジトリ" }, { "name": "dbt_job_definitions", "description": "dbtジョブ設定", "externalDocs": { "url": "https://documents.trocco.io/docs/dbt-job-configuration" } }, { "name": "dbt_jobs", "description": "dbtジョブ", "externalDocs": { "url": "https://documents.trocco.io/docs/dbt-job-configuration" } }, { "name": "notification_destinations", "description": "通知先", "externalDocs": { "url": "https://documents.trocco.io/docs/trocco-tutorial-additional-settings" } } ], "externalDocs": { "description": "trocco APIについて", "url": "https://documents.trocco.io/docs/trocco-api" }, "paths": { "/api/notification_destinations/{type}": { "post": { "summary": "通知先作成", "description": "通知先(email、slack_channel または http)を作成します。
\n`type=email` の場合は `email_config.email` を、
\n`type=slack_channel` の場合は `slack_channel_config.channel` および `slack_channel_config.webhook_url` を、
\n`type=http` の場合は `http_config.name` および `http_config.url` を指定してください。\n", "operationId": "createNotificationDestination", "tags": [ "notification_destinations" ], "parameters": [ { "name": "type", "description": "通知先種別(email、slack_channel または http)", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "email", "slack_channel", "http" ] }, "example": "email" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "properties": { "email_config": { "type": "object", "required": [ "email" ], "properties": { "email": { "type": "string", "example": "test@example.com" } } } }, "required": [ "email_config" ] }, { "type": "object", "properties": { "slack_channel_config": { "type": "object", "required": [ "channel", "webhook_url" ], "properties": { "channel": { "type": "string", "example": "#general" }, "webhook_url": { "type": "string", "example": "https://hooks.slack.com/services/XXXX/XXXX/XXXX" } } } }, "required": [ "slack_channel_config" ] }, { "type": "object", "properties": { "http_config": { "type": "object", "required": [ "name", "url" ], "properties": { "name": { "type": "string", "description": "通知先の名前。", "example": "My Webhook" }, "url": { "type": "string", "description": "リクエスト先のURL。TROCCOのドメインは指定できません。", "example": "https://example.com/webhook" }, "description": { "type": "string", "description": "通知先の説明。", "example": "Slack Incoming Webhook" }, "headers": { "type": "array", "description": "リクエストヘッダーの一覧。", "items": { "type": "object", "required": [ "key", "value", "masking" ], "properties": { "key": { "type": "string", "example": "Authorization" }, "value": { "type": "string", "example": "Bearer xxxx" }, "masking": { "type": "boolean", "description": "value をレスポンスでマスキングするかどうか。", "example": true } } } }, "query_params": { "type": "array", "description": "クエリパラメータの一覧。", "items": { "type": "object", "required": [ "key", "value", "masking" ], "properties": { "key": { "type": "string", "example": "token" }, "value": { "type": "string", "example": "xxxx" }, "masking": { "type": "boolean", "description": "value をレスポンスでマスキングするかどうか。", "example": true } } } } } } }, "required": [ "http_config" ] } ] } } } }, "responses": { "201": { "description": "作成した通知先の詳細を返します。", "content": { "application/json": { "schema": { "title": "NotificationDestination", "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "description": "通知先のIDです。" }, "type": { "type": "string", "enum": [ "email", "slack_channel", "http" ], "example": "email", "description": "通知先の種類です。" }, "email": { "type": "string", "description": "type=email の場合に設定されるメールアドレスです。", "example": "test@example.com" }, "channel": { "type": "string", "nullable": true, "description": "type=slack_channel の場合に設定されるチャンネル名です。", "example": "#general" }, "name": { "type": "string", "description": "type=http の場合に設定される通知先の名前です。", "example": "My Webhook" }, "url": { "type": "string", "description": "type=http の場合に設定されるリクエスト先のURLです。", "example": "https://example.com/webhook" }, "description": { "type": "string", "nullable": true, "description": "type=http の場合に設定される通知先の説明です。", "example": "Slack Incoming Webhook" }, "headers": { "type": "array", "description": "type=http の場合に設定されるリクエストヘッダーの一覧です(id 昇順)。
\nmasking=true のヘッダーの value は空文字で返却されます。\n", "items": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "description": "ヘッダーのIDです。" }, "key": { "type": "string", "description": "ヘッダー名です。", "example": "Authorization" }, "value": { "type": "string", "description": "ヘッダーの値です。masking=true の場合は空文字が返却されます。", "example": "Bearer xxxx" }, "masking": { "type": "boolean", "description": "value をレスポンスでマスキングするかどうかです。", "example": true } } } }, "query_params": { "type": "array", "description": "type=http の場合に設定されるクエリパラメータの一覧です(id 昇順)。
\nmasking=true のクエリパラメータの value は空文字で返却されます。\n", "items": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "description": "クエリパラメータのIDです。" }, "key": { "type": "string", "description": "クエリパラメータ名です。", "example": "token" }, "value": { "type": "string", "description": "クエリパラメータの値です。masking=true の場合は空文字が返却されます。", "example": "xxxx" }, "masking": { "type": "boolean", "description": "value をレスポンスでマスキングするかどうかです。", "example": true } } } } }, "required": [ "id", "type" ], "example": { "id": 1, "type": "email", "email": "test@example.com" } } } } }, "400": { "description": "不正なリクエストです。" }, "401": { "description": "API KEYが不正です。" }, "404": { "description": "指定した通知先が存在しません。" } } } } }, "components": { "securitySchemes": { "ApiKeyAuth": { "type": "apiKey", "in": "header", "name": "Authorization", "description": "認証キーとなるAPI KEYをAuthorization: Token {{API KEY}}の形式でヘッダーにセットします。
\nAPI KEYがabc123の場合は、Authorization: Token abc123とします。
\nAPI KEYの作成方法は、TROCCO API KEYの作成を参照ください。\n" } } } } ````