Clienvy API documentation

List subscriptions

GET
https://api.clienvy.io/employee/v1
/subscriptions

Returns a paginated list of subscriptions, newest first.

List subscriptions › query Parameters

search
​string

Full-text search across the reference and company name.

company_ids
​string

Only return subscriptions for these companies. Accepts a comma-separated list of UUIDs.

website_ids
​string

Only return subscriptions for these websites. Accepts a comma-separated list of UUIDs.

project_ids
​string

Only return subscriptions for these projects. Accepts a comma-separated list of UUIDs.

statuses
​string

Only return subscriptions in these statuses. Accepts a comma-separated list of concept, active, cancelling, cancelled.

sort_field
​string

Field to sort by: start_next_period or status.

sort_direction
​string

Sort direction: asc or desc.

page
​integer

Page number of the paginated result set.

per_page
​integer

Number of items per page. Defaults to the endpoint's own page size; capped at 500.

List subscriptions › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

List subscriptions › Responses

Array of SubscriptionListResource

​object

Create a subscription

POST
https://api.clienvy.io/employee/v1
/subscriptions

Creates a new subscription for a company and contact with its recurring line items. Set start_next_period to activate billing (requires at least one item).

Create a subscription › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Create a subscription › Request Body

company_id
​string · uuid · required

UUID of the company the subscription is for.

contact_id
​string · uuid · required

UUID of the contact the subscription is billed to.

reference
​string · maxLength: 128 · required

Reference/title of the subscription.

flow_id
​string · uuid

UUID of the invoice flow used for billing.

style_id
​string · uuid

UUID of the invoice style used for billing.

website_id
​string | null · uuid

UUID of the website the subscription relates to.

project_id
​string | null · uuid

UUID of the recurring project whose periodic amount this subscription bills. Only a recurring project is accepted.

po_number
​string | null · maxLength: 128

Purchase-order number.

period_interval
​integer

Billing interval count.

period_interval_type
​string

Billing interval unit: days, weeks, months or years.

minimum_periods
​integer

Minimum number of billing periods.

days_in_advance
​integer

Number of days before the period start to generate the invoice (0–28).

start_next_period
​string · date

Date the next period starts (Y-m-d). Setting this activates the subscription.

​object[]

Recurring line items (at least one). The price of a line, the amount of a line and the total of all lines are each limited to 10,000,000 excluding tax.

Create a subscription › Responses

SubscriptionResource

id
​string · uuid
reference
​string
po_number
​string | null
total_excluding_tax
​number
total_including_tax
​number
period_interval
​integer
period_interval_type
​IntervalType · enum
Enum values:
days
weeks
months
years
minimum_periods
​integer
days_in_advance
​integer
start_first_period
​string | null · date
start_current_period
​string | null · date
start_next_period
​string | null · date
end_last_period
​string | null · date
​WebsiteReferenceResource | null
​ProjectReferenceResource | null
status
​SubscriptionStatus · enum
Enum values:
concept
active
cancelling
cancelled
cancelled_at
​string | null · date
​array
​array
payment_conditions
​string
deletable
​boolean
​object
updated_at
​string · date-time
created_at
​string · date-time

Get a subscription

GET
https://api.clienvy.io/employee/v1
/subscriptions/{subscription}

Returns a single subscription by ID, including its line items and billing schedule.

Get a subscription › path Parameters

subscription
​string · uuid · required

The subscription UUID

Get a subscription › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Get a subscription › Responses

SubscriptionResource

id
​string · uuid
reference
​string
po_number
​string | null
total_excluding_tax
​number
total_including_tax
​number
period_interval
​integer
period_interval_type
​IntervalType · enum
Enum values:
days
weeks
months
years
minimum_periods
​integer
days_in_advance
​integer
start_first_period
​string | null · date
start_current_period
​string | null · date
start_next_period
​string | null · date
end_last_period
​string | null · date
​WebsiteReferenceResource | null
​ProjectReferenceResource | null
status
​SubscriptionStatus · enum
Enum values:
concept
active
cancelling
cancelled
cancelled_at
​string | null · date
​array
​array
payment_conditions
​string
deletable
​boolean
​object
updated_at
​string · date-time
created_at
​string · date-time

Update a subscription

PUT
https://api.clienvy.io/employee/v1
/subscriptions/{subscription}

Updates a subscription. Only the fields present in the request are changed. When items is present, it replaces the full set of line items.

Update a subscription › path Parameters

subscription
​string · uuid · required

The subscription UUID

Update a subscription › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Update a subscription › Request Body

company_id
​string · uuid

UUID of the company the subscription is for.

contact_id
​string · uuid

UUID of the contact the subscription is billed to.

reference
​string · maxLength: 128

Reference/title of the subscription.

flow_id
​string · uuid

UUID of the invoice flow used for billing.

style_id
​string · uuid

UUID of the invoice style used for billing.

website_id
​string | null · uuid

UUID of the website the subscription relates to.

project_id
​string | null · uuid

UUID of the recurring project whose periodic amount this subscription bills. Only a recurring project is accepted.

po_number
​string | null · maxLength: 128

Purchase-order number.

period_interval
​integer

Billing interval count.

period_interval_type
​string

Billing interval unit: days, weeks, months or years.

minimum_periods
​integer

Minimum number of billing periods.

days_in_advance
​integer

Number of days before the period start to generate the invoice (0–28).

start_next_period
​string · date

Date the next period starts (Y-m-d). Setting this activates the subscription.

