Skip to content

Create Contact

POST/contacts

Create a new contact.

Attributes

AttributeTypeDescription
firstNamestring
lastNamestring
email *string
phonestringMobile phone number with country code. Example: +46701234567
commentstring
companystring
categoryIdsarrayAttach categories to your contact.
workspaceId *number

Fields marked with * are required.

Request

js
import Confetti from 'confetti'

const confetti = new Confetti({ apiKey: 'your-key' })

const contact = await confetti.contacts.create({
  firstName: 'Jane',
  lastName: 'Doe',
  email: 'jane@example.com',
  phone: '+46701234567',
  comment: 'A note',
  workspaceId: 1,
})
sh
curl -X POST "https://api.confetti.events/contacts" \
  -H "Content-Type: application/json" \
  -H "Authorization: apikey your-key" \
  -d '{
  "data": {
    "type": "contact",
    "attributes": {
      "firstName": "Jane",
      "lastName": "Doe",
      "email": "jane@example.com",
      "phone": "+46701234567",
      "comment": "A note"
    }
  }
}'