# Update runtime service

```http
PATCH /agent-runtimes/push-services/{service_id}
```

Drain or resume a runtime service.

## Parameters

| Name         | In   | Required | Description                 |
| ------------ | ---- | -------- | --------------------------- |
| `service_id` | path | Yes      | Runtime service identifier. |

## Request body

| Field          | Type   | Required | Description                                                                                                                                                                         |
| -------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `availability` | string | Yes      | active makes the runtime service available for selection; drained stops selecting it for new work. For a managed source connection, drained also revokes queued and child dispatch. |

## Responses

| Status | Description                                                                                                                                                              |
| ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 200    | The runtime service after the change. service is the registration envelope: its status is active for availability active and disabled for availability drained.          |
| 400    | Bad request                                                                                                                                                              |
| 401    | Unauthorized                                                                                                                                                             |
| 403    | The caller cannot manage the service’s scope. Setting active on a managed source connection needs project.runtime.manage in both the destination and the source project. |
| 404    | Not found                                                                                                                                                                |
| 500    | Server error                                                                                                                                                             |
| 503    | internal: authentication state is temporarily unavailable and the request was not processed; retry shortly.                                                              |
