ProsperStack API Reference (v1)

Download OpenAPI specification:Download

This is the reference documentation for the ProsperStack API v1. Visit ProsperStack at prosperstack.com.

For more information on ProsperStack features, see the primary documentation.

Let us know how we can improve the API, documentation or anything else you need help with at support@prosperstack.com.

Introduction

The ProsperStack API provides a REST-like interface to your ProsperStack data. It uses standard HTTP verbs, accepts JSON-encoded request bodies and provides JSON-encoded responses.

You can use the ProsperStack API to access your live production data or data from test mode. The API key you use to authenticate requests determines which mode will be used.

Authentication

The ProsperStack API uses API keys to authenticate requests. You can manage your API keys from the ProsperStack API Keys settings page.

Live mode API keys have the prefix key_ and test mode API keys have the prefix key_test_.

Authentication uses HTTP basic authentication. Provide your API key as the basic authentication username. You don't need to provide a password.

A simple example using cURL:

curl https://api.prosperstack.com/v1/flow_sessions \
-u key_LSdJXBrN3SP7bdJrQSMp2eZK:

Learn more about creating API keys.

Pagination

All list endpoints support cursor-based pagination. The body of a list response will contain a data property with an array of objects and a next_cursor property desginating the cursor value to retrieve the next set of results.

Use the value of next_cursor in the cursor query parameter to specify the set of results to return. If next_cursor is null, there are no more results.

You can also specify a limit in the query parameters to adjust the number of items per result set. The limit defaults to 10 and has a maximum of 100.

Rate limits

The ProsperStack API enforces a rate limit of 100 requests per minute. Your live mode and test mode accounts have separate limits.

When the rate limit is exceeded, requests will fail with the HTTP status 429 Too Many Requests until the limit window resets.

The ProsperStack API implements the RateLimit Header Fields for HTTP draft which describes a set of HTTP headers you can use to observe current request limits.

The headers are:

  • RateLimit-Limit — The limit of requests per time window (1 minute)
  • RateLimit-Remaining — The number of requests left before exceeding the limit
  • RateLimit-Reset — The number of seconds until the limit window resets

If you need to exceed the rate limit, let us know at support@prosperstack.com and we'll be happy to help.

Flows

A flow represents a ProsperStack cancellation flow.

List flows

query Parameters
cursor
string

Pagnination cursor to retrieve

limit
integer [ 1 .. 100 ]

Limit of flows to return

Responses

Response Schema: application/json
required
Array of objects (Flow)
next_cursor
string or null (Cursor)

Response samples

Content type
application/json
{
  • "data": [
    • {
      • "id": "flow_3Aree3otQWV2qXhFiehIIQpA",
      • "name": "Default",
      • "created_at": "2019-08-24T14:15:22Z",
      • "updated_at": "2019-08-24T14:15:22Z"
      }
    ],
  • "next_cursor": "null"
}

Retrieve a flow

path Parameters
id
required
string

Flow ID to retrieve

Responses

Response Schema: application/json
id
required
string
name
required
string
created_at
required
string <date-time>
updated_at
required
string <date-time>

Response samples

