> ## 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 submission

> Retrieve submission status and linked job summaries.

Returns the current partner-facing status of a submission and processing jobs. Use this to poll for progress if you are not using webhooks.

## Status values

| Status       | Meaning                                                        |
| ------------ | -------------------------------------------------------------- |
| `received`   | Submission accepted                                            |
| `validating` | Validation in progress                                         |
| `validated`  | Validated, pipeline starting                                   |
| `processing` | Inference and report pipeline running                          |
| `completed`  | Finished — use `resultId` from the detail payload when present |
| `failed`     | Processing failed                                              |
| `rejected`   | Rejected (e.g. policy or validation at ingest)                 |

Statuses are lowercase strings with a human-readable `statusLabel`. They are partner-facing labels, not raw database enum names.

All resources are scoped to your account. A `submissionId` from another account returns `404`.

## Example request

```bash theme={null}
curl -H "Authorization: Bearer <your-api-key>" \
  https://api-test.idunox.com/v1/submissions/<submissionId>
```

When complete, follow the `resultId` (or webhook) to [`GET /v1/results/{resultId}`](/api-reference/endpoint/results).


## OpenAPI

````yaml GET /v1/submissions/{submissionId}
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/submissions/{submissionId}:
    get:
      tags:
        - Submissions
      summary: Get submission detail and job summaries
      operationId: getSubmissionDetail
      parameters:
        - $ref: '#/components/parameters/PathSubmissionId'
        - $ref: '#/components/parameters/HeaderRequestIdOptional'
      responses:
        '200':
          description: >-
            Submission scoped to tenant; enforces optional `metadata.partnerId`
            scoping
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerSubmissionDetailResponse'
        '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:
    PathSubmissionId:
      name: submissionId
      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:
    PartnerSubmissionDetailResponse:
      type: object
      additionalProperties: false
      required:
        - submissionId
        - subjectId
        - partnerSubmissionId
        - partnerSubjectId
        - status
        - statusLabel
        - createdAt
        - updatedAt
        - counts
        - jobs
      properties:
        submissionId:
          type: string
          format: uuid
        subjectId:
          type: string
          format: uuid
        partnerSubmissionId:
          type:
            - string
            - 'null'
        partnerSubjectId:
          type: string
        status:
          $ref: '#/components/schemas/PartnerSubmissionPublicStatus'
        statusLabel:
          type: string
          minLength: 1
          description: Human-readable label for `status` (e.g. Processing).
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        counts:
          type: object
          additionalProperties: false
          required:
            - documents
            - results
            - artifacts
          properties:
            documents:
              type: integer
              minimum: 0
            results:
              type: integer
              minimum: 0
            artifacts:
              type: integer
              minimum: 0
        jobs:
          type: array
          items:
            type: object
            additionalProperties: false
            required:
              - jobId
              - type
              - typeLabel
              - status
              - statusLabel
              - correlationId
              - queuedAt
              - startedAt
              - completedAt
              - acceptedAt
              - failedAt
              - slaDeadlineAt
              - processingDurationMs
              - slaBreached
              - attempts
              - maxAttempts
              - errorSummary
            properties:
              jobId:
                type: string
                format: uuid
              type:
                $ref: '#/components/schemas/PartnerProcessingJobTypePublic'
              typeLabel:
                type: string
                minLength: 1
              status:
                $ref: '#/components/schemas/PartnerProcessingJobStatusPublic'
              statusLabel:
                type: string
                minLength: 1
              correlationId:
                type:
                  - string
                  - 'null'
              queuedAt:
                type:
                  - string
                  - 'null'
                format: date-time
              startedAt:
                type:
                  - string
                  - 'null'
                format: date-time
              completedAt:
                type:
                  - string
                  - 'null'
                format: date-time
              acceptedAt:
                type:
                  - string
                  - 'null'
                format: date-time
              failedAt:
                type:
                  - string
                  - 'null'
                format: date-time
              slaDeadlineAt:
                type:
                  - string
                  - 'null'
                format: date-time
                description: >-
                  Deadline derived from acceptedAt + platform SLA at submission
                  time for ingest jobs
              processingDurationMs:
                type:
                  - integer
                  - 'null'
                description: >-
                  Milliseconds from startedAt (else acceptedAt) to terminal time
                  when finished
              slaBreached:
                type: boolean
                description: >-
                  True if in-flight past deadline or terminal end after
                  slaDeadlineAt
              attempts:
                type: integer
                minimum: 0
              maxAttempts:
                type: integer
                minimum: 0
              errorSummary:
                type:
                  - string
                  - 'null'
    PartnerSubmissionPublicStatus:
      type: string
      description: Stable public slug for submission pipeline state (partner JSON).
      enum:
        - received
        - validating
        - validated
        - processing
        - completed
        - failed
        - rejected
    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.

````