v1

latestSwagger 2.0Apache 2.02026-07-1334102.9 MB
Users

Update a user

Updates user attributes specified in the request body. Unspecified attributes remain unchanged. Updates can be performed via PUT or PATCH. The full_name attribute is mandatory for PUT requests but optional for PATCH. Note: When updating via /users/me/, you must use your full user ID in the request body. The me alias is not supported in request bodies.

Instructions for Updating Social, Education, and Employment Fields

  • Social Profiles:

    • Provide platform usernames or identifiers (not full URLs) for:
      • github, twitter, linkedIn: arrays of strings
      • scholar, orcid, researcherId, impactStory: single string
      • profileWebsites: array of full URLs
    • Example:
      "social": {
        "linkedIn": ["userLinkedInID"],
        "github": ["githubUsername"],
        "twitter": ["twitterHandle"],
        "profileWebsites": ["http://example.com"]
      }
      
  • Education and Employment:

    • Each record must include:
      • institution (required, non-empty string)
      • startYear and startMonth (required integers, startYear ≥ 1900, startMonth 1-12)
      • ongoing (required boolean)
      • Optional fields: degree, title, department
      • If ongoing is false, include endYear and endMonth (end date ≥ start date)
    • Example:
      "employment": [{
        "title": "Data Scientist",
        "institution": "Open Science Framework",
        "department": "Engineering",
        "startYear": 2018,
        "startMonth": 5,
        "ongoing": true
      }]
      
patch/users/{user_id}/

Path parameters

user_idstring required

The unique identifier of the user.

Request body

idstring required

The unique identifier of the user entity.

typestring required

The type identifier of the user entity (users).

Example request

{
  "data": {
    "type": "users",
    "id": "{user_id}",
    "attributes": {
      "full_name": "Casey M. Rollins",
      "middle_names": "Marie",
      "social": {
        "github": [
          "https://github.com/caseyrollins"
        ],
        "twitter": [
          "https://twitter.com/crollins"
        ]
      },
      "employment": [
        {
          "title": "Data Scientist",
          "institution": "Open Science Framework",
          "department": "Engineering",
          "startYear": 2018,
          "startMonth": 5,
          "ongoing": true
        }
      ],
      "education": [
        {
          "degree": "MS in Computer Science",
          "institution": "University of Somewhere",
          "department": "Computer Science",
          "startYear": 2014,
          "startMonth": 9,
          "endYear": 2016,
          "endMonth": 6,
          "ongoing": false
        }
      ]
    }
  }
}

Response

OK