Skip to main content

Imports

The ChatKitty Platform API allows for batched imports of large amounts of data from other systems using import file upload endpoints. All import API methods accept a JSON array text file with each item in the JSON array matching the import item schema of the resource type being imported.

Importing users

POST /v1/imports/users
curl --location --request 'POST' \
'https://api.chatkitty.com/v1/imports/users' \
-H 'accept: application/json' \
-H 'Authorization: Bearer ACCESS-TOKEN' \
-H 'Content-Type: multipart/form-data' \
-F 'file=@users_import_file.json;type=application/json

Item schema

display_name
required
string

Human readable name of this user. Shown to other users

object (FileImport)

External file properties

guest
required
boolean

True if this user was created by a guest user session

idempotency_key
string

Unique value generated by the client which ChatKitty uses to recognize subsequent retries of the same request. Optional but recommended

name
required
string

The unique name used to identify this user across ChatKitty. Also known as username

required
object

Custom data associated with this user

{
  • "name": "jane@chatkitty.com",
  • "displayName": "Jane Doe",
  • "isGuest": false,
  • "properties": {
    }
}

Importing channels

POST /v1/imports/channels
curl --location --request 'POST' \
'https://api.chatkitty.com/v1/imports/channels' \
-H 'accept: application/json' \
-H 'Authorization: Bearer ACCESS-TOKEN' \
-H 'Content-Type: multipart/form-data' \
-F 'file=@channels_import_file.json;type=application/json

Item schema

type
required
string
creator
string

Username of the user who created this channel

idempotency_key
string

Unique value generated by the client which ChatKitty uses to recognize subsequent retries of the same request. Optional but recommended

members
required
Array of strings

List of usernames of members of this channel

object

Custom data associated with this channel

name
string

The unique name of this channel used to reference the channel. If absent defaults to a random UUID

display_name
string

Human readable name of this channel shown to users. If absent defaults to the channel name

Example
{
  • "idempotencyKey": "unique-external-id",
  • "type": "PUBLIC",
  • "name": "b0a0bd55-921a-4f72-8ee3-f26c6fda0bb7"
}

Importing channel members

POST /v1/imports/channels/{id}/members
curl --location --request 'POST' \
'https://api.chatkitty.com/v1/imports/channels/1/members' \
-H 'accept: application/json' \
-H 'Authorization: Bearer ACCESS-TOKEN' \
-H 'Content-Type: multipart/form-data' \
-F 'file=@members_import_file.json;type=application/json

Item schema

idempotency_key
string

Unique value generated by the client which ChatKitty uses to recognize subsequent retries of the same request. Optional but recommended

username
required
string

Username of the user to be added as a member

{
  • "username": "jane@chatkitty.com"
}

Importing messages

POST /v1/imports/messages
curl --location --request 'POST' \
'https://api.chatkitty.com/v1/imports/messages' \
-H 'accept: application/json' \
-H 'Authorization: Bearer ACCESS-TOKEN' \
-H 'Content-Type: multipart/form-data' \
-F 'file=@messages_import_file.json;type=application/json

Item schema

type
required
string
channel_id
required
integer <int64>

ID of the channel this message belongs to

group_tag
string

Tag identifying the message group this message belongs to

idempotency_key
string

Unique value generated by the client which ChatKitty uses to recognize subsequent retries of the same request. Optional but recommended

object

Map of custom data attached to this message

body
required
string

The text body of this message

Example
{
  • "type": "SYSTEM_TEXT",
  • "body": "Hello, World!"
}