> ## Documentation Index
> Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update runtime service

> Drain or resume a runtime service.

`updateAgentPushRuntimeService(input: UpdateAgentPushRuntimeServiceInput!): AgentPushRuntimeService!`

## Arguments

| Argument | Type | Required |
| - | - | - |
| `input` | [`UpdateAgentPushRuntimeServiceInput!`](https://veryfront.com/docs/cloud/graphql/types/updateagentpushruntimeserviceinput) | Yes |

## Input fields

### input

[`UpdateAgentPushRuntimeServiceInput`](https://veryfront.com/docs/cloud/graphql/types/updateagentpushruntimeserviceinput)

| Field | Type | Required | Description |
| - | - | - | - |
| `projectReference` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | Yes | Project that owns the service, by ID or slug. Only a project service of this project is found; a global service answers not\_found. For a managed source connection, project.runtime.manage in the source project is also accepted when setting drained. |
| `serviceId` | [`ID!`](https://veryfront.com/docs/cloud/graphql/types/id) | Yes | Runtime service to change. Draining stops selection for new work and, for managed source connections, revokes queued and child dispatch; either project may revoke. Resuming re-enables selection; managed source connections require project.runtime.manage in both projects. |
| `availability` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/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. |

## Response

Returns [`AgentPushRuntimeService!`](https://veryfront.com/docs/cloud/graphql/types/agentpushruntimeservice). Open the type for its fields and nested types.

| Field | Type | Description |
| - | - | - |
| `id` | [`ID!`](https://veryfront.com/docs/cloud/graphql/types/id) | |
| `serviceId` | [`ID!`](https://veryfront.com/docs/cloud/graphql/types/id) | Same as id. |
| `projectId` | [`ID`](https://veryfront.com/docs/cloud/graphql/types/id) | |
| `serviceName` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | |
| `serviceKey` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | |
| `agentId` | [`String`](https://veryfront.com/docs/cloud/graphql/types/string) | |
| `status` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | |
| `connectionStatus` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | |

[All fields of `AgentPushRuntimeService`](https://veryfront.com/docs/cloud/graphql/types/agentpushruntimeservice).

Types marked with `!` cannot be null. Lists use `[Type]` notation. The [type index](https://veryfront.com/docs/cloud/graphql/schema.md) lists all published input and response types.

## Example

```graphql title="query.graphql" theme={null}
mutation UpdateAgentPushRuntimeService($input: UpdateAgentPushRuntimeServiceInput!) {
  updateAgentPushRuntimeService(input: $input) {
    id
    projectId
    agentId
    status
    updatedAt
  }
}
```

```json title="variables.json" theme={null}
{
  "input": {
    "projectReference": "00000000-0000-4000-8000-000000000001",
    "serviceId": "00000000-0000-4000-8000-000000000001",
    "availability": "drained"
  }
}
```

<details>
  <summary>Try this mutation</summary>

  Calls use `https://api.veryfront.com/graphql`. Replace sample values with resources you can access. See [Authentication](https://veryfront.com/docs/cloud/authentication.md) for credentials and permissions.

  Bearer token or API key

  Stored in this tab's session. Clear credential

  Mutation

  Variables (JSON)
</details>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.