forked from gogs/go-gogs-client
-
Notifications
You must be signed in to change notification settings - Fork 1
Administration Users
Unknwon edited this page Dec 9, 2015
·
3 revisions
POST /admin/users
| Name | Type | Description |
|---|---|---|
| source_id | int | Authentication source ID. Remain default means a local user |
| login_name | string | Authentication source login name, required for non-local user |
| username | string | Required Unique user name |
| string | Required Unique email address of user | |
| password | string | Default password for user, required for local user |
| send_notify | bool | Send a notification email for this creation, require mailer service enabled |
{
"source_id": 1,
"login_name": "apiuser",
"username": "apiuser",
"email": "apiuser@user.com"
}Status: 201 Created
Content-Type: application/json
{
"id": 9,
"username": "apiuser",
"full_name": "",
"email": "apiuser@user.com",
"avatar_url": "//1.gravatar.com/avatar/0550f43afcac6f78c3af2dd3a6f1c176"
}PATCH /admin/users/:username
| Name | Type | Description |
|---|---|---|
| source_id | int | Authentication source ID. Remain default means a local user |
| login_name | string | Authentication source login name, required for non-local user |
| full_name | string | Full name of user |
| string | Required Unique email address of user | |
| password | string | New password for user. Ignore this field to leave it unchanged |
| website | string | Personal website of user |
| location | string | Location of user |
| active | bool | Active or deactive the user. Ignore this field to leave it unchanged |
| admin | bool | Promote or depromote the user to be site admin. Ignore this field to leave it unchanged |
| allow_git_hook | bool | Allow or disallow the user for using Git hooks. Ignore this field to leave it unchanged |
| allow_import_local | bool | Allow or disallow the user for importing local repositories. Ignore this field to leave it unchanged |
{
"source_id":1,
"login_name":"apiuser",
"full_name": "API User",
"email":"apiuser@user.com"
}Status: 200 OK
Content-Type: application/json
{
"id": 9,
"username": "apiuser",
"full_name": "API User",
"email": "apiuser@user.com",
"avatar_url": "//1.gravatar.com/avatar/b7193b9f212a6fe7a20db58d556fcc41"
}DELETE /admin/users/:username
Status: 204 No Content
POST /admin/users/:username/keys
| Name | Type | Description |
|---|---|---|
| title | string | Required The name of the key |
| key | string | Required The content of the key |