CRMchat APIBeta
Telegram APIContacts

contacts.importContacts

POST
/workspaces/{workspaceId}/telegram-accounts/{accountId}/call/contacts.importContacts

Imports contacts: saves a full list on the server, adds already registered contacts to the contact list, returns added contacts and their info. Use contacts.RawAddContactRequest to add Telegram contacts without actually using their phone number.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

workspaceId*string

Workspace ID

accountId*string

Telegram account ID

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

params*

Imports contacts: saves a full list on the server, adds already registered contacts to the contact list, returns added contacts and their info. Use contacts.RawAddContactRequest to add Telegram contacts without actually using their phone number.

Response Body

application/json

application/json

curl -X POST "https://example.com/workspaces/string/telegram-accounts/string/call/contacts.importContacts" \  -H "Content-Type: application/json" \  -d '{    "params": {      "contacts": [        {          "_": "inputPhoneContact",          "clientId": "string",          "phone": "string",          "firstName": "string",          "lastName": "string"        }      ]    }  }'
{  "result": {    "_": "contacts.importedContacts",    "imported": [      {        "_": "importedContact",        "userId": 0,        "clientId": "string"      }    ],    "popularInvites": [      {        "_": "popularContact",        "clientId": "string",        "importers": 0      }    ],    "retryContacts": [      "string"    ],    "users": [      {        "_": "userEmpty",        "id": 0      }    ]  }}