Link Search Menu Expand Document

Updated Fri Mar 5th 2021, 12:17 UTC

Create

POST /users

To add Users to your Account, you need to create them with a Membership. Memberships accept a type attribute of admin, support, or user. These different types offer varying levels of permissions across the app. The user type is for standard users, whereas admin and support types allow users with those memberships to lock and restrict account settings for all users with memberships to a given account.

Examples

Creating new user

Request

POST /users

Body

{
  "name": "Eddie",
  "email": "edmund@bravo.com",
  "memberships": [
    {
      "account": "/accounts/my_account",
      "role":    "admin"
    }
  ]
}
Example
$ curl -i -H Accept:"application/vnd.textus+jsonld" \
    -H Authorization:"Bearer {token}" \
    -X POST /users
     -d '{json: "body"}' 

Response

Status

201

Response Type

User

Example
{
  "@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": {
    "notifications": {
      "email": true
    },
    "customSettings": {}
  },
  "memberships": {
    "@type": "hydra:Collection",
    "@context": "/contexts/hydra:Collection.jsonld",
    "id": "/users/wqyODPA/memberships",
    "members": [
      {
        "@type": "Membership",
        "@context": "/contexts/Membership.jsonld",
        "id": "/users/wqyODPA/memberships/PWApBE3",
        "role": "user",
        "user": "/users/wqyODPA",
        "account": {
          "@type": "Account",
          "@context": "/contexts/Account.jsonld",
          "id": "/accounts/my_account",
          "name": "Example Account"
        }
      }
    ],
    "totalItems": 1
  }
}

© 2021 TextUs