---
title: "Update Service"
method: PUT
path: "/api/v1/services/{service_id}"
tags: ["services"]
---

# Update Service

`PUT /api/v1/services/{service_id}`

Updates a service.

Args:
    service_id: The ID of the service to update.
    update: The model containing the attributes to update.

Returns:
    The updated service object.

## Path parameters

- `service_id` string, uuid, required

## Request body

- ServiceUpdate — Update model for stack components.
  - `name` string, nullable
  - `admin_state` 'inactive' | 'active' | 'pending_startup' | 'pending_shutdown' | 'error' | 'scaled_to_zero' — Possible states for the service and service endpoint.
  - `service_source` string, nullable — The fully qualified class name of the service implementation.
  - `status` object, nullable
  - `endpoint` object, nullable
  - `prediction_url` string, nullable
  - `health_check_url` string, nullable
  - `labels` object, nullable
  - `model_version_id` string, uuid, nullable

## Response `200`

Successful Response

- ServiceResponse — Response model for services.
  - `body` ServiceResponseBody — Response body for services.
    - `created` string, date-time, required
    - `updated` string, date-time, required
    - `user` UserResponse — Response model for user and service accounts. This returns the activation_token that is required for the user-invitation-flow of the frontend. The email is returned optionally as well for use by the analytics on the client-side.
      - `body` UserResponseBody — Response body for users.
        - `created` string, date-time, required
        - `updated` string, date-time, required
        - `active` boolean
        - `activation_token` string, nullable
        - `full_name` string
        - `email_opted_in` boolean, nullable — `null` if not answered, `true` if agreed, `false` if skipped.
        - `is_service_account` boolean, required
        - `is_admin` boolean, required
      - `metadata` UserResponseMetadata — Response metadata for users.
        - `email` string, nullable
        - `external_user_id` string, uuid, nullable
        - `user_metadata` object
      - `resources` UserResponseResources — Class for all resource models associated with the user entity.
      - `id` string, uuid, required
      - `permission_denied` boolean
      - `name` string, required
    - `service_type` ServiceType, required — Service type descriptor. Attributes: type: service type flavor: service flavor name: name of the service type description: description of the service type logo_url: logo of the service type
      - `type` string, required
      - `flavor` string, required
      - `name` string
      - `description` string
      - `logo_url` string
    - `labels` object, nullable
    - `state` 'inactive' | 'active' | 'pending_startup' | 'pending_shutdown' | 'error' | 'scaled_to_zero' — Possible states for the service and service endpoint.
  - `metadata` ServiceResponseMetadata — Response metadata for services.
    - `workspace` WorkspaceResponse, required — Response model for workspaces.
      - `body` WorkspaceResponseBody — Response body for workspaces.
        - `created` string, date-time, required
        - `updated` string, date-time, required
      - `metadata` WorkspaceResponseMetadata — Response metadata for workspaces.
        - `description` string
      - `resources` WorkspaceResponseResources — Class for all resource models associated with the workspace entity.
      - `id` string, uuid, required
      - `permission_denied` boolean
      - `name` string, required
    - `service_source` string, nullable, required
    - `admin_state` 'inactive' | 'active' | 'pending_startup' | 'pending_shutdown' | 'error' | 'scaled_to_zero', required — Possible states for the service and service endpoint.
    - `config` object, required
    - `status` object, nullable, required
    - `endpoint` object, nullable
    - `prediction_url` string, nullable
    - `health_check_url` string, nullable
  - `resources` ServiceResponseResources — Class for all resource models associated with the service entity.
  - `id` string, uuid, required
  - `permission_denied` boolean
  - `name` string, required

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `422` — Unprocessable Entity

---

[API](https://skmtc.net/zenml-io/apis/zenml-2.md) · [All operations](https://skmtc.net/zenml-io/apis/zenml-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/zenml-io/zenml-2/versions/febb01b8bce3/schema)
