Skip to main content
PATCH
/
users
/
{id}
Update User
curl --request PATCH \
  --url https://api.example.com/users/{id} \
  --header 'Content-Type: application/json' \
  --data '
{
  "githubId": "<string>",
  "email": "<string>",
  "username": "<string>",
  "name": "<string>",
  "avatarUrl": "<string>",
  "githubAccessToken": "<string>",
  "githubRefreshToken": "<string>",
  "installationId": 123
}
'
{
  "id": 123,
  "githubId": "<string>",
  "email": "<string>",
  "username": "<string>",
  "name": "<string>",
  "avatarUrl": "<string>",
  "githubAccessToken": "<string>",
  "githubRefreshToken": "<string>",
  "installationId": 123,
  "createdAt": "<string>",
  "updatedAt": "<string>"
}
Update an existing user’s information.

Request

Path Parameters

id
string
required
The unique identifier of the user to update

Headers

No authentication required.

Body

All fields are optional. Only include the fields you want to update.
githubId
string
GitHub ID of the user
email
string
Email address of the user (must be a valid email format)
username
string
GitHub username
name
string
Display name of the user
avatarUrl
string
URL to the user’s avatar image
githubAccessToken
string
GitHub OAuth access token
githubRefreshToken
string
GitHub OAuth refresh token
installationId
integer
GitHub App installation ID

Response

Returns the updated user object.
id
integer
required
Unique identifier for the user
githubId
string
required
GitHub ID of the user
email
string
Email address of the user
username
string
GitHub username
name
string
Display name of the user
avatarUrl
string
URL to the user’s avatar image
githubAccessToken
string
required
GitHub OAuth access token
githubRefreshToken
string
required
GitHub OAuth refresh token
installationId
integer
GitHub App installation ID
createdAt
string
required
ISO 8601 timestamp of when the user was created
updatedAt
string
required
ISO 8601 timestamp of when the user was last updated

Example

cURL
curl -X PATCH https://api.diffy.com/users/1 \
  -H "Content-Type: application/json" \
  -d '{
    "name": "John Smith",
    "installationId": 98765
  }'
Response
{
  "id": 1,
  "githubId": "12345678",
  "email": "[email protected]",
  "username": "johndoe",
  "name": "John Smith",
  "avatarUrl": "https://avatars.githubusercontent.com/u/12345678",
  "githubAccessToken": "gho_xxxxxxxxxxxxx",
  "githubRefreshToken": "ghr_xxxxxxxxxxxxx",
  "installationId": 98765,
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-20T14:22:00Z"
}

Build docs developers (and LLMs) love