Content type
application/json
{
  • "id": "flow_3Aree3otQWV2qXhFiehIIQpA",
  • "name": "Default",
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

Flow sessions

A flow session represents the session a cancelling subscriber took when going through the ProsperStack cancellation flow, including answers to survey questions and any offers presented or accepted.

List flow sessions

query Parameters
subscriber_id
string

Filter flow sessions by subscriber ID

status
string
Enum: "saved" "deflected" "canceled" "incomplete"

Filter flow sessions by status

started_at
string

Filter flow sessions by the started_at property. Specify as a dictionary with one of the following properties:

  • started_at[gt] — Return flow sessions where started_at is greater than this value
  • started_at[lt] — Return flow sessions where started_at is less than this value
  • started_at[gte] — Return flow sessions where started_at is greater than or equal to this value
  • started_at[lte] — Return flow sessions where started_at is less than or equal to this value

Specify date values in ISO 8601 format.

completed_at
string

Filter flow sessions by the completed_at property. Specify as a dictionary with one of the following properties:

  • completed_at[gt] — Return flow sessions where completed_at is greater than this value
  • completed_at[lt] — Return flow sessions where completed_at is less than this value
  • completed_at[gte] — Return flow sessions where completed_at is greater than or equal to this value
  • completed_at[lte] — Return flow sessions where completed_at is less than or equal to this value

Specify date values in ISO 8601 format.

cursor
string

Pagination cursor to retrieve

limit
integer [ 1 .. 100 ]

Limit of flow sessions to return

Responses

Response Schema: application/json
required
Array of objects (FlowSession)
next_cursor
string or null (Cursor)

Response samples

Content type
application/json
{
  • "data": [
    • {
      • "id": "sess_eoTR48bvoOCd7SxXAKRrPhj0",
      • "status": "saved",
      • "created_at": "2019-08-24T14:15:22Z",
      • "started_at": "2019-08-24T14:15:22Z",
      • "updated_at": "2019-08-24T14:15:22Z",
      • "completed_at": "2019-08-24T14:15:22Z",
      • "flow": {
        • "id": "flow_3Aree3otQWV2qXhFiehIIQpA",
        • "name": "Default",
        • "created_at": "2019-08-24T14:15:22Z",
        • "updated_at": "2019-08-24T14:15:22Z"
        },
      • "subscriber": {
        • "id": "subr_dRiytWmkVtSBt9mOpRaC0ca0",
        • "platform_id": "cus_Jax42BBWGOWuDp",
        • "name": "Jane Doe",
        • "email": "jane@example.com",
        • "status": "saved",
        • "properties": [
          • {
            • "property": {
              • "id": "prop_jrtpyZs1httwFFIl7V80cHwf",
              • "key": "number_of_contacts",
              • "name": "Number of contacts",
              • "entity": "subscriber",
              • "type": "number",
              • "format": "number"
              },
            • "value": 5800,
            • "formatted_value": "5,800"
            }
          ],
        • "created_at": "2019-08-24T14:15:22Z",
        • "updated_at": "2019-08-24T14:15:22Z"
        },
      • "subscription": {
        • "id": "subn_dp79dRR5wIy1kGW4PCO41wit",
        • "platform_id": "sub_JE1trB8eUAnh0r",
        • "subscriber_id": "subr_GQmXBebvivMb5tHhassNV9kj",
        • "mrr": "399.95",
        • "status": "active",
        • "properties": [
          • {
            • "property": {
              • "id": "prop_S6A17y8S8wgKBBJbveQHpLW6",
              • "key": "is_professional",
              • "name": "Is professional",
              • "entity": "subscription",
              • "type": "boolean",
              • "format": "null"
              },
            • "value": true,
            • "formatted_value": "True"
            }
          ],
        • "created_at": "2019-08-24T14:15:22Z",
        • "updated_at": "2019-08-24T14:15:22Z"
        },
      • "offers_presented": [
        • {
          • "id": "offr_jIGqAAUKqWM2pptJTfRuei1t",
          • "type": "coupon",
          • "name": "40% off",
          • "details": {
            • "type": "coupon",
            • "coupon_type": "percentage",
            • "amount_off": "23.7",
            • "duration": "repeating",
            • "months": 6,
            • "apply_to": "subscription",
            • "platform_coupon_id": "string"
            },
          • "metadata": { },
          • "created_at": "2019-08-24T14:15:22Z",
          • "updated_at": "2019-08-24T14:15:22Z"
          }
        ],
      • "offer_accepted": {
        • "id": "offr_jIGqAAUKqWM2pptJTfRuei1t",
        • "type": "coupon",
        • "name": "40% off",
        • "details": {
          • "type": "coupon",
          • "coupon_type": "percentage",
          • "amount_off": "23.7",
          • "duration": "repeating",
          • "months": 6,
          • "apply_to": "subscription",
          • "platform_coupon_id": "string"
          },
        • "metadata": { },
        • "created_at": "2019-08-24T14:15:22Z",
        • "updated_at": "2019-08-24T14:15:22Z"
        },
      • "answers": [
        • {
          • "question": {
            • "id": "ques_By8b753fR4egFkzaJ8wBGK70",
            • "type": "multiple_choice",
            • "text": "What is your primary reason for leaving?",
            • "primary": true
            },
          • "value": {
            • "id": "qopt_Jv3WHts65H9Iwz6bNcuBSapF",
            • "text": "Too expensive"
            },
          • "sentiment": "null"
          }
        ],
      • "steps": [
        • {
          • "step": {
            • "id": "step_S3biU4JN09ie6p52eIk3SWF3",
            • "type": "question",
            • "title": "What is your primary reason for leaving?"
            },
          • "started_at": "2019-08-24T14:15:22Z",
          • "completed_at": "2019-08-24T14:15:22Z"
          }
        ],
      • "cancel_reason": {
        • "text": "Too expensive",
        • "reason_code": "too_expensive"
        },
      • "deflected_by": {
        • "type": "deflection",
        • "details": {
          • "deflection": {
            • "id": "defl_qvNg13Ydk3N9C5Pw5AgTSfFU",
            • "name": "Account snapshot",
            • "actions": []
            },
          • "action": {}
          }
        },
      • "rerouted_from_flow_session_id": "string"
      }
    ],
  • "next_cursor": "null"
}

Retrieve a flow session

path Parameters
id
required
string

Flow session ID to retrieve

Responses

Response Schema: application/json
id
required
string
status
required
string
Enum: "canceled" "saved" "deflected" "incomplete" "rerouted"
created_at
required
string <date-time>
started_at
required
string or null <date-time>
updated_at
required
string <date-time>
completed_at
required
string or null <date-time>
required
object (Flow)
required
object (Subscriber)
required
object (Subscription)
required
Array of objects (Offer)
required
Offer (object) or null
required
Array of objects (Answer)
required
Array of objects (FlowSessionStep)
required
CancelReason (object) or null
required
FlowSessionDeflectedBy (object) or null
rerouted_from_flow_session_id
required
string or null

Response samples

Content type
application/json
{
  • "id": "sess_eoTR48bvoOCd7SxXAKRrPhj0",
  • "status": "saved",
  • "created_at": "2019-08-24T14:15:22Z",
  • "started_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "completed_at": "2019-08-24T14:15:22Z",
  • "flow": {
    • "id": "flow_3Aree3otQWV2qXhFiehIIQpA",
    • "name": "Default",
    • "created_at": "2019-08-24T14:15:22Z",
    • "updated_at": "2019-08-24T14:15:22Z"
    },
  • "subscriber": {
    • "id": "subr_dRiytWmkVtSBt9mOpRaC0ca0",
    • "platform_id": "cus_Jax42BBWGOWuDp",
    • "name": "Jane Doe",
    • "email": "jane@example.com",
    • "status": "saved",
    • "properties": [
      • {
        • "property": {
          • "id": "prop_jrtpyZs1httwFFIl7V80cHwf",
          • "key": "number_of_contacts",
          • "name": "Number of contacts",
          • "entity": "subscriber",
          • "type": "number",
          • "format": "number"
          },
        • "value": 5800,
        • "formatted_value": "5,800"
        }
      ],
    • "created_at": "2019-08-24T14:15:22Z",
    • "updated_at": "2019-08-24T14:15:22Z"
    },
  • "subscription": {
    • "id": "subn_dp79dRR5wIy1kGW4PCO41wit",
    • "platform_id": "sub_JE1trB8eUAnh0r",
    • "subscriber_id": "subr_GQmXBebvivMb5tHhassNV9kj",
    • "mrr": "399.95",
    • "status": "active",
    • "properties": [
      • {
        • "property": {
          • "id": "prop_S6A17y8S8wgKBBJbveQHpLW6",
          • "key": "is_professional",
          • "name": "Is professional",
          • "entity": "subscription",
          • "type": "boolean",
          • "format": "null"
          },
        • "value": true,
        • "formatted_value": "True"
        }
      ],
    • "created_at": "2019-08-24T14:15:22Z",
    • "updated_at": "2019-08-24T14:15:22Z"
    },
  • "offers_presented": [
    • {
      • "id": "offr_jIGqAAUKqWM2pptJTfRuei1t",
      • "type": "coupon",
      • "name": "40% off",
      • "details": {
        • "type": "coupon",
        • "coupon_type": "percentage",
        • "amount_off": "23.7",
        • "duration": "repeating",
        • "months": 6,
        • "apply_to": "subscription",
        • "platform_coupon_id": "string"
        },
      • "metadata": { },
      • "created_at": "2019-08-24T14:15:22Z",
      • "updated_at": "2019-08-24T14:15:22Z"
      }
    ],
  • "offer_accepted": {
    • "id": "offr_jIGqAAUKqWM2pptJTfRuei1t",
    • "type": "coupon",
    • "name": "40% off",
    • "details": {
      • "type": "coupon",
      • "coupon_type": "percentage",
      • "amount_off": "23.7",
      • "duration": "repeating",
      • "months": 6,
      • "apply_to": "subscription",
      • "platform_coupon_id": "string"
      },
    • "metadata": { },
    • "created_at": "2019-08-24T14:15:22Z",
    • "updated_at": "2019-08-24T14:15:22Z"
    },
  • "answers": [
    • {
      • "question": {
        • "id": "ques_By8b753fR4egFkzaJ8wBGK70",
        • "type": "multiple_choice",
        • "text": "What is your primary reason for leaving?",
        • "primary": true
        },
      • "value": {
        • "id": "qopt_Jv3WHts65H9Iwz6bNcuBSapF",
        • "text": "Too expensive"
        },
      • "sentiment": "null"
      }
    ],
  • "steps": [
    • {
      • "step": {
        • "id": "step_S3biU4JN09ie6p52eIk3SWF3",
        • "type": "question",
        • "title": "What is your primary reason for leaving?"
        },
      • "started_at": "2019-08-24T14:15:22Z",
      • "completed_at": "2019-08-24T14:15:22Z"
      }
    ],
  • "cancel_reason": {
    • "text": "Too expensive",
    • "reason_code": "too_expensive"
    },
  • "deflected_by": {
    • "type": "deflection",
    • "details": {
      • "deflection": {
        • "id": "defl_qvNg13Ydk3N9C5Pw5AgTSfFU",
        • "name": "Account snapshot",
        • "actions": []
        },
      • "action": {}
      }
    },
  • "rerouted_from_flow_session_id": "string"
}

Offers

An offer represents a ProsperStack offer.

Offers can be of type coupon, pause_subscription, trial_extension, change_plan or custom.

List offers

query Parameters
cursor
string

Pagination cursor to retrieve

limit
integer [ 1 .. 100 ]

Limit of offers to return

Responses

Response Schema: application/json
required
Array of objects (Offer)
next_cursor
string or null (Cursor)

Response samples

Content type
application/json
{
  • "data": [
    • {
      • "id": "offr_jIGqAAUKqWM2pptJTfRuei1t",
      • "type": "coupon",
      • "name": "40% off",
      • "details": {
        • "type": "coupon",
        • "coupon_type": "percentage",
        • "amount_off": "23.7",
        • "duration": "repeating",
        • "months": 6,
        • "apply_to": "subscription",
        • "platform_coupon_id": "string"
        },
      • "metadata": { },
      • "created_at": "2019-08-24T14:15:22Z",
      • "updated_at": "2019-08-24T14:15:22Z"
      }
    ],
  • "next_cursor": "null"
}

Retrieve an offer

path Parameters
id
required
string

Offer ID to retrieve

Responses

Response Schema: application/json
id
required
string
type
required
string
Enum: "coupon" "pause_subscription" "trial_extension" "change_plan" "custom"
name
required
string
required
CouponOfferDetails (object) or ChangePlanOfferDetails (object) or TrialExtensionOfferDetails (object) or PauseSubscriptionOfferDetails (object) or CustomOfferDetails (object)
metadata
required
object
created_at
required
string <date-time>
updated_at
required
string <date-time>

Response samples

Content type
application/json
{
  • "id": "offr_jIGqAAUKqWM2pptJTfRuei1t",
  • "type": "coupon",
  • "name": "40% off",
  • "details": {
    • "type": "coupon",
    • "coupon_type": "percentage",
    • "amount_off": "23.7",
    • "duration": "repeating",
    • "months": 6,
    • "apply_to": "subscription",
    • "platform_coupon_id": "string"
    },
  • "metadata": { },
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

Properties

A property represents a ProsperStack custom property defined for subscribers or subscriptions.

Properties can be used to store custom data with your subscribers and subscriptions. They can be of type text, number, boolean or date.

Each custom property must be attached to either the subscriber or subscription entity type.

List properties

query Parameters
entity
string
Enum: "subscriber" "subscription"

Entity type to return properties for

cursor
string

Pagination cursor to retrieve

limit
integer [ 1 .. 100 ]

Limit of properties to return

Responses

Response Schema: application/json
required
Array of objects (Property)
next_cursor
string or null (Cursor)

Response samples

Content type
application/json
{
  • "data": [
    • {
      • "id": "prop_jrtpyZs1httwFFIl7V80cHwf",
      • "key": "number_of_contacts",
      • "name": "Number of contacts",
      • "entity": "subscriber",
      • "type": "number",
      • "format": "number"
      }
    ],
  • "next_cursor": "null"
}

Create a property

Request Body schema: application/json
key
required
string
name
required
string
entity
required
string
Enum: "subscriber" "subscription"
type
required
string
Enum: "text" "number" "boolean" "date"
format
string
Enum: "number" "currency"

Responses

Response Headers
Location
string <uri>

The URL of the created property

Response Schema: application/json
id
required
string
key
required
string
name
required
string
entity
required
string
Enum: "subscriber" "subscription"
type
required
string
Enum: "text" "number" "boolean" "date"
format
required
string or null
Enum: "number" "currency"

Request samples

Content type
application/json
{
  • "key": "number_of_contacts",
  • "name": "Number of contacts",
  • "entity": "subscriber",
  • "type": "number",
  • "format": "number"
}

Response samples

Content type
application/json
{
  • "id": "prop_jrtpyZs1httwFFIl7V80cHwf",
  • "key": "number_of_contacts",
  • "name": "Number of contacts",
  • "entity": "subscriber",
  • "type": "number",
  • "format": "number"
}

Retrieve a property

path Parameters
id
required
string

Property ID to retrieve

Responses

Response Schema: application/json
id
required
string
key
required
string
name
required
string
entity
required
string
Enum: "subscriber" "subscription"
type
required
string
Enum: "text" "number" "boolean" "date"
format
required
string or null
Enum: "number" "currency"

Response samples

Content type
application/json
{
  • "id": "prop_jrtpyZs1httwFFIl7V80cHwf",
  • "key": "number_of_contacts",
  • "name": "Number of contacts",
  • "entity": "subscriber",
  • "type": "number",
  • "format": "number"
}

Delete a property

Delete a property to prevent it from being used in the future. Deleting a property does not delete associated property data already stored on subscribers or subscriptions.

path Parameters
id
required
string

Property ID to delete

Responses

Response samples

Content type
application/json
{
  • "error": "string"
}

Subscribers

A subscriber represents a customer of your product.

List subscribers

query Parameters
platform_id
string

Filter subscribers by subscription platform ID

email
string

Filter subscribers by email address

cursor
string

Pagination cursor to retrieve

limit
integer [ 1 .. 100 ]

Limit of subscribers to return

Responses

Response Schema: application/json
required
Array of objects (Subscriber)
next_cursor
string or null (Cursor)

Response samples

Content type
application/json
{
  • "data": [
    • {
      • "id": "subr_dRiytWmkVtSBt9mOpRaC0ca0",
      • "platform_id": "cus_Jax42BBWGOWuDp",
      • "name": "Jane Doe",
      • "email": "jane@example.com",
      • "status": "saved",
      • "properties": [
        • {
          • "property": {
            • "id": "prop_jrtpyZs1httwFFIl7V80cHwf",
            • "key": "number_of_contacts",
            • "name": "Number of contacts",
            • "entity": "subscriber",
            • "type": "number",
            • "format": "number"
            },
          • "value": 5800,
          • "formatted_value": "5,800"
          }
        ],
      • "created_at": "2019-08-24T14:15:22Z",
      • "updated_at": "2019-08-24T14:15:22Z"
      }
    ],
  • "next_cursor": "null"
}

Retrieve a subscriber

path Parameters
id
required
string

Subscriber ID to retrieve

Responses

Response Schema: application/json
id
required
string
platform_id
required
string
name
required
string
email
required
string
status
required
string
Enum: "active" "canceled" "saved" "reactivated"
required
Array of objects (SubscriberPropertyValue)
created_at
required
string <date-time>
updated_at
required
string <date-time>

Response samples

Content type
application/json
{
  • "id": "subr_dRiytWmkVtSBt9mOpRaC0ca0",
  • "platform_id": "cus_Jax42BBWGOWuDp",
  • "name": "Jane Doe",
  • "email": "jane@example.com",
  • "status": "saved",
  • "properties": [
    • {
      • "property": {
        • "id": "prop_jrtpyZs1httwFFIl7V80cHwf",
        • "key": "number_of_contacts",
        • "name": "Number of contacts",
        • "entity": "subscriber",
        • "type": "number",
        • "format": "number"
        },
      • "value": 5800,
      • "formatted_value": "5,800"
      }
    ],
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

Update a subscriber

Update a subscriber. Only the custom properties of a subscriber can be modified.

Returns the updated subscriber on success.

path Parameters
id
required
string

Subscriber ID to update

Request Body schema: application/json
properties
object

Object containing properties to update. Use property keys as the object keys.

You can use an empty string or null value to delete a property.

Read more about formatting custom properties.

Responses

Response Schema: application/json
id
required
string
platform_id
required
string
name
required
string
email
required
string
status
required
string
Enum: "active" "canceled" "saved" "reactivated"
required
Array of objects (SubscriberPropertyValue)
created_at
required
string <date-time>
updated_at
required
string <date-time>

Request samples

Content type
application/json
{
  • "properties": {
    • "last_contacted": "2021-05-04",
    • "preferred_name": "Johnny"
    }
}

Response samples

Content type
application/json
{
  • "id": "subr_dRiytWmkVtSBt9mOpRaC0ca0",
  • "platform_id": "cus_Jax42BBWGOWuDp",
  • "name": "Jane Doe",
  • "email": "jane@example.com",
  • "status": "saved",
  • "properties": [
    • {
      • "property": {
        • "id": "prop_jrtpyZs1httwFFIl7V80cHwf",
        • "key": "number_of_contacts",
        • "name": "Number of contacts",
        • "entity": "subscriber",
        • "type": "number",
        • "format": "number"
        },
      • "value": 5800,
      • "formatted_value": "5,800"
      }
    ],
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

Delete a subscriber

Delete a subscriber. This does not affect reporting.

path Parameters
id
required
string

Subscriber ID to delete

Responses

Response samples

Content type
application/json
{
  • "error": "string"
}

Subscriptions

A subscription represents a subscription belonging to a customer of your product.

List subscriptions

query Parameters
platform_id
string

Filter subscribers by subscription platform ID

subscriber_id
string

Filter subscriptions by subscriber ID

cursor
string

Pagination cursor to retrieve

limit
integer [ 1 .. 100 ]

Limit of subscriptions to return

Responses

Response Schema: application/json
required
Array of objects (Subscription)
next_cursor
string or null (Cursor)

Response samples

Content type
application/json
{
  • "data": [
    • {
      • "id": "subn_dp79dRR5wIy1kGW4PCO41wit",
      • "platform_id": "sub_JE1trB8eUAnh0r",
      • "subscriber_id": "subr_GQmXBebvivMb5tHhassNV9kj",
      • "mrr": "399.95",
      • "status": "active",
      • "properties": [
        • {
          • "property": {
            • "id": "prop_S6A17y8S8wgKBBJbveQHpLW6",
            • "key": "is_professional",
            • "name": "Is professional",
            • "entity": "subscription",
            • "type": "boolean",
            • "format": "null"
            },
          • "value": true,
          • "formatted_value": "True"
          }
        ],
      • "created_at": "2019-08-24T14:15:22Z",
      • "updated_at": "2019-08-24T14:15:22Z"
      }
    ],
  • "next_cursor": "null"
}

Retrieve a subscription

path Parameters
id
required
string

Subscription ID to retrieve

Responses

Response Schema: application/json
id
required
string
platform_id
required
string
subscriber_id
required
string
mrr
required
string
status
required
string
Enum: "active" "canceled" "trialing" "paused"
required
Array of objects (SubscriptionPropertyValue)
created_at
required
string <date-time>
updated_at
required
string <date-time>

Response samples

Content type
application/json
{
  • "id": "subn_dp79dRR5wIy1kGW4PCO41wit",
  • "platform_id": "sub_JE1trB8eUAnh0r",
  • "subscriber_id": "subr_GQmXBebvivMb5tHhassNV9kj",
  • "mrr": "399.95",
  • "status": "active",
  • "properties": [
    • {
      • "property": {
        • "id": "prop_S6A17y8S8wgKBBJbveQHpLW6",
        • "key": "is_professional",
        • "name": "Is professional",
        • "entity": "subscription",
        • "type": "boolean",
        • "format": "null"
        },
      • "value": true,
      • "formatted_value": "True"
      }
    ],
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

Update a subscription

Update a subscription. Only the custom properties of a subscription can be modified.

Returns the updated subscription on success.

path Parameters
id
required
string

Subscription ID to update

Request Body schema: application/json
properties
object

Object containing properties to update. Use property keys as the object keys.

You can use an empty string or null value to delete a property.

Read more about formatting custom properties.

Responses

Response Schema: application/json
id
required
string
platform_id
required
string
subscriber_id
required
string
mrr
required
string
status
required
string
Enum: "active" "canceled" "trialing" "paused"
required
Array of objects (SubscriptionPropertyValue)
created_at
required
string <date-time>
updated_at
required
string <date-time>

Request samples

Content type
application/json
{
  • "properties": {
    • "number_of_contacts": 5800,
    • "is_professional": true
    }
}

Response samples

Content type
application/json
{
  • "id": "subn_dp79dRR5wIy1kGW4PCO41wit",
  • "platform_id": "sub_JE1trB8eUAnh0r",
  • "subscriber_id": "subr_GQmXBebvivMb5tHhassNV9kj",
  • "mrr": "399.95",
  • "status": "active",
  • "properties": [
    • {
      • "property": {
        • "id": "prop_S6A17y8S8wgKBBJbveQHpLW6",
        • "key": "is_professional",
        • "name": "Is professional",
        • "entity": "subscription",
        • "type": "boolean",
        • "format": "null"
        },
      • "value": true,
      • "formatted_value": "True"
      }
    ],
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

Webhooks

A webhook represents a ProsperStack webhook that delivers events to a specified endpoint.

Supported events are flow_session_started and flow_session_completed.

A ProsperStack account can have a maximum of ten configured webhooks.

List webhooks

query Parameters
cursor
string

Pagination cursor to retrieve

limit
integer [ 1 .. 100 ]

Limit of webhooks to return

Responses

Response Schema: application/json
required
Array of objects (Webhook)
next_cursor
string or null (Cursor)

Response samples

Content type
application/json
{
  • "data": [],
  • "next_cursor": "null"
}

Create a webhook

Request Body schema: application/json
url
required
string <uri>
events
required
Array of strings
Items Value: "flow_session_completed"

Responses

Response Headers
Location
string <uri>

The URL of the created webhook

Response Schema: application/json
id
required
string
url
required
string
events
required
Array of strings
Items Value: "flow_session_completed"
created_at
required
string <date-time>

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{}

Retrieve a webhook

path Parameters
id
required
string

Webhook ID to retrieve

Responses

Response Schema: application/json
id
required
string
url
required
string
events
required
Array of strings
Items Value: "flow_session_completed"
created_at
required
string <date-time>

Response samples

Content type
application/json
{}

Delete a webhook

path Parameters
id
required
string

Webhook ID to delete

Responses

Response samples

Content type
application/json
{
  • "error": "string"
}

Events

An event represents a ProsperStack event that occurred in your account. These are the same events that are delivered via configured webhooks.

The events endpoints can be used as an alternative or in addition to webhooks. Use the events endpoints if you would like to poll for new events rather than receiving them in real-time, or to catch up on any events a webhook endpoint may have missed.

Use the event id property to determine if your application has handled the event before.

Note that the events endpoints are only guaranteed to maintain event history for 30 days.

List events

query Parameters
after_id
string

Filter events occurring after the specified ID

event
string

Filter events by event type (flow_session_started, flow_session_completed)

created_at
string

Filter events by the created_at property. Specify as a dictionary with one of the following properties:

  • created_at[gt] — Return events where created_at is greater than this value
  • created_at[lt] — Return events where created_at is less than this value
  • created_at[gte] — Return events where created_at is greater than or equal to this value
  • created_at[lte] — Return events where created_at is less than or equal to this value

Specify date values in ISO 8601 format.

cursor
string

Pagination cursor to retrieve

limit
integer [ 1 .. 100 ]

Limit of events to return

Responses

Response Schema: application/json
required
Array of objects (Event)
next_cursor
string or null (Cursor)

Response samples

Content type
application/json
{
  • "data": [
    • {
      • "id": "evt_ujO4n2g2QbWtGUVg1zJSbC5I",
      • "event": "flow_session_completed",
      • "data": { },
      • "created_at": "2019-08-24T14:15:22Z"
      }
    ],
  • "next_cursor": "null"
}

Retrieve an event

path Parameters
id
required
string

Event ID to retrieve

Responses

Response Schema: application/json
id
required
string
event
required
string
Value: "flow_session_completed"
data
required
object

The payload of the event.

created_at
required
string <date-time>

Response samples

Content type
application/json
{
  • "id": "evt_ujO4n2g2QbWtGUVg1zJSbC5I",
  • "event": "flow_session_completed",
  • "data": { },
  • "created_at": "2019-08-24T14:15:22Z"
}

Customer portal

The customer portal allows customers to self-manage their subscriptions and billing details.

Creating a portal session creates a unique URL for a specific customer. Create sessions via the API to seamlessly log customers in to the portal directly from your application or website.

Create a customer portal session

Request Body schema: application/json
platform_subscriber_id
required
string

The ID of the customer from your connected subscription platform

return_url
required
string <uri>

The URL to redirect customers to when they leave the customer portal

Responses

Response Headers
Location
string <uri>

The URL of the created customer portal session

Response Schema: application/json
id
required
string
url
required
string <uri>

The URL of the created customer portal session

created_at
required
string <date-time>
expires_at
required
string <date-time>

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{}