naftiko: 1.0.0-alpha2 info: label: PostHog API — alerts description: 'PostHog API — alerts. 14 operations. Lead operation: alerts. Self-contained Naftiko capability covering one Posthog business surface.' tags: - Posthog - alerts created: '2026-05-19' modified: '2026-05-19' binds: - namespace: env keys: POSTHOG_API_KEY: POSTHOG_API_KEY capability: consumes: - type: http namespace: posthog-alerts baseUri: '' description: PostHog API — alerts business capability. Self-contained, no shared references. resources: - name: api-environments-environment_id-alerts path: /api/environments/{environment_id}/alerts/ operations: - name: environmentsalertslist method: GET description: '' outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: limit in: query type: integer description: Number of results to return per page. - name: offset in: query type: integer description: The initial index from which to return the results. - name: environmentsalertscreate method: POST description: '' outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: api-environments-environment_id-alerts-simulate path: /api/environments/{environment_id}/alerts/simulate/ operations: - name: environmentsalertssimulatecreate method: POST description: Simulate a detector on an insight's historical data. Read-only — no AlertCheck records are created. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: api-environments-environment_id-alerts-id path: /api/environments/{environment_id}/alerts/{id}/ operations: - name: environmentsalertsretrieve method: GET description: '' outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: checks_date_from in: query type: string description: Relative date string for the start of the check history window (e.g. '-24h', '-7d', '-14d'). Returns checks created after this time. Max retention is 14 days. - name: checks_date_to in: query type: string description: Relative date string for the end of the check history window (e.g. '-1h', '-1d'). Defaults to now if not specified. - name: checks_limit in: query type: integer description: Maximum number of check results to return (default 5, max 500). Applied after date filtering. - name: checks_offset in: query type: integer description: Number of newest checks to skip (0-based). Use with checks_limit for pagination. Default 0. - name: id in: path type: string description: A UUID string identifying this alert configuration. required: true - name: environmentsalertsupdate method: PUT description: '' outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: A UUID string identifying this alert configuration. required: true - name: body in: body type: object description: Request body (JSON). required: true - name: environmentsalertspartialupdate method: PATCH description: '' outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: A UUID string identifying this alert configuration. required: true - name: body in: body type: object description: Request body (JSON). required: false - name: environmentsalertsdestroy method: DELETE description: '' outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: A UUID string identifying this alert configuration. required: true - name: api-projects-project_id-alerts path: /api/projects/{project_id}/alerts/ operations: - name: alertslist method: GET description: '' outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: limit in: query type: integer description: Number of results to return per page. - name: offset in: query type: integer description: The initial index from which to return the results. - name: alertscreate method: POST description: '' outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: api-projects-project_id-alerts-simulate path: /api/projects/{project_id}/alerts/simulate/ operations: - name: alertssimulatecreate method: POST description: Simulate a detector on an insight's historical data. Read-only — no AlertCheck records are created. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: api-projects-project_id-alerts-id path: /api/projects/{project_id}/alerts/{id}/ operations: - name: alertsretrieve method: GET description: '' outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: checks_date_from in: query type: string description: Relative date string for the start of the check history window (e.g. '-24h', '-7d', '-14d'). Returns checks created after this time. Max retention is 14 days. - name: checks_date_to in: query type: string description: Relative date string for the end of the check history window (e.g. '-1h', '-1d'). Defaults to now if not specified. - name: checks_limit in: query type: integer description: Maximum number of check results to return (default 5, max 500). Applied after date filtering. - name: checks_offset in: query type: integer description: Number of newest checks to skip (0-based). Use with checks_limit for pagination. Default 0. - name: id in: path type: string description: A UUID string identifying this alert configuration. required: true - name: alertsupdate method: PUT description: '' outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: A UUID string identifying this alert configuration. required: true - name: body in: body type: object description: Request body (JSON). required: true - name: alertspartialupdate method: PATCH description: '' outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: A UUID string identifying this alert configuration. required: true - name: body in: body type: object description: Request body (JSON). required: false - name: alertsdestroy method: DELETE description: '' outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: A UUID string identifying this alert configuration. required: true authentication: type: bearer token: '{{env.POSTHOG_API_KEY}}' exposes: - type: rest namespace: posthog-alerts-rest port: 8080 description: REST adapter for PostHog API — alerts. One Spectral-compliant resource per consumed operation, prefixed with /v1. resources: - path: /v1/api/environments/{environment-id}/alerts name: api-environments-environment-id-alerts description: REST surface for api-environments-environment_id-alerts. operations: - method: GET name: environmentsalertslist description: environmentsalertslist call: posthog-alerts.environmentsalertslist with: limit: rest.limit offset: rest.offset outputParameters: - type: object mapping: $. - method: POST name: environmentsalertscreate description: environmentsalertscreate call: posthog-alerts.environmentsalertscreate with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/api/environments/{environment-id}/alerts/simulate name: api-environments-environment-id-alerts-simulate description: REST surface for api-environments-environment_id-alerts-simulate. operations: - method: POST name: environmentsalertssimulatecreate description: Simulate a detector on an insight's historical data. Read-only — no AlertCheck records are created. call: posthog-alerts.environmentsalertssimulatecreate with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/api/environments/{environment-id}/alerts/{id} name: api-environments-environment-id-alerts-id description: REST surface for api-environments-environment_id-alerts-id. operations: - method: GET name: environmentsalertsretrieve description: environmentsalertsretrieve call: posthog-alerts.environmentsalertsretrieve with: checks_date_from: rest.checks_date_from checks_date_to: rest.checks_date_to checks_limit: rest.checks_limit checks_offset: rest.checks_offset id: rest.id outputParameters: - type: object mapping: $. - method: PUT name: environmentsalertsupdate description: environmentsalertsupdate call: posthog-alerts.environmentsalertsupdate with: id: rest.id body: rest.body outputParameters: - type: object mapping: $. - method: PATCH name: environmentsalertspartialupdate description: environmentsalertspartialupdate call: posthog-alerts.environmentsalertspartialupdate with: id: rest.id body: rest.body outputParameters: - type: object mapping: $. - method: DELETE name: environmentsalertsdestroy description: environmentsalertsdestroy call: posthog-alerts.environmentsalertsdestroy with: id: rest.id outputParameters: - type: object mapping: $. - path: /v1/api/projects/{project-id}/alerts name: api-projects-project-id-alerts description: REST surface for api-projects-project_id-alerts. operations: - method: GET name: alertslist description: alertslist call: posthog-alerts.alertslist with: limit: rest.limit offset: rest.offset outputParameters: - type: object mapping: $. - method: POST name: alertscreate description: alertscreate call: posthog-alerts.alertscreate with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/api/projects/{project-id}/alerts/simulate name: api-projects-project-id-alerts-simulate description: REST surface for api-projects-project_id-alerts-simulate. operations: - method: POST name: alertssimulatecreate description: Simulate a detector on an insight's historical data. Read-only — no AlertCheck records are created. call: posthog-alerts.alertssimulatecreate with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/api/projects/{project-id}/alerts/{id} name: api-projects-project-id-alerts-id description: REST surface for api-projects-project_id-alerts-id. operations: - method: GET name: alertsretrieve description: alertsretrieve call: posthog-alerts.alertsretrieve with: checks_date_from: rest.checks_date_from checks_date_to: rest.checks_date_to checks_limit: rest.checks_limit checks_offset: rest.checks_offset id: rest.id outputParameters: - type: object mapping: $. - method: PUT name: alertsupdate description: alertsupdate call: posthog-alerts.alertsupdate with: id: rest.id body: rest.body outputParameters: - type: object mapping: $. - method: PATCH name: alertspartialupdate description: alertspartialupdate call: posthog-alerts.alertspartialupdate with: id: rest.id body: rest.body outputParameters: - type: object mapping: $. - method: DELETE name: alertsdestroy description: alertsdestroy call: posthog-alerts.alertsdestroy with: id: rest.id outputParameters: - type: object mapping: $. - type: mcp namespace: posthog-alerts-mcp port: 9090 transport: http description: MCP adapter for PostHog API — alerts. One tool per consumed operation, routed inline through this capability's consumes block. tools: - name: environmentsalertslist description: environmentsalertslist hints: readOnly: true destructive: false idempotent: true call: posthog-alerts.environmentsalertslist with: limit: tools.limit offset: tools.offset outputParameters: - type: object mapping: $. - name: environmentsalertscreate description: environmentsalertscreate hints: readOnly: false destructive: false idempotent: false call: posthog-alerts.environmentsalertscreate with: body: tools.body outputParameters: - type: object mapping: $. - name: simulate-detector-insight-s-historical-data description: Simulate a detector on an insight's historical data. Read-only — no AlertCheck records are created. hints: readOnly: true destructive: false idempotent: false call: posthog-alerts.environmentsalertssimulatecreate with: body: tools.body outputParameters: - type: object mapping: $. - name: environmentsalertsretrieve description: environmentsalertsretrieve hints: readOnly: true destructive: false idempotent: true call: posthog-alerts.environmentsalertsretrieve with: checks_date_from: tools.checks_date_from checks_date_to: tools.checks_date_to checks_limit: tools.checks_limit checks_offset: tools.checks_offset id: tools.id outputParameters: - type: object mapping: $. - name: environmentsalertsupdate description: environmentsalertsupdate hints: readOnly: false destructive: false idempotent: true call: posthog-alerts.environmentsalertsupdate with: id: tools.id body: tools.body outputParameters: - type: object mapping: $. - name: environmentsalertspartialupdate description: environmentsalertspartialupdate hints: readOnly: false destructive: false idempotent: true call: posthog-alerts.environmentsalertspartialupdate with: id: tools.id body: tools.body outputParameters: - type: object mapping: $. - name: environmentsalertsdestroy description: environmentsalertsdestroy hints: readOnly: false destructive: true idempotent: true call: posthog-alerts.environmentsalertsdestroy with: id: tools.id outputParameters: - type: object mapping: $. - name: alertslist description: alertslist hints: readOnly: true destructive: false idempotent: true call: posthog-alerts.alertslist with: limit: tools.limit offset: tools.offset outputParameters: - type: object mapping: $. - name: alertscreate description: alertscreate hints: readOnly: false destructive: false idempotent: false call: posthog-alerts.alertscreate with: body: tools.body outputParameters: - type: object mapping: $. - name: simulate-detector-insight-s-historical-data-2 description: Simulate a detector on an insight's historical data. Read-only — no AlertCheck records are created. hints: readOnly: true destructive: false idempotent: false call: posthog-alerts.alertssimulatecreate with: body: tools.body outputParameters: - type: object mapping: $. - name: alertsretrieve description: alertsretrieve hints: readOnly: true destructive: false idempotent: true call: posthog-alerts.alertsretrieve with: checks_date_from: tools.checks_date_from checks_date_to: tools.checks_date_to checks_limit: tools.checks_limit checks_offset: tools.checks_offset id: tools.id outputParameters: - type: object mapping: $. - name: alertsupdate description: alertsupdate hints: readOnly: false destructive: false idempotent: true call: posthog-alerts.alertsupdate with: id: tools.id body: tools.body outputParameters: - type: object mapping: $. - name: alertspartialupdate description: alertspartialupdate hints: readOnly: false destructive: false idempotent: true call: posthog-alerts.alertspartialupdate with: id: tools.id body: tools.body outputParameters: - type: object mapping: $. - name: alertsdestroy description: alertsdestroy hints: readOnly: false destructive: true idempotent: true call: posthog-alerts.alertsdestroy with: id: tools.id outputParameters: - type: object mapping: $.