Skip to main content
This page collects the most common queries and mutations you can run on the ION API. The quickest way to run them is through the API Playground.
Find parts by part number or description substring:
query SearchParts($q: String!, $first: Int) {
  parts(filters: { partNumber: { ilike: $q } }, first: $first) {
    edges {
      node {
        id
        partNumber
        description
        revision
        partType
        status
        partSubtypes { id name }
      }
    }
  }
}
{ "q": "%BRKT%", "first": 25 }
Fetch a procedure template plus every step and its fields:
query GetProcedure($id: Int!) {
  procedure(id: $id) {
    id
    title
    steps {
      id
      title
      fields { id }
    }
  }
}
{ "id": 12 }
Walk an as-built BOM tree from the parent down to all installations:
query AbomTree($id: Int!) {
  partInventory(id: $id) {
    id
    serialNumber
    part { partNumber }
    buildRequirements {
      id
      part { partNumber }
      quantity
    }
  }
}
{ "id": 9876 }
Pull two as-built BOMs and diff them client-side:
query CompareAboms($idA: Int!, $idB: Int!) {
  a: partInventory(id: $idA) {
    id
    serialNumber
    buildRequirements { id part { partNumber } quantity }
  }
  b: partInventory(id: $idB) {
    id
    serialNumber
    buildRequirements { id part { partNumber } quantity }
  }
}
{ "idA": 9876, "idB": 9877 }
Get every run that’s in progress, with the current step the operator is on:
query OpenRuns {
  runs(filters: { status: { in: ["TODO", "IN_PROGRESS"] } }, first: 100) {
    edges {
      node {
        id
        title
        status
        procedure { id title }
        partInventory { id serialNumber part { partNumber } }
      }
    }
  }
}
Every run a specific part inventory has gone through, newest first:
query RunHistory($partInventoryId: Int!) {
  runs(
    filters: { partInventoryId: { eq: $partInventoryId } }
    first: 50
  ) {
    edges {
      node {
        id
        title
        status
        _created
        procedure { id title }
      }
    }
  }
}
{ "partInventoryId": 9876 }
List inventory units of a given part, grouped by physical location:
query InventoryByLocation($partId: Int!) {
  partInventories(filters: { partId: { eq: $partId } }, first: 250) {
    edges {
      node {
        id
        serialNumber
        lotNumber
        quantity
        status
        location { id name type }
      }
    }
  }
}
{ "partId": 12 }
Get every serialized instance of a part with its current state:
query SerializedUnits($partId: Int!) {
  partInventories(filters: { partId: { eq: $partId } }, first: 250) {
    edges {
      node {
        id
        serialNumber
        status
        location { id name }
      }
    }
  }
}
{ "partId": 12 }
All open issues grouped by disposition type for triage:
query OpenIssuesByDisposition {
  issues(
    filters: { status: { in: ["PENDING", "IN_PROGRESS", "IN_REVIEW"] } }
    first: 250
  ) {
    edges {
      node {
        id
        title
        status
        issueDispositionType { id title }
        assignedTo { id name }
        _created
      }
    }
  }
}
Verify your token and find which org you’re in:
query Me {
  me {
    id
    name
    email
    organization { id domain }
  }
}