View as Markdown
MSG91 icon

MSG91 ACTION

Create or Update Contact in Segmento

Add or update contact information in Segmento (MSG91's contact management system). See the documentation
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's MSG91 account once, then configure and run Create or Update Contact in Segmento from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "msg91-create-or-update-contact",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    msg91: { authProvisionId: "apn_xxxxxxx" },
    phonebook: "Phonebook",
    fields: true,
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Create or Update Contact in Segmento inputs
Property Type Description
phonebook Phonebook string
The ID of the phonebook where the contact will be added or updated
Required
fields Fields boolean
If fields is true or not set, dynamic fields are created; if false, they aren't
Required
input Contact Data string
An object containing contact details. Example: { "name": "Name", "email": "email address", "contact_id": "if exists update or create", "new_field": "field_type created based on value ", "date_field": "YYYY-MM-DD HH:MM:SS format", "details": { "qualification": "graduate", "age": 30, "address": "random address" } }
Required

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
msg91-create-or-update-contact
Version
0.0.2
App
MSG91
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes