menu button

API process flow

Get Results

Get Results

This is the final call in the main API process flow. Use the getResults query to retrieve all AI-generated items for a given protocol — including protocol metadata, agenda items, and task items.

If creationDone is false, processing is still ongoing. Check the creatingStep field of ApiProtocolType for the current phase.


GraphQL Query

fragment protocolDetails on ApiProtocolType {
  slug
  name
  date
  language
  empty
  creatingStep
  status
  renamedSpeakers
}

fragment agendaDetails on ApiAgendaItemType {
  id
  classType
  title
  depth
  maxDepth
  metaData
  # legacy fields
  textList
  resolutionList {
    resolution
    decision
  }
  # new structured fields
  texts {
    depth
    name
    text
    hasBulletpoints
  }
  resolutions {
    id
    resolution
    decision
    positiveVote
    negativeVote
    neutralVote
    numberAttendees
  }
  createdAt
  updatedAt
}

fragment taskDetails on ApiTaskType {
  id
  text
  date
  assignedTo
  done
  createdAt
  updatedAt
}

query GetResults($protocolSlug: String!) {
  getResults(protocolSlug: $protocolSlug) {
    creationDone
    protocol {
      ...protocolDetails
    }
    agendaItemList {
      ...agendaDetails
    }
    taskItemList {
      ...taskDetails
    }
  }
}

Query Variables

{
  "protocolSlug": "PROTOCOL_SLUG"
}

Example JavaScript Implementation

import axios from "axios";

async function getResults(protocolSlug) {
  const res = await axios({
    method: "POST",
    url: "https://api-v2.speechmind.com/external/v2/graphql",
    headers: {
      "Content-Type": "application/json",
      "x-api-key": process.env.SPEECHMIND_API_KEY,
    },
    data: JSON.stringify({
      query: GET_RESULTS,
      variables: { protocolSlug },
    }),
  });

  const { creationDone, protocol, agendaItemList, taskItemList } = res.data.data.getResults;

  return { creationDone, protocol, agendaItemList, taskItemList };
}

Notes

  • Poll this query every 5–10 seconds until creationDone becomes true. Total processing time is typically ~40% of the audio duration (e.g. a 60-minute recording takes ~24 minutes).
  • The creatingStep field shows which phase the AI is currently processing.
  • agendaItem.textList has different detail levels. For summary the correct textList looks like {"0": [...]}. For politics it looks like {"0": [...], "1": [...], "2": [...]}. An empty value {} means the AI could not map content to that item.

Two ways to read content — both fully supported

Each agenda item exposes two parallel field sets for text and resolutions. Both return the same underlying data — request whichever fits your integration, or request both at once as shown in the query above.

  • textList — JSON object keyed by depth level. {"0": [...]} for summary, {"0": [...], "1": [...], "2": [...]} for politics.
  • texts — typed list; each entry has depth (Int), name (String), text ([String]), and hasBulletpoints (Boolean).
  • resolutionList — each entry has resolution (String) and decision (String).
  • resolutions — extends resolutionList with id, positiveVote, negativeVote, neutralVote, and numberAttendees.

Use textList / resolutionList for the simplest shape. Use texts / resolutions if you need typed fields or vote count data.

Have questions?

Still have questions? Talk to support.