Persons
Persons describe contacts that may be referenced in other entities. Person entities contain the source of truth for information such as name, contact methods, and profile pictures. On this page, we'll dive into the different person endpoints you can use to manage contacts programmatically.
The person model
The person model contains all the information about your contacts, including their name, email, and custom fields.
Properties
- Name
personId
- Type
- string
- Description
Unique identifier for the person.
- Name
firstName
- Type
- string
- Description
The person's first name.
- Name
lastName
- Type
- string
- Description
The person's last name.
- Name
email
- Type
- string
- Description
The person's email address.
- Name
profilePicture
- Type
- string
- Description
The URL for the person's profile picture.
- Name
address
- Type
- string
- Description
The person's address.
- Name
city
- Type
- string
- Description
The person's city.
- Name
state
- Type
- string
- Description
The person's state.
- Name
customFields
- Type
- object
- Description
An object containing custom fields for the person.
- Name
eventHistory
- Type
- array
- Description
An array of event objects that the person has been associated with.
List all persons
This endpoint allows you to retrieve a paginated list of all persons in your organization. By default, a maximum of ten persons are shown per page.
Optional attributes
- Name
limit
- Type
- integer
- Description
Limit the number of persons returned.
- Name
skip
- Type
- integer
- Description
Number of persons to skip for pagination.
Request
curl -G https://rest.gatsby.events/person \
-H "Authorization: Bearer {token}" \
-H "organizationSlug: {organizationSlug}"
Response
{
"persons": [
{
"personId": "52907745-7672-470e-a",
"firstName": "John",
"lastName": "Doe",
"email": "[email protected]",
"profilePicture": "https://assets.gatsby.events/avatars/johndoe.jpg",
"address": "123 Main St",
"city": "San Francisco",
"state": "CA",
"customFields": {
"title": "Software Engineer",
"company": "Acme Inc"
}
},
{
"personId": "8293b8f2-3019-42a8-b"
// ...
}
]
}
Create a person
This endpoint allows you to create a new person in your organization.
Required attributes
- Name
firstName
- Type
- string
- Description
The person's first name.
- Name
lastName
- Type
- string
- Description
The person's last name.
- Name
email
- Type
- string
- Description
The person's email address.
Request
curl https://rest.gatsby.events/person \
-H "Authorization: Bearer {token}" \
-H "organizationSlug: {organizationSlug}" \
-d '{"firstName":"John","lastName":"Doe","email":"[email protected]"}'
Response
{
"personId": "52907745-7672-470e-a"
}
Retrieve a person
This endpoint allows you to retrieve a person by providing their personId. This includes detailed information about the person, including their event history.
Request
curl https://rest.gatsby.events/person/52907745-7672-470e-a \
-H "Authorization: Bearer {token}" \
-H "organizationSlug: {organizationSlug}"
Response
{
"personId": "52907745-7672-470e-a",
"firstName": "John",
"lastName": "Doe",
"email": "[email protected]",
"profilePicture": "https://assets.gatsby.events/avatars/johndoe.jpg",
"address": "123 Main St",
"city": "San Francisco",
"state": "CA",
"customFields": {
"title": "Software Engineer",
"company": "Acme Inc"
},
"eventHistory": [
{
"eventId": "e8dj2ns9-34kd-9j3b",
"name": "Annual Conference 2023",
"slug": "annual-conference-2023",
"date": "2023-11-15T09:00:00Z",
"rsvpStatus": "Accepted",
"rsvpStatusHistory": [
{
"status": "Invited",
"actorId": "admin-user-1",
"actorType": "user",
"createdAt": "2023-10-01T14:30:00Z"
},
{
"status": "Accepted",
"actorId": "52907745-7672-470e-a",
"actorType": "eventPerson",
"createdAt": "2023-10-05T10:15:00Z"
}
],
"attendance": "Attended"
}
]
}
Update a person
This endpoint allows you to update a person's information by providing their personId.
Required attributes
- Name
personId
- Type
- string
- Description
The unique identifier for the person.
Optional attributes
- Name
firstName
- Type
- string
- Description
The person's first name.
- Name
lastName
- Type
- string
- Description
The person's last name.
- Name
email
- Type
- string
- Description
The person's email address.
- Name
phoneNumber
- Type
- string
- Description
The person's phone number.
- Name
customFields
- Type
- object
- Description
An object containing custom fields for the person.
Request
curl -X PUT https://rest.gatsby.events/person/52907745-7672-470e-a \
-H "Authorization: Bearer {token}" \
-H "organizationSlug: {organizationSlug}" \
-d '{"personId":"52907745-7672-470e-a","firstName":"John","lastName":"Smith"}'
Response
{
"success": true
}