subbydocs
Visit Subby Start building

Nudges

Reminders delivered over SMS, WhatsApp or email.

OpenAPI

https://sandbox-api.mysubbyapp.com/v1

POST/nudges

Send a nudge

Sends a reminder to a customer now. Costs 1 write request plus 1 nudge from your allowance once sent. Limited to 3 manual nudges per customer per 24 hours.

Metered on successful live writesnudges:write

Request example

curl --request POST \
  --url 'https://sandbox-api.mysubbyapp.com/v1/nudges' \
  --header 'Authorization: Bearer sk_test_YOUR_SECRET_KEY'

Add a JSON body matching the request schema below and a Content-Type: application/json header.

Parameters

Idempotency-Keyheader · string

Makes retries safe. Replays return the original response and are not metered.

Request body schema
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "required": [
          "customer",
          "template"
        ],
        "properties": {
          "customer": {
            "type": "string"
          },
          "subscription": {
            "type": "string"
          },
          "channels": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "whatsapp",
                "sms",
                "email"
              ]
            },
            "description": "In order of preference. Defaults to the plan's reminder channels."
          },
          "template": {
            "type": "string",
            "enum": [
              "payment_due",
              "payment_failed",
              "update_payment_method",
              "service_paused",
              "custom"
            ]
          },
          "custom_message": {
            "type": "string",
            "maxLength": 480,
            "description": "Required when template is custom. A payment link is appended automatically."
          }
        }
      }
    }
  }
}

Responses

201 The queued nudge.
{
  "application/json": {
    "schema": {
      "type": "object",
      "properties": {
        "success": {
          "const": true
        },
        "data": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "example": "ndg_7Yt2Qa"
            },
            "object": {
              "const": "nudge"
            },
            "customer": {
              "type": "string"
            },
            "subscription": {
              "type": [
                "string",
                "null"
              ]
            },
            "channel": {
              "type": "string",
              "enum": [
                "whatsapp",
                "sms",
                "email"
              ]
            },
            "template": {
              "type": "string"
            },
            "source": {
              "type": "string",
              "enum": [
                "automatic",
                "api",
                "dashboard"
              ]
            },
            "status": {
              "type": "string",
              "enum": [
                "queued",
                "sent",
                "delivered",
                "failed"
              ]
            },
            "failure_reason": {
              "type": [
                "string",
                "null"
              ]
            },
            "counts_toward_allowance": {
              "type": "boolean"
            },
            "billed_as_overage": {
              "type": "boolean"
            },
            "sent_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "delivered_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "livemode": {
              "type": "boolean"
            },
            "created_at": {
              "type": "string",
              "format": "date-time"
            }
          }
        }
      }
    }
  }
}
400 Invalid request.
{
  "application/json": {
    "schema": {
      "type": "object",
      "required": [
        "success",
        "error"
      ],
      "properties": {
        "success": {
          "const": false
        },
        "error": {
          "type": "object",
          "required": [
            "type",
            "code",
            "message",
            "request_id"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "authentication_error",
                "permission_error",
                "invalid_request_error",
                "state_error",
                "idempotency_error",
                "rate_limit_error",
                "api_error"
              ]
            },
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": [
                "string",
                "null"
              ]
            },
            "request_id": {
              "type": "string"
            },
            "doc_url": {
              "type": "string",
              "format": "uri"
            }
          }
        }
      }
    }
  }
}
422 Valid request that conflicts with the object's state.
{
  "application/json": {
    "schema": {
      "type": "object",
      "required": [
        "success",
        "error"
      ],
      "properties": {
        "success": {
          "const": false
        },
        "error": {
          "type": "object",
          "required": [
            "type",
            "code",
            "message",
            "request_id"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "authentication_error",
                "permission_error",
                "invalid_request_error",
                "state_error",
                "idempotency_error",
                "rate_limit_error",
                "api_error"
              ]
            },
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": [
                "string",
                "null"
              ]
            },
            "request_id": {
              "type": "string"
            },
            "doc_url": {
              "type": "string",
              "format": "uri"
            }
          }
        }
      }
    }
  }
}
GET/nudges

