openapi: 3.2.0 info: title: 'GTM API public contract: gtm.service.id Notifications API' description: 'Identity, access and money: users, teams and members, API keys, OAuth clients and authorizations, billing products, subscriptions, transactions and payment methods, notifications, TLS certificates and support requests.' version: '1.0' contact: name: GTM API url: https://gtm-api.com email: support@gtm-api.com license: name: Proprietary url: https://gtm-api.com/license servers: - url: https://app.gtm-api.com/id/v4 description: Production, through the app.gtm-api.com gateway security: - BearerJwt: [] TeamSid: [] tags: - name: Notifications description: Registry package `mcp.id/notifications`, served on MCP mount `id.platform`. paths: /api/notifications/metrics: post: operationId: get_notifications_metrics summary: Notifications metrics description: 'Period-bound delivery-health aggregates over a filtered notification set: how many notifications were delivered, failed, and rate-limited in the window. Requires period {from,to}. Optional filter and a single group_by axis (event_name / status / channel). Contract: - MCP tool `get_notifications_metrics`, registry package `mcp.id/notifications`, mount `id.platform`. - Operation `metrics`, response envelope `metrics`. - Flags: read only.' tags: - Notifications requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/GetNotificationsMetricsRequest' responses: '200': description: '`metrics` success envelope.' content: application/json: schema: $ref: '#/components/schemas/GetNotificationsMetricsResponse' 4XX: $ref: '#/components/responses/McpClientError' 5XX: $ref: '#/components/responses/McpServerError' x-gtm-mcp-tool: get_notifications_metrics x-gtm-mcp-mount: id.platform x-gtm-entity: notifications x-gtm-operation: metrics x-gtm-envelope: metrics x-gtm-availability: ga x-gtm-dangerous: false x-gtm-mass-action: false x-gtm-step-eligible: false x-gtm-schedule-required: false x-gtm-tool-class: typical /api/notifications/search: post: operationId: search_notifications summary: Search notifications description: 'List notifications (email and in_app channels) for the team/user with filtering, sorting and cursor pagination: the user inbox ("what was sent to me?"), admin audit ("what did the system email Jane about?"), or failure triage (status:failed in the last 24h). No full-text search. Returns a counts block of predicate tallies (by status / event_name / channel). Bodies are omitted from list rows; call get_notification for the rendered body. On gtm-api.com every row is channel email: the in_app channel, read_at and the mark-read verbs are a shared-contract surface the GetSales side writes, so read_at is always null here and there is nothing to mark read. Contract: - MCP tool `search_notifications`, registry package `mcp.id/notifications`, mount `id.platform`. - Operation `search`, response envelope `search`. - Flags: read only.' tags: - Notifications requestBody: required: false content: application/json: schema: $ref: '#/components/schemas/SearchNotificationsRequest' responses: '200': description: '`search` success envelope.' content: application/json: schema: $ref: '#/components/schemas/SearchNotificationsResponse' 4XX: $ref: '#/components/responses/McpClientError' 5XX: $ref: '#/components/responses/McpServerError' x-gtm-mcp-tool: search_notifications x-gtm-mcp-mount: id.platform x-gtm-entity: notifications x-gtm-operation: search x-gtm-envelope: search x-gtm-availability: ga x-gtm-dangerous: false x-gtm-mass-action: false x-gtm-step-eligible: false x-gtm-schedule-required: false x-gtm-tool-class: typical /api/notifications/{sid}: get: operationId: get_notification summary: Get notification description: 'Fetch a single notification by sid: the rendered subject / body, delivery state, and failure reason if any. Contract: - MCP tool `get_notification`, registry package `mcp.id/notifications`, mount `id.platform`. - Operation `get`, response envelope `get`. - Flags: read only.' tags: - Notifications parameters: - name: sid in: path required: true description: Path segment `{sid}`. schema: type: string minLength: 18 maxLength: 18 pattern: ^id_nt_ - name: include[] in: query required: false description: Query parameter `include`. style: form explode: true schema: type: array items: type: string responses: '200': description: '`get` success envelope.' content: application/json: schema: $ref: '#/components/schemas/GetNotificationResponse' 4XX: $ref: '#/components/responses/McpClientError' 5XX: $ref: '#/components/responses/McpServerError' x-gtm-mcp-tool: get_notification x-gtm-mcp-mount: id.platform x-gtm-entity: notifications x-gtm-operation: get x-gtm-envelope: get x-gtm-availability: ga x-gtm-dangerous: false x-gtm-mass-action: false x-gtm-step-eligible: false x-gtm-schedule-required: false x-gtm-tool-class: trivial delete: operationId: delete_notification summary: Dismiss notification description: 'Dismiss a notification from the inbox: a soft-delete that sets deleted_at. DESTRUCTIVE (removes the row from inbox lists). It does NOT cancel in-flight delivery: if the delivery worker already picked the row up, the email still goes out. The audit row is retained (recoverable via deleted_at filters). Contract: - MCP tool `delete_notification`, registry package `mcp.id/notifications`, mount `id.platform`. - Operation `delete`, response envelope `delete_simple`. - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.' tags: - Notifications parameters: - name: sid in: path required: true description: Path segment `{sid}`. schema: type: string minLength: 18 maxLength: 18 pattern: ^id_nt_ responses: '200': description: '`delete_simple` success envelope.' content: application/json: schema: $ref: '#/components/schemas/DeleteNotificationResponse' 4XX: $ref: '#/components/responses/McpClientError' 5XX: $ref: '#/components/responses/McpServerError' x-gtm-mcp-tool: delete_notification x-gtm-mcp-mount: id.platform x-gtm-entity: notifications x-gtm-operation: delete x-gtm-envelope: delete_simple x-gtm-availability: ga x-gtm-dangerous: true x-gtm-mass-action: false x-gtm-step-eligible: false x-gtm-schedule-required: false x-gtm-tool-class: trivial components: schemas: McpError: type: object properties: success: type: boolean enum: - false error: type: object properties: code: type: string enum: - validation_failed - nothing_to_update - not_found - relation_not_found - invalid_transition - limit_exceeded - payment_required - duplicate_rejected - conflict - delete_blocked - unauthorized - forbidden - rate_limited - internal_error - service_unavailable - not_implemented message: type: string recoverable: type: boolean suggestion: type: string field_errors: type: object additionalProperties: type: array items: type: object properties: rule: type: string message: type: string required: - rule - message blockers: type: array items: type: object properties: type: type: string description: Machine-readable blocker type (active_flow, pending_tasks, …). severity: type: string enum: - hard - soft description: hard = external action required; soft = acknowledge is enough. description: type: string entity_sid: type: - string - 'null' count: type: integer resolution: type: string description: 'Hard: tool name to call. Soft: code for acknowledge[].' resolution_hint: type: string required: - type - severity - description - entity_sid - resolution - resolution_hint context: type: object additionalProperties: {} required: - code - message - recoverable meta: type: object properties: trace_id: type: string description: UUID v7; same 128-bit value as the X-Trace-Id header. span_id: type: string pattern: ^[0-9a-f]{16}$ description: 16 hex chars, root span of this request. timestamp: type: string description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time. duration_ms: type: integer minimum: 0 description: Server-side wall clock. team_sid: type: - string - 'null' description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends. actor_type: type: - string - 'null' description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends. required: - trace_id - span_id - timestamp - duration_ms required: - success - error GetNotificationsMetricsResponse: type: object properties: success: type: boolean enum: - true operation: type: string enum: - metrics metrics: type: object properties: filter: type: object additionalProperties: {} period: type: object properties: from: type: string to: type: string required: - from - to aggregated: type: object properties: counts: type: object additionalProperties: {} metrics: type: object properties: {} metrics: type: object properties: {} applied_filters: type: object additionalProperties: {} meta: type: object properties: trace_id: type: string description: UUID v7; same 128-bit value as the X-Trace-Id header. span_id: type: string pattern: ^[0-9a-f]{16}$ description: 16 hex chars, root span of this request. timestamp: type: string description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time. duration_ms: type: integer minimum: 0 description: Server-side wall clock. team_sid: type: - string - 'null' description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends. actor_type: type: - string - 'null' description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends. required: - trace_id - span_id - timestamp - duration_ms required: - success - operation - metrics - meta GetNotificationsMetricsRequest: type: object description: Request body of `get_notifications_metrics`. properties: filter: type: object properties: sid: type: object properties: eq: type: string in: type: array items: type: string additionalProperties: false team_sid: type: object properties: eq: type: string in: type: array items: type: string additionalProperties: false description: Scoped by JWT; explicit override only for internal-support. user_sid: type: object properties: eq: type: string in: type: array items: type: string additionalProperties: false description: 'Recipient: "show me Joe''s notifications".' event_name: type: object properties: eq: type: string in: type: array items: type: string additionalProperties: false description: e.g. linkedin-accounts.logged-out. read_at: type: object properties: gte: type: string lte: type: string gt: type: string lt: type: string is_null: type: boolean additionalProperties: false description: is_null:true = unread. entity_sid: type: object properties: eq: type: string in: type: array items: type: string is_null: type: boolean additionalProperties: false description: The domain entity a notification is about (e.g. a linkedin_account sid). status: type: object properties: eq: type: string enum: - pending - delivered - failed in: type: array items: type: string enum: - pending - delivered - failed additionalProperties: false channel: type: object properties: eq: type: string enum: - email - in_app additionalProperties: false scheduled_at: type: object properties: gte: type: string lte: type: string gt: type: string lt: type: string additionalProperties: false delivered_at: type: object properties: gte: type: string lte: type: string is_null: type: boolean additionalProperties: false description: is_null:true = not yet delivered. failed_at: type: object properties: gte: type: string lte: type: string is_null: type: boolean additionalProperties: false created_at: type: object properties: gte: type: string lte: type: string gt: type: string lt: type: string additionalProperties: false deleted_at: type: object properties: gte: type: string lte: type: string is_null: type: boolean additionalProperties: false description: 'Default scope is { is_null: true } (undismissed rows).' period: type: object properties: from: type: string description: ISO 8601 UTC window start (inclusive). to: type: string description: ISO 8601 UTC window end (exclusive); must be after from. required: - from - to description: Required metrics window [from, to). group_by: type: string enum: - event_name - status - channel description: Optional single split axis. required: - period GetNotificationResponse: type: object properties: success: type: boolean enum: - true operation: type: string enum: - get item: type: object properties: sid: type: string team_sid: type: string user_sid: type: - string - 'null' event_name: type: string event_sid: type: string entity_sid: type: - string - 'null' channel: type: string enum: - email - in_app status: type: string enum: - pending - delivered - failed subject: type: string body_html: type: string body_text: type: string rate_limit_bucket: type: string scheduled_at: type: string delivered_at: type: - string - 'null' failed_at: type: - string - 'null' failure_reason: type: - string - 'null' retry_count: type: number created_by: type: object properties: actor_type: type: string enum: - user - support - api_key - system - agent actor_sid: type: string team_sid: type: string permissions: type: object additionalProperties: {} request_sid: type: - string - 'null' reason: type: - string - 'null' required: - actor_type - actor_sid - team_sid - permissions - reason created_at: type: string updated_at: type: string deleted_at: type: - string - 'null' required: - sid - team_sid - user_sid - event_name - event_sid - entity_sid - channel - status - subject - rate_limit_bucket - scheduled_at - delivered_at - failed_at - failure_reason - retry_count - created_by - created_at - updated_at - deleted_at included: type: object additionalProperties: {} includes: type: array items: type: string meta: type: object properties: trace_id: type: string description: UUID v7; same 128-bit value as the X-Trace-Id header. span_id: type: string pattern: ^[0-9a-f]{16}$ description: 16 hex chars, root span of this request. timestamp: type: string description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time. duration_ms: type: integer minimum: 0 description: Server-side wall clock. team_sid: type: - string - 'null' description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends. actor_type: type: - string - 'null' description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends. required: - trace_id - span_id - timestamp - duration_ms required: - success - operation - item - included - includes - meta DeleteNotificationResponse: type: object properties: success: type: boolean enum: - true operation: type: string enum: - delete item: type: object additionalProperties: {} already_deleted: type: boolean soft_deleted: type: boolean retained: type: array items: type: string meta: type: object properties: trace_id: type: string description: UUID v7; same 128-bit value as the X-Trace-Id header. span_id: type: string pattern: ^[0-9a-f]{16}$ description: 16 hex chars, root span of this request. timestamp: type: string description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time. duration_ms: type: integer minimum: 0 description: Server-side wall clock. team_sid: type: - string - 'null' description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends. actor_type: type: - string - 'null' description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends. required: - trace_id - span_id - timestamp - duration_ms required: - success - operation - item - already_deleted - soft_deleted - retained - meta SearchNotificationsResponse: type: object properties: success: type: boolean enum: - true operation: type: string enum: - search items: type: array items: type: object properties: item: type: object properties: sid: type: string team_sid: type: string user_sid: type: - string - 'null' event_name: type: string event_sid: type: string entity_sid: type: - string - 'null' channel: type: string enum: - email - in_app status: type: string enum: - pending - delivered - failed subject: type: string body_html: type: string body_text: type: string rate_limit_bucket: type: string scheduled_at: type: string delivered_at: type: - string - 'null' failed_at: type: - string - 'null' failure_reason: type: - string - 'null' retry_count: type: number created_by: type: object properties: actor_type: type: string enum: - user - support - api_key - system - agent actor_sid: type: string team_sid: type: string permissions: type: object additionalProperties: {} request_sid: type: - string - 'null' reason: type: - string - 'null' required: - actor_type - actor_sid - team_sid - permissions - reason created_at: type: string updated_at: type: string deleted_at: type: - string - 'null' required: - sid - team_sid - user_sid - event_name - event_sid - entity_sid - channel - status - subject - rate_limit_bucket - scheduled_at - delivered_at - failed_at - failure_reason - retry_count - created_by - created_at - updated_at - deleted_at included: type: object additionalProperties: {} required: - item - included pagination: type: object properties: next_cursor: type: - string - 'null' has_more: type: boolean total_count: type: - integer - 'null' required: - next_cursor - has_more - total_count applied_filters: type: object additionalProperties: {} includes: type: array items: type: string meta: type: object properties: trace_id: type: string description: UUID v7; same 128-bit value as the X-Trace-Id header. span_id: type: string pattern: ^[0-9a-f]{16}$ description: 16 hex chars, root span of this request. timestamp: type: string description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time. duration_ms: type: integer minimum: 0 description: Server-side wall clock. team_sid: type: - string - 'null' description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends. actor_type: type: - string - 'null' description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends. required: - trace_id - span_id - timestamp - duration_ms counts: type: object properties: {} required: - success - operation - items - pagination - applied_filters - includes - meta SearchNotificationsRequest: type: object description: Request body of `search_notifications`. properties: filter: type: object properties: sid: type: object properties: eq: type: string in: type: array items: type: string additionalProperties: false team_sid: type: object properties: eq: type: string in: type: array items: type: string additionalProperties: false description: Scoped by JWT; explicit override only for internal-support. user_sid: type: object properties: eq: type: string in: type: array items: type: string additionalProperties: false description: 'Recipient: "show me Joe''s notifications".' event_name: type: object properties: eq: type: string in: type: array items: type: string additionalProperties: false description: e.g. linkedin-accounts.logged-out. read_at: type: object properties: gte: type: string lte: type: string gt: type: string lt: type: string is_null: type: boolean additionalProperties: false description: is_null:true = unread. entity_sid: type: object properties: eq: type: string in: type: array items: type: string is_null: type: boolean additionalProperties: false description: The domain entity a notification is about (e.g. a linkedin_account sid). status: type: object properties: eq: type: string enum: - pending - delivered - failed in: type: array items: type: string enum: - pending - delivered - failed additionalProperties: false channel: type: object properties: eq: type: string enum: - email - in_app additionalProperties: false scheduled_at: type: object properties: gte: type: string lte: type: string gt: type: string lt: type: string additionalProperties: false delivered_at: type: object properties: gte: type: string lte: type: string is_null: type: boolean additionalProperties: false description: is_null:true = not yet delivered. failed_at: type: object properties: gte: type: string lte: type: string is_null: type: boolean additionalProperties: false created_at: type: object properties: gte: type: string lte: type: string gt: type: string lt: type: string additionalProperties: false deleted_at: type: object properties: gte: type: string lte: type: string is_null: type: boolean additionalProperties: false description: 'Default scope is { is_null: true } (undismissed rows).' sort: type: object properties: field: type: string enum: - created_at - scheduled_at - delivered_at direction: type: string enum: - asc - desc description: Default desc. required: - field page_size: type: integer minimum: 0 maximum: 500 description: 0..500, default 50. page_size=0 = count-only, page_size=1 = getFirst. cursor: type: - string - 'null' description: Opaque forward cursor from a previous response pagination.next_cursor. responses: McpServerError: description: MCP error envelope with `error.code` internal_error or service_unavailable. content: application/json: schema: $ref: '#/components/schemas/McpError' McpClientError: description: MCP error envelope. `error.code` is one of validation_failed, nothing_to_update, not_found, relation_not_found, invalid_transition, limit_exceeded, payment_required, duplicate_rejected, conflict, delete_blocked, unauthorized, forbidden, rate_limited, not_implemented. content: application/json: schema: $ref: '#/components/schemas/McpError' securitySchemes: BearerJwt: type: http scheme: bearer bearerFormat: JWT description: Access token issued by gtm.service.id. Its `access_identity` claim carries `team_sid`, `actor_sid` and `actor_type`, and that team scope is authoritative. TeamSid: type: apiKey in: header name: Team-SID description: Team scope for tokens that do not carry one. Ignored when the token already names a team.