Persons
Manage persons associated to contacts.
Create a person
Create a person associated to a contact
HTTP Request
POST/contacts/{contact_id}/persons
Parameters
Name | Type | Description |
---|---|---|
name | String / Required | Name |
position | String / Optional | Position |
phone | String / Optional | Phone |
String / Optional | ||
default | Boolean / Optional / true, false (If not sent will be `false` by default) | Set as default person |
Playload
{
"name": "Person name"
}
201Response
{
"data": {
"id": 80,
"name": "Person name",
"position": "",
"phone": "",
"email": "",
"default": false,
"contact_id": 120,
"created_at": "2022-09-30T15:30:15+00:00",
"updated_at": "2022-09-30T15:30:15+00:00"
}
}
List persons
This endpoint allows the consultation of persons of a contact.
HTTP Request
GET/contacts/{contact_id}/persons
200 Response
{
"data": [
{
"id": 60,
"name": "Mary",
"position": "Boss",
"phone": "",
"email": "mary@acme.com",
"default": true,
"contact_id": 120,
"created_at": "2022-09-30T15:30:15+00:00",
"updated_at": "2022-09-30T15:30:15+00:00"
},
{
"id": 65,
"name": "John Doe",
"position": "",
"phone": "999-999-999",
"email": "jhon.doe@acme.com",
"default": false,
"contact_id": 120,
"created_at": "2022-09-30T15:30:15+00:00",
"updated_at": "2022-09-30T15:30:15+00:00"
}
]
}
Get a person
This endpoint allows the consultation of a person of a contact.
HTTP Request
GET/contacts/{contact_id}/persons/{person_id}
200 Response
{
"data": {
"id": 80,
"name": "Person name",
"position": "",
"phone": "",
"email": "",
"default": false,
"contact_id": 120,
"created_at": "2022-09-30T15:30:15+00:00",
"updated_at": "2022-10-30T16:30:25+00:00"
}
}
Update a person
This endpoint allows the update of a person of a contact.
HTTP Request
PATCH/contacts/{contact_id}/persons/{person_id}
Parameters
Name | Type | Description |
---|---|---|
name | String / Optional | Name |
position | String / Optional | Position |
phone | String / Optional | Phone |
String / Optional | ||
default | Boolean / Optional | Set as default person |
All parameters are optional but at least one parameter with value must be sent.
Playload
{
"name": "New name",
"email": "person@acme.com",
"default": true
}
204 Response
Response without body.
Delete a person
This endpoint allows the deletion of a person of a contact.
HTTP Request
DELETE/contacts/{contact_id}/persons/{person_id}
204 Response
Response without body.