# at.happyproto.server.getJob

> Published by [happyproto.at](https://lexicon.garden/identity/did:plc:mo7vq4jbioxwafy5zkcc3eux)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.server.getJob)
- [Documentation](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.server.getJob/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.server.getJob/examples)

## Definitions

### `at.happyproto.server.getJob#job`

**Type**: `object`

A background job. Never carries its session fields.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `error` | `string` | No | Why the job failed. For an instance change, the operation's error code, then its message. |
| `id` | `string` | Yes | A UUID. |
| `progress` | `unknown` | No | The job's last progress report. For an instance change: {status, step?}, the operation's. |
| `result` | `unknown` | No | What the job returned, once completed. |
| `status` | `string` | Yes |  |

### `at.happyproto.server.getJob`

**Type**: `query`

One of the caller's own background jobs, such as the one a change to an instance started. Customers only.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes | The job's UUID. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `job` | `ref` → `#job` | Yes |  |

#### Errors

- **AuthRequired**: This endpoint requires an authenticated caller.
- **Forbidden**: The caller is not a HappyProto customer.
- **InvalidRequest**: id is not a UUID.
- **NotFound**: No such job, or the caller did not create it. The two are indistinguishable.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "job": {
      "description": "A background job. Never carries its session fields.",
      "properties": {
        "error": {
          "description": "Why the job failed. For an instance change, the operation's error code, then its message.",
          "type": "string"
        },
        "id": {
          "description": "A UUID.",
          "type": "string"
        },
        "progress": {
          "description": "The job's last progress report. For an instance change: {status, step?}, the operation's.",
          "type": "unknown"
        },
        "result": {
          "description": "What the job returned, once completed.",
          "type": "unknown"
        },
        "status": {
          "knownValues": [
            "pending",
            "running",
            "paused",
            "pausing",
            "cancelling",
            "completed",
            "failed",
            "cancelled"
          ],
          "type": "string"
        }
      },
      "required": [
        "id",
        "status"
      ],
      "type": "object"
    },
    "main": {
      "description": "One of the caller's own background jobs, such as the one a change to an instance started. Customers only.",
      "errors": [
        {
          "description": "This endpoint requires an authenticated caller.",
          "name": "AuthRequired"
        },
        {
          "description": "The caller is not a HappyProto customer.",
          "name": "Forbidden"
        },
        {
          "description": "id is not a UUID.",
          "name": "InvalidRequest"
        },
        {
          "description": "No such job, or the caller did not create it. The two are indistinguishable.",
          "name": "NotFound"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "job": {
              "ref": "#job",
              "type": "ref"
            }
          },
          "required": [
            "job"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "id": {
            "description": "The job's UUID.",
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "params"
      },
      "type": "query"
    }
  },
  "id": "at.happyproto.server.getJob",
  "lexicon": 1
}
```
