github.com/kim0/docker@v0.6.2-0.20161130212042-4addda3f07e7/docs/reference/api/docker_io_accounts_api.md (about) 1 --- 2 title: "docker.io accounts API" 3 description: "API Documentation for docker.io accounts." 4 keywords: ["API, Docker, accounts, REST, documentation"] 5 --- 6 7 <!-- This file is maintained within the docker/docker Github 8 repository at https://github.com/docker/docker/. Make all 9 pull requests against that repo. If you see this file in 10 another repository, consider it read-only there, as it will 11 periodically be overwritten by the definitive file. Pull 12 requests which include edits to this file in other repositories 13 will be rejected. 14 --> 15 16 # docker.io accounts API 17 18 ## Get a single user 19 20 `GET /api/v1.1/users/:username/` 21 22 Get profile info for the specified user. 23 24 Parameters: 25 26 - **username** – username of the user whose profile info is being 27 requested. 28 29 Request Headers: 30 31 - **Authorization** – required authentication credentials of 32 either type HTTP Basic or OAuth Bearer Token. 33 34 Status Codes: 35 36 - **200** – success, user data returned. 37 - **401** – authentication error. 38 - **403** – permission error, authenticated user must be the user 39 whose data is being requested, OAuth access tokens must have 40 `profile_read` scope. 41 - **404** – the specified username does not exist. 42 43 **Example request**: 44 45 GET /api/v1.1/users/janedoe/ HTTP/1.1 46 Host: www.docker.io 47 Accept: application/json 48 Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ= 49 50 **Example response**: 51 52 HTTP/1.1 200 OK 53 Content-Type: application/json 54 55 { 56 "id": 2, 57 "username": "janedoe", 58 "url": "https://www.docker.io/api/v1.1/users/janedoe/", 59 "date_joined": "2014-02-12T17:58:01.431312Z", 60 "type": "User", 61 "full_name": "Jane Doe", 62 "location": "San Francisco, CA", 63 "company": "Success, Inc.", 64 "profile_url": "https://docker.io/", 65 "gravatar_url": "https://secure.gravatar.com/avatar/0212b397124be4acd4e7dea9aa357.jpg?s=80&r=g&d=mm" 66 "email": "jane.doe@example.com", 67 "is_active": true 68 } 69 70 ## Update a single user 71 72 `PATCH /api/v1.1/users/:username/` 73 74 Update profile info for the specified user. 75 76 Parameters: 77 78 - **username** – username of the user whose profile info is being 79 updated. 80 81 Json Parameters: 82 83 - **full_name** (*string*) – (optional) the new name of the user. 84 - **location** (*string*) – (optional) the new location. 85 - **company** (*string*) – (optional) the new company of the user. 86 - **profile_url** (*string*) – (optional) the new profile url. 87 - **gravatar_email** (*string*) – (optional) the new Gravatar 88 email address. 89 90 Request Headers: 91 92 - **Authorization** – required authentication credentials of 93 either type HTTP Basic or OAuth Bearer Token. 94 - **Content-Type** – MIME Type of post data. JSON, url-encoded 95 form data, etc. 96 97 Status Codes: 98 99 - **200** – success, user data updated. 100 - **400** – post data validation error. 101 - **401** – authentication error. 102 - **403** – permission error, authenticated user must be the user 103 whose data is being updated, OAuth access tokens must have 104 `profile_write` scope. 105 - **404** – the specified username does not exist. 106 107 **Example request**: 108 109 PATCH /api/v1.1/users/janedoe/ HTTP/1.1 110 Host: www.docker.io 111 Accept: application/json 112 Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ= 113 114 { 115 "location": "Private Island", 116 "profile_url": "http://janedoe.com/", 117 "company": "Retired", 118 } 119 120 **Example response**: 121 122 HTTP/1.1 200 OK 123 Content-Type: application/json 124 125 { 126 "id": 2, 127 "username": "janedoe", 128 "url": "https://www.docker.io/api/v1.1/users/janedoe/", 129 "date_joined": "2014-02-12T17:58:01.431312Z", 130 "type": "User", 131 "full_name": "Jane Doe", 132 "location": "Private Island", 133 "company": "Retired", 134 "profile_url": "http://janedoe.com/", 135 "gravatar_url": "https://secure.gravatar.com/avatar/0212b397124be4acd4e7dea9aa357.jpg?s=80&r=g&d=mm" 136 "email": "jane.doe@example.com", 137 "is_active": true 138 } 139 140 ## List email addresses for a user 141 142 `GET /api/v1.1/users/:username/emails/` 143 144 List email info for the specified user. 145 146 Parameters: 147 148 - **username** – username of the user whose profile info is being 149 updated. 150 151 Request Headers: 152 153 - **Authorization** – required authentication credentials of 154 either type HTTP Basic or OAuth Bearer Token 155 156 Status Codes: 157 158 - **200** – success, user data updated. 159 - **401** – authentication error. 160 - **403** – permission error, authenticated user must be the user 161 whose data is being requested, OAuth access tokens must have 162 `email_read` scope. 163 - **404** – the specified username does not exist. 164 165 **Example request**: 166 167 GET /api/v1.1/users/janedoe/emails/ HTTP/1.1 168 Host: www.docker.io 169 Accept: application/json 170 Authorization: Bearer zAy0BxC1wDv2EuF3tGs4HrI6qJp6KoL7nM 171 172 **Example response**: 173 174 HTTP/1.1 200 OK 175 Content-Type: application/json 176 177 [ 178 { 179 "email": "jane.doe@example.com", 180 "verified": true, 181 "primary": true 182 } 183 ] 184 185 ## Add email address for a user 186 187 `POST /api/v1.1/users/:username/emails/` 188 189 Add a new email address to the specified user's account. The email 190 address must be verified separately, a confirmation email is not 191 automatically sent. 192 193 Json Parameters: 194 195 - **email** (*string*) – email address to be added. 196 197 Request Headers: 198 199 - **Authorization** – required authentication credentials of 200 either type HTTP Basic or OAuth Bearer Token. 201 - **Content-Type** – MIME Type of post data. JSON, url-encoded 202 form data, etc. 203 204 Status Codes: 205 206 - **201** – success, new email added. 207 - **400** – data validation error. 208 - **401** – authentication error. 209 - **403** – permission error, authenticated user must be the user 210 whose data is being requested, OAuth access tokens must have 211 `email_write` scope. 212 - **404** – the specified username does not exist. 213 214 **Example request**: 215 216 POST /api/v1.1/users/janedoe/emails/ HTTP/1.1 217 Host: www.docker.io 218 Accept: application/json 219 Content-Type: application/json 220 Authorization: Bearer zAy0BxC1wDv2EuF3tGs4HrI6qJp6KoL7nM 221 222 { 223 "email": "jane.doe+other@example.com" 224 } 225 226 **Example response**: 227 228 HTTP/1.1 201 Created 229 Content-Type: application/json 230 231 { 232 "email": "jane.doe+other@example.com", 233 "verified": false, 234 "primary": false 235 } 236 237 ## Delete email address for a user 238 239 `DELETE /api/v1.1/users/:username/emails/` 240 241 Delete an email address from the specified user's account. You 242 cannot delete a user's primary email address. 243 244 Json Parameters: 245 246 - **email** (*string*) – email address to be deleted. 247 248 Request Headers: 249 250 - **Authorization** – required authentication credentials of 251 either type HTTP Basic or OAuth Bearer Token. 252 - **Content-Type** – MIME Type of post data. JSON, url-encoded 253 form data, etc. 254 255 Status Codes: 256 257 - **204** – success, email address removed. 258 - **400** – validation error. 259 - **401** – authentication error. 260 - **403** – permission error, authenticated user must be the user 261 whose data is being requested, OAuth access tokens must have 262 `email_write` scope. 263 - **404** – the specified username or email address does not 264 exist. 265 266 **Example request**: 267 268 DELETE /api/v1.1/users/janedoe/emails/ HTTP/1.1 269 Host: www.docker.io 270 Accept: application/json 271 Content-Type: application/json 272 Authorization: Bearer zAy0BxC1wDv2EuF3tGs4HrI6qJp6KoL7nM 273 274 { 275 "email": "jane.doe+other@example.com" 276 } 277 278 **Example response**: 279 280 HTTP/1.1 204 NO CONTENT 281 Content-Length: 0