Skip to main content
POST
Create a VPP enrollment

Authorizations

Authorization
string
header
required

Bearer token obtained from POST /auth/tokens.

Path Parameters

device_id
string
required

Flatpeak Device ID.

Example:

"dev_63a6087272941ef077a8fd3e"

Body

application/json

Enrolls a device in a VPP program.

program_id
string
required

Flatpeak VPP Program ID.

Example:

"vpr_6a1f8e375db9de605baadd46"

Response

VPP enrollment response.

A device's enrollment in a VPP program, with its lifecycle timeline. Ended enrollments are retained; at most one is in a non-terminal state at a time.

id
string
required

Flatpeak VPP Enrollment ID.

Example:

"enr_7c2f1a9e4b0d8f3a6e2c5d10"

object
enum<string>
default:vpp_enrollment
required

Object type.

Available options:
vpp_enrollment
Example:

"vpp_enrollment"

live_mode
boolean
required

true for live data, false for test data.

operator
object
required

The VPP operator that runs the program.

program
object
required

The VPP program the device is enrolled in.

device_id
string
required

Flatpeak Device ID of the enrolled device.

Example:

"dev_63a6087272941ef077a8fd3e"

location_id
string
required

Flatpeak Location ID of the device's location.

Example:

"loc_641b90b758fb8e6293716e40"

state_data_delayed
boolean
required

true when device state submissions have stalled beyond the device's required cadence.

Example:

false

device_meters_data_delayed
boolean
required

true when the device's own meter record submissions have stalled beyond the program's required cadence.

Example:

false

enrollment_state
enum<string>
required

The enrollment lifecycle state. enrollment_step gives the detail.

Available options:
PENDING,
ACTIVE,
SUSPENDED,
LEAVING,
ENDED,
REJECTED
Example:

"ACTIVE"

enrollment_step
enum<string>
required

The current step within enrollment_state, matching the timeline entry whose step_status is IN_PROGRESS.

Available options:
REQUESTED,
AWAITING_CONSENT,
AWAITING_TARIFF,
AWAITING_TELEMETRY,
TESTING_DISPATCH,
AWAITING_APPROVAL,
ACTIVE,
SUSPENDED,
UNENROLLING,
UNENROLLED,
INELIGIBLE,
FAILED
Example:

"ACTIVE"

enrollment_state_timeline
VppEnrollmentTimelineEntry · object[]
required

Ordered lifecycle timeline. Render in array order, do not sort by date.

Minimum array length: 1
time_updated
string<date-time>
required

Time the enrollment was last updated.

time_created
string<date-time>
required

Time the enrollment was created.

account_id
string
required

Flatpeak Account ID.

Example:

"acc_661677911f2197045e6cf1b1"

suspension_reasons
enum<string>[]

Why the enrollment is suspended. Present only when enrollment_state is SUSPENDED; contains at least one reason. Critical reasons suspend; the others appear in warnings instead.

Minimum array length: 1
Available options:
DISPATCH_UNRESPONSIVE,
CONSENT_REVOKED,
TELEMETRY_STALLED,
USER_PAUSED
warnings
enum<string>[]

Non-critical issues on an active enrollment. Present only when enrollment_state is ACTIVE and an issue is open. The device stays dispatchable; a warning left unresolved past its grace period becomes a suspension reason.

Minimum array length: 1
Available options:
DISPATCH_UNRESPONSIVE,
CONSENT_REVOKED,
TELEMETRY_STALLED,
USER_PAUSED
terms
object
read-only

The program's terms as they stood when the user joined. Rewards are priced from this copy, and a later change to the program's terms does not alter it.