Partner API
Developer Reference
API REFERENCE

Licenses

The licenses on each contract line item your credentials can see: how many were purchased, how many are assigned, how many are still available, and the dates they are valid. Use them to see how many members you can still invite, and which licenses a member finished early so that you can give the leftover time to someone else.

GET /partner/reporting/licenses

list licenses

Returns the contract line items you can see, with their license counts, latest end date first. Counts and status can be up to about 3 hours old. The assigned licenses on a contract line item are purchased_assigned_licenses + overage_assigned_licenses. This total can exceed purchased_licenses; the difference is overage.

Requires any one of api:partner:reporting:read api:partner:reporting:write

Query parameters

ParameterTypeRequiredDescription
pageintegeroptionalPage number for pagination
per_pageintegeroptionalRecords per page
product_idinteger[]optionalProduct ids; a contract line item for any of them is returned
statusstring (enum)[]optionalStatuses; a contract line item in any of them is returned. Status can be up to about 3 hours old.
Allowed values
  • upcoming
  • active
  • ended
idstring (uuid)[]optionalContract line item ids. An id you cannot see returns no row.
partial_availabilitybooleanoptionalReturn only contract line items whose early-finished licenses are, or are not, given to someone else automatically

Responses

StatusReasonSchema
200OKobject
400Bad RequestErrors
401UnauthorizedErrors
403ForbiddenErrors

Response fields

ParameterTypeRequiredDescription
urlstringoptional
dataReporting.License[]optional
data[].idstringrequired
data[].coaching_monthsinteger | nullrequired
data[].courtesy_assigned_licensesintegerrequiredEvery courtesy license on this contract line item, in use or used up. Courtesy licenses only exist once assigned. Can be up to about 3 hours old.
data[].ends_onstring (date)required
data[].full_available_licensesintegerrequiredCan be up to about 3 hours old.
data[].full_term_access_assign_by_datestring (date) | nullrequiredThe last day a new member still gets the full license length. Null when no licenses are available, or when the date would fall before starts_on.
data[].kindstringrequired
data[].labelstring | nullrequired
data[].overage_assigned_licensesintegerrequiredEvery overage license, in use or finished. Can be up to about 3 hours old.
data[].partial_availabilitybooleanrequiredWhether a license that a member leaves early is given to someone else automatically. true: the leftover time is as long as a new license (both run to the contract line item end), so it counts in full_available_licenses. false: it counts in partial_available_licenses, and its leftover time is listed by the partial licenses endpoint.
data[].partial_available_licensesintegerrequiredLicenses where a member finished early and the leftover time is unused. Invites never use these. Can be up to about 3 hours old.
data[].product_idintegerrequired
data[].product_namestringrequired
data[].purchased_assigned_licensesintegerrequiredCan be up to about 3 hours old.
data[].purchased_licensesintegerrequiredCan be up to about 3 hours old.
data[].related_linksobjectoptional
data[].starts_onstring (date)required
data[].statusstring (enum)requiredCan be up to about 3 hours old.
Allowed values
  • upcoming
  • active
  • ended
pagination_metadataPaginationMetadataoptionalPagination metadata for the response.
pagination_metadata.next_page_paramsmap<string, any> | nullrequiredQuery params for the next page. Merge them into the params of this request. Null on the last page.
pagination_metadata.next_page_urlstring | nullrequired
pagination_metadata.pageintegerrequired
pagination_metadata.per_pageintegerrequired
pagination_metadata.previous_page_paramsmap<string, any> | nullrequiredQuery params for the previous page. Merge them into the params of this request. Null on the first page.
pagination_metadata.previous_page_urlstring | nullrequired
pagination_metadata.total_recordsinteger | nullrequired
Example request
curl -X GET "https://api.betterup.co/partner/reporting/licenses" \
  -H "Authorization: Bearer <access_token>"
Example response
{
  "url": "<url>",
  "data": [
    {
      "id": "<id>",
      "coaching_months": 0,
      "courtesy_assigned_licenses": 0,
      "ends_on": "<date>",
      "full_available_licenses": 0,
      "full_term_access_assign_by_date": "<date>",
      "kind": "<kind>",
      "label": "<label>",
      "overage_assigned_licenses": 0,
      "partial_availability": true,
      "partial_available_licenses": 0,
      "product_id": 0,
      "product_name": "<product_name>",
      "purchased_assigned_licenses": 0,
      "purchased_licenses": 0,
      "related_links": {},
      "starts_on": "<date>",
      "status": "upcoming"
    }
  ],
  "pagination_metadata": {
    "next_page_params": {
      "<key>": {}
    },
    "next_page_url": "<next_page_url>",
    "page": 0,
    "per_page": 0,
    "previous_page_params": {
      "<key>": {}
    },
    "previous_page_url": "<previous_page_url>",
    "total_records": 0
  }
}
GET /partner/reporting/licenses/{license_id}/partial_licenses

list partial licenses

Returns the purchased licenses on a contract line item where a member finished early and the leftover time is unused and can be given to someone else. Shortest remaining time first; the order stays the same between requests. Empty when the license has partial_availability: true, because the leftover time is then given to someone else automatically. Can be up to about 3 hours old. A contract line item you cannot see returns 404, the same as one that does not exist.

Requires any one of api:partner:reporting:read api:partner:reporting:write

Path parameters

ParameterTypeRequiredDescription
license_idstring (uuid)requiredThe contract line item id, as the licenses list returns it

Query parameters

ParameterTypeRequiredDescription
pageintegeroptionalPage number for pagination
per_pageintegeroptionalRecords per page

Responses

StatusReasonSchema
200OKobject
401UnauthorizedErrors
403ForbiddenErrors
404Not FoundErrors

Response fields

ParameterTypeRequiredDescription
urlstringoptional
dataReporting.PartialLicense[]optional
data[].idstringrequired
data[].kindstringrequired
data[].related_linksobjectoptional
data[].remaining_duration_length_secondsintegerrequiredSeconds of leftover time, capped at the contract line item end. Can be 0. Can be up to about 3 hours old.
pagination_metadataPaginationMetadataoptionalPagination metadata for the response.
pagination_metadata.next_page_paramsmap<string, any> | nullrequiredQuery params for the next page. Merge them into the params of this request. Null on the last page.
pagination_metadata.next_page_urlstring | nullrequired
pagination_metadata.pageintegerrequired
pagination_metadata.per_pageintegerrequired
pagination_metadata.previous_page_paramsmap<string, any> | nullrequiredQuery params for the previous page. Merge them into the params of this request. Null on the first page.
pagination_metadata.previous_page_urlstring | nullrequired
pagination_metadata.total_recordsinteger | nullrequired
Example request
curl -X GET "https://api.betterup.co/partner/reporting/licenses/<license_id>/partial_licenses" \
  -H "Authorization: Bearer <access_token>"
Example response
{
  "url": "<url>",
  "data": [
    {
      "id": "<id>",
      "kind": "<kind>",
      "related_links": {},
      "remaining_duration_length_seconds": 0
    }
  ],
  "pagination_metadata": {
    "next_page_params": {
      "<key>": {}
    },
    "next_page_url": "<next_page_url>",
    "page": 0,
    "per_page": 0,
    "previous_page_params": {
      "<key>": {}
    },
    "previous_page_url": "<previous_page_url>",
    "total_records": 0
  }
}