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

# Optimizer Job Status

> Poll compact status every ten seconds. On success, read the returned run_id.



## OpenAPI

````yaml /openapi-public.json get /v1/optimizer/jobs/{job_id}
openapi: 3.1.0
info:
  title: Edgeful API
  description: >-
    Public API reference for Edgeful market analysis. The bearer token is your
    Edgeful API key. Reports support the docs playground. Report responses
    include row-level output in `detailed` only when your plan includes
    row-level detail.
  version: 1.0.0
servers:
  - url: https://api.edgeful.com
    description: Production
security:
  - BearerAuth: []
tags:
  - name: reports
  - name: discovery
  - name: live data
  - name: settings
  - name: custom reports
  - name: optimizer
paths:
  /v1/optimizer/jobs/{job_id}:
    get:
      tags:
        - optimizer
      summary: Optimizer Job Status
      description: >-
        Poll compact status every ten seconds. On success, read the returned
        run_id.
      operationId: optimizer_job_status_v1_optimizer_jobs__job_id__get
      parameters:
        - name: job_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: Your durable optimizer job ID returned by submission.
            title: Job Id
          description: Your durable optimizer job ID returned by submission.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OptimizerJob'
        '401':
          description: Missing, invalid or revoked API key.
        '403':
          description: >-
            Requires active All Access and, for mutations, credential write
            permission.
        '404':
          description: Record or job is missing or belongs to another member.
        '409':
          description: >-
            Active job: Retry-After is present; retry the same request_id later.
            Accepted request_id with different settings: no Retry-After; use a
            new ID.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
                minimum: 1
        '413':
          description: Request body exceeds 16 KiB or snapshot exceeds 8 KiB.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Shared member optimizer budget exhausted. Follow Retry-After.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
                minimum: 1
        '503':
          description: >-
            Capacity or admission controls unavailable. Follow Retry-After;
            reuse request_id.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
                minimum: 1
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.edgeful.com/v1/optimizer/jobs/<job_id>' \
              --header 'Authorization: Bearer <api-key>'
        - lang: python
          label: Python
          source: |-
            import requests

            url = "https://api.edgeful.com/v1/optimizer/jobs/<job_id>"
            headers = {"Authorization": "Bearer <api-key>"}

            response = requests.get(url, headers=headers)
            print(response.json())
        - lang: javascript
          label: JavaScript
          source: |-
            const url = "https://api.edgeful.com/v1/optimizer/jobs/<job_id>";
            const options = {
              method: "GET",
              headers: { Authorization: "Bearer <api-key>" },
            };

            const response = await fetch(url, options);
            const data = await response.json();
            console.log(data);
        - lang: php
          label: PHP
          source: >-
            <?php

            $ch =
            curl_init("https://api.edgeful.com/v1/optimizer/jobs/<job_id>");

            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");

            curl_setopt($ch, CURLOPT_HTTPHEADER, ["Authorization: Bearer
            <api-key>"]);

            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

            $response = curl_exec($ch);

            curl_close($ch);

            echo $response;
        - lang: go
          label: Go
          source: |-
            package main

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

            func main() {
                req, _ := http.NewRequest("GET", "https://api.edgeful.com/v1/optimizer/jobs/<job_id>", nil)
                req.Header.Set("Authorization", "Bearer <api-key>")
                resp, _ := http.DefaultClient.Do(req)
                defer resp.Body.Close()
                body, _ := io.ReadAll(resp.Body)
                fmt.Println(string(body))
            }
        - lang: java
          label: Java
          source: >-
            import java.net.URI;

            import java.net.http.HttpClient;

            import java.net.http.HttpRequest;

            import java.net.http.HttpResponse;


            HttpClient client = HttpClient.newHttpClient();

            HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create("https://api.edgeful.com/v1/optimizer/jobs/<job_id>"))
                .header("Authorization", "Bearer <api-key>")
                .method("GET", HttpRequest.BodyPublishers.noBody())
                .build();
            HttpResponse<String> response = client.send(request,
            HttpResponse.BodyHandlers.ofString());

            System.out.println(response.body());
        - lang: ruby
          label: Ruby
          source: >-
            require "net/http"

            require "uri"


            uri = URI("https://api.edgeful.com/v1/optimizer/jobs/<job_id>")

            request = Net::HTTP::Get.new(uri)

            request["Authorization"] = "Bearer <api-key>"


            response = Net::HTTP.start(uri.hostname, uri.port, use_ssl:
            uri.scheme == "https") do |http|
              http.request(request)
            end

            puts response.body
components:
  schemas:
    OptimizerJob:
      properties:
        job_id:
          type: string
          title: Job Id
        request_id:
          type: string
          title: Request Id
        origin:
          type: string
          enum:
            - app
            - external
          title: Origin
        status:
          type: string
          enum:
            - queued
            - running
            - cancel_requested
            - succeeded
            - failed
            - cancelled
          title: Status
        run_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Run Id
        progress:
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
          type: object
          title: Progress
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        failure_kind:
          anyOf:
            - type: string
            - type: 'null'
          title: Failure Kind
        created_at:
          type: string
          title: Created At
        deadline_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Deadline At
        payload_expired:
          type: boolean
          title: Payload Expired
        result_expired:
          type: boolean
          title: Result Expired
        poll_after_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          title: Poll After Seconds
      type: object
      required:
        - job_id
        - request_id
        - origin
        - status
        - run_id
        - progress
        - error
        - failure_kind
        - created_at
        - deadline_at
        - payload_expired
        - result_expired
        - poll_after_seconds
      title: OptimizerJob
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    JsonValue: {}
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Send your Edgeful API key in the Authorization header as `Bearer
        <api-key>` (for example, `Bearer ef_live_<random>`).

````

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