> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://apidocs.polytomic.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://apidocs.polytomic.com/_mcp/server.

# Get Job

GET https://app.polytomic.com/api/jobs/{type}/{id}

Returns the current state of an asynchronous job.

This endpoint is used as a polling target by other asynchronous workflows such
as model preview and log export. The caller must know the job `type` and `id`
that were returned when the job was created.

If the job is still running, the response returns `status: running` and may not
include a `result` yet. Once complete, `status` becomes `done` or `failed`.

Only specific job types are supported by this endpoint. Passing an unknown
`type` returns `400`.

Reference: https://apidocs.polytomic.com/api-reference/jobs/get

## Authentication

- `Authorization` header (basic auth, required) — This is the Polytomic deployment key (on-premises only)
- `Authorization` header (bearer token, required) — This is the Polytomic API key

## Request

### Path parameters

- `id` (string, required) — Unique identifier of the job (usually returned by whichever endpoint started the job).
- `type` (string, required) — Job type. One of: createmodel, updatemodel, previewmodel, samplemodel, exportlogs, connectionproxy.

## Response

### 200

OK

- `data` (V2JobResponse, optional)

## Errors

### 400 Bad Request Error

Bad Request

- `key` (string, optional)
- `message` (string, optional)
- `metadata` (map from string to any, optional)
- `status` (integer, optional)

### 401 Unauthorized Error

Unauthorized

- `code` (integer, optional) — Application-specific error code.
- `context` (map from string to any, optional) — Application context.
- `error` (string, optional) — Error message.
- `status` (string, optional) — Status text.

### 404 Not Found Error

Not Found

- `key` (string, optional)
- `message` (string, optional)
- `metadata` (map from string to any, optional)
- `status` (integer, optional)

### 500 Internal Server Error

Internal Server Error

- `key` (string, optional)
- `message` (string, optional)
- `metadata` (map from string to any, optional)
- `status` (integer, optional)

## Types

### V2JobResponse

- `error` (string, optional, nullable) — Error message if the job failed.
- `job_id` (string, optional) — Identifier of the job.
- `result` (any, optional) — Job result. Shape depends on the job type; only populated once status is done.
- `status` (enum, optional)
  - Allowed values: `created`, `running`, `done`, `failed`
- `type` (string, optional) — Job type. Matches the type used to fetch the job.

## Examples

**Response**

```json
{
  "data": {
    "error": "error message",
    "job_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
    "result": null,
    "status": "created",
    "type": "createmodel"
  }
}
```

**SDK Code**

```python
import requests

url = "https://app.polytomic.com/api/jobs/createmodel/248df4b7-aa70-47b8-a036-33ac447e668d"

headers = {
    "X-Polytomic-Version": "X-Polytomic-Version"
}

response = requests.get(url, headers=headers, auth=("<username>", "<password>"))

print(response.json())
```

```javascript
const url = 'https://app.polytomic.com/api/jobs/createmodel/248df4b7-aa70-47b8-a036-33ac447e668d';
const credentials = btoa("<username>:<password>");

const options = {
  method: 'GET',
  headers: {
    'X-Polytomic-Version': 'X-Polytomic-Version',
    Authorization: `Basic ${credentials}`
  }
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://app.polytomic.com/api/jobs/createmodel/248df4b7-aa70-47b8-a036-33ac447e668d"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-Polytomic-Version", "X-Polytomic-Version")
	req.SetBasicAuth("<username>", "<password>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://app.polytomic.com/api/jobs/createmodel/248df4b7-aa70-47b8-a036-33ac447e668d")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-Polytomic-Version"] = 'X-Polytomic-Version'
request.basic_auth("<username>", "<password>")

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://app.polytomic.com/api/jobs/createmodel/248df4b7-aa70-47b8-a036-33ac447e668d")
  .header("X-Polytomic-Version", "X-Polytomic-Version")
  .basicAuth("<username>", "<password>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://app.polytomic.com/api/jobs/createmodel/248df4b7-aa70-47b8-a036-33ac447e668d', [
  'headers' => [
    'X-Polytomic-Version' => 'X-Polytomic-Version',
  ],
    'auth' => ['<username>', '<password>'],
]);

echo $response->getBody();
```

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://app.polytomic.com/api/jobs/createmodel/248df4b7-aa70-47b8-a036-33ac447e668d");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.GET);
request.AddHeader("X-Polytomic-Version", "X-Polytomic-Version");

IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

let headers = [
  "X-Polytomic-Version": "X-Polytomic-Version",
  "Authorization": "Basic \(credentials)"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://app.polytomic.com/api/jobs/createmodel/248df4b7-aa70-47b8-a036-33ac447e668d")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```