Users
User management in Drive API is very basic: only the user id needs to be registered.
We recommend that you use the same user id that you use to identify users in your system.
Create user - POST
Creates a user in Drive API. Only the id
field is required. It should be the same identifier used in your system. Any string is accepted.
The email field is optional.
Endpoint: /v1/users
Body fields:
id
(string)email
(string, optional)
Example body:
{
"id": "b5d00e95-b998-4a33-9210-84777f4cb4f9",
"email": "[email protected]"
}
Example response:
201
- Created (no body)
Error responses:
400
- The provided query parameters, route parameters or body is invalid.409
- Conflict - a user with this id or email was already created.500
- Internal server error
Get user - GET
Returns the user with the given userId
.
Endpoint: /v1/users/{userId}
Parameters:
userId
(path parameter, string)
Example response:
200
- OK
{
"id": "11f84452-0c8c-41d4-8a7f-f2d3f285ef05",
"email": "[email protected]",
"hasDebt": false
}
Error responses:
400
- The provided query parameters, route parameters or body is invalid.404
- User not found500
- Internal server error
Patch user - PATCH
The endpoint allows changing the user's email.
Endpoint: /v1/users/{userId}
Parameters:
userId
(path parameter, string)
Example body:
{
"email": "[email protected]",
"hasDebt": false
}
Example response:
200
- OK (no body)
Error responses:
400
- The provided query parameters, route parameters or body is invalid.404
- User not found409
- Conflict - this email is already taken500
- Internal server error.
Delete user - DELETE
Deletes the user with the given userId
. The deletion is done immediately.
Before deleting a user make sure it does not have debt.
We also reserve the right to reject this call if less than 3 years passed since recent user activity, due to legal obligation of storing data.
Endpoint: /v1/users/{userId}
Parameters:
userId
(path parameter, string)
Example response:
204
- OK (no body)
Error responses:
400
- Bad Request404
- User not found409
- User has debt500
- Internal Server Error
Updated 3 months ago