Create Contact

Prev Next
Post
/api/v1/contacts.create
Premium tag

Create a local personal contact for the authenticated user. The contact source is always local. displayName is built from givenName and optional surname.

Changelog

Version Description
9.1.0 Added
Header parameters
X-Auth-Token
stringRequired

The authToken of the authenticated user.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired

The userId of the authenticated user.

ExamplerbAXPnMktTFbNpwtJ
Body parameters
Example 1
{
  "givenName": "John",
  "surname": "Doe",
  "companyName": "Example Corp",
  "emails": [
    {
      "address": "john.doe@example.com",
      "label": "work"
    }
  ],
  "phones": [
    {
      "raw": "+1 555 0100",
      "label": "mobile"
    }
  ]
}
Expand All
object
givenName
string Required

Enter the contact's given name. Required and must contain a non-whitespace character.

Min length1
surname
string

Enter the contact's surname.

companyName
string

Enter the contact's company name.

emails
Array of object

Up to 10 email addresses.

Max items10
object
address
string Required
label
string
phones
Array of object

Up to 10 phone numbers. When raw includes a resolvable country code, the response also includes e164.

Max items10
object
raw
string Required
label
string
Responses
200

OK

Example 1
{
  "contact": {
    "_id": "690c2b2d4e7e8bcf6985b3d8",
    "source": "local",
    "displayName": "John Doe",
    "givenName": "John",
    "surname": "Doe",
    "companyName": "Example Corp",
    "emails": [
      {
        "address": "john.doe@example.com",
        "label": "work"
      }
    ],
    "phones": [
      {
        "raw": "+1 555 0100",
        "e164": "+15550100",
        "label": "mobile"
      }
    ],
    "_updatedAt": "2025-11-05T07:53:43.420Z"
  },
  "success": true
}
Expand All
object
contact
object (Contact)

A personal contact returned by the Contacts API. Sync-only fields (uid, externalId, folderId, lastSyncAt) are never included.

_id
string
source
string

local for contacts created in Rocket.Chat. outlook for contacts imported by Microsoft Exchange server-to-server sync.

Valid values[ "local", "outlook" ]
displayName
string
givenName
string
surname
string
companyName
string
officeLocation
string
emails
Array of object
object
address
string
label
string

Present on local contacts. Exchange imports may omit it.

phones
Array of object
object
raw
string
e164
string

E.164 form when raw includes a resolvable country code.

label
string
categories
Array of string
string
favorite
boolean
syncProvider
string

Set on Outlook-synced contacts. Either ews or graph.

Valid values[ "ews", "graph" ]
_updatedAt
string
success
boolean
400

Bad Request

Missing Given Name
{
  "success": false,
  "error": "must have required property 'givenName' [error-invalid-params]"
}
Not Created
{
  "success": false,
  "error": "error-contact-not-created"
}
object
success
boolean
error
string
401

Unauthorized

Authorization Error
{
  "success": false,
  "error": "You must be logged in to do this."
}
object
success
boolean
error
string
403

Forbidden

Permission Error
{
  "success": false,
  "error": "User does not have the permissions required for this action",
  "errorType": "error-forbidden"
}
object
success
boolean
error
string
errorType
string