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

# Get Job Status

> Poll an async edit/generate/enhance/remix job's status.



## OpenAPI

````yaml https://api.photalabs.com/v1/phota/openapi.json get /v1/phota/jobs/{job_id}
openapi: 3.1.0
info:
  title: Phota API
  description: Create and manage profiles for photo editing and enhancement.
  version: v0.7.0
servers:
  - url: https://api.photalabs.com
security: []
tags:
  - name: Studio
    description: Image editing, generation, and enhancement.
  - name: Profiles
    description: 'Profile lifecycle: create, query, delete.'
paths:
  /v1/phota/jobs/{job_id}:
    get:
      tags:
        - Studio
      summary: Get Job Status
      description: Poll an async edit/generate/enhance/remix job's status.
      operationId: get_job_status_v1_phota_jobs__job_id__get
      parameters:
        - name: job_id
          in: path
          required: true
          schema:
            type: string
            title: Job Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobStatus'
        '401':
          description: Invalid API key in the X-API-Key header.
        '403':
          description: Missing X-API-Key header (no API key provided).
        '404':
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhotaError404Response'
        '410':
          description: Job result has expired.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhotaError500Response'
        '503':
          description: Service temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhotaError503Response'
      security:
        - APIKeyHeader: []
components:
  schemas:
    JobStatus:
      properties:
        job_id:
          type: string
          title: Job Id
        status:
          type: string
          enum:
            - pending
            - running
            - succeeded
            - failed
          title: Status
        operation:
          type: string
          enum:
            - edit
            - generate
            - enhance
            - remix
          title: Operation
        result:
          anyOf:
            - $ref: '#/components/schemas/EditResponse'
            - type: 'null'
          description: >-
            The edit/generate result (download_urls populated) once status is
            'succeeded'.
        error:
          anyOf:
            - $ref: '#/components/schemas/JobError'
            - type: 'null'
          description: Populated once status is 'failed'.
        created_at:
          type: string
          format: date-time
          title: Created At
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
      type: object
      required:
        - job_id
        - status
        - operation
        - created_at
      title: JobStatus
      description: Status of an async edit/generate job (GET /v1/jobs/{job_id}).
    PhotaError404Response:
      properties:
        detail:
          type: string
          title: Detail
          description: Human-readable error message.
        code:
          type: string
          enum:
            - NOT_FOUND
            - PROFILE_NOT_FOUND
            - PROFILE_NOT_READY
          title: Code
          description: Machine-readable error code.
        request_id:
          type: string
          title: Request Id
          description: Unique request identifier for support.
      type: object
      required:
        - detail
        - code
        - request_id
      title: PhotaError404Response
      description: Error response for 404 Not Found.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PhotaError500Response:
      properties:
        detail:
          type: string
          title: Detail
          description: Human-readable error message.
        code:
          type: string
          const: INTERNAL_ERROR
          title: Code
          description: Machine-readable error code.
        request_id:
          type: string
          title: Request Id
          description: Unique request identifier for support.
      type: object
      required:
        - detail
        - code
        - request_id
      title: PhotaError500Response
      description: Error response for 500 Internal Server Error.
    PhotaError503Response:
      properties:
        detail:
          type: string
          title: Detail
          description: Human-readable error message.
        code:
          type: string
          enum:
            - SERVICE_UNAVAILABLE
            - INPUT_IMAGE_FETCH_FAILED
          title: Code
          description: Machine-readable error code.
        request_id:
          type: string
          title: Request Id
          description: Unique request identifier for support.
      type: object
      required:
        - detail
        - code
        - request_id
      title: PhotaError503Response
      description: Error response for 503 Service Unavailable.
    EditResponse:
      properties:
        images:
          items:
            type: string
          type: array
          title: Images
          description: >-
            Output image(s) as raw base64-encoded strings. Format matches the
            requested output_format. Populated when response_mode='bytes', empty
            otherwise.
        download_urls:
          items:
            type: string
          type: array
          title: Download Urls
          description: >-
            Signed download URLs for each output image (24-hour expiry).
            Populated when response_mode='urls', empty otherwise.
        known_subjects:
          $ref: '#/components/schemas/KnownGeneratedSubjectCounts'
          description: >-
            Dictionary mapping a known subject's `profile_id` to the number of
            times they were generated. If multiple variations are generated,
            this will be the aggregated count across all variations.
      type: object
      required:
        - known_subjects
      title: EditResponse
      description: Response returned by the edit, generate, and enhance endpoints.
    JobError:
      properties:
        code:
          anyOf:
            - $ref: '#/components/schemas/PhotaErrorCode'
            - $ref: '#/components/schemas/EditJobErrorCode'
          title: Code
          description: >-
            Machine-readable error code (a PhotaErrorCode or job-infra
            EditJobErrorCode).
        message:
          type: string
          title: Message
          description: Human-readable error description.
      type: object
      required:
        - code
        - message
      title: JobError
      description: |-
        Failure detail surfaced on a failed job.

        ``code`` is one of the synchronous customer-facing categories
        (:class:`PhotaErrorCode`, so an async pipeline failure surfaces the same
        stable code as its sync twin) or a job-infrastructure-specific code
        (:class:`~database.models.EditJobErrorCode`, for the watchdog reap /
        dispatch-exhaustion states that have no synchronous equivalent).
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    KnownGeneratedSubjectCounts:
      properties:
        counts:
          additionalProperties:
            type: integer
          type: object
          title: Counts
          description: >-
            Mapping of profile ID to the number of times that subject was
            generated.
      type: object
      title: KnownGeneratedSubjectCounts
      description: Counts of known subjects generated, keyed by profile ID.
    PhotaErrorCode:
      type: string
      enum:
        - CONTENT_MODERATION
        - SERVICE_UNAVAILABLE
        - INPUT_IMAGE_FETCH_FAILED
        - NOT_FOUND
        - PROFILE_NOT_FOUND
        - PROFILE_NOT_READY
        - INVALID_REQUEST
        - NO_IMAGE_GENERATED
        - TIMEOUT
        - INTERNAL_ERROR
      title: PhotaErrorCode
      description: |-
        Machine-readable error codes returned by the Phota API.

        Clients can use these codes to programmatically react to specific error
        types without parsing human-readable messages.

        Attributes:
            CONTENT_MODERATION: Content was blocked by a safety filter.
            SERVICE_UNAVAILABLE: Upstream resource exhaustion or rate limit.
            INPUT_IMAGE_FETCH_FAILED: A caller-supplied input image URL could not
                be downloaded after retries because the URL's host/CDN kept
                failing (timeouts or 5xx from the image host). Retryable, but the
                failure is upstream of Phota — the URL's host, not this service.
            NOT_FOUND: Generic resource not found or no longer available (unknown
                route, unknown job, or an expired job result).
            PROFILE_NOT_FOUND: The requested profile does not exist.
            PROFILE_NOT_READY: The profile exists but training has not completed.
            INVALID_REQUEST: Malformed input, missing fields, or bad parameters.
            NO_IMAGE_GENERATED: The model completed without producing an image (a
                soft refusal or transient glitch — no safety verdict). The request
                is not charged; retrying may succeed.
            TIMEOUT: The request exceeded its synchronous time budget; resubmit
                with ``async: true`` and poll for the result.
            INTERNAL_ERROR: An unexpected internal error (genuine bug).
    EditJobErrorCode:
      type: string
      enum:
        - instance_died
        - dispatch_failed
      title: EditJobErrorCode
      description: >-
        Job-infrastructure failure codes with no synchronous-pipeline
        equivalent.


        Pipeline failures reuse the synchronous customer-facing taxonomy

        (``api.schema.phota.PhotaErrorCode``) so an async failure surfaces the
        same

        stable code as its sync twin. These members cover the failure modes the

        watchdog sweep raises, which the sync path never produces:


        Attributes:
            INSTANCE_DIED: A ``RUNNING`` job was reaped after exceeding max runtime
                (the instance crashed mid-run).
            DISPATCH_FAILED: A ``PENDING`` job's dispatch never landed after the
                maximum re-dispatch attempts.
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````