---
title: "Change service"
method: PUT
path: "/billing/active-services/{active_service_id}/"
tags: ["active-service"]
---

# Change service

`PUT /billing/active-services/{active_service_id}/`

## Request

- Base URL: `https://api.angelcam.com/v1`
- URL: `https://api.angelcam.com/v1/billing/active-services/{active_service_id}/`
- Auth: one of:
  - OAuth 2
    - Authorization code: `https://my.angelcam.com/oauth/authorize/`, token URL `https://my.angelcam.com/oauth/token/`
    - Password, token URL `https://api.angelcam.com/oauth/token/`
    - Scopes: `active_services_manage`
  - API key in header `Authorization`
- TypeScript: <https://skmtc.dev/angelcam/apis/angelcam-api/docs/billing/active-services/:active_service_id/put.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `active_service_id` integer, required

## Request body

- object
  - `code` string, required: Code of service, this code together with type is unique identifier of service
  - `period` 'P1M' | 'P1Y', duration, required
  - `force_downgrade` boolean: If set to false, the downgrade occurs after the current period concludes. If set to true, the downgrade happens immediately, applying the prorated price of the current service towards the new service. Should the prorated price exceed the cost of the new service, the new service will be extended for a period that matches the full price value.

## Response `201`

Newly activated service

- ActiveServiceObject
  - `id` integer, required
  - `current_service` ServiceObject, required
    - `type` 'cloud-recording' | 'broadcasting' | 'timelapse' | 'user-service' | 'event-recording' | 'live-view', required: Type of service
    - `code` string, required: Code of service, this code together with type is unique identifier of service
  - `renew_service` ServiceObject, required
    - `type` 'cloud-recording' | 'broadcasting' | 'timelapse' | 'user-service' | 'event-recording' | 'live-view', required: Type of service
    - `code` string, required: Code of service, this code together with type is unique identifier of service
  - `renew_period` string, duration, nullable, required
  - `valid_until` string, datetime, required
  - `in_use` boolean, required: Says if service is in use for example by a camera
  - `usage_detail` UsageDetailObject, required: In case of camera service show info for what camera the service is used.
    - `camera_id` integer
    - `camera_name` string

## Other responses

- `400`: Body payload is invalid.
- `401`: Missing or invalid authorization.
- `403`: Missing permission.
- `404`: The specified resource was not found

---

[API](https://skmtc.dev/angelcam/apis/angelcam-api.md) - [All operations](https://skmtc.dev/angelcam/apis/angelcam-api/llms.txt) - [OpenAPI document](https://skmtc.dev/angelcam/apis/angelcam-api/revisions/dd1cdc3f2c23?raw)
