Skip to content

Restore a service

POST
/services/{id}/restore
Code sample: Shell / cURL
curl --request POST \
--url https://example.com/api/v1/services/example/restore \
--header 'Authorization: Bearer <token>'

Restores an archived service; an active service succeeds without change. Requires the invoices.manage permission.

id
required

Resource identifier (CUID2).

string
>= 1 characters

Resource identifier (CUID2).

The restored service.

Media typeapplication/json
object
data
required

A workspace service-catalog entry.

object
baseHourlyRate
required

Standard hourly rate hour packages are priced at, in the service currency; null when not set.

number | null
classKind
required

How a line of the service gets its class; null when no rule is set.

Any of:

What fills the class of a line booked to the account: FIXED_TEAM is one team, COMPANY_TEAM is the team the company has in force on the invoice date.

string
Allowed values: FIXED_TEAM COMPANY_TEAM
classTeamId
required

The fixed class team; null unless classKind is FIXED_TEAM.

string | null
createdAt
required
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
currency
required
string
description
required
string | null
hours
required

Hours the single price includes; null in options mode.

number | null
id
required
string
imageUrl
required
string | null
intakeFormId
required

The SERVICE_INTAKE order form a buyer fills in after purchase; null when the service asks for nothing.

string | null
isActive
required

False when the service is archived.

boolean
isRecurring
required
boolean
metadata
required
Any of:
object
key
additional properties
string
name
required
string
orderTypeId
required

The order type an invoice line of this service opens; null leaves the type to be chosen on the invoice, from the hours the service sells.

string | null
periodMonths
required

Months of a FIXED_MONTHS period; null for any other rule.

Any of:
integer
>= -9007199254740991 <= 9007199254740991
periodRule
required

How a line’s service period is computed; null when no rule is set.

Any of:

How the service period of an invoice line is computed: RECURRING is one renewal interval from the invoice date, FIXED_MONTHS is periodMonths months from it, and MANUAL leaves the dates to the person invoicing.

string
Allowed values: RECURRING FIXED_MONTHS MANUAL
pricingMode
required

single sells one price (rate); options sells one of pricingOptions.

string
Allowed values: single options
pricingOptions
required

Every option by position, disabled ones included; empty in single mode.

Array<object>

A purchasable pricing option of a service.

object
hours
required

Hours the option includes, when hour-bound.

number | null
id
required
string
isActive
required

Disabled options are not offered to buyers.

boolean
label
required
string
position
required
integer
>= -9007199254740991 <= 9007199254740991
price
required

Price of the option in the service currency.

number
pricePerHour
required

Price / hours rounded to cents; null when the option has no hours.

number | null
rate
required

Single price in the service currency; null in options mode.

number | null
recurringInterval
required

Billing cadence; null for one-off services.

Any of:
string
Allowed values: WEEKLY MONTHLY QUARTERLY YEARLY
recurringIntervalCount
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
revenueAccountId
required

The revenue account the service books to; null when none is set.

string | null
reviewReminderDays
required

Days before the term ends, or before each anniversary when it runs until canceled, that the order’s responsibles and the admins are reminded to review it; null sends no reminder.

Any of:
integer
>= -9007199254740991 <= 9007199254740991
showInPortal
required

Listed in the client portal; hidden services still sell on forms.

boolean
subscriptionTermMonths
required

Months an order opened from an invoice of this recurring service runs before it closes and stops billing; null when it renews until canceled. Each invoice still covers one billing cycle.

Any of:
integer
>= -9007199254740991 <= 9007199254740991
trialDurationDays
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
trialRate
required
number | null
updatedAt
required
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/

Example

{
"data": {
"classKind": "FIXED_TEAM",
"periodRule": "RECURRING",
"pricingMode": "single",
"recurringInterval": "WEEKLY"
}
}

Unauthorized.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Forbidden.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Not found.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Rate limit exceeded. Wait for Retry-After before retrying.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}
RateLimit-Limit
string
/^\d+$/

Maximum requests in the current quota window.

RateLimit-Policy
string

Quota policy in requests and window seconds, for example 60;w=60.

RateLimit-Remaining
string
/^\d+$/

Requests left in this quota window (zero when blocked).

RateLimit-Reset
string
/^\d+$/

Seconds until the current quota window resets, when available from the rate-limit store.

Retry-After
string
/^\d+$/

Seconds until another request may be attempted.