SparrowDesk
Contacts

Create a contact

POST
/contacts
AuthorizationBearer <token>

In: header

first_namestring
last_name?string
email?string

Required if phone not provided

Formatemail
phone?string

Required if email not provided

company_id?integer
custom_fields?object

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://app.sparrowdesk.com/v1/contacts" \  -H "Content-Type: application/json" \  -d '{    "first_name": "John"  }'
{
  "data": {
    "id": 12345,
    "first_name": "John",
    "last_name": "Doe",
    "full_name": "John Doe",
    "email": "[email protected]",
    "phone": "+1234567890",
    "language": null,
    "time_zone": null,
    "country": null,
    "region": null,
    "city": null,
    "active": true,
    "unsubscribed": false,
    "blocked": false,
    "avatar": null,
    "company_id": 123,
    "company_name": "apple",
    "custom_fields": {
      "company_size": "51-200",
      "job_title": "Software Engineer",
      "lead_source": "website"
    },
    "properties": {
      "initial_avatar_color": {
        "backgroundColor": "linear-gradient(...)",
        "textColor": "linear-gradient(...)"
      }
    },
    "created_at": 1672531200,
    "updated_at": 1672531200
  }
}
{
  "error": {
    "message": "Invalid request data"
  }
}
{
  "error": {
    "message": "Company not found"
  }
}
{
  "error": {
    "message": "Contact with this email already exists"
  }
}
{
  "error": {
    "message": "Error creating contact"
  }
}