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

# Get job

> Retrieve processing status for a single pipeline job.

Returns public lifecycle details for one processing job linked to a submission. Job `type` and `status` values use stable lowercase slugs (for example `pipeline.run_inference`, `succeeded`).

Use `GET /v1/submissions/{submissionId}` when you want the full job list for a submission. Use this endpoint when you already have a `jobId` from the `POST /v1/submissions` acceptance response.

## Example request

```bash theme={null}
curl -H "X-Api-Key: <your-api-key>" \
  https://api-test.idunox.com/v1/jobs/<jobId>
```

## Example response (excerpt)

```json theme={null}
{
  "jobId": "bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb",
  "submissionId": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
  "partnerSubmissionId": "hy-sub-0001",
  "type": "pipeline.run_inference",
  "typeLabel": "Run inference",
  "status": "succeeded",
  "statusLabel": "Succeeded",
  "completedAt": "2026-04-20T09:00:45.000Z"
}
```


## OpenAPI

````yaml GET /v1/jobs/{jobId}
openapi: 3.1.0
info:
  title: IduScore Partner & Platform API
  description: >-
    Partner-facing JSON API for de-identified clinical submissions (canonical
    Type A, not FHIR at ingestion).


    **Authentication:** Send `X-Api-Key: <key>` **or** `Authorization: Bearer
    <key>` on every `/v1/*` request (except preflight `OPTIONS`).


    **Writes (`POST`):** Client MUST send non-empty `x-correlation-id` and
    `Idempotency-Key`. The server does not synthesize these from the request id.


    **Tenant scope:** Credentials resolve to a tenant; all IDs are tenant-scoped
    (cross-tenant access returns `404` where applicable).


    **Request id:** Responses may echo `x-request-id` when the client sent it;
    otherwise the server generates one (see error envelope `requestId`).


    **Partner responses:** Read APIs return **IduScore wellbeing** language only
    — stable `wellbeing.*` outcome ids,

    plain-English labels, and optional `notices[].message` lines (no internal
    warning codes or model identifiers).

    Use **`GET /openapi.yaml`** for request/response examples aligned with this
    contract.



    ---

    **Merged spec (this file):** includes **Platform** and **Diagnostics** paths
    from the service implementation in addition to the **Type A** `/v1` product
    routes. The slimmer `type-a-partner-v1.*` files are the same contract for
    submissions, jobs, and results.
  version: 0.1.0
  license:
    name: Proprietary
servers:
  - url: https://api-test.idunox.com
    description: Lab partner API (iduscore-andres-test)
  - url: https://andres-test-submission-api-oymsigepna-ew.a.run.app
    description: Lab submission-api Cloud Run URL (direct)
security: []
tags:
  - name: Submissions
    description: Ingestion and submission reads
  - name: Jobs
    description: Processing job status
  - name: Results
    description: Inference / scoring results
  - name: Webhooks
    description: >
      Outbound HTTPS callbacks the platform may POST to a URL you register (not
      paths on the IduScore Partner API;

      `/_reference/...` entries document payload and headers for your
      implementer only).
  - name: Platform
    description: >-
      Liveness, readiness, and OpenAPI document discovery. **No API key**
      required.
  - name: Diagnostics
    description: >-
      Validates the same **partner API key** and (for `POST`) write headers as
      other `/v1` routes. Returns `204` when valid.
paths:
  /v1/jobs/{jobId}:
    get:
      tags:
        - Jobs
      summary: Get processing job detail
      operationId: getJobDetail
      parameters:
        - $ref: '#/components/parameters/PathJobId'
        - $ref: '#/components/parameters/HeaderRequestIdOptional'
      responses:
        '200':
          description: >-
            Job scoped to tenant; partner scoping follows linked submission
            metadata when present
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerJobDetailResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - partnerApiKey: []
        - partnerBearer: []
