GoliathDevelopersGet an API key
Reference/Contactsgenerated from the gateway manifest

shareContactsWithPartner

shareContactWithPartner for many contacts.

POST/api/v1/callWRITEidempotent · 24 hruns as the key's owner
View as Markdown

shareContactWithPartner for many contacts (contactIds), as a bulk task (bulkTaskId, getBulkTask). partnerOrganizationId from listPartnerships; assignments name the PARTNER org users who get it (userId, role POINT_PERSON | PARTICIPANT). include* choose what is copied (core, notes, calls, texts default true; tasks false).

curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operationId": "shareContactsWithPartner",
    "variables": {
      "contactIds": [
        "<String>"
      ],
      "partnerOrganizationId": "<partnerOrganizationId>",
      "assignments": [
        {
          "userId": "<userId>",
          "role": "POINT_PERSON"
        }
      ]
    }
  }'
import { GoliathClient } from '@goliath-data/sdk'

const goliath = new GoliathClient({
  apiKey: process.env.GOLIATH_API_KEY!,
  baseUrl: 'https://server.goliathdata.com',
})

// Enum values as strings: the SDK's enum types aren't exported yet, so assert to the method's variables type.
const variables = {
  contactIds: [
    '<String>'
  ],
  partnerOrganizationId: '<partnerOrganizationId>',
  assignments: [
    {
      userId: '<userId>',
      role: 'POINT_PERSON'
    }
  ]
} as Parameters<typeof goliath.contacts.shareContactsWithPartner>[0]

const result = await goliath.contacts.shareContactsWithPartner(variables, { idempotencyKey: crypto.randomUUID() })
const res = await fetch('https://server.goliathdata.com/api/v1/call', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.GOLIATH_API_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({
    operationId: 'shareContactsWithPartner',
    variables: {
      contactIds: [
        '<String>'
      ],
      partnerOrganizationId: '<partnerOrganizationId>',
      assignments: [
        {
          userId: '<userId>',
          role: 'POINT_PERSON'
        }
      ]
    }
  }),
})
const { data, errors } = await res.json()

Variables

The example sends only what the schema requires. Some operations also need one of several optional variables (one filter or another, say); the description above says which.

contactIds[String!]!required
partnerOrganizationIdID!required
assignments[BulkShareContactUserAssignmentInput!]!required
userIdID!required
roleShareContactAssignmentRole!required
POINT_PERSONPARTICIPANT
createTaskBulkShareContactCreateTaskInput
includeContactCoreBoolean
includeTasksBoolean
includeNotesBoolean
includeCallsBoolean
includeTextsBoolean
Every field, all the way down
variables
[
  {
    "name": "contactIds",
    "type": "[String!]!",
    "required": true,
    "description": null,
    "defaultValue": null
  },
  {
    "name": "partnerOrganizationId",
    "type": "ID!",
    "required": true,
    "description": null,
    "defaultValue": null
  },
  {
    "name": "assignments",
    "type": "[BulkShareContactUserAssignmentInput!]!",
    "required": true,
    "description": null,
    "defaultValue": null,
    "fields": [
      {
        "name": "userId",
        "type": "ID!",
        "required": true,
        "description": null,
        "defaultValue": null
      },
      {
        "name": "role",
        "type": "ShareContactAssignmentRole!",
        "required": true,
        "description": null,
        "defaultValue": null,
        "enumValues": [
          "POINT_PERSON",
          "PARTICIPANT"
        ]
      },
      {
        "name": "createTask",
        "type": "BulkShareContactCreateTaskInput",
        "required": false,
        "description": null,
        "defaultValue": null,
        "fields": [
          {
            "name": "title",
            "type": "String!",
            "required": true,
            "description": null,
            "defaultValue": null
          },
          {
            "name": "taskType",
            "type": "String",
            "required": false,
            "description": null,
            "defaultValue": null
          },
          {
            "name": "timezone",
            "type": "Timezone!",
            "required": true,
            "description": "AZ: Arizona: MST all year, no DST.",
            "defaultValue": null,
            "enumValues": [
              "IDLW",
              "SST",
              "HST",
              "AKST",
              "PST",
              "MST",
              "AZ",
              "CST",
              "EST",
              "AST",
              "BRT",
              "FNT",
              "AZOT",
              "UTC",
              "CET",
              "EET",
              "MSK",
              "GST",
              "PKT",
              "BST",
              "ICT",
              "JST",
              "AEST",
              "NCT",
              "NZST"
            ]
          },
          {
            "name": "description",
            "type": "String",
            "required": false,
            "description": null,
            "defaultValue": null
          },
          {
            "name": "endDate",
            "type": "DateTime!",
            "required": true,
            "description": null,
            "defaultValue": null
          },
          {
            "name": "participants",
            "type": "[String!]",
            "required": false,
            "description": null,
            "defaultValue": null
          },
          {
            "name": "autoCompleteOnNoteAdded",
            "type": "Boolean",
            "required": false,
            "description": null,
            "defaultValue": null
          },
          {
            "name": "autoCompleteOnReassignment",
            "type": "Boolean",
            "required": false,
            "description": null,
            "defaultValue": null
          },
          {
            "name": "createCalendarEvent",
            "type": "Boolean",
            "required": false,
            "description": null,
            "defaultValue": null
          }
        ]
      }
    ]
  },
  {
    "name": "includeContactCore",
    "type": "Boolean",
    "required": false,
    "description": null,
    "defaultValue": null
  },
  {
    "name": "includeTasks",
    "type": "Boolean",
    "required": false,
    "description": null,
    "defaultValue": null
  },
  {
    "name": "includeNotes",
    "type": "Boolean",
    "required": false,
    "description": null,
    "defaultValue": null
  },
  {
    "name": "includeCalls",
    "type": "Boolean",
    "required": false,
    "description": null,
    "defaultValue": null
  },
  {
    "name": "includeTexts",
    "type": "Boolean",
    "required": false,
    "description": null,
    "defaultValue": null
  }
]

Response

What comes back under data: a list shows as one entry, and a value as its type.

response shape
{
  "data": {
    "contactMutation": {
      "bulkShareContacts": {
        "mode": "SYNC",
        "bulkTaskId": "…"
      }
    }
  }
}

Errors

Idempotency

Send an Idempotency-Key of 1 to 255 characters. A finished request retried with the same key replays its stored response, marked Idempotency-Replayed: true; one still in flight returns 409 idempotency_conflict. Keys expire after 24 hours. Write without fear →