github.com/sijibomii/docker@v0.0.0-20231230191044-5cf6ca554647/docs/reference/api/docker_io_accounts_api.md (about)

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