menu button

API process flow

Get Results

This API involves getting the result items created by AI


Get Results

This is the final call in the main API process flow.

  • Retrieve all AI-generated items related to a specific protocol.
  • This includes protocol metadata, agenda items, and task items.
  • The getResults docs can be found here.

Overview

  • Use the getResults query to fetch all AI-created results for a given protocol.
  • If creationDone is false, the creation process is still ongoing.
  • You can check the current creation progress in the creatingStep field of ApiProtocolType.

Example 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
    }
  }
}

Example JavaScript Implementation

import axios from "axios";

export const GET_RESULTS = `...`; // GraphQL query from above

export async function getResults(protocolSlug) {
  const queryData = {
    query: GET_RESULTS,
    variables: { protocolSlug },
  };

  try {
    const response = await axios.post(
      "https://api-v2.speechmind.com/external/v2/graphql",
      JSON.stringify(queryData),
      {
        headers: {
          "Content-Type": "application/json",
          "x-api-key": process.env.SPEECHMIND_API_KEY,
        },
      }
    );

    const result = response.data.data.getResults;
    const { creationDone, protocol, agendaItemList, taskItemList } = result;
    // agendaItemList entries now include both legacy (textList, resolutionList)
    // and new structured fields (texts, resolutions)

    return { creationDone, protocol, agendaItemList, taskItemList };
  } catch (error) {
    console.error("Error fetching results:", error.response?.data || error.message);
    throw error;
  }
}

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 the following: ”{“0”: […]}“. For politics the correct textList looks the following: ”{“0”: […], “1”: […], “2”: […]}“.

  • An agendaItem.textList value can also be empty - it then has the following content: ”{}“. This means that the AI was not able to map it to the given file content.

New Fields: texts and resolutions

Two new structured fields are available per agenda item alongside the existing legacy fields — no breaking change.

texts — Typed list of text blocks per agenda item. Each entry has:

FieldTypeDescription
depthIntDetail depth level (0, 1, 2, …)
nameStringLabel, e.g. "Verlauf", "Stichpunkte", "Ergebnis"
text[String]List of text content
hasBulletpointsBooleanWhether the content is formatted as bullet points

resolutions — Typed list of resolutions per agenda item. Each entry has:

FieldTypeDescription
idIDResolution ID
resolutionStringResolution title
decisionStringDecision text
positiveVoteIntNumber of yes votes
negativeVoteIntNumber of no votes
neutralVoteIntNumber of abstentions
numberAttendeesIntTotal attendees counted

The legacy textList and resolutionList fields remain available and unchanged.

Next steps

The core API process flow is complete: you can go from an audio or video file to a fully generated protocol based on the AI-generated or your own agenda, including the content for each agenda item.

Optional API calls let you further modify the generated content, access the underlying data used to create the agenda items, or delete individual files or entire protocols.

Have questions?

Still have questions? Talk to support.