Team Members
List the team and change roles. Admin only, existing accounts only.
| Endpoint | What it does |
|---|---|
| GET /api/v1/site/{site}/users/ | List the site's team, paginated |
| POST /api/v1/site/{site}/users/ | Add an existing account, or change a role. Admin only |
| GET /api/v1/site/{site}/users/{username}/ | Read one member |
| POST /api/v1/site/{site}/users/{username}/ | Change that member's role. Admin only |
Roles are reader, editor, and admin, and both username and role are required when adding someone.
Request
curl -X POST -H "Authorization: Token $ENINE_TOKEN" -H "Content-Type: application/json" \
-d '{"username": "priya", "role": "editor"}' \
https://e9sites.com/api/v1/site/mysite.e9sites.com/users/
Response
{"username": "priya", "email": "priya@example.com", "role": "editor", "job_title": ""}
These endpoints add accounts that already exist. Inviting somebody new by email address happens in the manager, not here. A username nobody holds returns 400 with the field named in errors, not 404 -- the site you addressed does exist, the value inside your payload is what is wrong.