reactivate
​boolean

Reactivate a cancelled/cancelling subscription.

​object[]

Recurring line items (at least one). Replaces the current items. The price of a line, the amount of a line and the total of all lines are each limited to 10,000,000 excluding tax.

Update a subscription › Responses

SubscriptionResource

id
​string · uuid
reference
​string
po_number
​string | null
total_excluding_tax
​number
total_including_tax
​number
period_interval
​integer
period_interval_type
​IntervalType · enum
Enum values:
days
weeks
months
years
minimum_periods
​integer
days_in_advance
​integer
start_first_period
​string | null · date
start_current_period
​string | null · date
start_next_period
​string | null · date
end_last_period
​string | null · date
​WebsiteReferenceResource | null
​ProjectReferenceResource | null
status
​SubscriptionStatus · enum
Enum values:
concept
active
cancelling
cancelled
cancelled_at
​string | null · date
​array
​array
payment_conditions
​string
deletable
​boolean
​object
updated_at
​string · date-time
created_at
​string · date-time

Delete a subscription

DELETE
https://api.clienvy.io/employee/v1
/subscriptions/{subscription}

Deletes a subscription. A subscription that has already generated invoices cannot be deleted.

Delete a subscription › path Parameters

subscription
​string · uuid · required

The subscription UUID

Delete a subscription › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Delete a subscription › Responses

SubscriptionResource

id
​string · uuid
reference
​string
po_number
​string | null
total_excluding_tax
​number
total_including_tax
​number
period_interval
​integer
period_interval_type
​IntervalType · enum
Enum values:
days
weeks
months
years
minimum_periods
​integer
days_in_advance
​integer
start_first_period
​string | null · date
start_current_period
​string | null · date
start_next_period
​string | null · date
end_last_period
​string | null · date
​WebsiteReferenceResource | null
​ProjectReferenceResource | null
status
​SubscriptionStatus · enum
Enum values:
concept
active
cancelling
cancelled
cancelled_at
​string | null · date
​array
​array
payment_conditions
​string
deletable
​boolean
​object
updated_at
​string · date-time
created_at
​string · date-time

Cancel a subscription

POST
https://api.clienvy.io/employee/v1
/subscriptions/{subscription}/cancel

Cancels the subscription. With direct set to true it stops immediately and minimum periods are dropped. Otherwise it is cancelled at the end of the current commitment.

Cancel a subscription › path Parameters

subscription
​string · uuid · required

The subscription UUID

Cancel a subscription › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Cancel a subscription › Request Body

direct
​boolean · required

Cancel immediately (true) or at the end of the running period (false).

Cancel a subscription › Responses

SubscriptionResource

id
​string · uuid
reference
​string
po_number
​string | null
total_excluding_tax
​number
total_including_tax
​number
period_interval
​integer
period_interval_type
​IntervalType · enum
Enum values:
days
weeks
months
years
minimum_periods
​integer
days_in_advance
​integer
start_first_period
​string | null · date
start_current_period
​string | null · date
start_next_period
​string | null · date
end_last_period
​string | null · date
​WebsiteReferenceResource | null
​ProjectReferenceResource | null
status
​SubscriptionStatus · enum
Enum values:
concept
active
cancelling
cancelled
cancelled_at
​string | null · date
​array
​array
payment_conditions
​string
deletable
​boolean
​object
updated_at
​string · date-time
created_at
​string · date-time

List activities

GET
https://api.clienvy.io/employee/v1
/subscriptions/{subscription}/activities

Returns a paginated list of activities logged on the parent resource, newest first. Activities cover both system-generated events and manually logged remarks.

With include_related the list is the timeline of the resource: its own activities together with those of the records that belong to it, such as the domain names, applications and mailbox domains of a website. Each activity then names the record it belongs to in subject.

List activities › path Parameters

subscription
​string · uuid · required

The subscription UUID

List activities › query Parameters

type
​string

Only return activities of this type (for example remark).

include_related
​boolean

Also return the activities of the records that belong to the resource, each naming its record in subject.

source
​string

With include_related: only return the activities of one record, as <type>:<id>, for example domain:<uuid>. The record has to be the resource itself or belong to it.

page
​integer

Page number of the paginated result set.

per_page
​integer

Number of items per page. Defaults to the endpoint's own page size; capped at 500.

List activities › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

List activities › Responses

Array of ActivityWithSubjectResource

Array of ActivityResource

​
​object

Log a remark

POST
https://api.clienvy.io/employee/v1
/subscriptions/{subscription}/activities

Logs a manual remark as an activity on the parent resource. The remark may contain basic HTML (p, br, b, strong, i, em, u, s, ul, ol, li, a, span). Other tags and attributes are stripped and line breaks become <br>. To mention an employee and notify them, add a span with a data-employee-id attribute holding the employee's UUID, for example <span data-employee-id="…">@Jan</span>. The answer names the record in subject, like the timeline does.

Log a remark › path Parameters

subscription
​string · uuid · required

The subscription UUID

Log a remark › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Log a remark › Request Body

remark
​string · maxLength: 20000 · required

Log a remark › Responses

ActivityWithSubjectResource

id
​string · uuid
type
​string
title
​string
data
​string
​ContactReferenceResource | null

The contact who did it in the customer portal, if any.

​OAuthConnectionReferenceResource | null

The AI connection the activity was done through, if any.

updated_at
​string · date-time
created_at
​string · date-time
​ActivitySubjectResource | null

null when the record is gone