Skip to content

contact

Deprecated

This endpoint will stop working on 1 August 2027. Migrate to POST /v1/contacts in the new API; the migration guide has the recommended order of work and the important model differences.

The legacy /rest/contact/contact upsert is split across three operations in the new API. Pick the right one for what you're doing:

flowchart TD
    start([Need to manage a contact?]) --> q1{Contact already<br/>exists?}
    q1 -->|No| create["POST /v1/contacts<br/>create the contact"]
    q1 -->|Yes| update["PATCH /v1/contacts/{id}<br/>update fields"]
    create --> q2{Link to a site?}
    update --> q2
    q2 -->|Add| addsite["PUT /v1/sites/{id}/contacts/{contactId}"]
    q2 -->|Remove| rmsite["DELETE /v1/sites/{id}/contacts/{contactId}"]
    q2 -->|No change| done([Done])
    addsite --> done
    rmsite --> done

Site association is now an explicit operation; the legacy endpoint did this implicitly as part of the upsert payload.

Open POST /v1/contacts in the new API →

View legacy reference

/rest/contact/contact


POST
This API adds or updates a Contact and associates it to Locations.  Contact will be associated to any Locations specified in the "locations" section and will be removed from any other locations.

acceptable request representations:

  • application/json

{    "clientRef":"1",    "contactRef":"ahah",
    "salutation":"Mr",
    "forename":"Arthur",
    "surname":"Putey",
    "contact1":"08789 998778",
    "contact1Type":"2",
    "contact2":"aputey@email.com",
    "contact2Type":"3",
    "contact3":"arthur64",
    "contact3Type":"7",
    "contact4":"01395 278878",
    "contact4Type":"1",
    "preferredContact":"1",    "address1":"7 Eve St",    "address2":"Siydenham",    "address3":"Oxon",    "address4":"",
    "postCode":"OX7 7HG",
    "notes":"some notes",
    "considerations":"some considerations",    "locations" : [
        { "locationRef":"dhsjsk21",          "isPreferred":"false",          "startDate":"12/12/2010",          "endDate":"12/12/2099"          "usageTypeId":"32" }
    ]
}

available response representations:
  • 200 - application/json

{
    "result" : "success or fail",
    "result_msg" : "error message"
}

Field specification details:

Rest API Field Specification - Contact



See the Contact API matrix for the full list of endpoints in this category.