Text.lk icon

Text.lk

Consume Text.lk API

Actions14

Contact → Create

AI-generated

Summary

Create a Text.lk contact

Inputs

  • group_id (required) — The route-safe Text.lk group ID. Use only letters and numbers; do not include slashes, spaces, or query strings.
  • mobile (required) — Contact mobile number in Text.lk-supported international format, for example 94771234567. Avoid spaces, plus signs, and punctuation unless Text.lk explicitly supports them.
  • first_name — First name to send to Text.lk. Avoid control characters and unnecessary personal data.
  • last_name — Last name to send to Text.lk. Avoid control characters and unnecessary personal data.
  • requestOptions — Additional options to customize the request, such as batching settings.
  • allowUnauthorizedCerts — Whether to accept the response even if SSL certificate validation is not possible.
  • proxy — HTTP proxy to use. If authentication is required it can be defined as follow: http://username:password@myproxy:3128
  • timeout — Time in ms to wait for the server to send response headers (and start the response body) before aborting the request

Output shape

Created contact object

Returns the newly created contact details; typically includes a UID and other attributes. Errors are returned as JSON error objects.

Examples

Example 1: Add a contact to the marketing group

'group_id': 'marketing', 'mobile': '94771234567', 'first_name': 'Alice', 'last_name': 'Smith'

Example 2: Create a contact using a proxy and custom timeout

'group_id': 'support', 'mobile': '9421234567', 'proxy': 'http://proxy.example.com:3128', 'timeout': 15000

Example 3: Create contact with batching option disabled

'group_id': 'events', 'mobile': '94987654321', 'requestOptions': { 'batch': { 'batchSize': 0 } }

Links

Discussion