← Developer DocsOptional Calls

Update Address Config

Control which speaker name fields appear in the generated document.

The updateAddressConfig mutation controls which speaker name fields appear in the generated document output. It can be called at any time after protocol creation.

This maps to addressnameConfiguration in protocol meta_data.


Field Reference

All fields are Boolean. If omitted, they default to true.

Field Meaning
gender Herr / Frau / Divers prefix
givenName First name
familyName Last name
preTitle e.g. Dr., Prof.
postTitle e.g. MBA
party Party / organisation
posLong Funktionsbezeichnung lang
posShort Funktionsbezeichnung kurz

GraphQL Mutation

mutation UpdateAddressConfig(
  $protocolSlug: String!
  $addressConfig: AddressConfigInput!
) {
  updateAddressConfig(
    protocolSlug: $protocolSlug
    addressConfig: $addressConfig
  ) {
    success
    protocol {
      slug
    }
  }
}

Mutation Variables

{
  "protocolSlug": "PROTOCOL_SLUG",
  "addressConfig": {
    "gender": false,
    "givenName": true,
    "familyName": true,
    "preTitle": true,
    "postTitle": false,
    "party": true,
    "posLong": true,
    "posShort": false
  }
}

Example JavaScript Implementation

import axios from "axios";

async function updateAddressConfig(protocolSlug, addressConfig) {
  try {
    const response = 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: UPDATE_ADDRESS_CONFIG,
        variables: { protocolSlug, addressConfig },
      }),
    });

    const data = response.data.data.updateAddressConfig;

    if (data.success) {
      console.log("Address config updated for protocol:", data.protocol.slug);
    }
  } catch (error) {
    console.error("Error updating address config:", error);
  }
}

// Example usage
updateAddressConfig("my-protocol-slug", {
  gender: false,
  givenName: true,
  familyName: true,
  preTitle: true,
  postTitle: false,
  party: true,
  posLong: true,
  posShort: false,
});