Skip to main content

Creating people

This endpoint creates a new person

HTTP Request

POST https://api.lunatask.app/v1/people

Body Parameters

ParameterDescription
first_nameA person's first name
last_nameA person's last name
relationship_strengthOne of family, intimate-friends, close-friends, casual-friends, acquaintances, business-contacts, or almost-strangers (optional, casual-friends will be used if not provided)
sourceIdentification of external system where the note is coming from (optional, e.g. "salesforce")
source_idThe ID of the record in the external system (optional, e.g. "352fd2d7-cdc0-4e91-a0a3-9d6cc9d440e7")

When creating a person, given there's already an existing person with the same source/source_id, the endpoint will return 204 No Content without creating a duplicate.

Additionally, you can persist value for a few selected fields while creating people:

ParameterDescription
emailA person's email address
birthdayA person's birthday (ISO-8601 formatted date)
phoneA person's phone number
caution

Custom fields for email, birthday, or phone number first have to be defined in the app. Otherwise the API will return 422 error code.

Example in Ruby

require 'rest-client'

access_token = 'xxx'

payload = {
first_name: 'John',
last_name: 'Doe',
relationship_strength: 'business-contacts',
source: 'salesforce',
source_id: '352fd2d7-cdc0-4e91-a0a3-9d6cc9d440e7',
}

RestClient.post('https://api.lunatask.app/v1/people', payload.to_json, { Authorization: "bearer #{access_token}", "Content-Type": 'application/json' })

Response

The above command returns JSON structured like this:

{
"person": {
"id": "5999b945-b2b1-48c6-aa72-b251b75b3c2e",
"relationship_strength": "business-contacts",
"sources": [
{
"source": "salesforce",
"source_id": "352fd2d7-cdc0-4e91-a0a3-9d6cc9d440e7"
}
],
"created_at": "2021-01-10T10:39:25Z",
"updated_at": "2021-01-10T10:39:25Z"
}
}
caution

When the number of people on Free plan reaches its limit, this API will respond with a 402 HTTP status code.