Users
- GET /api/users/
Get a list of all registered users.
- Returns:
an object mapping user ID to user object.
- GET /api/users/(int: user_id)
Get a single user’s details, including a list of their API keys.
- Returns:
a single user object
- Status Codes:
404 Not Found – if the user does not exist
- PUT /api/users/
Create a new user.
- Reqjson:
a user object
- Status Codes:
400 Bad Request – if any fields are missing or invalid
409 Conflict – if the username is already taken
201 Created – on success
- Returns:
the new user object
- PATCH /api/users/(int: user_id)
Edit an existing user.
- Parameters:
user_id – the ID the user to edit.
- Status Codes:
400 Bad Request – if the user data is invalid
404 Not Found – if the user does not exist
- Returns:
the modified user object
- DELETE /api/users/(int: user_id)
Delete an existing user.
- Parameters:
user_id – the ID of the
User
to delete.
- Status Codes:
404 Not Found – if the user does not exist
204 No Content – on success
- PUT /api/users/keys
Create a new API key for the current user.
- Request JSON Object:
name (string) – name for the new API key
- Resjson:
an
APIKey
object with thekey
property set to the newly-generated API key. This value will never be available in plaintext again.- Status Codes:
201 Created – on success
400 Bad Request – if the name is not provided
- DELETE /api/users/keys/(int: api_key_id)
Delete an existing API key. Deleting an API key will stop it from working forever.
- Parameters:
api_key_id – the ID of the
APIKey
to delete.
- Status Codes:
204 No Content – on success
403 Forbidden – if the current user is not the owner of the API key or an administrator
404 Not Found – if the key does not exist