components:
  parameters:
    PathJobId:
      name: jobId
      in: path
      required: true
      schema:
        type: string
        format: uuid
    HeaderRequestIdOptional:
      name: x-request-id
      in: header
      required: false
      schema:
        type: string
      description: Optional; echoed when possible. Server generates when absent.
  schemas:
    PartnerJobDetailResponse:
      type: object
      additionalProperties: false
      required:
        - jobId
        - submissionId
        - partnerSubmissionId
        - partnerSubjectId
        - type
        - typeLabel
        - status
        - statusLabel
        - segment
        - correlationId
        - parentJobId
        - attempts
        - maxAttempts
        - lastError
        - errorDetail
        - queuedAt
        - acceptedAt
        - startedAt
        - completedAt
        - failedAt
        - slaDeadlineAt
        - processingDurationMs
        - slaBreached
        - createdAt
        - updatedAt
      properties:
        jobId:
          type: string
          format: uuid
        submissionId:
          type:
            - string
            - 'null'
          format: uuid
        partnerSubmissionId:
          type:
            - string
            - 'null'
        partnerSubjectId:
          type:
            - string
            - 'null'
        type:
          $ref: '#/components/schemas/PartnerProcessingJobTypePublic'
        typeLabel:
          type: string
          minLength: 1
        status:
          $ref: '#/components/schemas/PartnerProcessingJobStatusPublic'
        statusLabel:
          type: string
          minLength: 1
        segment:
          type:
            - string
            - 'null'
        correlationId:
          type:
            - string
            - 'null'
        parentJobId:
          type:
            - string
            - 'null'
          format: uuid
        attempts:
          type: integer
          minimum: 0
        maxAttempts:
          type: integer
          minimum: 0
        lastError:
          type:
            - string
            - 'null'
        errorDetail:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: Opaque JSON when present (Zod unknown)
        queuedAt:
          type:
            - string
            - 'null'
          format: date-time
        acceptedAt:
          type:
            - string
            - 'null'
          format: date-time
        startedAt:
          type:
            - string
            - 'null'
          format: date-time
        completedAt:
          type:
            - string
            - 'null'
          format: date-time
        failedAt:
          type:
            - string
            - 'null'
          format: date-time
        slaDeadlineAt:
          type:
            - string
            - 'null'
          format: date-time
        processingDurationMs:
          type:
            - integer
            - 'null'
        slaBreached:
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    PartnerProcessingJobTypePublic:
      type: string
      description: Stable public id for a pipeline step (not `ProcessingJobType`).
      enum:
        - pipeline.ingest_validate
        - pipeline.deidentify
        - pipeline.map_to_fhir
        - pipeline.fhir_store_upsert
        - pipeline.run_inference
        - pipeline.write_artifacts
        - pipeline.dispatch_webhooks
    PartnerProcessingJobStatusPublic:
      type: string
      description: Stable public id for job lifecycle (not `ProcessingJobStatus`).
      enum:
        - pending
        - queued
        - running
        - succeeded
        - failed
        - cancelled
        - dead_letter
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - requestId
          properties:
            code:
              type: string
              description: Machine-readable error code (e.g. VALIDATION_ERROR, NOT_FOUND).
            message:
              type: string
            requestId:
              type: string
            correlationId:
              type: string
              description: >-
                Present when the request established a correlation id (writes
                always send `x-correlation-id`).
            details:
              description: Optional structured validation or domain hints (shape varies).
      description: Matches `errorEnvelopeSchema` in src/lib/error-envelope.ts
  responses:
    BadRequest:
      description: Validation or missing required headers / bad UUID parameter
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              code: VALIDATION_ERROR
              message: Invalid submission payload
              requestId: 550e8400-e29b-41d4-a716-446655440000
              correlationId: corr-example-1
              details: {}
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              code: INVALID_API_KEY
              message: Invalid or expired API key
              requestId: 550e8400-e29b-41d4-a716-446655440000
    Forbidden:
      description: >-
        Tenant inactive, `partnerId` mismatch, or submission restricted to
        another credential via `metadata.partnerId`
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    NotFound:
      description: Resource not found or not visible in tenant scope
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              code: NOT_FOUND
              message: Submission not found
              requestId: 550e8400-e29b-41d4-a716-446655440000
    InternalError:
      description: Unhandled failure
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              code: INTERNAL_ERROR
              message: Internal server error
              requestId: 550e8400-e29b-41d4-a716-446655440000
  securitySchemes:
    partnerApiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: Plaintext API key issued for the tenant (stored hashed server-side).
    partnerBearer:
      type: http
      scheme: bearer
      bearerFormat: opaque
      description: Same secret as X-Api-Key, sent as a Bearer token.

````