Campaigns V2

Generate Audience Rule

Changed on

Uses an LLM to turn a natural-language prompt into a structured audience targeting rule (RuleConditions AST). The suggestion is returned for the caller to review and save; it is not persisted by this endpoint. Requires campaigns:write scope.

post/v2/campaigns/{id}/audiences/{audience_id}/generate-rule

Request

  • Base URL
    https://api.superwall.com
  • URL
    https://api.superwall.com/v2/campaigns/{id}/audiences/{audience_id}/generate-rule
  • Auth
    • HTTP bearer
    • or API key in cookie accounts_superwall_token
    • or HTTP bearer

Path parameters

idstring required
audience_idstring required

Request body

promptstring required

Natural-language description of the audience to target

Response

AI-generated audience targeting rule

Example response

{
  "rule_conditions": {
    "operator": "and",
    "conditions": [
      {
        "type": "condition",
        "lhs": {
          "type": "property",
          "value": "device.appVersion"
        },
        "operator": "gte",
        "rhs": {
          "type": "string",
          "value": "1.2.3"
        }
      }
    ]
  }
}

Changes

    • warning

      added the new credentials_missing enum value to the / response property for the response status

    • warning

      added the new credentials_missing enum value to the / response property for the response status

    • warning

      added the new credentials_missing enum value to the / response property for the response status

    • warning

      added the new credentials_missing enum value to the / response property for the response status

    • warning

      added the new credentials_missing enum value to the / response property for the response status

    • info

      added subschema #1 subschema #2 subschema #3 subschema #4 subschema #5 to the response body anyOf list for the response status

    • info

      removed subschema #1 subschema #2 subschema #3 subschema #4 subschema #5 from the response body anyOf list for the response status

    • breaking

      the response's property type changed from string to no type for status

    • breaking

      the response's property type changed from string to no type for status

    • breaking

      the response's property type changed from string to no type for status

    • breaking

      the response's property type changed from string to no type for status

    • breaking

      the response's property type changed from string to no type for status

    • breaking

      the response's property type changed from string to no type for status

    • breaking

      the response's property type changed from string to no type for status

    • breaking

      the response's property type changed from string to no type for status

    • breaking

      the response's property type changed from string to no type for status

    • breaking

      the response's property type changed from string to no type for status

    • breaking

      the response's property type changed from string to no type for status

    • breaking

      the response's property type changed from string to no type for status

    • breaking

      the response's property type changed from string to no type for status

    • breaking

      the response's property type changed from number to no type for status

    • breaking

      the ////// response's property type changed from string to no type for status

    • breaking

      the ////// response's property type changed from string to no type for status

    • breaking

      the / response's property type changed from object to no type for status

    • breaking

      the response's property type changed from string to no type for status

    • breaking

      the response's property type changed from string to no type for status

    • breaking

      the response's property type changed from string to no type for status

    • breaking

      the response's property type changed from string to no type for status

    • breaking

      removed the required property // from the response with the status

    • breaking

      removed the required property // from the response with the status

    • info

      added subschema #1 subschema #2 subschema #3 subschema #4 subschema #5 to the response body anyOf list for the response status

    • info

      added subschema #2 to the response body anyOf list for the response status

    • info

      removed subschema #1: Missing API Key subschema #2: Invalid API Key Format subschema #3: Invalid API Key subschema #4: Authentication Failed subschema #5: Invalid Session from the response body anyOf list for the response status

    • info

      removed subschema #2: Bad Request from the response body anyOf list for the response status

    • info

      added subschema #1 to the response property anyOf list for the response status

    • info

      added subschema #1 to the response property anyOf list for the response status

    • info

      added subschema #1 to the response property anyOf list for the response status

    • info

      added subschema #1 to the response property anyOf list for the response status

    • info

      added subschema #1 to the response property anyOf list for the response status

    • info

      added subschema #1 to the response property anyOf list for the response status

    • info

      added subschema #1 to the response property anyOf list for the response status

    • info

      added subschema #1 to the response property anyOf list for the response status

    • info

      added subschema #1 to the response property anyOf list for the response status

    • info

      added subschema #1 to the response property anyOf list for the response status

    • info

      added subschema #1 to the response property anyOf list for the response status

    • info

      added subschema #1 to the response property anyOf list for the response status

    • info

      added subschema #1 to the response property anyOf list for the response status

    • info

      added subschema #1 to the response property anyOf list for the response status

    • info

      added subschema #1 to the response property anyOf list for the response status

    • info

      added subschema #1 to the ////// response property anyOf list for the response status

    • info

      added subschema #1 to the ////// response property anyOf list for the response status

    • info

      added subschema #1 to the / response property anyOf list for the response status

    • info

      added subschema #1 to the response property anyOf list for the response status

    • info

      added subschema #1 to the response property anyOf list for the response status

    • info

      added subschema #1 to the response property anyOf list for the response status

    • info

      added subschema #1 to the response property anyOf list for the response status

    • info

      removed the api_error enum value from the response property for the response status

    • info

      removed the api_error enum value from the response property for the response status

    • info

      removed the api_error enum value from the response property for the response status

    • info

      removed the api_error enum value from the response property for the response status

    • info

      removed the authentication_error enum value from the response property for the response status

    • info

      removed the authentication_error enum value from the response property for the response status

    • info

      removed the authentication_error enum value from the response property for the response status

    • info

      removed the authentication_error enum value from the response property for the response status

    • info

      removed the authentication_failed enum value from the response property for the response status

    • info

      removed the authentication_failed enum value from the response property for the response status

    • info

      removed the authentication_failed enum value from the response property for the response status

    • info

      removed the authentication_failed enum value from the response property for the response status

    • info

      removed the idempotency_key_in_use enum value from the response property for the response status

    • info

      removed the idempotency_key_in_use enum value from the response property for the response status

    • info

      removed the idempotency_key_in_use enum value from the response property for the response status

    • info

      removed the idempotency_key_in_use enum value from the response property for the response status

    • info

      removed the insufficient_permissions enum value from the response property for the response status

    • info

      removed the insufficient_permissions enum value from the response property for the response status

    • info

      removed the insufficient_permissions enum value from the response property for the response status

    • info

      removed the insufficient_permissions enum value from the response property for the response status

    • info

      removed the internal_error enum value from the response property for the response status

    • info

      removed the internal_error enum value from the response property for the response status

    • info

      removed the internal_error enum value from the response property for the response status

    • info

      removed the internal_error enum value from the response property for the response status

    • info

      removed the invalid_api_key enum value from the response property for the response status

    • info

      removed the invalid_api_key enum value from the response property for the response status

    • info

      removed the invalid_api_key enum value from the response property for the response status

    • info

      removed the invalid_api_key enum value from the response property for the response status

    • info

      removed the invalid_api_key_format enum value from the response property for the response status

    • info

      removed the invalid_api_key_format enum value from the response property for the response status

    • info

      removed the invalid_api_key_format enum value from the response property for the response status

    • info

      removed the invalid_api_key_format enum value from the response property for the response status

    • info

      removed the invalid_reference enum value from the response property for the response status

    • info

      removed the invalid_reference enum value from the response property for the response status

    • info

      removed the invalid_reference enum value from the response property for the response status

    • info

      removed the invalid_reference enum value from the response property for the response status

    • info

      removed the invalid_request_error enum value from the response property for the response status

    • info

      removed the invalid_request_error enum value from the response property for the response status

    • info

      removed the invalid_request_error enum value from the response property for the response status

    • info

      removed the invalid_request_error enum value from the response property for the response status

    • info

      removed the invalid_session enum value from the response property for the response status

    • info

      removed the invalid_session enum value from the response property for the response status

    • info

      removed the invalid_session enum value from the response property for the response status

    • info

      removed the invalid_session enum value from the response property for the response status

    • info

      removed the missing_api_key enum value from the response property for the response status

    • info

      removed the missing_api_key enum value from the response property for the response status

    • info

      removed the missing_api_key enum value from the response property for the response status

    • info

      removed the missing_api_key enum value from the response property for the response status

    • info

      removed the organization_required enum value from the response property for the response status

    • info

      removed the organization_required enum value from the response property for the response status

    • info

      removed the organization_required enum value from the response property for the response status

    • info

      removed the organization_required enum value from the response property for the response status

    • info

      removed the parameter_invalid enum value from the response property for the response status

    • info

      removed the parameter_invalid enum value from the response property for the response status

    • info

      removed the parameter_invalid enum value from the response property for the response status

    • info

      removed the parameter_invalid enum value from the response property for the response status

    • info

      removed the parameter_missing enum value from the response property for the response status

    • info

      removed the parameter_missing enum value from the response property for the response status

    • info

      removed the parameter_missing enum value from the response property for the response status

    • info

      removed the parameter_missing enum value from the response property for the response status

    • info

      removed the parameter_unknown enum value from the response property for the response status

    • info

      removed the parameter_unknown enum value from the response property for the response status

    • info

      removed the parameter_unknown enum value from the response property for the response status

    • info

      removed the parameter_unknown enum value from the response property for the response status

    • info

      removed the permission_error enum value from the response property for the response status

    • info

      removed the permission_error enum value from the response property for the response status

    • info

      removed the permission_error enum value from the response property for the response status

    • info

      removed the permission_error enum value from the response property for the response status

    • info

      removed the rate_limit_error enum value from the response property for the response status

    • info

      removed the rate_limit_error enum value from the response property for the response status

    • info

      removed the rate_limit_error enum value from the response property for the response status

    • info

      removed the rate_limit_error enum value from the response property for the response status

    • info

      removed the rate_limit_exceeded enum value from the response property for the response status

    • info

      removed the rate_limit_exceeded enum value from the response property for the response status

    • info

      removed the rate_limit_exceeded enum value from the response property for the response status

    • info

      removed the rate_limit_exceeded enum value from the response property for the response status

    • info

      removed the resource_already_exists enum value from the response property for the response status

    • info

      removed the resource_already_exists enum value from the response property for the response status

    • info

      removed the resource_already_exists enum value from the response property for the response status

    • info

      removed the resource_already_exists enum value from the response property for the response status

    • info

      removed the resource_archived enum value from the response property for the response status

    • info

      removed the resource_archived enum value from the response property for the response status

    • info

      removed the resource_archived enum value from the response property for the response status

    • info

      removed the resource_archived enum value from the response property for the response status

    • info

      removed the resource_missing enum value from the response property for the response status

    • info

      removed the resource_missing enum value from the response property for the response status

    • info

      removed the resource_missing enum value from the response property for the response status

    • info

      removed the resource_missing enum value from the response property for the response status

    • info

      removed the side_effect_failed enum value from the response property for the response status

    • info

      removed the side_effect_failed enum value from the response property for the response status

    • info

      removed the side_effect_failed enum value from the response property for the response status

    • info

      removed the side_effect_failed enum value from the response property for the response status

    • info

      removed the unsupported_operation enum value from the response property for the response status

    • info

      removed the unsupported_operation enum value from the response property for the response status

    • info

      removed the unsupported_operation enum value from the response property for the response status

    • info

      removed the unsupported_operation enum value from the response property for the response status

    • info

      removed the upstream_service_error enum value from the response property for the response status

    • info

      removed the upstream_service_error enum value from the response property for the response status

    • info

      removed the upstream_service_error enum value from the response property for the response status

    • info

      removed the upstream_service_error enum value from the response property for the response status

    This list may be incomplete.