Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Updated Mon Feb 6th 2023, 19:36 UTC

Create

POST /:account/contacts

Create a new contact

Examples

Creating the contact

Request

POST /my_account/contacts

Body

{
  "name": "Cordell Walker",
  "phones": [
    {
      "number": "1-720-333-1234",
      "type": "Mobile"
    },
    {
      "number": "1-720-333-1235",
      "type": "Mobile"
    },
    {
      "number": "1-303-123-4567 x2921",
      "type": "Work"
    }
  ],
  "data": {
    "businessName": "McDonalds",
    "tags": ["cashier", "burger flipper", "fry cook"]
  }
}
Example
$ curl -i -H Accept:"application/vnd.textus+jsonld" \
    -H Authorization:"Bearer {token}" \
    -X POST /my_account/contacts
    -d '{
  "name": "Cordell Walker",
  "phones": [
    {
      "number": "1-720-333-1234",
      "type": "Mobile"
    },
    {
      "number": "1-720-333-1235",
      "type": "Mobile"
    },
    {
      "number": "1-303-123-4567 x2921",
      "type": "Work"
    }
  ],
  "data": {
    "businessName": "McDonalds",
    "tags": ["cashier", "burger flipper", "fry cook"]
  }
}'

Response

Status

200

Response Type

Contact

Example Body

{
  "id": "/contacts/Vled2N",
  "@type": "Contact",
  "@context": "/contexts/Contact.jsonld",
  "name": "Jamel Hirthe",
  "firstName": "Jamel",
  "lastName": "Hirthe",
  "phones": {
    "id": "/contacts/Vled2N/phones",
    "@type": "hydra:Collection",
    "@context": "/contexts/hydra:Collection.jsonld",
    "totalItems": 1,
    "members": [
      {
        "@type": "ContactPhone",
        "id": "/contact_phones/mxvbRw",
        "@context": "/contexts/ContactPhone.jsonld",
        "phoneNumber": "+13035551234",
        "formattedPhoneNumber": "(303) 555-1234",
        "extension": null,
        "type": "Mobile",
        "deliverabilityStatus": "unknown",
        "contact": "/contacts/DQeeO69"
      },
      {
        "@type": "ContactPhone",
        "id": "/contact_phones/mxvbRw",
        "@context": "/contexts/ContactPhone.jsonld",
        "phoneNumber": "+13035551234",
        "formattedPhoneNumber": "(303) 555-1234",
        "extension": "2921",
        "type": "Mobile",
        "deliverabilityStatus": "unknown",
        "contact": "/contacts/DQeeO69"
      }
    ]
  },
  "notes": {
    "@type": "hydra:Collection",
    "id": "/contacts/DQeeO69/notes",
    "@context": "/contexts/hydra:Collection.jsonld",
    "totalItems": 0,
    "members": [
      {
        "@type": "ContactNote",
        "id": "/contact_notes/RN5QNG",
        "@context": "/contexts/ContactNote.jsonld",
        "content": "Life is a fragile thing, Har. One minute you're chewin' on a burger, the next minute you're dead meat.",
        "createdAt": "2018-10-31T16:17:10.914Z",
        "updatedAt": "2018-10-31T16:17:10.914Z",
        "user": {
          "@type": "User",
          "@context": "/contexts/User.jsonld",
          "id": "/users/wqyODPA",
          "name": "Chuck Norris",
          "firstName": "Chuck",
          "lastName": "Norris",
          "email": "chuck@textus.example",
          "avatar": null,
          "automatedActor": false,
          "hasPassword": false,
          "discarded": false,
          "settings": {
            "customSettings": {}
          },
          "memberships": "/users/wqyODPA/memberships"
        },
        "contact": "/contacts/DQeeO69"
      }
    ]
  },
  "conversations": "/contacts/DQeeO69/conversations",
  "data": {
    "businessName": "McDonalds",
    "tags": [
      "cashier",
      "burger flipper",
      "fry cook"
    ]
  },
  "customData": {
    "@context": "/contexts/hydra:Collection.jsonld",
    "@type": "hydra:Collection",
    "id": "/contacts/DQeeO69/custom_data",
    "members": [],
    "totalItems": 0
  },
  "createdAt": "2020-01-06T21:49:58.312Z"
}

© 2023 TextUs