aboutsummaryrefslogtreecommitdiff
path: root/docs/Admin-API.md
blob: 3b19d1aa6fd34566d194d854ee6804c31ace5cf6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Admin API
Authentication is required and the user must be an admin.

## `/api/pleroma/admin/user`
### Remove a user
* Method `DELETE`
* Params:
    * `nickname`
* Response: User’s nickname
### Create a user
* Method: `POST`
* Params:
    * `nickname`
    * `email`
    * `password`
* Response: User’s nickname

## `/api/pleroma/admin/users/tag`
### Tag a list of users
* Method: `PUT`
* Params:
    * `nickname`
    * `tags`
### Untag a list of users
* Method: `DELETE`
* Params:
    * `nickname`
    * `tags`

## `/api/pleroma/admin/permission_group/:nickname`
### Get user user permission groups membership
* Method: `GET`
* Params: none
* Response:
```JSON
{
	"is_moderator": bool,
	"is_admin": bool
}
```

## `/api/pleroma/admin/permission_group/:nickname/:permission_group`
Note: Available `:permission_group` is currently moderator and admin. 404 is returned when the permission group doesn’t exist.

### Get user user permission groups membership
* Method: `GET`
* Params: none
* Response:
```JSON
{
	"is_moderator": bool,
	"is_admin": bool
}
```
### Add user in permission group
* Method: `POST`
* Params: none
* Response:
    * On failure: ``{"error": "…"}``
    * On success: JSON of the ``user.info``
### Remove user from permission group
* Method: `DELETE`
* Params: none
* Response:
    * On failure: ``{"error": "…"}``
    * On success: JSON of the ``user.info``
* Note: An admin cannot revoke their own admin status.

## `/api/pleroma/admin/relay`
### Follow a Relay
* Methods: `POST`
* Params:
    * `relay_url`
* Response:
    * On success: URL of the followed relay
### Unfollow a Relay
* Methods: `DELETE`
* Params:
    * `relay_url`
* Response:
    * On success: URL of the unfollowed relay

## `/api/pleroma/admin/invite_token`
### Get a account registeration invite token
* Methods: `GET`
* Params: none
* Response: invite token (base64 string)

## `/api/pleroma/admin/email_invite`
### Sends registration invite via email
* Methods: `POST`
* Params:
    * `email`
    * `name`, optionnal

## `/api/pleroma/admin/password_reset`
### Get a password reset token for a given nickname
* Methods: `GET`
* Params: none
* Response: password reset token (base64 string)