People
Summary of people endpoints
- GET /admin/api/people - list all available people for the current site.
- POST /admin/api/people - create a new person.
- GET /admin/api/people/1 - get data for a single person.
- PUT /admin/api/people/1 - update a person.
- DELETE /admin/api/people/1 - delete a person.
The person object
Attributes
firstname
- String Person's first name.lastname
- String Person's last name.phone
- String Person's phone number.working_language
- String Interface language for person, 2-character ISO 369 code.owner
- Boolean Person's owner status.direct_marketing
- Boolean Whether person has agreed to receive direct marketing or not. Please note that this attribute is only accessible to the authenticated user.
Read only attributes
name
- String Person's full name. Combined fromfirstname
andlastname
.email
- String Person's email address.status
- String Person's current activation status.CREATED
- Person has been created but their account has not yet been activated.ACTIVATED
- Person has activated their account.
List all available people for the current site
GET /admin/api/people
Example response:
Status: 200 OK
[
{
"id": 1,
"firstname": "John",
"lastname": "Smith",
"name": "John Smith",
"phone": null,
"email": "tanel@example.com",
"working_language": "en",
"status": "ACTIVATED",
"owner": true,
"created_at": "2014-01-23T09:19:04.000Z",
"updated_at": "2014-01-24T10:03:02.000Z",
"last_login_at": "2014-01-24T12:11:02.000Z",
"url": "http://helloworld.voog.co/admin/api/people/1",
"direct_marketing": false
}, {
"id": 2,
"firstname": null,
"lastname": null,
"name": "api@example.com",
"phone": null,
"email": "api@example.com",
"working_language": "en",
"status": "ACTIVATED",
"owner": true,
"created_at": "2014-01-23T10:03:04.000Z",
"updated_at": "2014-01-24T13:01:22.000Z",
"last_login_at": "2014-01-24T13:01:22.000Z",
"url": "http://helloworld.voog.co/admin/api/people/2"
}
]
Parameters
per_page
- elements per response (default:50
; maximum:250
).page
- requested page (default:1
).
Filter attributes
Read more about filters.
- Object
person
attributes:id
,email
,firstname
,lastname
,working_language
,status
,owner
,created_at
,updated_at
,last_login_at
.
Create a new person
POST /admin/api/people
Example data:
{
"email": "john@doe.com"
}
Example response:
Status: 201 Created
{
"id": 3,
"firstname": null,
"lastname": null,
"created_at": "2024-08-15T13:13:32.000Z",
"updated_at": "2024-08-15T13:13:32.000Z",
"email": "john@doe.com",
"working_language": "en",
"status": "CREATED",
"last_login_at": null,
"owner": false,
"name": "john",
"phone": null,
"url": "http://helloworld.voog.co/admin/api/people/3"
}
Parameters:
email
- email address of the person.
Get data for a single person
GET /admin/api/people/1
Example request:
GET http://helloworld.voog.co/admin/api/people/1
Example response:
Status: 200 OK
{
"id": 1,
"firstname": "John",
"lastname": "Smith",
"name": "John Smith",
"phone": null,
"email": "tanel@example.com",
"working_language": "en",
"status": "ACTIVATED",
"owner": true,
"created_at": "2014-01-23T09:19:04.000Z",
"updated_at": "2014-01-24T10:03:02.000Z",
"last_login_at": "2014-01-24T12:11:02.000Z",
"url": "http://helloworld.voog.co/admin/api/people/1",
"direct_marketing": false
}
Update a person
PUT /admin/api/people/1
Example data:
{
"lastname": "Doe",
"phone": "12345678",
"direct_marketing": true,
"current_password": "oldpassword",
"password": "newpassword"
}
Example response:
Status: 200 OK
{
"id": 1,
"firstname": "John",
"lastname": "Doe",
"name": "John Doe",
"phone": "12345678",
"email": "tanel@example.com",
"working_language": "en",
"status": "ACTIVATED",
"owner": true,
"created_at": "2014-01-23T09:19:04.000Z",
"updated_at": "2024-08-15T13:13:32.000Z",
"last_login_at": "2014-01-24T12:11:02.000Z",
"url": "http://helloworld.voog.co/admin/api/people/1",
"direct_marketing": true
}
Updatable parameters:
For authenticated user: firstname
, lastname
, phone
, direct_marketing
, working_language
,
current_password
, password
.
For other users: owner
.
Please note that restrictions apply when updating person data:
- Authenticated users cannot update their
owner
status. - Editors cannot update
owner
status of other people. - Password change is only possible for authenticated users.
Delete a person
Example request:
DELETE /admin/api/people/1
Example response:
Status: 204 No Content
Please note that restrictions apply when deleting a person.
- People with
owner: true
status can delete any other person. - People with
owner: false
status can only delete people withowner: false
status. - If user is the only person with
owner: true
status, then the user cannot delete themselves.