2016-10-14 18:30:36 -04:00
|
|
|
|
---
|
|
|
|
|
title: "docker.io accounts API"
|
|
|
|
|
description: "API Documentation for docker.io accounts."
|
2016-11-03 18:48:30 -04:00
|
|
|
|
keywords: "API, Docker, accounts, REST, documentation"
|
2016-10-14 18:30:36 -04:00
|
|
|
|
---
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2016-10-19 13:25:45 -04:00
|
|
|
|
<!-- This file is maintained within the docker/docker Github
|
|
|
|
|
repository at https://github.com/docker/docker/. Make all
|
|
|
|
|
pull requests against that repo. If you see this file in
|
|
|
|
|
another repository, consider it read-only there, as it will
|
|
|
|
|
periodically be overwritten by the definitive file. Pull
|
|
|
|
|
requests which include edits to this file in other repositories
|
|
|
|
|
will be rejected.
|
|
|
|
|
-->
|
|
|
|
|
|
2015-04-21 11:50:09 -04:00
|
|
|
|
# docker.io accounts API
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
## Get a single user
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
`GET /api/v1.1/users/:username/`
|
|
|
|
|
|
|
|
|
|
Get profile info for the specified user.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **username** – username of the user whose profile info is being
|
2014-04-15 20:53:12 -04:00
|
|
|
|
requested.
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Request Headers:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **Authorization** – required authentication credentials of
|
2014-04-15 20:53:12 -04:00
|
|
|
|
either type HTTP Basic or OAuth Bearer Token.
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **200** – success, user data returned.
|
|
|
|
|
- **401** – authentication error.
|
|
|
|
|
- **403** – permission error, authenticated user must be the user
|
2014-04-15 20:53:12 -04:00
|
|
|
|
whose data is being requested, OAuth access tokens must have
|
|
|
|
|
`profile_read` scope.
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **404** – the specified username does not exist.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
GET /api/v1.1/users/janedoe/ HTTP/1.1
|
|
|
|
|
Host: www.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 200 OK
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
"id": 2,
|
|
|
|
|
"username": "janedoe",
|
|
|
|
|
"url": "https://www.docker.io/api/v1.1/users/janedoe/",
|
|
|
|
|
"date_joined": "2014-02-12T17:58:01.431312Z",
|
|
|
|
|
"type": "User",
|
|
|
|
|
"full_name": "Jane Doe",
|
|
|
|
|
"location": "San Francisco, CA",
|
|
|
|
|
"company": "Success, Inc.",
|
|
|
|
|
"profile_url": "https://docker.io/",
|
|
|
|
|
"gravatar_url": "https://secure.gravatar.com/avatar/0212b397124be4acd4e7dea9aa357.jpg?s=80&r=g&d=mm"
|
|
|
|
|
"email": "jane.doe@example.com",
|
|
|
|
|
"is_active": true
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
## Update a single user
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
`PATCH /api/v1.1/users/:username/`
|
|
|
|
|
|
|
|
|
|
Update profile info for the specified user.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **username** – username of the user whose profile info is being
|
2014-04-15 20:53:12 -04:00
|
|
|
|
updated.
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Json Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **full_name** (*string*) – (optional) the new name of the user.
|
|
|
|
|
- **location** (*string*) – (optional) the new location.
|
|
|
|
|
- **company** (*string*) – (optional) the new company of the user.
|
|
|
|
|
- **profile_url** (*string*) – (optional) the new profile url.
|
|
|
|
|
- **gravatar_email** (*string*) – (optional) the new Gravatar
|
2014-04-15 20:53:12 -04:00
|
|
|
|
email address.
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Request Headers:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **Authorization** – required authentication credentials of
|
2014-04-15 20:53:12 -04:00
|
|
|
|
either type HTTP Basic or OAuth Bearer Token.
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **Content-Type** – MIME Type of post data. JSON, url-encoded
|
2014-04-15 20:53:12 -04:00
|
|
|
|
form data, etc.
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **200** – success, user data updated.
|
|
|
|
|
- **400** – post data validation error.
|
|
|
|
|
- **401** – authentication error.
|
|
|
|
|
- **403** – permission error, authenticated user must be the user
|
2014-04-15 20:53:12 -04:00
|
|
|
|
whose data is being updated, OAuth access tokens must have
|
|
|
|
|
`profile_write` scope.
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **404** – the specified username does not exist.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
PATCH /api/v1.1/users/janedoe/ HTTP/1.1
|
|
|
|
|
Host: www.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
"location": "Private Island",
|
|
|
|
|
"profile_url": "http://janedoe.com/",
|
|
|
|
|
"company": "Retired",
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 200 OK
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
"id": 2,
|
|
|
|
|
"username": "janedoe",
|
|
|
|
|
"url": "https://www.docker.io/api/v1.1/users/janedoe/",
|
|
|
|
|
"date_joined": "2014-02-12T17:58:01.431312Z",
|
|
|
|
|
"type": "User",
|
|
|
|
|
"full_name": "Jane Doe",
|
|
|
|
|
"location": "Private Island",
|
|
|
|
|
"company": "Retired",
|
|
|
|
|
"profile_url": "http://janedoe.com/",
|
|
|
|
|
"gravatar_url": "https://secure.gravatar.com/avatar/0212b397124be4acd4e7dea9aa357.jpg?s=80&r=g&d=mm"
|
|
|
|
|
"email": "jane.doe@example.com",
|
|
|
|
|
"is_active": true
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
## List email addresses for a user
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
`GET /api/v1.1/users/:username/emails/`
|
|
|
|
|
|
|
|
|
|
List email info for the specified user.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **username** – username of the user whose profile info is being
|
2014-04-15 20:53:12 -04:00
|
|
|
|
updated.
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Request Headers:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **Authorization** – required authentication credentials of
|
2014-04-15 20:53:12 -04:00
|
|
|
|
either type HTTP Basic or OAuth Bearer Token
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **200** – success, user data updated.
|
|
|
|
|
- **401** – authentication error.
|
|
|
|
|
- **403** – permission error, authenticated user must be the user
|
2014-04-15 20:53:12 -04:00
|
|
|
|
whose data is being requested, OAuth access tokens must have
|
|
|
|
|
`email_read` scope.
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **404** – the specified username does not exist.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
GET /api/v1.1/users/janedoe/emails/ HTTP/1.1
|
|
|
|
|
Host: www.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Authorization: Bearer zAy0BxC1wDv2EuF3tGs4HrI6qJp6KoL7nM
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 200 OK
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
{
|
|
|
|
|
"email": "jane.doe@example.com",
|
|
|
|
|
"verified": true,
|
|
|
|
|
"primary": true
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
## Add email address for a user
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
`POST /api/v1.1/users/:username/emails/`
|
|
|
|
|
|
|
|
|
|
Add a new email address to the specified user's account. The email
|
|
|
|
|
address must be verified separately, a confirmation email is not
|
|
|
|
|
automatically sent.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Json Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **email** (*string*) – email address to be added.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Request Headers:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **Authorization** – required authentication credentials of
|
2014-04-15 20:53:12 -04:00
|
|
|
|
either type HTTP Basic or OAuth Bearer Token.
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **Content-Type** – MIME Type of post data. JSON, url-encoded
|
2014-04-15 20:53:12 -04:00
|
|
|
|
form data, etc.
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **201** – success, new email added.
|
|
|
|
|
- **400** – data validation error.
|
|
|
|
|
- **401** – authentication error.
|
|
|
|
|
- **403** – permission error, authenticated user must be the user
|
2014-04-15 20:53:12 -04:00
|
|
|
|
whose data is being requested, OAuth access tokens must have
|
|
|
|
|
`email_write` scope.
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **404** – the specified username does not exist.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
POST /api/v1.1/users/janedoe/emails/ HTTP/1.1
|
|
|
|
|
Host: www.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
Authorization: Bearer zAy0BxC1wDv2EuF3tGs4HrI6qJp6KoL7nM
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
"email": "jane.doe+other@example.com"
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 201 Created
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
"email": "jane.doe+other@example.com",
|
|
|
|
|
"verified": false,
|
|
|
|
|
"primary": false
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
## Delete email address for a user
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
`DELETE /api/v1.1/users/:username/emails/`
|
|
|
|
|
|
|
|
|
|
Delete an email address from the specified user's account. You
|
|
|
|
|
cannot delete a user's primary email address.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Json Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **email** (*string*) – email address to be deleted.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Request Headers:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **Authorization** – required authentication credentials of
|
2014-04-15 20:53:12 -04:00
|
|
|
|
either type HTTP Basic or OAuth Bearer Token.
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **Content-Type** – MIME Type of post data. JSON, url-encoded
|
2014-04-15 20:53:12 -04:00
|
|
|
|
form data, etc.
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **204** – success, email address removed.
|
|
|
|
|
- **400** – validation error.
|
|
|
|
|
- **401** – authentication error.
|
|
|
|
|
- **403** – permission error, authenticated user must be the user
|
2014-04-15 20:53:12 -04:00
|
|
|
|
whose data is being requested, OAuth access tokens must have
|
|
|
|
|
`email_write` scope.
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **404** – the specified username or email address does not
|
2014-04-15 20:53:12 -04:00
|
|
|
|
exist.
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
DELETE /api/v1.1/users/janedoe/emails/ HTTP/1.1
|
|
|
|
|
Host: www.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
Authorization: Bearer zAy0BxC1wDv2EuF3tGs4HrI6qJp6KoL7nM
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
"email": "jane.doe+other@example.com"
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 204 NO CONTENT
|
|
|
|
|
Content-Length: 0
|