API documentation

v1.0

Persons

Manage persons associated to contacts.

Create a person

Create a person associated to a contact

HTTP Request

POST/contacts/{contact_id}/persons

Parameters

NameTypeDescription
nameString / RequiredName
positionString / OptionalPosition
phoneString / OptionalPhone
emailString / OptionalEmail
defaultBoolean / 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

NameTypeDescription
nameString / OptionalName
positionString / OptionalPosition
phoneString / OptionalPhone
emailString / OptionalEmail
defaultBoolean / OptionalSet 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.