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_ids?array<integer>
custom_fields?object
contact_note?

Optional notes created under the new contact. Requires an API key bound to a member. A note that fails to create is skipped; the contact is still created and only the notes that succeeded are returned.

Response Body

application/json

application/json

application/json

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": 0,
    "company_name": "string",
    "companies": [
      {
        "id": 0,
        "name": "string",
        "domain": "string",
        "logo": "string",
        "phone": "string",
        "address": "string",
        "notes": "string"
      }
    ],
    "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,
    "contact_note": [
      {
        "id": 0,
        "title": "string",
        "description": "string",
        "attachments": [
          {
            "id": 0,
            "url": "string",
            "file_name": "string",
            "content_type": "string",
            "size": 0,
            "status": "string"
          }
        ]
      }
    ]
  }
}
{
  "error": {
    "message": "Invalid request data"
  }
}
{
  "message": "Unauthorized"
}
{
  "error": {
    "message": "Company not found"
  }
}
{
  "error": {
    "message": "Contact with this email already exists"
  }
}
{
  "error": {
    "message": "string"
  }
}
{
  "name": "RateLimitExceeded",
  "message": "Rate limit exceeded for: APIS_PER_MINUTE",
  "code": 429,
  "details": [
    {
      "name": "APIS_PER_MINUTE",
      "quota": 0,
      "count": 0,
      "remaining": 0
    }
  ]
}
{
  "error": {
    "message": "Error creating contact"
  }
}