{
  "service": "onesignal_rest_api",
  "displayName": "OneSignal",
  "categories": [
    "Communication",
    "Marketing"
  ],
  "authTypes": [
    "api_key"
  ],
  "auth": [
    {
      "type": "api_key",
      "label": "App API Key",
      "placeholder": "ONESIGNAL_APP_API_KEY",
      "description": "OneSignal app API key used with the Authorization: Key header for app-scoped REST API requests. Find it in Settings > Keys & IDs for the target app: https://documentation.onesignal.com/docs/en/keys-and-ids",
      "extraFields": [
        {
          "key": "appId",
          "label": "App ID",
          "inputType": "text",
          "required": true,
          "secret": false,
          "placeholder": "11111111-1111-4111-8111-111111111111",
          "description": "OneSignal app UUID sent as app_id on every request. Copy it from Settings > Keys & IDs for the target app: https://documentation.onesignal.com/docs/en/keys-and-ids"
        }
      ]
    }
  ],
  "homepageUrl": "https://onesignal.com",
  "actions": [
    {
      "id": "onesignal_rest_api.cancel_message",
      "service": "onesignal_rest_api",
      "name": "cancel_message",
      "description": "Cancel one scheduled OneSignal message by id.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "message_id": {
            "type": "string",
            "minLength": 1,
            "description": "The OneSignal message identifier."
          }
        },
        "additionalProperties": false,
        "required": [
          "message_id"
        ],
        "description": "Input parameters for canceling one OneSignal message."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "Whether OneSignal accepted the cancellation request."
          }
        },
        "additionalProperties": true,
        "description": "The cancel message response returned by OneSignal."
      }
    },
    {
      "id": "onesignal_rest_api.create_push_notification",
      "service": "onesignal_rest_api",
      "name": "create_push_notification",
      "description": "Create a push notification for the connected OneSignal app using one official targeting method.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "contents": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "minLength": 1,
              "description": "The localized text value for one language key."
            },
            "description": "Localized push notification body keyed by language code."
          },
          "headings": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "minLength": 1,
              "description": "The localized text value for one language key."
            },
            "description": "Localized push notification title keyed by language code."
          },
          "subtitle": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "minLength": 1,
              "description": "The localized text value for one language key."
            },
            "description": "Localized push notification subtitle keyed by language code."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Optional OneSignal message name."
          },
          "included_segments": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "description": "One included segment name."
            },
            "description": "Segments targeted by this push notification.",
            "minItems": 1
          },
          "excluded_segments": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "description": "One excluded segment name."
            },
            "description": "Segments explicitly excluded from delivery.",
            "minItems": 1
          },
          "include_aliases": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "description": "A single OneSignal alias value."
              },
              "description": "The alias values for one alias label.",
              "minItems": 1
            },
            "description": "Mapping of OneSignal alias labels to one or more alias values."
          },
          "include_subscription_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "description": "One OneSignal subscription id."
            },
            "description": "Direct subscription ids targeted by this push notification.",
            "minItems": 1
          },
          "filters": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true,
              "description": "One OneSignal filter or operator object."
            },
            "description": "OneSignal filter objects used as the targeting method.",
            "minItems": 1
          },
          "template_id": {
            "type": "string",
            "minLength": 1,
            "description": "The OneSignal template UUID."
          },
          "send_after": {
            "type": "string",
            "minLength": 1,
            "description": "Scheduled delivery time string accepted by OneSignal."
          },
          "url": {
            "type": "string",
            "minLength": 1,
            "description": "Optional URL to open from the notification."
          },
          "web_url": {
            "type": "string",
            "minLength": 1,
            "description": "Optional web URL to open from the notification."
          },
          "app_url": {
            "type": "string",
            "minLength": 1,
            "description": "Optional app deep link to open from the notification."
          },
          "data": {
            "type": "object",
            "properties": {},
            "additionalProperties": true,
            "description": "Custom push data included in the message payload."
          },
          "custom_data": {
            "type": "object",
            "properties": {},
            "additionalProperties": true,
            "description": "Template personalization data included in the request."
          },
          "content_available": {
            "type": "boolean",
            "description": "Whether to set content_available for silent delivery."
          }
        },
        "additionalProperties": true,
        "description": "Core OneSignal push notification fields. The connector injects app_id from the connected credential and allows additional official request keys."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "description": "The created OneSignal message identifier."
          },
          "external_id": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "description": "The upstream external id."
              },
              {
                "type": "null",
                "description": "The response does not include this field."
              }
            ],
            "description": "The upstream external id when OneSignal returns it."
          },
          "errors": {
            "anyOf": [
              {
                "description": "The upstream errors payload."
              },
              {
                "type": "null",
                "description": "The response does not include this field."
              }
            ],
            "description": "OneSignal validation errors returned for the create request."
          },
          "warnings": {
            "anyOf": [
              {
                "description": "The upstream warnings payload."
              },
              {
                "type": "null",
                "description": "The response does not include this field."
              }
            ],
            "description": "OneSignal warnings returned for the create request."
          }
        },
        "additionalProperties": true,
        "required": [
          "id"
        ],
        "description": "The create push notification response returned by OneSignal."
      }
    },
    {
      "id": "onesignal_rest_api.get_message",
      "service": "onesignal_rest_api",
      "name": "get_message",
      "description": "Retrieve one OneSignal message by id from the connected app.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "message_id": {
            "type": "string",
            "minLength": 1,
            "description": "The OneSignal message identifier."
          }
        },
        "additionalProperties": false,
        "required": [
          "message_id"
        ],
        "description": "Input parameters for retrieving one OneSignal message."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "description": "The OneSignal message identifier."
          },
          "app_id": {
            "type": "string",
            "minLength": 1,
            "description": "The OneSignal app UUID attached to the message."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "The message name when OneSignal includes it."
          },
          "queued_at": {
            "type": "integer",
            "description": "Unix timestamp when the message was queued."
          },
          "send_after": {
            "type": "string",
            "minLength": 1,
            "description": "The scheduled delivery time string returned by OneSignal."
          },
          "completed_at": {
            "type": "integer",
            "description": "Unix timestamp when the message finished processing."
          },
          "canceled": {
            "type": "boolean",
            "description": "Whether the message has been canceled."
          },
          "contents": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "minLength": 1,
              "description": "The localized text value for one language key."
            },
            "description": "The localized message body returned by OneSignal."
          },
          "headings": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "minLength": 1,
              "description": "The localized text value for one language key."
            },
            "description": "The localized message title returned by OneSignal."
          },
          "subtitle": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "minLength": 1,
              "description": "The localized text value for one language key."
            },
            "description": "The localized message subtitle returned by OneSignal."
          },
          "included_segments": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "description": "One included segment name."
            },
            "description": "Included OneSignal segments attached to the message.",
            "minItems": 1
          },
          "excluded_segments": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "description": "One excluded segment name."
            },
            "description": "Excluded OneSignal segments attached to the message.",
            "minItems": 1
          },
          "include_aliases": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "description": "A single OneSignal alias value."
              },
              "description": "The alias values for one alias label.",
              "minItems": 1
            },
            "description": "Mapping of OneSignal alias labels to one or more alias values."
          },
          "include_subscription_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "description": "One OneSignal subscription id."
            },
            "description": "Included subscription ids attached to the message.",
            "minItems": 1
          },
          "filters": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true,
              "description": "One OneSignal filter or operator object."
            },
            "description": "OneSignal filter objects used as the targeting method.",
            "minItems": 1
          },
          "template_id": {
            "type": "string",
            "minLength": 1,
            "description": "The OneSignal template UUID."
          },
          "url": {
            "type": "string",
            "minLength": 1,
            "description": "The URL attached to the message."
          },
          "web_url": {
            "type": "string",
            "minLength": 1,
            "description": "The web URL attached to the message."
          },
          "app_url": {
            "type": "string",
            "minLength": 1,
            "description": "The app URL attached to the message."
          },
          "data": {
            "type": "object",
            "properties": {},
            "additionalProperties": true,
            "description": "Custom push data attached to the message."
          },
          "custom_data": {
            "type": "object",
            "properties": {},
            "additionalProperties": true,
            "description": "Template custom data attached to the message."
          },
          "successful": {
            "type": "integer",
            "description": "The number of successful deliveries recorded by OneSignal."
          },
          "failed": {
            "type": "integer",
            "description": "The number of failed deliveries recorded by OneSignal."
          },
          "received": {
            "type": "integer",
            "description": "The number of received deliveries recorded by OneSignal."
          },
          "errored": {
            "type": "integer",
            "description": "The number of errored deliveries recorded by OneSignal."
          },
          "converted": {
            "type": "integer",
            "description": "The number of conversions recorded by OneSignal."
          },
          "remaining": {
            "type": "integer",
            "description": "The number of remaining deliveries recorded by OneSignal."
          },
          "platform_delivery_stats": {
            "type": "object",
            "properties": {},
            "additionalProperties": true,
            "description": "Platform-specific delivery metrics returned by OneSignal."
          },
          "outcomes": {
            "type": "object",
            "properties": {},
            "additionalProperties": true,
            "description": "Outcome metrics returned by OneSignal."
          }
        },
        "additionalProperties": true,
        "required": [
          "id",
          "app_id"
        ],
        "description": "A OneSignal message object returned by the upstream API."
      }
    },
    {
      "id": "onesignal_rest_api.list_messages",
      "service": "onesignal_rest_api",
      "name": "list_messages",
      "description": "List messages from the connected OneSignal app.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 50,
            "description": "Maximum number of messages to return."
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "description": "Pagination offset for the message list."
          },
          "kind": {
            "anyOf": [
              {
                "const": 0,
                "type": "number"
              },
              {
                "const": 1,
                "type": "number"
              },
              {
                "const": 3,
                "type": "number"
              }
            ],
            "description": "The OneSignal message kind filter: 0 for API-created, 1 for automated, or 3 for journey."
          },
          "template_id": {
            "type": "string",
            "minLength": 1,
            "description": "The OneSignal template UUID."
          },
          "time_offset": {
            "type": "string",
            "minLength": 1,
            "description": "The sequential time_offset token returned by OneSignal."
          }
        },
        "additionalProperties": false,
        "description": "Input parameters for listing messages from the connected OneSignal app."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "total_count": {
            "type": "integer",
            "description": "Total number of messages matching the request."
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "description": "The offset echoed by OneSignal."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 50,
            "description": "The limit echoed by OneSignal."
          },
          "time_offset": {
            "anyOf": [
              {
                "type": "integer",
                "description": "A numeric OneSignal time_offset token."
              },
              {
                "type": "string",
                "minLength": 1,
                "description": "A string OneSignal time_offset token."
              },
              {
                "type": "null",
                "description": "The response does not include this field."
              }
            ],
            "description": "The sequential time_offset token returned by OneSignal."
          },
          "next_time_offset": {
            "anyOf": [
              {
                "type": "integer",
                "description": "A numeric OneSignal time_offset token."
              },
              {
                "type": "string",
                "minLength": 1,
                "description": "A string OneSignal time_offset token."
              },
              {
                "type": "null",
                "description": "The response does not include this field."
              }
            ],
            "description": "The sequential time_offset token returned by OneSignal."
          },
          "notifications": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "description": "The OneSignal message identifier."
                },
                "app_id": {
                  "type": "string",
                  "minLength": 1,
                  "description": "The OneSignal app UUID attached to the message."
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "description": "The message name when OneSignal includes it."
                },
                "queued_at": {
                  "type": "integer",
                  "description": "Unix timestamp when the message was queued."
                },
                "send_after": {
                  "type": "string",
                  "minLength": 1,
                  "description": "The scheduled delivery time string returned by OneSignal."
                },
                "completed_at": {
                  "type": "integer",
                  "description": "Unix timestamp when the message finished processing."
                },
                "canceled": {
                  "type": "boolean",
                  "description": "Whether the message has been canceled."
                },
                "contents": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string",
                    "minLength": 1,
                    "description": "The localized text value for one language key."
                  },
                  "description": "The localized message body returned by OneSignal."
                },
                "headings": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string",
                    "minLength": 1,
                    "description": "The localized text value for one language key."
                  },
                  "description": "The localized message title returned by OneSignal."
                },
                "subtitle": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string",
                    "minLength": 1,
                    "description": "The localized text value for one language key."
                  },
                  "description": "The localized message subtitle returned by OneSignal."
                },
                "included_segments": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "description": "One included segment name."
                  },
                  "description": "Included OneSignal segments attached to the message.",
                  "minItems": 1
                },
                "excluded_segments": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "description": "One excluded segment name."
                  },
                  "description": "Excluded OneSignal segments attached to the message.",
                  "minItems": 1
                },
                "include_aliases": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "description": "A single OneSignal alias value."
                    },
                    "description": "The alias values for one alias label.",
                    "minItems": 1
                  },
                  "description": "Mapping of OneSignal alias labels to one or more alias values."
                },
                "include_subscription_ids": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "description": "One OneSignal subscription id."
                  },
                  "description": "Included subscription ids attached to the message.",
                  "minItems": 1
                },
                "filters": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {},
                    "additionalProperties": true,
                    "description": "One OneSignal filter or operator object."
                  },
                  "description": "OneSignal filter objects used as the targeting method.",
                  "minItems": 1
                },
                "template_id": {
                  "type": "string",
                  "minLength": 1,
                  "description": "The OneSignal template UUID."
                },
                "url": {
                  "type": "string",
                  "minLength": 1,
                  "description": "The URL attached to the message."
                },
                "web_url": {
                  "type": "string",
                  "minLength": 1,
                  "description": "The web URL attached to the message."
                },
                "app_url": {
                  "type": "string",
                  "minLength": 1,
                  "description": "The app URL attached to the message."
                },
                "data": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": true,
                  "description": "Custom push data attached to the message."
                },
                "custom_data": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": true,
                  "description": "Template custom data attached to the message."
                },
                "successful": {
                  "type": "integer",
                  "description": "The number of successful deliveries recorded by OneSignal."
                },
                "failed": {
                  "type": "integer",
                  "description": "The number of failed deliveries recorded by OneSignal."
                },
                "received": {
                  "type": "integer",
                  "description": "The number of received deliveries recorded by OneSignal."
                },
                "errored": {
                  "type": "integer",
                  "description": "The number of errored deliveries recorded by OneSignal."
                },
                "converted": {
                  "type": "integer",
                  "description": "The number of conversions recorded by OneSignal."
                },
                "remaining": {
                  "type": "integer",
                  "description": "The number of remaining deliveries recorded by OneSignal."
                },
                "platform_delivery_stats": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": true,
                  "description": "Platform-specific delivery metrics returned by OneSignal."
                },
                "outcomes": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": true,
                  "description": "Outcome metrics returned by OneSignal."
                }
              },
              "additionalProperties": true,
              "required": [
                "id",
                "app_id"
              ],
              "description": "A OneSignal message object returned by the upstream API."
            },
            "description": "Messages returned by OneSignal."
          }
        },
        "additionalProperties": true,
        "required": [
          "total_count",
          "offset",
          "limit",
          "notifications"
        ],
        "description": "The paginated message list returned by OneSignal."
      }
    }
  ]
}
