# updateAgentPushRuntimeService

```graphql
mutation UpdateAgentPushRuntimeService($input: UpdateAgentPushRuntimeServiceInput!) {
  updateAgentPushRuntimeService(input: $input) {
    id
    serviceId
    projectId
    serviceName
    serviceKey
    agentId
    status
    connectionStatus
    invokeUrl
    lastHeartbeatAt
    updatedAt
    scopeKind
    availability
    runtime
    region
    lastSeenAt
  }
}
```

Drain or resume a runtime service.

## Arguments

| Name                     | Type                                | Required | Description                                                                                                                                                                                                                                                                    |
| ------------------------ | ----------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `input`                  | UpdateAgentPushRuntimeServiceInput! | Yes      |                                                                                                                                                                                                                                                                                |
| `input.projectReference` | 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.                       |
| `input.serviceId`        | 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. |
| `input.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.                                                                                            |

## Variables

```json
{
  "input": {
    "projectReference": "string",
    "serviceId": "string",
    "availability": "active"
  }
}
```

## Responses

| Status | Description                                                         |
| ------ | ------------------------------------------------------------------- |
| 200    | The AgentPushRuntimeService! in data.updateAgentPushRuntimeService. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "mutation UpdateAgentPushRuntimeService($input: UpdateAgentPushRuntimeServiceInput!) {\n  updateAgentPushRuntimeService(input: $input) {\n    id\n    serviceId\n    projectId\n    serviceName\n    serviceKey\n    agentId\n    status\n    connectionStatus\n    invokeUrl\n    lastHeartbeatAt\n    updatedAt\n    scopeKind\n    availability\n    runtime\n    region\n    lastSeenAt\n  }\n}",
  "variables": {
    "input": {
      "projectReference": "string",
      "serviceId": "string",
      "availability": "active"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "updateAgentPushRuntimeService": {
      "id": "string",
      "serviceId": "string",
      "projectId": "string",
      "serviceName": "string",
      "serviceKey": "string",
      "agentId": "string",
      "status": "string",
      "connectionStatus": "string",
      "invokeUrl": "https://example.com",
      "lastHeartbeatAt": "string",
      "updatedAt": "string",
      "scopeKind": "string",
      "availability": "string",
      "runtime": "string",
      "region": "string",
      "lastSeenAt": "2026-01-01T00:00:00Z"
    }
  }
}
```
