github.com/cozy/cozy-stack@v0.0.0-20240327093429-939e4a21320e/docs/contacts.md (about)

     1  [Table of contents](README.md#table-of-contents)
     2  
     3  # Contacts
     4  
     5  ## Routes
     6  
     7  ### POST /contacts/myself
     8  
     9  This endpoint returns the information about the io.cozy.contacts document for
    10  the owner of this instance, the "myself" contact. If the document does not
    11  exist, it is recreated with some basic fields.
    12  
    13  A permission on the `io.cozy.contacts` document is required.
    14  
    15  #### Request
    16  
    17  ```http
    18  POST /contacts/myself HTTP/1.1
    19  ```
    20  
    21  #### Response
    22  
    23  ```http
    24  HTTP/1.1 200 OK
    25  Content-Type: application/vnd.api+json
    26  ```
    27  
    28  ```json
    29  {
    30    "data": {
    31      "type": "io.cozy.contacts",
    32      "id": "bf91cce0-ef48-0137-2638-543d7eb8149c",
    33      "attributes": {
    34        "fullname": "Alice",
    35        "email": [
    36          { "address": "alice@example.com", "primary": true }
    37        ]
    38      },
    39      "meta": {
    40        "rev": "1-6516671ec"
    41      }
    42    }
    43  }
    44  ```