# sandboxBackgroundCommand

```graphql
query SandboxBackgroundCommand($sandboxId: ID!, $commandId: ID!) {
  sandboxBackgroundCommand(sandboxId: $sandboxId, commandId: $commandId) {
    commandId
    command
    status
    signal
    heartbeatStatus
    lastHeartbeatAt
    lastHeartbeatError
    heartbeatFailureCount
    exitCode
    startedAt
    finishedAt
  }
}
```

Get a background command. Requires project.sandboxes.manage.

## Arguments

| Name        | Type | Required | Description |
| ----------- | ---- | -------- | ----------- |
| `sandboxId` | ID!  | Yes      |             |
| `commandId` | ID!  | Yes      |             |

## Variables

```json
{
  "sandboxId": "string",
  "commandId": "string"
}
```

## Responses

| Status | Description                                                    |
| ------ | -------------------------------------------------------------- |
| 200    | The SandboxBackgroundCommand in data.sandboxBackgroundCommand. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "query SandboxBackgroundCommand($sandboxId: ID!, $commandId: ID!) {\n  sandboxBackgroundCommand(sandboxId: $sandboxId, commandId: $commandId) {\n    commandId\n    command\n    status\n    signal\n    heartbeatStatus\n    lastHeartbeatAt\n    lastHeartbeatError\n    heartbeatFailureCount\n    exitCode\n    startedAt\n    finishedAt\n  }\n}",
  "variables": {
    "sandboxId": "string",
    "commandId": "string"
  }
}'
```

## Example response

```json
{
  "data": {
    "sandboxBackgroundCommand": {
      "commandId": "string",
      "command": "string",
      "status": "pending",
      "signal": "string",
      "heartbeatStatus": "disabled",
      "lastHeartbeatAt": "2026-01-01T00:00:00Z",
      "lastHeartbeatError": "string",
      "heartbeatFailureCount": 0,
      "exitCode": 0,
      "startedAt": "string",
      "finishedAt": "string"
    }
  }
}
```