List nudges

Not meterednudges:read

Request example

curl --request GET \
  --url 'https://sandbox-api.mysubbyapp.com/v1/nudges' \
  --header 'Authorization: Bearer sk_test_YOUR_SECRET_KEY'

Parameters

limitquery · integer

starting_afterquery · string

ending_beforequery · string

customerquery · string

subscriptionquery · string

channelquery · string

statusquery · string

Responses

200 Nudges, newest first.
{
  "application/json": {
    "schema": {
      "type": "object",
      "properties": {
        "success": {
          "const": true
        },
        "data": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "example": "ndg_7Yt2Qa"
              },
              "object": {
                "const": "nudge"
              },
              "customer": {
                "type": "string"
              },
              "subscription": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "channel": {
                "type": "string",
                "enum": [
                  "whatsapp",
                  "sms",
                  "email"
                ]
              },
              "template": {
                "type": "string"
              },
              "source": {
                "type": "string",
                "enum": [
                  "automatic",
                  "api",
                  "dashboard"
                ]
              },
              "status": {
                "type": "string",
                "enum": [
                  "queued",
                  "sent",
                  "delivered",
                  "failed"
                ]
              },
              "failure_reason": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "counts_toward_allowance": {
                "type": "boolean"
              },
              "billed_as_overage": {
                "type": "boolean"
              },
              "sent_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "delivered_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "livemode": {
                "type": "boolean"
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              }
            }
          }
        },
        "meta": {
          "type": "object",
          "required": [
            "has_more",
            "limit"
          ],
          "properties": {
            "has_more": {
              "type": "boolean"
            },
            "next_cursor": {
              "type": [
                "string",
                "null"
              ]
            },
            "limit": {
              "type": "integer"
            }
          }
        }
      }
    }
  }
}
GET/nudges/{id}

Retrieve a nudge

Not meterednudges:read

Request example

curl --request GET \
  --url 'https://sandbox-api.mysubbyapp.com/v1/nudges/{id}' \
  --header 'Authorization: Bearer sk_test_YOUR_SECRET_KEY'

Parameters

idpath · string · required

Responses

200 The nudge.
{
  "application/json": {
    "schema": {
      "type": "object",
      "properties": {
        "success": {
          "const": true
        },
        "data": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "example": "ndg_7Yt2Qa"
            },
            "object": {
              "const": "nudge"
            },
            "customer": {
              "type": "string"
            },
            "subscription": {
              "type": [
                "string",
                "null"
              ]
            },
            "channel": {
              "type": "string",
              "enum": [
                "whatsapp",
                "sms",
                "email"
              ]
            },
            "template": {
              "type": "string"
            },
            "source": {
              "type": "string",
              "enum": [
                "automatic",
                "api",
                "dashboard"
              ]
            },
            "status": {
              "type": "string",
              "enum": [
                "queued",
                "sent",
                "delivered",
                "failed"
              ]
            },
            "failure_reason": {
              "type": [
                "string",
                "null"
              ]
            },
            "counts_toward_allowance": {
              "type": "boolean"
            },
            "billed_as_overage": {
              "type": "boolean"
            },
            "sent_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "delivered_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "livemode": {
              "type": "boolean"
            },
            "created_at": {
              "type": "string",
              "format": "date-time"
            }
          }
        }
      }
    }
  }
}
404 Object or route not found in this environment.
{
  "application/json": {
    "schema": {
      "type": "object",
      "required": [
        "success",
        "error"
      ],
      "properties": {
        "success": {
          "const": false
        },
        "error": {
          "type": "object",
          "required": [
            "type",
            "code",
            "message",
            "request_id"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "authentication_error",
                "permission_error",
                "invalid_request_error",
                "state_error",
                "idempotency_error",
                "rate_limit_error",
                "api_error"
              ]
            },
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": [
                "string",
                "null"
              ]
            },
            "request_id": {
              "type": "string"
            },
            "doc_url": {
              "type": "string",
              "format": "uri"
            }
          }
        }
      }
    }
  }
}