Users

All available operations for manipulating users and their information


Check out our integration guide to understand how user syncing fits in your backend workflow

Create or update a user

This endpoint creates or updates a user:

  • if the user does not exist in the Cord backend (based on its ID), it will be created; some fields are required.
  • if the user exists, it will be updated; all fields are optional, only the fields provided will be updated.

HTTP Request

PUT https://api.cord.com/v1/users/<ID>
Copy

For more information about IDs, check out our Identifiers concept breakdown.

Request Body

Listed below are the fields of the request body to be added as part of the HTTP PUT request.


email

required
string
format: email
Email address

name

optional
string
Full user name

shortName

optional
string
Short user name. In most cases, this will be preferred over name when set.

short_name

optional
string

status

optional
string
enum: ( "active" | "deleted" )

profilePictureURL

optional

This property can be one of the following:

  • string
    format: uri
    This must be a valid URL, which means it needs to follow the usual URL formatting and encoding rules. For example, any space character will need to be encoded as %20. We recommend using your programming language's standard URL encoding function, such as encodeURI in Javascript.
  • null

profile_picture_url

optional

This property can be one of the following:

  • string
    format: uri
  • null

first_name

optional
string
User's first name. This field is deprecated and has no effect.

last_name

optional
string
User's last name. This field is deprecated and has no effect.

metadata

optional
object
Arbitrary key-value pairs that can be used to store additional information.

Example Request

curl "https://api.cord.com/v1/users/123" \
-X PUT \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
  "name": "Bender Bending Rodriguez",
  "profilePictureURL": "https://cord.com/favicon-32x32.png"
}'
Copy

If successful, the response will be:

{
  "success": true
}
Copy

List users

This endpoint lists all users created in the context of your application.

HTTP Request

GET https://api.cord.com/v1/users
Copy

Request Body

This REST endpoint has no request body.

Example Request

curl "https://api.cord.com/v1/users" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"
Copy

If successful, the response will be:

[
  {
    "id": "3001",
    "name": "Philip J Fry",
    "email": "delivery@planetexpress.nny",
  },
  {
    "id": "123",
    "name": "Bender Bending Rodriguez",
    "email": "bending@planetexpress.nny"
  }
]
Copy

Get user details

This endpoint fetches the information about a user that has been stored in Cord's backend. The data you retrieve here contains the same values that would be displayed in Cord's UI components when that user loads your application.

HTTP Request

GET https://api.cord.com/v1/users/<ID>
Copy

Request Body

This REST endpoint has no request body.

Example Request

curl "https://api.cord.com/v1/users/3001" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"
Copy

If successful, the response will be:

{
  "id": "3001",
  "name": "Philip J Fry",
  "email": "delivery@planetexpress.nny",
  "organizations": ["org1", "org2"]
}
Copy