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

# Get a job



## OpenAPI

````yaml /openapi.json get /diagrams/{id}
openapi: 3.1.0
info:
  title: diagramkit API
  version: '1'
  description: >-
    Make, change, animate and download diagrams. Full reference: /docs/api.md on
    diagramkit’s site.
servers:
  - url: https://app.diagramkit.ai/api/v1
security:
  - bearer: []
paths:
  /diagrams/{id}:
    get:
      summary: Get a job
      operationId: getDiagram
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: wait
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            maximum: 300
            default: 0
            description: Hold the request open until done or this many seconds pass.
          description: Answer when the job finishes or after this long.
      responses:
        '200':
          description: The finished job.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Job'
        '202':
          description: Accepted and still being made.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Job'
        '402':
          description: >-
            no_credits: the balance cannot pay for this request (per page: 5
            credits a new diagram, 2 a change, 8 an animation). Nothing is
            charged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: An error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Job:
      type: object
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - queued
            - running
            - succeeded
            - failed
        title:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
          description: What the diagram shows and any assumptions it made.
        version:
          type: integer
          description: How many versions it has; 0 until the first is made.
        animated:
          type: boolean
        preset:
          type:
            - string
            - 'null'
          description: >-
            Where the diagram will be used, as it was made or last revised for;
            null without one.
        progress:
          type:
            - string
            - 'null'
        image_url:
          type:
            - string
            - 'null'
          format: uri
        downloads:
          type:
            - object
            - 'null'
          additionalProperties:
            type: string
            format: uri
          description: png, jpg, svg, pdf, and mp4 and gif when animated.
        recommended_download:
          type: object
          description: >-
            With a preset, once there is a version: the download it offers
            first, as format, url and the query options in that url.
          properties:
            format:
              type: string
            url:
              type: string
              format: uri
            options:
              type: object
              additionalProperties:
                type: string
        error:
          type:
            - object
            - 'null'
          description: >-
            Why a failed job failed. type no_credits (the balance cannot pay for
            the planned pages) and too_many_pages (a set longer than max_pages
            or 100 pages) are refused before anything is drawn or charged;
            otherwise generation_failed.
          properties:
            type:
              type: string
              enum:
                - generation_failed
                - no_credits
                - too_many_pages
            message:
              type: string
        created_at:
          type: string
          format: date-time
        applied:
          type: array
          items:
            type: object
          description: 'Edits only: the wording changes made.'
        moved:
          type: array
          items:
            type: object
            properties:
              part:
                type: string
              wide:
                type: array
                items:
                  type: number
              compact:
                type: array
                items:
                  type: number
          description: >-
            Edits only: each part an edit moved, with its new box [left, top,
            width, height] per layout.
        skipped:
          type: array
          items:
            type: object
          description: 'Edits only: the wording changes not made, with a reason.'
      required:
        - id
        - status
        - version
        - animated
        - created_at
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
            message:
              type: string
            issues:
              type: array
              items:
                type: string
          required:
            - type
            - message
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: An API key (aid_…) from Settings › API.

````

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