openapi: 3.1.0
info:
  contact:
    email: contact@passbolt.com
  summary: Public documentation for Passbolt's API
  description: >
    ---


    ### Welcome


    This document is a raw low-level overview describing the API and its
    endpoints. For a higher-level overview of the API and some guides on
    interacting with the different endpoints, please follow the [Developer
    guide](../development).


    ### Base URL


    The API is served over HTTPS. All occurrences of `{{API_BASE_URL}}`
    referenced in the following documentation should be replaced by the base url
    of your passbolt installation domain, such as:
    `https://<passbolt.your-organization.com>`.
  license:
    name: AGPL-3.0
    url: https://www.gnu.org/licenses/agpl-3.0.html
  termsOfService: https://www.passbolt.com/terms
  title: Passbolt API Documentation
  version: 4.9.0
servers:
  - url: https://passbolt.local
    description: API Passbolt
paths:
  /auth/is-authenticated.json:
    get:
      summary: Check authentication status.
      description: Can be used as a session keep-alive.
      operationId: viewAuthIsAuthenticated
      security:
        - gpgCookieAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/auth/is-authenticated.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url = '{{API_BASE_URL}}/auth/is-authenticated.json';

            const options = {method: 'GET', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/auth/is-authenticated.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Authentication (GPGAuth)
      responses:
        '200':
          $ref: '#/components/responses/nullBody'
        '401':
          $ref: '#/components/responses/authenticationRequired'
  /auth/jwt/jwks.json:
    get:
      summary: Get the JWKs server information.
      operationId: viewAuthJwtJwks
      security: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/auth/jwt/jwks.json
        - lang: JavaScript
          source: |
            const url = '{{API_BASE_URL}}/auth/jwt/jwks.json';
            const options = {method: 'GET'};

            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/auth/jwt/jwks.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Authentication (JWT)
      responses:
        '200':
          $ref: '#/components/responses/jwks'
        '404':
          $ref: '#/components/responses/notFound'
  /auth/jwt/login.json:
    post:
      summary: Login.
      operationId: authJwtLogin
      security: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request POST \
              --url {{API_BASE_URL}}/auth/jwt/login.json \
              --data '{
                "user_id": "8bb80df5-700c-48ce-b568-85a60fc3c8f2",
                "challenge": "-----BEGIN PGP MESSAGE-----"
              }'
        - lang: JavaScript
          source: |
            const url = '{{API_BASE_URL}}/auth/jwt/login.json';
            const options = {
              method: 'POST',
              body: '{"user_id":"8bb80df5-700c-48ce-b568-85a60fc3c8f2","challenge":"-----BEGIN PGP MESSAGE-----"}'
            };

            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/auth/jwt/login.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => json_encode([
                'user_id' => '8bb80df5-700c-48ce-b568-85a60fc3c8f2',
                'challenge' => '-----BEGIN PGP MESSAGE-----'
              ]),
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Authentication (JWT)
      requestBody:
        $ref: '#/components/requestBodies/login'
      responses:
        '200':
          $ref: '#/components/responses/login'
        '400':
          $ref: '#/components/responses/badRequest'
  /auth/jwt/logout.json:
    post:
      summary: Logout.
      operationId: authJwtLogout
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request POST \
              --url {{API_BASE_URL}}/auth/jwt/logout.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}' \
              --data '{
                "refresh_token": "ad71952e-7842-599e-a19e-3a82e6974b23"
              }'
        - lang: JavaScript
          source: |
            const url = '{{API_BASE_URL}}/auth/jwt/logout.json';
            const options = {
              method: 'POST',
              headers: {Authorization: 'Bearer {{JWT_TOKEN}}'},
              body: '{"refresh_token":"ad71952e-7842-599e-a19e-3a82e6974b23"}'
            };

            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/auth/jwt/logout.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => json_encode([
                'refresh_token' => 'ad71952e-7842-599e-a19e-3a82e6974b23'
              ]),
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Authentication (JWT)
      requestBody:
        $ref: '#/components/requestBodies/logout'
      responses:
        '200':
          $ref: '#/components/responses/nullBody'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
  /auth/jwt/refresh.json:
    post:
      summary: Refresh access token.
      operationId: authJwtRefresh
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request POST \
              --url {{API_BASE_URL}}/auth/jwt/refresh.json \
              --data '{
                "user_id": "8bb80df5-700c-48ce-b568-85a60fc3c8f2",
                "refresh_token": "f8cea352-6bd3-4944-9523-20b31272bef0"
              }'
        - lang: JavaScript
          source: |
            const url = '{{API_BASE_URL}}/auth/jwt/refresh.json';
            const options = {
              method: 'POST',
              body: '{"user_id":"8bb80df5-700c-48ce-b568-85a60fc3c8f2","refresh_token":"f8cea352-6bd3-4944-9523-20b31272bef0"}'
            };

            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/auth/jwt/refresh.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => json_encode([
                'user_id' => '8bb80df5-700c-48ce-b568-85a60fc3c8f2',
                'refresh_token' => 'f8cea352-6bd3-4944-9523-20b31272bef0'
              ]),
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Authentication (JWT)
      requestBody:
        $ref: '#/components/requestBodies/refresh'
      responses:
        '200':
          $ref: '#/components/responses/refresh'
        '400':
          $ref: '#/components/responses/badRequest'
  /auth/jwt/rsa.json:
    get:
      summary: Get the JWT RSA server information.
      operationId: viewAuthJwtRsa
      description: |
        This is not the key to use when encrypting the JWT login challenge.
      security: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/auth/jwt/rsa.json
        - lang: JavaScript
          source: |
            const url = '{{API_BASE_URL}}/auth/jwt/rsa.json';
            const options = {method: 'GET'};

            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/auth/jwt/rsa.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Authentication (JWT)
      responses:
        '200':
          $ref: '#/components/responses/rsa'
        '404':
          $ref: '#/components/responses/notFound'
  /auth/login.json:
    post:
      summary: Log in.
      operationId: authLogin
      security: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request POST \
              --url {{API_BASE_URL}}/auth/login.json \
              --data '{
              "data": {
                "gpg_auth": {
                  "keyid": "5FB36DE5C8E69DD4DB185DF2BC9F2749E432CB59",
                  "user_token_result": "gpgauthv1.3.0|36|10e2074b-f610-42be-8525-100d4e68c481|gpgauthv1.3.0"
                }
              }
            }'
        - lang: JavaScript
          source: |
            const url = '{{API_BASE_URL}}/auth/login.json';
            const options = {
              method: 'POST',
              body: '{"data":{"gpg_auth":{"keyid":"5FB36DE5C8E69DD4DB185DF2BC9F2749E432CB59","user_token_result":"gpgauthv1.3.0|36|10e2074b-f610-42be-8525-100d4e68c481|gpgauthv1.3.0"}}}'
            };

            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/auth/login.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => json_encode([
                'data' => [
                  'gpg_auth' => [
                    'keyid' => '5FB36DE5C8E69DD4DB185DF2BC9F2749E432CB59',
                    'user_token_result' => 'gpgauthv1.3.0|36|10e2074b-f610-42be-8525-100d4e68c481|gpgauthv1.3.0'
                  ]
                ]
              ]),
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Authentication (GPGAuth)
      requestBody:
        $ref: '#/components/requestBodies/authGpg_login'
      responses:
        '200':
          $ref: '#/components/responses/authGpg_login'
        '400':
          $ref: '#/components/responses/badRequest'
  /auth/logout.json:
    post:
      summary: Log out.
      operationId: authLogout
      security:
        - gpgCookieAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/auth/logout.json
        - lang: JavaScript
          source: |
            const url = '{{API_BASE_URL}}/auth/logout.json';
            const options = {method: 'POST'};

            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/auth/logout.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Authentication (GPGAuth)
      responses:
        '200':
          $ref: '#/components/responses/nullBody'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '403':
          $ref: '#/components/responses/missingCsrfToken'
  /auth/verify.json:
    get:
      summary: Get the server's public PGP key.
      description: Can be used to validate data signature.
      operationId: viewAuthVerify
      security: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/auth/verify.json
        - lang: JavaScript
          source: |
            const url = '{{API_BASE_URL}}/auth/verify.json';
            const options = {method: 'GET'};

            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/auth/verify.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Authentication (GPGAuth)
      responses:
        '200':
          $ref: '#/components/responses/verify'
    post:
      summary: Verify the server's identity.
      operationId: checkAuthVerify
      security: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request POST \
              --url {{API_BASE_URL}}/auth/verify.json \
              --data '{
              "data": {
                "gpg_auth": {
                  "keyid": "5FB36DE5C8E69DD4DB185DF2BC9F2749E432CB59",
                  "server_verify_token": "-----BEGIN PGP MESSAGE-----"
                }
              }
            }'
        - lang: JavaScript
          source: |
            const url = '{{API_BASE_URL}}/auth/verify.json';
            const options = {
              method: 'POST',
              body: '{"data":{"gpg_auth":{"keyid":"5FB36DE5C8E69DD4DB185DF2BC9F2749E432CB59","server_verify_token":"-----BEGIN PGP MESSAGE-----"}}}'
            };

            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/auth/verify.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => json_encode([
                'data' => [
                  'gpg_auth' => [
                    'keyid' => '5FB36DE5C8E69DD4DB185DF2BC9F2749E432CB59',
                    'server_verify_token' => '-----BEGIN PGP MESSAGE-----'
                  ]
                ]
              ]),
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Authentication (GPGAuth)
      requestBody:
        $ref: '#/components/requestBodies/verify'
      responses:
        '200':
          $ref: '#/components/responses/stage0'
        '400':
          $ref: '#/components/responses/badRequest'
  /avatars/view/{avatarId}/{avatarFormat}:
    get:
      summary: Get an avatar as an image.
      description: When the avatar doesn't exist, a placeholder image is returned instead.
      operationId: viewAvatar
      security: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/avatars/view/8ef95b32-e2a3-4b58-827c-dd67e68cfb49/medium.jpg
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/avatars/view/8ef95b32-e2a3-4b58-827c-dd67e68cfb48/medium.jpg';

            const options = {method: 'GET'};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/avatars/view/8ef95b32-e2a3-4b58-827c-dd67e68cfb48/medium.jpg",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Avatars
      parameters:
        - $ref: '#/components/parameters/avatarId'
        - $ref: '#/components/parameters/avatarFormat'
      responses:
        '200':
          $ref: '#/components/responses/view'
  /comments/{commentId}.json:
    put:
      summary: Update a comment.
      operationId: updateComment
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request PUT \
              --url {{API_BASE_URL}}/comments/41aca4aa-430c-4b60-a1f1-c0de1b52a1ce.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}' \
              --data '{
                "content": "no comment"
              }'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/comments/41aca4aa-430c-4b60-a1f1-c0de1b52a1ce.json';

            const options = {
              method: 'PUT',
              headers: {Authorization: 'Bearer {{JWT_TOKEN}}'},
              body: '{"content":"no comment"}'
            };


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/comments/41aca4aa-430c-4b60-a1f1-c0de1b52a1ce.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => json_encode([
                'content' => 'no comment'
              ]),
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Comments
      parameters:
        - $ref: '#/components/parameters/commentId'
      requestBody:
        $ref: '#/components/requestBodies/commentUpdate'
      responses:
        '200':
          $ref: '#/components/responses/update'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
    delete:
      summary: Delete a comment.
      operationId: deleteComment
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request DELETE \
              --url {{API_BASE_URL}}/comments/9149d7d7-e191-41d5-a263-cfccbd775f0b.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/comments/9149d7d7-e191-41d5-a263-cfccbd775f0b.json';

            const options = {method: 'DELETE', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/comments/9149d7d7-e191-41d5-a263-cfccbd775f0b.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Comments
      parameters:
        - $ref: '#/components/parameters/commentId'
      responses:
        '200':
          $ref: '#/components/responses/nullBody'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
  /comments/resource/{resourceId}.json:
    get:
      summary: Get comments for a resource.
      operationId: indexComments
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/comments/resource/42968631-0c51-4405-9f2d-c6700c5057be.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/comments/resource/42968631-0c51-4405-9f2d-c6700c5057be.json';

            const options = {method: 'GET', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/comments/resource/42968631-0c51-4405-9f2d-c6700c5057be.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Comments
      parameters:
        - $ref: '#/components/parameters/resourceId'
        - $ref: '#/components/parameters/containCreator'
        - $ref: '#/components/parameters/containModifier'
      responses:
        '200':
          $ref: '#/components/responses/index'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
    post:
      summary: Add a comment.
      operationId: addComment
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request POST \
              --url {{API_BASE_URL}}/comments/resource/42968631-0c51-4405-9f2d-c6700c5057be.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}' \
              --data '{
                "content": "no comment"
              }'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/comments/resource/42968631-0c51-4405-9f2d-c6700c5057be.json';

            const options = {
              method: 'POST',
              headers: {Authorization: 'Bearer {{JWT_TOKEN}}'},
              body: '{"content":"no comment"}'
            };


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/comments/resource/42968631-0c51-4405-9f2d-c6700c5057be.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => json_encode([
                'content' => 'no comment'
              ]),
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Comments
      parameters:
        - $ref: '#/components/parameters/resourceId'
      requestBody:
        $ref: '#/components/requestBodies/commentAdd'
      responses:
        '200':
          $ref: '#/components/responses/add'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
  /favorite/{favoriteId}.json:
    delete:
      summary: Unset a resource as favorite.
      operationId: deleteFavorite
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request DELETE \
              --url {{API_BASE_URL}}/favorites/9edeffa4-a4fb-4e6a-b5f8-1ffc3f408335.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/favorites/9edeffa4-a4fb-4e6a-b5f8-1ffc3f408335.json';

            const options = {method: 'DELETE', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/favorites/9edeffa4-a4fb-4e6a-b5f8-1ffc3f408335.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Favorites
      parameters:
        - $ref: '#/components/parameters/favoriteId'
      responses:
        '200':
          $ref: '#/components/responses/nullBody'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
  /favorite/{foreignModel}/{foreignId}.json:
    post:
      summary: Set a resource as favorite.
      operationId: addFavorite
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request POST \
              --url {{API_BASE_URL}}/favorites/resource/42968631-0c51-4405-9f2d-c6700c5057be.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/favorites/resource/42968631-0c51-4405-9f2d-c6700c5057be.json';

            const options = {method: 'POST', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/favorites/resource/42968631-0c51-4405-9f2d-c6700c5057be.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Favorites
      parameters:
        - $ref: '#/components/parameters/favoritesForeignModel'
        - $ref: '#/components/parameters/foreignId'
      responses:
        '200':
          $ref: '#/components/responses/favorites_add'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
  /folders.json:
    get:
      summary: Get multiple folders.
      operationId: indexFolders
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/folders.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url = '{{API_BASE_URL}}/folders.json';

            const options = {method: 'GET', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/folders.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Folders
      parameters:
        - $ref: '#/components/parameters/containChildrenResources'
        - $ref: '#/components/parameters/containChildrenFolders'
        - $ref: '#/components/parameters/containCreator'
        - $ref: '#/components/parameters/containCreatorProfile'
        - $ref: '#/components/parameters/containModifier'
        - $ref: '#/components/parameters/containModifierProfile'
        - $ref: '#/components/parameters/containPermission'
        - $ref: '#/components/parameters/containPermissions'
        - $ref: '#/components/parameters/containPermissionsUserProfile'
        - $ref: '#/components/parameters/containPermissionsGroup'
        - $ref: '#/components/parameters/filterHasId'
        - $ref: '#/components/parameters/filterHasParent'
        - $ref: '#/components/parameters/filterSearch'
      responses:
        '200':
          $ref: '#/components/responses/folders_index'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
    post:
      summary: Create a folder.
      operationId: addFolder
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request POST \
              --url {{API_BASE_URL}}/folders.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}' \
              --data '{
                "name": "bob",
                "folder_parent_id": "2d8142fc-5be2-463f-a6ba-e28d7d96e211"
              }'
        - lang: JavaScript
          source: |
            const url = '{{API_BASE_URL}}/folders.json';
            const options = {
              method: 'POST',
              headers: {Authorization: 'Bearer {{JWT_TOKEN}}'},
              body: '{"name":"bob","folder_parent_id":"2d8142fc-5be2-463f-a6ba-e28d7d96e211"}'
            };

            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/folders.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => json_encode([
                'name' => 'bob',
                'folder_parent_id' => '2d8142fc-5be2-463f-a6ba-e28d7d96e211'
              ]),
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Folders
      requestBody:
        $ref: '#/components/requestBodies/folderAdd'
      parameters:
        - $ref: '#/components/parameters/containChildrenResources'
        - $ref: '#/components/parameters/containChildrenFolders'
        - $ref: '#/components/parameters/containCreator'
        - $ref: '#/components/parameters/containModifier'
        - $ref: '#/components/parameters/containPermission'
        - $ref: '#/components/parameters/containPermissions'
        - $ref: '#/components/parameters/containPermissionsUserProfile'
        - $ref: '#/components/parameters/containPermissionsGroup'
      responses:
        '200':
          $ref: '#/components/responses/folders_add'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
  /folders/{folderId}.json:
    get:
      summary: Get a folder.
      operationId: viewFolder
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/folders/b2a72cb2-508c-43ad-b96f-697f7ad21635.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/folders/b2a72cb2-508c-43ad-b96f-697f7ad21635.json';

            const options = {method: 'GET', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/folders/b2a72cb2-508c-43ad-b96f-697f7ad21635.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Folders
      parameters:
        - $ref: '#/components/parameters/folderId'
        - $ref: '#/components/parameters/containChildrenResources'
        - $ref: '#/components/parameters/containChildrenFolders'
        - $ref: '#/components/parameters/containCreator'
        - $ref: '#/components/parameters/containCreatorProfile'
        - $ref: '#/components/parameters/containModifier'
        - $ref: '#/components/parameters/containModifierProfile'
        - $ref: '#/components/parameters/containPermission'
        - $ref: '#/components/parameters/containPermissions'
        - $ref: '#/components/parameters/containPermissionsUserProfile'
        - $ref: '#/components/parameters/containPermissionsGroup'
        - $ref: '#/components/parameters/filterHasId'
      responses:
        '200':
          $ref: '#/components/responses/folders_view'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
    put:
      summary: Update a folder.
      description: >-
        The current user must have the “update” or “owner” permission on the
        folder.
      operationId: updateFolder
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request PUT \
              --url {{API_BASE_URL}}/folders/2d8142fc-5be2-463f-a6ba-e28d7d96e211.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}' \
              --data '{
                "name": "dylan2"
              }'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/folders/2d8142fc-5be2-463f-a6ba-e28d7d96e211.json';

            const options = {
              method: 'PUT',
              headers: {Authorization: 'Bearer {{JWT_TOKEN}}'},
              body: '{"name":"dylan2"}'
            };


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/folders/2d8142fc-5be2-463f-a6ba-e28d7d96e211.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => json_encode([
                'name' => 'dylan2'
              ]),
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      security:
        - bearerHttpAuthentication: []
      parameters:
        - $ref: '#/components/parameters/folderId'
        - $ref: '#/components/parameters/containChildrenResources'
        - $ref: '#/components/parameters/containChildrenFolders'
        - $ref: '#/components/parameters/containCreator'
        - $ref: '#/components/parameters/containModifier'
        - $ref: '#/components/parameters/containPermission'
        - $ref: '#/components/parameters/containPermissions'
        - $ref: '#/components/parameters/containPermissionsUserProfile'
        - $ref: '#/components/parameters/containPermissionsGroup'
      tags:
        - Folders
      requestBody:
        $ref: '#/components/requestBodies/folderUpdate'
      responses:
        '200':
          $ref: '#/components/responses/folders_update'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
    delete:
      summary: Delete a folder.
      operationId: deleteFolder
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request DELETE \
              --url {{API_BASE_URL}}/folders/b2a72cb2-508c-43ad-b96f-697f7ad21635.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/folders/b2a72cb2-508c-43ad-b96f-697f7ad21635.json';

            const options = {method: 'DELETE', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/folders/b2a72cb2-508c-43ad-b96f-697f7ad21635.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      security:
        - bearerHttpAuthentication: []
      parameters:
        - $ref: '#/components/parameters/folderId'
        - $ref: '#/components/parameters/cascade'
      tags:
        - Folders
      responses:
        '200':
          $ref: '#/components/responses/nullBody'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
  /gpgkeys.json:
    get:
      summary: Get multiple GPG keys.
      operationId: indexGpgkeys
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/gpgkeys.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url = '{{API_BASE_URL}}/gpgkeys.json';

            const options = {method: 'GET', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/gpgkeys.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - GPG keys
      parameters:
        - $ref: '#/components/parameters/filterModifiedAfter'
        - $ref: '#/components/parameters/filterIsDeleted'
      responses:
        '200':
          $ref: '#/components/responses/gpgkeys_index'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
  /gpgkeys/{gpgkeyId}.json:
    get:
      summary: Get a GPG key.
      operationId: viewGpgkey
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/gpgkeys/ed4d9ea6-f354-4a74-ad09-4e1dd69041ec.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/gpgkeys/ed4d9ea6-f354-4a74-ad09-4e1dd69041ec.json';

            const options = {method: 'GET', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/gpgkeys/ed4d9ea6-f354-4a74-ad09-4e1dd69041ec.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      parameters:
        - $ref: '#/components/parameters/gpgkeyId'
      tags:
        - GPG keys
      responses:
        '200':
          $ref: '#/components/responses/gpgkeys_view'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
  /groups.json:
    get:
      summary: Get multiple groups.
      operationId: indexGroups
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/groups.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url = '{{API_BASE_URL}}/groups.json';

            const options = {method: 'GET', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/groups.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Groups
      parameters:
        - $ref: '#/components/parameters/containModifier'
        - $ref: '#/components/parameters/containModifierProfile'
        - $ref: '#/components/parameters/containMyGroupUser'
        - $ref: '#/components/parameters/containGroupsUsers'
        - $ref: '#/components/parameters/containGroupsUsersUser'
        - $ref: '#/components/parameters/containGroupsUsersUserProfile'
        - $ref: '#/components/parameters/containGroupsUsersUserGpgkey'
        - $ref: '#/components/parameters/filterHasUsers'
        - $ref: '#/components/parameters/filterHasManagers'
      responses:
        '200':
          $ref: '#/components/responses/groups_index'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
    post:
      summary: Create a group.
      description: Please note that only users with Admin role can create a group.
      operationId: addGroup
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request POST \
              --url {{API_BASE_URL}}/groups.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}' \
              --data '{
              "name": "Groupe B",
              "groups_users": [
                {
                  "user_id": "8bb80df5-700c-48ce-b568-85a60fc3c8f2",
                  "is_admin": true
                }]
              }'
        - lang: JavaScript
          source: |
            const url = '{{API_BASE_URL}}/groups.json';
            const options = {
              method: 'POST',
              headers: {Authorization: 'Bearer {{JWT_TOKEN}}'},
              body: '{"name":"Groupe B","groups_users":[{"user_id":"8bb80df5-700c-48ce-b568-85a60fc3c8f2","is_admin":true}]}'
            };

            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/groups.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => json_encode([
                'name' => 'Groupe B',
                'groups_users' => [
                  [
                    'user_id' => '8bb80df5-700c-48ce-b568-85a60fc3c8f2',
                    'is_admin' => true
                  ]
                ]
              ]),
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Groups
      responses:
        '200':
          $ref: '#/components/responses/addAndUpdate'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
      requestBody:
        $ref: '#/components/requestBodies/groupAdd'
  /groups/{groupId}.json:
    get:
      summary: Get a group.
      operationId: viewGroup
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/groups/8a3c5c4e-e931-4e6b-854a-9b2e9afcd3bc.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/groups/8a3c5c4e-e931-4e6b-854a-9b2e9afcd3bc.json';

            const options = {method: 'GET', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/groups/8a3c5c4e-e931-4e6b-854a-9b2e9afcd3bc.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Groups
      parameters:
        - $ref: '#/components/parameters/groupId'
        - $ref: '#/components/parameters/containModifier'
        - $ref: '#/components/parameters/containModifierProfile'
        - $ref: '#/components/parameters/containUsers'
        - $ref: '#/components/parameters/containMyGroupUser'
        - $ref: '#/components/parameters/containGroupsUsers'
        - $ref: '#/components/parameters/containGroupsUsersUser'
        - $ref: '#/components/parameters/containGroupsUsersUserProfile'
        - $ref: '#/components/parameters/containGroupsUsersUserGpgkey'
      responses:
        '200':
          $ref: '#/components/responses/groups_view'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
    put:
      summary: Update a group.
      operationId: updateGroup
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: >
            curl --request PUT \

            --url
            {{API_BASE_URL}}/groups/8fa37ef6-f167-4342-8e1c-3488439cf7d1.json \

            --header 'Authorization: Bearer {{JWT_TOKEN}}' \

            --data '{
              "name": "WRC",
              "groups_users": [
                {
                  "user_id": "8bb80df5-700c-48ce-b568-85a60fc3c8f2",
                  "is_admin": true
                }
              ]
            }'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/groups/8fa37ef6-f167-4342-8e1c-3488439cf7d1.json';

            const options = {
              method: 'PUT',
              headers: {Authorization: 'Bearer {{JWT_TOKEN}}'},
              body: '{"name":"WRC","groups_users":[{"user_id":"8bb80df5-700c-48ce-b568-85a60fc3c8f2","is_admin":true}]}'
            };


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/groups/8fa37ef6-f167-4342-8e1c-3488439cf7d1.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => json_encode([
                'name' => 'WRC',
                'groups_users' => [
                  [
                    'user_id' => '8bb80df5-700c-48ce-b568-85a60fc3c8f2',
                    'is_admin' => true
                  ]
                ]
              ]),
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Groups
      parameters:
        - $ref: '#/components/parameters/groupId'
      responses:
        '200':
          $ref: '#/components/responses/addAndUpdate'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
      requestBody:
        $ref: '#/components/requestBodies/groupUpdate'
    delete:
      summary: Delete a group.
      description: >
        Only a group manager or a user with administrator role can delete a
        group. A group cannot be deleted as long as it is the sole owner of a
        shared resource or folder.
      operationId: deleteGroup
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request DELETE \
              --url {{API_BASE_URL}}/groups/164d51b8-d6ce-4d59-b8a0-43869919407e.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/groups/164d51b8-d6ce-4d59-b8a0-43869919407e.json';

            const options = {method: 'DELETE', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/groups/164d51b8-d6ce-4d59-b8a0-43869919407e.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Groups
      parameters:
        - $ref: '#/components/parameters/groupId'
      responses:
        '200':
          $ref: '#/components/responses/nullBody'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
  /groups/{groupId}/dry-run.json:
    put:
      summary: Dry run a group update.
      operationId: dryRunUpdateGroup
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: >
            curl --request PUT \

            --url
            {{API_BASE_URL}}/groups/8fa37ef6-f167-4342-8e1c-3488439cf7d1/dry-run.json
            \

            --header 'Authorization: Bearer {{JWT_TOKEN}}' \

            --data '{
              "name": "WRC",
              "groups_users": [
                {
                  "user_id": "8bb80df5-700c-48ce-b568-85a60fc3c8f2",
                  "is_admin": true
                }
              ]
            }'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/groups/8fa37ef6-f167-4342-8e1c-3488439cf7d1/dry-run.json';

            const options = {
              method: 'PUT',
              headers: {Authorization: 'Bearer {{JWT_TOKEN}}'},
              body: '{"name":"WRC","groups_users":[{"user_id":"8bb80df5-700c-48ce-b568-85a60fc3c8f2","is_admin":true}]}'
            };


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/groups/8fa37ef6-f167-4342-8e1c-3488439cf7d1/dry-run.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => json_encode([
                'name' => 'WRC',
                'groups_users' => [
                  [
                    'user_id' => '8bb80df5-700c-48ce-b568-85a60fc3c8f2',
                    'is_admin' => true
                  ]
                ]
              ]),
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Groups
      parameters:
        - $ref: '#/components/parameters/groupId'
      responses:
        '200':
          $ref: '#/components/responses/updateDryRunSuccess'
        '400':
          $ref: '#/components/responses/updateDryRunError'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
      requestBody:
        $ref: '#/components/requestBodies/groupUpdate'
    delete:
      summary: Dry run a group deletion.
      operationId: dryRunDeleteGroup
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request DELETE \
              --url {{API_BASE_URL}}/groups/164d51b8-d6ce-4d59-b8a0-43869919407e/dry-run.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/groups/164d51b8-d6ce-4d59-b8a0-43869919407e/dry-run.json';

            const options = {method: 'DELETE', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/groups/164d51b8-d6ce-4d59-b8a0-43869919407e/dry-run.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Groups
      parameters:
        - $ref: '#/components/parameters/groupId'
      responses:
        '200':
          $ref: '#/components/responses/emptyArrayBody'
        '400':
          $ref: '#/components/responses/deleteDryRun'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
  /healthcheck.json:
    get:
      summary: Get healthcheck information.
      description: Only administrators can query this endpoint.
      security:
        - bearerHttpAuthentication: []
      operationId: viewHealthcheck
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/healthcheck.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url = '{{API_BASE_URL}}/healthcheck.json';

            const options = {method: 'GET', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/healthcheck.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Healthcheck
      responses:
        '200':
          $ref: '#/components/responses/healthcheck'
        '403':
          $ref: '#/components/responses/authenticationRequired'
  /healthcheck/status.json:
    get:
      summary: Check if passbolt is up.
      operationId: viewHealthcheckStatus
      security: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/healthcheck/status.json
        - lang: JavaScript
          source: |
            const url = '{{API_BASE_URL}}/healthcheck/status.json';
            const options = {method: 'GET'};

            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/healthcheck/status.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Healthcheck
      responses:
        '200':
          $ref: '#/components/responses/status'
  /mfa/verify/{mfaProviderName}.json:
    get:
      summary: Check multi-factor authentication.
      operationId: mfaVerifyCheck
      description: >
        Check if MFA validation is needed. `400` means that this kind of MFA is
        not required.
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/mfa/verify/totp.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url = '{{API_BASE_URL}}/mfa/verify/totp.json';

            const options = {method: 'GET', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/mfa/verify/totp.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Multi-Factor Authentication
      parameters:
        - $ref: '#/components/parameters/mfaProviderName'
      responses:
        '200':
          $ref: '#/components/responses/nullBody'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
    post:
      summary: Attempt multi-factor authentication.
      operationId: mfaVerifyAttempt
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request POST \
              --url {{API_BASE_URL}}/mfa/verify/totp.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}' \
              --data '{
                "totp": "654373"
              }'
        - lang: JavaScript
          source: |
            const url = '{{API_BASE_URL}}/mfa/verify/totp.json';
            const options = {
              method: 'POST',
              headers: {Authorization: 'Bearer {{JWT_TOKEN}}'},
              body: '{"totp":"654373"}'
            };

            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/mfa/verify/totp.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => json_encode([
                'totp' => '654373'
              ]),
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Multi-Factor Authentication
      requestBody:
        $ref: '#/components/requestBodies/attempt'
      parameters:
        - $ref: '#/components/parameters/mfaProviderName'
      responses:
        '200':
          $ref: '#/components/responses/nullBody'
        '400':
          $ref: '#/components/responses/invalidOtp'
        '401':
          $ref: '#/components/responses/authenticationRequired'
  /mfa/verify/error.json:
    get:
      summary: Information about MFA requirements.
      operationId: mfaVerifyError
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/mfa/verify/error.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url = '{{API_BASE_URL}}/mfa/verify/error.json';

            const options = {method: 'GET', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/mfa/verify/error.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Multi-Factor Authentication
      responses:
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '403':
          $ref: '#/components/responses/error'
  /move/{foreignModel}/{foreignId}.json:
    put:
      summary: Move an element.
      operationId: moveElement
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request PUT \
              --url {{API_BASE_URL}}/move/folder/162e4717-59a2-439b-86c6-fc651e989939.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}' \
              --data '{
                "folder_parent_id": "58cd7e9d-1c27-4f67-9266-4156dea94e80"
              }'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/move/folder/162e4717-59a2-439b-86c6-fc651e989939.json';

            const options = {
              method: 'PUT',
              headers: {Authorization: 'Bearer {{JWT_TOKEN}}'},
              body: '{"folder_parent_id":"58cd7e9d-1c27-4f67-9266-4156dea94e80"}'
            };


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/move/folder/162e4717-59a2-439b-86c6-fc651e989939.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => json_encode([
                'folder_parent_id' => '58cd7e9d-1c27-4f67-9266-4156dea94e80'
              ]),
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      security:
        - bearerHttpAuthentication: []
      parameters:
        - $ref: '#/components/parameters/moveForeignModel'
        - $ref: '#/components/parameters/foreignId'
      tags:
        - Move
      responses:
        '200':
          $ref: '#/components/responses/nullBody'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
      requestBody:
        $ref: '#/components/requestBodies/move'
  /permissions/resource/{resourceId}.json:
    get:
      summary: Get permissions for a resource.
      operationId: indexPermissionsResource
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/permissions/resource/42968631-0c51-4405-9f2d-c6700c5057be.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/permissions/resource/42968631-0c51-4405-9f2d-c6700c5057be.json';

            const options = {method: 'GET', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/permissions/resource/42968631-0c51-4405-9f2d-c6700c5057be.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Permissions
      parameters:
        - $ref: '#/components/parameters/resourceId'
        - $ref: '#/components/parameters/containGroup'
        - $ref: '#/components/parameters/containUser'
        - $ref: '#/components/parameters/containUserProfile'
      responses:
        '200':
          $ref: '#/components/responses/permissions_index'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
  /resources.json:
    get:
      summary: Get multiple resources.
      operationId: indexResources
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/resources.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url = '{{API_BASE_URL}}/resources.json';

            const options = {method: 'GET', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/resources.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Resources
      parameters:
        - $ref: '#/components/parameters/containCreator'
        - $ref: '#/components/parameters/containFavorite'
        - $ref: '#/components/parameters/containModifier'
        - $ref: '#/components/parameters/containSecret'
        - $ref: '#/components/parameters/containResourceType'
        - $ref: '#/components/parameters/containPermission'
        - $ref: '#/components/parameters/containPermissions'
        - $ref: '#/components/parameters/containPermissionsUserProfile'
        - $ref: '#/components/parameters/containPermissionsGroup'
        - $ref: '#/components/parameters/filterIsFavorite'
        - $ref: '#/components/parameters/filterIsSharedWithGroup'
        - $ref: '#/components/parameters/filterIsOwnedByMe'
        - $ref: '#/components/parameters/filterIsSharedWithMe'
        - $ref: '#/components/parameters/filterHasId'
        - $ref: '#/components/parameters/filterHasParent'
      responses:
        '200':
          $ref: '#/components/responses/resources_index'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
    post:
      summary: Create a resource.
      operationId: addResource
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request POST \
              --url {{API_BASE_URL}}/resources.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}' \
              --data '{
                "name": "NextClould",
                "username": "ada@passbolt.com",
                "uri": "https://nextcloud.com/",
                "resource_type_id": "a28a04cd-6f53-518a-967c-9963bf9cec51",
                "secrets": [{
                  "data": "-----BEGIN PGP MESSAGE-----"
                }]
              }'      
        - lang: JavaScript
          source: |
            const url = '{{API_BASE_URL}}/resources.json';
            const options = {
              method: 'POST',
              headers: {Authorization: 'Bearer {{JWT_TOKEN}}'},
              body: '{"name":"NextCloud","username":"ada@passbolt.com","uri":"https://nextcloud.com/","resource_type_id":"a28a04cd-6f53-518a-967c-9963bf9cec51","secrets":[{"data":"-----BEGIN PGP MESSAGE-----"}]}'
            };

            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/resources.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => json_encode([
                'name' => 'NextCloud',
                'username' => 'ada@passbolt.com',
                'uri' => 'https://nextcloud.com/',
                'resource_type_id' => 'a28a04cd-6f53-518a-967c-9963bf9cec51',
                'secrets' => [
                    [
                            'data' => '-----BEGIN PGP MESSAGE-----'
                    ]
                ]
              ]),
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Resources
      responses:
        '200':
          $ref: '#/components/responses/resources_addAndUpdate'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
      requestBody:
        $ref: '#/components/requestBodies/resourceAdd'
  /resources/{resourceId}.json:
    get:
      summary: Get a resource.
      operationId: viewResource
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/resources/ae60d89c-f13b-4fb1-b2dc-c8dc806cac88.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/resources/ae60d89c-f13b-4fb1-b2dc-c8dc806cac88.json';

            const options = {method: 'GET', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/resources/ae60d89c-f13b-4fb1-b2dc-c8dc806cac88.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Resources
      parameters:
        - $ref: '#/components/parameters/resourceId'
        - $ref: '#/components/parameters/containCreator'
        - $ref: '#/components/parameters/containFavorite'
        - $ref: '#/components/parameters/containModifier'
        - $ref: '#/components/parameters/containSecret'
        - $ref: '#/components/parameters/containResourceType'
        - $ref: '#/components/parameters/containPermission'
        - $ref: '#/components/parameters/containPermissions'
        - $ref: '#/components/parameters/containPermissionsUserProfile'
        - $ref: '#/components/parameters/containPermissionsGroup'
      responses:
        '200':
          $ref: '#/components/responses/resources_view'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
    put:
      summary: Update a resource.
      description: >
        If the password you are updating has been shared with 7 users, the
        `secrets` key will need to be an array of 7 objects.


        You must encrypt and sign the new plaintext passwords using the
        recipient public key and the current user secret key. You can then
        create a list which include one object per user: the `data` key holds
        the encrypted plaintext password and `user_id` holds the user UUID.
      operationId: updateResource
      x-codeSamples:
        - lang: cURL
          source: >
            curl --request PUT \

            --url
            {{API_BASE_URL}}/resources/43051c9f-7122-4887-81e8-3b390cf0f04a.json
            \

            --header 'Authorization: Bearer {{JWT_TOKEN}}' \

            --data '{
              "name": "NextCloud",
              "username": "ada@passbolt.com",
              "uri": "https://nextcloud.com/",
              "resource_type_id": "a28a04cd-6f53-518a-967c-9963bf9cec51",
              "secrets": [{
                "id": "f1b79505-2371-422f-88d8-9c6326806b3d",
                "data": "-----BEGIN PGP MESSAGE-----"
              }]
            }'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/resources/43051c9f-7122-4887-81e8-3b390cf0f04a.json';

            const options = {
              method: 'PUT',
              headers: {Authorization: 'Bearer {{JWT_TOKEN}}'},
              body: '{"name":"NextCloud","username":"ada@passbolt.com","uri":"https://nextcloud.com/","resource_type_id":"a28a04cd-6f53-518a-967c-9963bf9cec51","secrets":[{"id":"f1b79505-2371-422f-88d8-9c6326806b3d","data":"-----BEGIN PGP MESSAGE-----"}]}'
            };


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/resources/43051c9f-7122-4887-81e8-3b390cf0f04a.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => json_encode([
                'name' => 'NextCloud',
                'username' => 'ada@passbolt.com',
                'uri' => 'https://nextcloud.com/',
                'resource_type_id' => 'a28a04cd-6f53-518a-967c-9963bf9cec51',
                'secrets' => [
                    [
                            'id' => 'f1b79505-2371-422f-88d8-9c6326806b3d',
                            'data' => '-----BEGIN PGP MESSAGE-----'
                    ]
                ]
              ]),
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      security:
        - bearerHttpAuthentication: []
      parameters:
        - $ref: '#/components/parameters/resourceId'
      tags:
        - Resources
      responses:
        '200':
          $ref: '#/components/responses/resources_addAndUpdate'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
      requestBody:
        $ref: '#/components/requestBodies/resourceUpdate'
    delete:
      summary: Delete a resource.
      operationId: deleteResource
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request DELETE \
              --url {{API_BASE_URL}}/resources/43051c9f-7122-4887-81e8-3b390cf0f04a.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/resources/43051c9f-7122-4887-81e8-3b390cf0f04a.json';

            const options = {method: 'DELETE', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/resources/43051c9f-7122-4887-81e8-3b390cf0f04a.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      security:
        - bearerHttpAuthentication: []
      parameters:
        - $ref: '#/components/parameters/resourceId'
      tags:
        - Resources
      responses:
        '200':
          $ref: '#/components/responses/nullBody'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
  /resource-types.json:
    get:
      summary: Get multiple resource types.
      operationId: resourceTypesIndex
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/resource-types.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url = '{{API_BASE_URL}}/resource-types.json';

            const options = {method: 'GET', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/resource-types.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Resource types
      responses:
        '200':
          $ref: '#/components/responses/resourceTypes_index'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
  /resource-types/{resourceTypeId}.json:
    get:
      summary: Get a resource type.
      operationId: viewResourceType
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/resource-types/43051c9f-7122-4887-81e8-3b390cf0f04a.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/resource-types/43051c9f-7122-4887-81e8-3b390cf0f04a.json';

            const options = {method: 'GET', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/resource-types/43051c9f-7122-4887-81e8-3b390cf0f04a.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Resource types
      parameters:
        - $ref: '#/components/parameters/resourceTypeId'
      responses:
        '200':
          $ref: '#/components/responses/resourceTypes_view'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
  /roles.json:
    get:
      summary: Get multiple roles.
      operationId: indexRoles
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/roles.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url = '{{API_BASE_URL}}/roles.json';

            const options = {method: 'GET', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/roles.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Roles
      responses:
        '200':
          $ref: '#/components/responses/roles_index'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
  /secrets/resource/{resourceId}.json:
    get:
      summary: View user's secret for a resource.
      operationId: viewSecret
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/secrets/resource/42968631-0c51-4405-9f2d-c6700c5057be.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/secrets/resource/42968631-0c51-4405-9f2d-c6700c5057be.json';

            const options = {method: 'GET', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/secrets/resource/42968631-0c51-4405-9f2d-c6700c5057be.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Secrets
      parameters:
        - $ref: '#/components/parameters/resourceId'
      responses:
        '200':
          $ref: '#/components/responses/secrets_view'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
  /share/{foreignModel}/{foreignId}.json:
    put:
      summary: Share a resource or folder.
      operationId: updateShare
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: >
            curl --request PUT \

            --url
            {{API_BASE_URL}}/share/resource/42968631-0c51-4405-9f2d-c6700c5057be.json
            \

            --header 'Authorization: Bearer {{JWT_TOKEN}}' \

            --data '{
              "permissions": [
                {
                  "id": "540174b9-90db-458c-ae90-e9a1912cc656",
                  "type": 7
                }
              ]
            }'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/share/resource/42968631-0c51-4405-9f2d-c6700c5057be.json';

            const options = {
              method: 'PUT',
              headers: {Authorization: 'Bearer {{JWT_TOKEN}}'},
              body: '{"permissions":[{"id":"540174b9-90db-458c-ae90-e9a1912cc656","type":7}]}'
            };


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/share/resource/42968631-0c51-4405-9f2d-c6700c5057be.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => json_encode([
                'permissions' => [
                  [
                    'id' => '540174b9-90db-458c-ae90-e9a1912cc656',
                    'type' => 7
                  ]
                ]
              ]),
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      parameters:
        - $ref: '#/components/parameters/sharesForeignModel'
        - $ref: '#/components/parameters/foreignId'
      tags:
        - Shares
      requestBody:
        $ref: '#/components/requestBodies/shareUpdate'
      responses:
        '200':
          $ref: '#/components/responses/nullBody'
        '400':
          $ref: '#/components/responses/updateError'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
  /share/search-aros.json:
    get:
      summary: Get AROs for sharing.
      operationId: indexShareAros
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/share/search-aros.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url = '{{API_BASE_URL}}/share/search-aros.json';

            const options = {method: 'GET', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/share/search-aros.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      parameters:
        - $ref: '#/components/parameters/filterSearch'
        - $ref: '#/components/parameters/containGroupsUsers'
        - $ref: '#/components/parameters/containGpgkey'
        - $ref: '#/components/parameters/containRole'
      tags:
        - Shares
      responses:
        '200':
          $ref: '#/components/responses/arosIndex'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
  /share/simulate/{foreignModel}/{foreignId}.json:
    post:
      summary: Simulate sharing a resource or folder.
      operationId: updateShareDryRun
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request POST \
              --url {{API_BASE_URL}}/share/simulate/resource/42968631-0c51-4405-9f2d-c6700c5057be.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}' \
              --data '{
                "permissions": [
                  {
                    "id": "540174b9-90db-458c-ae90-e9a1912cc656",
                    "delete": true
                  }
                ]
              }'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/share/simulate/resource/42968631-0c51-4405-9f2d-c6700c5057be.json';

            const options = {
              method: 'POST',
              headers: {Authorization: 'Bearer {{JWT_TOKEN}}'},
              body: '{"permissions":[{"id":"540174b9-90db-458c-ae90-e9a1912cc656","delete":true}]}'
            };


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/share/simulate/resource/42968631-0c51-4405-9f2d-c6700c5057be.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => json_encode([
                'permissions' => [
                    [
                            'id' => '540174b9-90db-458c-ae90-e9a1912cc656',
                            'delete' => True
                    ]
                ]
              ]),
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      parameters:
        - $ref: '#/components/parameters/sharesForeignModel'
        - $ref: '#/components/parameters/foreignId'
      tags:
        - Shares
      requestBody:
        $ref: '#/components/requestBodies/shareUpdateDryRun'
      responses:
        '200':
          $ref: '#/components/responses/updateDryRun'
        '400':
          $ref: '#/components/responses/updateError'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
  /users.json:
    get:
      summary: Get multiple users.
      operationId: indexUsers
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/users.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url = '{{API_BASE_URL}}/users.json';

            const options = {method: 'GET', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/users.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Users
      parameters:
        - $ref: '#/components/parameters/containLastLoggedIn'
        - $ref: '#/components/parameters/containGroupsUsers'
        - $ref: '#/components/parameters/containGpgkey'
        - $ref: '#/components/parameters/containProfile'
        - $ref: '#/components/parameters/containRole'
        - $ref: '#/components/parameters/filterSearch'
        - $ref: '#/components/parameters/filterHasGroups'
        - $ref: '#/components/parameters/filterHasAccess'
        - $ref: '#/components/parameters/filterIsAdmin'
        - $ref: '#/components/parameters/filterIsActive'
      responses:
        '200':
          $ref: '#/components/responses/users_index'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
    post:
      summary: Create a user.
      operationId: addUser
      description: |
        Only users with `admin` role can create other users.
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request POST \
              --url {{API_BASE_URL}}/users.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}' \
              --data '{
                "username": "ada@passbolt.com",
                "profile": {
                  "first_name": "Ada",
                  "last_name": "Lovelace"
                }
              }'
        - lang: JavaScript
          source: |
            const url = '{{API_BASE_URL}}/users.json';
            const options = {
              method: 'POST',
              headers: {Authorization: 'Bearer {{JWT_TOKEN}}'},
              body: '{"username":"ada@passbolt.com","profile":{"first_name":"Ada","last_name":"Lovelace"}}'
            };

            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/users.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => json_encode([
                'username' => 'ada@passbolt.com',
                'profile' => [
                    'first_name' => 'Ada',
                    'last_name' => 'Lovelace'
                ]
              ]),
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Users
      requestBody:
        $ref: '#/components/requestBodies/userAdd'
      responses:
        '200':
          $ref: '#/components/responses/users_add'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
  /users/{userId}.json:
    get:
      summary: Get a user.
      operationId: viewUser
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request GET \
              --url {{API_BASE_URL}}/users/8c640fd5-268c-4ae0-9e35-2f120cf1a831.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/users/8c640fd5-268c-4ae0-9e35-2f120cf1a831.json';

            const options = {method: 'GET', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/users/8c640fd5-268c-4ae0-9e35-2f120cf1a831.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Users
      parameters:
        - $ref: '#/components/parameters/userId'
      responses:
        '200':
          $ref: '#/components/responses/users_view'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
    put:
      summary: Update a user.
      operationId: updateUser
      description: >
        Neither the email or the username field which can be updated, and only
        administrators can update a user's role.
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request PUT \
              --url {{API_BASE_URL}}/users/8c640fd5-268c-4ae0-9e35-2f120cf1a831.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}' \
              --data '{
                "profile": {
                  "first_name": "Freddy",
                  "last_name": "Mercury"
                }
              }'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/users/8c640fd5-268c-4ae0-9e35-2f120cf1a831.json';

            const options = {
              method: 'PUT',
              headers: {Authorization: 'Bearer {{JWT_TOKEN}}'},
              body: '{"profile":{"first_name":"Freddy","last_name":"Mercury"}}'
            };


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/users/8c640fd5-268c-4ae0-9e35-2f120cf1a831.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => json_encode([
                'profile' => [
                    'first_name' => 'Freddy',
                    'last_name' => 'Mercury'
                ]
              ]),
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Users
      parameters:
        - $ref: '#/components/parameters/userId'
      responses:
        '200':
          $ref: '#/components/responses/users_update'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
      requestBody:
        $ref: '#/components/requestBodies/userUpdate'
    delete:
      summary: Delete a user.
      operationId: deleteUser
      description: >
        Only a user with an administrator role can delete users. A `user` can
        not be deleted as long as:


        - They are the sole owner of a shared resource.

        - They are a manager of a non empty group.


        In this case you will need to transfer the ownership of the shared
        resources and appoint a new manager to the group in order to proceed.
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request DELETE \
              --url {{API_BASE_URL}}/users/8c640fd5-268c-4ae0-9e35-2f120cf1a831.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/users/8c640fd5-268c-4ae0-9e35-2f120cf1a831.json';

            const options = {method: 'DELETE', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/users/8c640fd5-268c-4ae0-9e35-2f120cf1a831.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Users
      parameters:
        - $ref: '#/components/parameters/userId'
      responses:
        '200':
          $ref: '#/components/responses/nullBody'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
  /users/{userId}/dry-run.json:
    delete:
      summary: Dry run a user deletion.
      operationId: dryRunDeleteUser
      security:
        - bearerHttpAuthentication: []
      x-codeSamples:
        - lang: cURL
          source: |
            curl --request DELETE \
              --url {{API_BASE_URL}}/users/8c640fd5-268c-4ae0-9e35-2f120cf1a831/dry-run.json \
              --header 'Authorization: Bearer {{JWT_TOKEN}}'
        - lang: JavaScript
          source: >
            const url =
            '{{API_BASE_URL}}/users/8c640fd5-268c-4ae0-9e35-2f120cf1a831/dry-run.json';

            const options = {method: 'DELETE', headers: {Authorization: 'Bearer
            {{JWT_TOKEN}}'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "{{API_BASE_URL}}/users/8c640fd5-268c-4ae0-9e35-2f120cf1a831/dry-run.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer {{JWT_TOKEN}}"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
      tags:
        - Users
      parameters:
        - $ref: '#/components/parameters/userId'
      responses:
        '200':
          $ref: '#/components/responses/nullBody'
        '400':
          $ref: '#/components/responses/users_deleteDryRun'
        '401':
          $ref: '#/components/responses/authenticationRequired'
        '404':
          $ref: '#/components/responses/notFound'
tags:
  - name: Authentication (GPGAuth)
    description: >
      The legacy authentication method, using the GPGAuth protocol.


      Find more
      [here](https://www.passbolt.com/docs/development/authentication).
  - name: Authentication (JWT)
    description: >
      JWT-based authentication is the preferred way to interact with the
      Passbolt API. Find more [here](https://www.passbolt.com/docs/development)
  - name: Avatars
    description: Query avatar images.
  - name: Comments
    description: Manipulate comments for resources.
  - name: Favorites
    description: >
      The favorite endpoints are used to add or remove a `Resource` from your
      favorites.
  - name: Folders
    description: Organize your passwords and share them in bulk using folders.
  - name: GPG keys
    description: >
      In order to encrypt information, the server and the clients needs the
      user's public keys. These OpenPGP endpoints let you query the saved public
      key data.
  - name: Groups
    description: >
      Organize users in logical groups to make it easier to share resources with
      them.
  - name: Healthcheck
    description: Gather data about the passbolt instance's health.
  - name: Move
    description: Move a folder or a resource across folders.
  - name: Multi-Factor Authentication
    description: |
      Complete and validate authentication for users with MFA enabled.
  - name: Permissions
    description: Query permissions for resources.
  - name: Resources
    description: |
      A resource holds the metadata for its secrets.
  - name: Resource types
    description: >
      Resource-types are used for describing how and what data is stored for a
      resource and its associated secrets.
  - name: Roles
    description: Different categories of users.
  - name: Secrets
    description: Secrets associated to resources.
  - name: Shares
    description: |
      Share resources and folders to users with an exhaustive permission system.
  - name: Users
    description: |
      User are entities with the ability to interact with the application.
components:
  securitySchemes:
    bearerHttpAuthentication:
      description: Bearer token using a JWT
      type: http
      scheme: Bearer
      bearerFormat: JWT
    gpgCookieAuthentication:
      description: >-
        Session-based authentication. Note that a CSRF token needs to be
        provided through a header named `X-CSRF-Token`.
      type: apiKey
      in: cookie
      name: passbolt_session
  schemas:
    header:
      type: object
      required:
        - id
        - status
        - servertime
        - action
        - message
        - url
        - code
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - success
            - error
        servertime:
          type: integer
          example: 1720702619
        action:
          type: string
          format: uuid
        message:
          type: string
          example: The operation was successful.
        url:
          type: string
          format: uri
          example: /auth/verify.json
        code:
          type: integer
          example: 200
    jwk:
      type: object
      required:
        - kty
        - alg
        - use
        - e
        - 'n'
      properties:
        kty:
          type: string
        alg:
          type: string
        use:
          type: string
        e:
          type: string
        'n':
          type: string
    loginRequest:
      type: object
      required:
        - user_id
        - challenge
      properties:
        user_id:
          type: string
          format: uuid
        challenge:
          type: string
          description: '`gpg_encrypt(gpg_sign(challenge_message, user_key), server_key)`'
    loginResponse:
      type: object
      required:
        - challenge
      properties:
        challenge:
          type: string
    logout:
      type: object
      properties:
        refresh_token:
          type: string
          format: uuid
    refreshRequest:
      type: object
      required:
        - refresh_token
        - user_id
      properties:
        refresh_token:
          type: string
          format: uuid
        user_id:
          type: string
          format: uuid
    refreshResponse:
      type: object
      required:
        - access_token
      properties:
        access_token:
          type: string
          format: uuid
    rsa:
      type: object
      required:
        - keydata
      properties:
        keydata:
          type: string
    login:
      type: object
      required:
        - data
      properties:
        data:
          type: object
          required:
            - gpg_auth
          properties:
            gpg_auth:
              type: object
              required:
                - keyid
              properties:
                keyid:
                  type: string
                server_verify_token:
                  type: string
                  description: Used for server key verification.
                user_token_result:
                  type: string
                  description: Used for client key verification.
    verify:
      type: object
      required:
        - fingerprint
        - keydata
      properties:
        fingerprint:
          type: string
        keydata:
          type: string
    commentUpdate:
      type: object
      required:
        - content
      properties:
        content:
          type: string
    commentView:
      type: object
      required:
        - id
        - parent_id
        - foreign_key
        - foreign_model
        - content
        - created
        - modified
        - created_by
        - modified_by
        - user_id
      properties:
        id:
          type: string
          format: uuid
        parent_id:
          type: string
          format: uuid
        foreign_key:
          type: string
          format: uuid
        foreign_model:
          type: string
          enum:
            - Resource
        content:
          type: string
        created:
          type: string
          format: date-time
        modified:
          type: string
          format: date-time
        created_by:
          type: string
          format: uuid
        modified_by:
          type: string
          format: uuid
        user_id:
          type: string
          format: uuid
        children:
          type: array
          items:
            $ref: '#/components/schemas/commentView'
        modifier:
          $ref: '#/components/schemas/userIndexAndView'
        creator:
          $ref: '#/components/schemas/userIndexAndView'
    userIndexAndView:
      type: object
      required:
        - id
        - role_id
        - username
        - active
        - deleted
        - created
        - modified
        - disabled
      properties:
        is_mfa_enabled:
          type: boolean
        id:
          type: string
          format: uuid
        role_id:
          type: string
          format: uuid
        username:
          type: string
        active:
          type: boolean
        deleted:
          type: boolean
        created:
          type: string
          format: date-time
        modified:
          type: string
          format: date-time
        disabled:
          type: string
          format: date-time
          x-nullable: true
        profile:
          type: object
          required:
            - id
            - user_id
            - first_name
            - last_name
            - created
            - modified
            - avatar
          properties:
            id:
              type: string
              format: uuid
            user_id:
              type: string
              format: uuid
            first_name:
              type: string
            last_name:
              type: string
            created:
              type: string
              format: date-time
            modified:
              type: string
              format: date-time
            avatar:
              type: object
              required:
                - url
              properties:
                id:
                  type: string
                  format: uuid
                profile_id:
                  type: string
                  format: uuid
                created:
                  type: string
                  format: date-time
                modified:
                  type: string
                  format: date-time
                url:
                  type: object
                  required:
                    - medium
                    - small
                  properties:
                    medium:
                      type: string
                      format: url
                    small:
                      type: string
                      format: url
        groups_users:
          $ref: '#/components/schemas/groupsUsersIndexAndView'
        gpgkey:
          $ref: '#/components/schemas/gpgkey'
          x-nullable: true
        role:
          $ref: '#/components/schemas/role'
        last_logged_in:
          type: string
          format: date-time
          x-nullable: true
    groupsUsersIndexAndView:
      type: object
      required:
        - id
        - group_id
        - user_id
        - is_admin
        - created
      properties:
        id:
          type: string
          format: uuid
        group_id:
          type: string
          format: uuid
        user_id:
          type: string
          format: uuid
        is_admin:
          type: boolean
        created:
          type: string
          format: date-time
        user:
          $ref: '#/components/schemas/userIndexAndView'
    gpgkey:
      type: object
      required:
        - id
        - user_id
        - armored_key
        - bits
        - uid
        - key_id
        - fingerprint
        - type
        - expires
        - key_created
        - deleted
        - created
        - modified
      properties:
        id:
          type: string
          format: uuid
        user_id:
          type: string
          format: uuid
        armored_key:
          type: string
        bits:
          type: integer
        uid:
          type: string
        key_id:
          type: string
        fingerprint:
          type: string
        type:
          type: string
          enum:
            - RSA
            - ECC
        expires:
          type: string
          format: date-time
          x-nullable: true
        deleted:
          type: boolean
        created:
          type: string
          format: date-time
        modified:
          type: string
          format: date-time
    role:
      type: object
      required:
        - id
        - name
        - description
        - created
        - modified
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          enum:
            - admin
            - guest
            - user
        description:
          type: string
        created:
          type: string
          format: date-time
        modified:
          type: string
          format: date-time
    commentAdd:
      type: object
      required:
        - content
      properties:
        content:
          type: string
        parent_id:
          type: string
          format: uuid
    favorite:
      type: object
      required:
        - id
        - user_id
        - foreign_key
        - foreign_model
        - created
        - modified
      properties:
        id:
          type: string
          format: uuid
        user_id:
          type: string
          format: uuid
        foreign_key:
          type: string
          format: uuid
        foreign_model:
          type: string
          enum:
            - Resource
        created:
          type: string
          format: date-time
        modified:
          type: string
          format: date-time
    headerWithPagination:
      type: object
      required:
        - id
        - status
        - servertime
        - action
        - message
        - url
        - code
        - pagination
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - success
            - error
        servertime:
          type: integer
          example: 1720702619
        action:
          type: string
          format: uuid
        message:
          type: string
          example: The operation was successful.
        url:
          type: string
          format: uri
          example: /auth/verify.json
        code:
          type: integer
          example: 200
        pagination:
          type: object
          required:
            - count
            - page
            - limit
          properties:
            count:
              type: integer
            page:
              type: integer
            limit:
              type: integer
              x-nullable: true
    secretIndex:
      type: object
      required:
        - id
        - user_id
        - resource_id
        - data
        - created
        - modified
      properties:
        id:
          type: string
          format: uuid
        user_id:
          type: string
          format: uuid
        resource_id:
          type: string
          format: uuid
        data:
          type: string
        created:
          type: string
          format: date-time
        modified:
          type: string
          format: date-time
    resourceType:
      type: object
      required:
        - id
        - slug
        - name
        - description
        - definition
      properties:
        id:
          type: string
          format: uuid
        slug:
          type: string
          description: >
            * `password-string` - The original passbolt resource type, where the
            secret is a non empty string.

            * `password-and-description` - A resource with the password and the
            description encrypted.

            * `totp` - A resource with standalone TOTP fields.

            * `password-description-totp` - A resource with encrypted password,
            description and TOTP fields.
          enum:
            - password-string
            - password-and-description
            - totp
            - password-description-totp
        name:
          type: string
        description:
          type: string
        definition:
          type: object
          description: Schema for the expected data for this kind of resources.
        created:
          type: string
          format: date-time
        modified:
          type: string
          format: date-time
    permissionLevel:
      description: |
        * `1` - Read
        * `7` - Update
        * `15` - Owner
      type: integer
      enum:
        - 1
        - 7
        - 15
    groupIndexAndView:
      type: object
      required:
        - id
        - name
        - deleted
        - created
        - modified
        - created_by
        - modified_by
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        deleted:
          type: boolean
        created:
          type: string
          format: date-time
        modified:
          type: string
          format: date-time
        created_by:
          type: string
          format: uuid
        modified_by:
          type: string
          format: uuid
        my_group_user:
          $ref: '#/components/schemas/groupsUsersIndexAndView'
        groups_users:
          type: array
          items:
            $ref: '#/components/schemas/groupsUsersIndexAndView'
        user_count:
          type: integer
    permissionIndexAndView:
      type: object
      required:
        - id
        - aco
        - aco_foreign_key
        - aro
        - aro_foreign_key
        - type
        - created
        - modified
      properties:
        id:
          type: string
          format: uuid
        aco:
          type: string
          enum:
            - Resource
            - Folder
        aco_foreign_key:
          type: string
          format: uuid
        aro:
          type: string
          enum:
            - User
            - Group
        aro_foreign_key:
          type: string
          format: uuid
        type:
          $ref: '#/components/schemas/permissionLevel'
        created:
          type: string
          format: date-time
        modified:
          type: string
          format: date-time
        user:
          $ref: '#/components/schemas/userIndexAndView'
          x-nullable: true
        group:
          $ref: '#/components/schemas/groupIndexAndView'
          x-nullable: true
    resourceIndexAndView:
      type: object
      required:
        - id
        - name
        - username
        - uri
        - description
        - deleted
        - created
        - created_by
        - modified_by
        - resource_type_id
        - expired
        - folder_parent_id
        - personal
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        username:
          type: string
        uri:
          type: string
        description:
          type: string
        deleted:
          type: boolean
        created:
          type: string
          format: date-time
        created_by:
          type: string
          format: uuid
        modified_by:
          type: string
          format: uuid
        resource_type_id:
          type: string
          format: uuid
        expired:
          type: string
          format: date-time
          x-nullable: true
        folder_parent_id:
          type: string
          format: uuid
          x-nullable: true
        personal:
          type: boolean
        favorite:
          $ref: '#/components/schemas/favorite'
        modifier:
          $ref: '#/components/schemas/userIndexAndView'
        creator:
          $ref: '#/components/schemas/userIndexAndView'
        secrets:
          type: array
          items:
            $ref: '#/components/schemas/secretIndex'
        resource_type:
          $ref: '#/components/schemas/resourceType'
        permission:
          $ref: '#/components/schemas/permissionIndexAndView'
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/permissionIndexAndView'
    folderIndexAndView:
      type: object
      required:
        - id
        - name
        - created
        - modified
        - created_by
        - modified_by
        - personal
        - folder_parent_id
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        created:
          type: string
          format: date-time
        modified:
          type: string
          format: date-time
        created_by:
          type: string
          format: uuid
        modified_by:
          type: string
          format: uuid
        children_resources:
          type: array
          items:
            $ref: '#/components/schemas/resourceIndexAndView'
        children_folders:
          type: array
          items:
            $ref: '#/components/schemas/folderIndexAndView'
        modifier:
          $ref: '#/components/schemas/userIndexAndView'
        creator:
          $ref: '#/components/schemas/userIndexAndView'
        permission:
          $ref: '#/components/schemas/permissionIndexAndView'
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/permissionIndexAndView'
        personal:
          type: boolean
        folder_parent_id:
          type: string
          format: uuid
          x-nullable: true
    folderAdd:
      type: object
      required:
        - name
      properties:
        name:
          type: string
        folder_parent_id:
          type: string
          format: uuid
          x-nullable: true
    folderUpdate:
      type: object
      required:
        - name
      properties:
        name:
          type: string
    groupAdd:
      type: object
      required:
        - name
        - groups_users
      properties:
        name:
          type: string
        groups_users:
          type: array
          items:
            type: object
            required:
              - user_id
              - is_admin
            properties:
              user_id:
                type: string
                format: uuid
              is_admin:
                type: boolean
    groupUpdate:
      type: object
      required:
        - name
        - groups_users
      properties:
        name:
          type: string
        groups_users:
          type: array
          items:
            type: object
            required:
              - user_id
            properties:
              user_id:
                type: string
                format: uuid
              is_admin:
                type: boolean
              delete:
                type: boolean
        secrets:
          type: array
          items:
            type: object
            required:
              - resource_id
              - user_id
              - data
            properties:
              resource_id:
                type: string
                format: uuid
              user_id:
                type: string
                format: uuid
              data:
                type: string
    groupUpdateDryRun:
      type: object
      required:
        - dry-run
      properties:
        dry-run:
          type: object
          required:
            - SecretsNeeded
            - Secrets
          properties:
            SecretsNeeded:
              type: array
              items:
                type: object
                required:
                  - Secret
                properties:
                  Secret:
                    type: object
                    required:
                      - resource_id
                      - user_id
                    properties:
                      resource_id:
                        type: string
                        format: uuid
                      user_id:
                        type: string
                        format: uuid
            Secrets:
              type: object
              items:
                type: object
                required:
                  - Secret
                properties:
                  Secret:
                    type: object
                    required:
                      - id
                      - resource_id
                      - user_id
                      - data
                    properties:
                      id:
                        type: string
                        format: uuid
                      resource_id:
                        type: string
                        format: uuid
                      user_id:
                        type: string
                        format: uuid
                      data:
                        type: string
    groupDeleteDryRunError:
      type: object
      properties:
        resources:
          type: object
          properties:
            sole_owner:
              type: array
              items:
                $ref: '#/components/schemas/resourceIndexAndView'
        folders:
          type: object
          properties:
            sole_owner:
              type: array
              items:
                $ref: '#/components/schemas/folderIndexAndView'
    healthcheck:
      type: object
      required:
        - environment
        - configFile
        - core
        - ssl
        - smtpSettings
        - gpg
        - application
        - database
      properties:
        environment:
          type: object
          required:
            - gnupg
            - info
            - phpVersion
            - nextMinPhpVersion
            - pcre
            - mbstring
            - intl
            - image
            - tmpWritable
            - logWritable
          properties:
            gnupg:
              type: boolean
            info:
              type: object
              required:
                - phpVersion
              properties:
                phpVersion:
                  type: string
            phpVersion:
              type: boolean
            nextMinPhpVersion:
              type: boolean
            pcre:
              type: boolean
            mbstring:
              type: boolean
            intl:
              type: boolean
            image:
              type: boolean
            tmpWritable:
              type: boolean
            logWritable:
              type: boolean
        configFile:
          type: object
          required:
            - app
            - passbolt
          properties:
            app:
              type: boolean
            passbolt:
              type: boolean
        core:
          type: object
          required:
            - cache
            - debugDisabled
            - salt
            - info
            - fullBaseUrl
            - validFullBaseUrl
            - fullBaseUrlReachable
          properties:
            cache:
              type: boolean
            debugDisabled:
              type: boolean
            salt:
              type: boolean
            info:
              type: object
              required:
                - fullBaseUrl
              properties:
                fullBaseUrl:
                  type: string
            fullBaseUrl:
              type: boolean
            validFullBaseUrl:
              type: boolean
            fullBaseUrlReachable:
              type: boolean
        ssl:
          type: object
          required:
            - info
            - peerValid
            - hostValid
            - notSelfSigned
          properties:
            info:
              type: string
            peerValid:
              type: boolean
            hostValid:
              type: boolean
            notSelfSigned:
              type: boolean
        smtpSettings:
          type: object
          required:
            - isEnabled
            - errorMessage
            - source
            - isInDb
            - areEndpointsDisabled
            - customSslOptions
          properties:
            isEnabled:
              type: boolean
            errorMessage:
              type: boolean
            source:
              type: string
            isInDb:
              type: boolean
            areEndpointsDisabled:
              type: boolean
            customSslOptions:
              type: boolean
        gpg:
          type: object
          required:
            - lib
            - gpgHome
            - gpgHomeWritable
            - gpgKeyNotDefault
            - gpgKeyPublicBlock
            - gpgKeyPrivateBlock
            - gpgKeyPublicReadable
            - gpgKeyPrivateReadable
            - gpgKeyPrivateFingerprint
            - gpgKeyPublic
            - gpgKeyPrivate
            - gpgKey
            - info
            - gpgKeyPublicFingerprint
            - gpgKeyPublicInKeyring
            - gpgKeyPublicEmail
            - canEncrypt
            - canSign
            - canEncryptSign
            - canDecrypt
            - canDecryptVerify
            - canVerify
            - isPublicServerKeyGopengpgCompatible
            - isPrivateServerKeyGopengpgCompatible
          properties:
            lib:
              type: boolean
            gpgHome:
              type: boolean
            gpgHomeWritable:
              type: boolean
            gpgKeyPublicBlock:
              type: boolean
            gpgKeyPrivateBlock:
              type: boolean
            gpgKeyPublicReadable:
              type: boolean
            gpgKeyPrivateReadable:
              type: boolean
            gpgKeyPrivateFingerprint:
              type: boolean
            gpgKeyPublic:
              type: boolean
            gpgKeyPrivate:
              type: boolean
            gpgKey:
              type: boolean
            info:
              type: object
              required:
                - gpgKeyPrivate
                - gpgHome
              properties:
                gpgKeyPrivate:
                  type: string
                gpgHome:
                  type: string
            gpgKeyPublicFingerprint:
              type: boolean
            gpgKeyPublicInKeyring:
              type: boolean
            gpgKeyPublicEmail:
              type: boolean
            canEncrypt:
              type: boolean
            canSign:
              type: boolean
            canEncryptSign:
              type: boolean
            canDecrypt:
              type: boolean
            canDecryptVerify:
              type: boolean
            canVerify:
              type: boolean
            isPublicServerKeyGopengpgCompatible:
              type: boolean
            isPrivateServerKeyGopengpgCompatible:
              type: boolean
        application:
          type: object
          required:
            - configPath
            - info
            - latestVersion
            - sslForce
            - sslFullBaseUrl
            - seleniumDisabled
            - robotsIndexDisabled
            - registrationClosed
            - hostAvailabilityCheckEnabled
            - jsProd
            - emailNotificationEnabled
            - schema
          properties:
            configPath:
              type: string
            info:
              type: object
              required:
                - remoteVersion
                - currentVersion
              properties:
                remoteVersion:
                  type: string
                currentVersion:
                  type: string
            latestVersion:
              type: boolean
            sslForce:
              type: boolean
            sslFullBaseUrl:
              type: boolean
            seleniumDisabled:
              type: boolean
            robotsIndexDisabled:
              type: boolean
            registrationClosed:
              type: object
              required:
                - isSelfRegistrationPluginEnabled
                - selfRegistrationProvider
                - isRegistrationPublicRemovedFromPassbolt
              properties:
                isSelfRegistrationPluginEnabled:
                  type: boolean
                selfRegistrationProvider:
                  type: string
                  x-nullable: true
                isRegistrationPublicRemovedFromPassbolt:
                  type: boolean
            hostAvailabilityCheckEnabled:
              type: boolean
            jsProd:
              type: boolean
            emailNotificationEnabled:
              type: boolean
            schema:
              type: boolean
        database:
          type: object
          required:
            - supportedBackend
            - connect
            - info
            - tablesCount
            - defaultContent
          properties:
            supportedBackend:
              type: boolean
            connect:
              type: boolean
            info:
              type: object
              required:
                - tablesCount
              properties:
                tablesCount:
                  type: integer
            tablesCount:
              type: boolean
            defaultContent:
              type: boolean
    mfaAttempt:
      anyOf:
        - type: object
          required:
            - totp
          properties:
            totp:
              type: string
              description: One-time code for TOTP-based MFA.
            remember:
              type: integer
              enum:
                - 0
                - 1
        - type: object
          required:
            - hotp
          properties:
            hotp:
              type: string
              description: One-time code for Yubikey-based MFA.
            remember:
              type: integer
              enum:
                - 0
                - 1
    invalidOtp:
      anyOf:
        - type: object
          required:
            - totp
          properties:
            totp:
              type: object
              properties:
                numeric:
                  type: string
                minLength:
                  type: string
                isValidOtp:
                  type: string
        - type: object
          required:
            - hotp
          properties:
            hotp:
              type: object
              properties:
                isValidModhex:
                  type: string
                isValidHotp:
                  type: string
    error:
      type: object
      required:
        - mfa_providers
      properties:
        mfa_providers:
          type: array
          items:
            type: string
            enum:
              - totp
              - yubikey
    move:
      type: object
      required:
        - folder_parent_id
      properties:
        folder_parent_id:
          type: string
          format: uuid
    secretAdd:
      type: object
      required:
        - data
      properties:
        user_id:
          type: string
          format: uuid
        data:
          type: string
        resource_id:
          type: string
          format: uuid
    resourceAdd:
      type: object
      required:
        - name
        - username
        - uri
        - resource_type_id
      properties:
        name:
          type: string
        username:
          type: string
        uri:
          type: string
        description:
          type: string
        resource_type_id:
          type: string
          format: uuid
        folder_parent_id:
          type: string
          format: uuid
        expired:
          type: string
          format: date-time
          x-nullable: true
        secrets:
          type: array
          items:
            $ref: '#/components/schemas/secretAdd'
    secretUpdate:
      type: object
      required:
        - user_id
        - data
      properties:
        user_id:
          type: string
          format: uuid
        data:
          type: string
    resourceUpdate:
      type: object
      properties:
        name:
          type: string
        username:
          type: string
        uri:
          type: string
        description:
          type: string
        resource_type_id:
          type: string
          format: uuid
        expired:
          type: string
          format: date-time
          x-nullable: true
        secrets:
          type: array
          items:
            $ref: '#/components/schemas/secretUpdate'
    permissionUpdate:
      type: object
      properties:
        id:
          type: string
          format: uuid
        aro:
          type: string
          enum:
            - User
            - Group
        aro_foreign_key:
          type: string
          format: uuid
        type:
          $ref: '#/components/schemas/permissionLevel'
        delete:
          type: boolean
        is_new:
          type: boolean
    shareUpdate:
      type: object
      properties:
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/permissionUpdate'
        secrets:
          description: Not required on simulation.
          type: array
          items:
            $ref: '#/components/schemas/secretAdd'
    shareUpdateError:
      type: object
      properties:
        permissions:
          type: array
          items:
            type: object
            properties:
              aco_forein_key:
                type: object
                properties:
                  permission_unique:
                    type: string
                  aco_exists:
                    type: string
                  _existsIn:
                    type: string
              aro_forein_key:
                type: object
                properties:
                  aro_exists:
                    type: string
                  _existsIn:
                    type: string
    shareAros:
      oneOf:
        - $ref: '#/components/schemas/userIndexAndView'
        - $ref: '#/components/schemas/groupIndexAndView'
    shareUpdateDryRun:
      type: object
      required:
        - added
        - removed
      properties:
        added:
          type: array
          items:
            type: object
            properties:
              User:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
        removed:
          type: array
          items:
            type: object
            properties:
              User:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
    userAdd:
      type: object
      required:
        - username
        - profile
      properties:
        username:
          type: string
          format: email
        role_id:
          type: string
          format: uuid
        profile:
          type: object
          required:
            - first_name
            - last_name
          properties:
            first_name:
              type: string
            last_name:
              type: string
    userUpdate:
      type: object
      properties:
        role_id:
          type: string
          format: uuid
        disabled:
          type: boolean
        profile:
          type: object
          properties:
            first_name:
              type: string
            last_name:
              type: string
            avatar:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  description: Image file in binary format.
    userDeleteDryRun:
      type: object
      properties:
        errors:
          type: object
          properties:
            groups:
              type: object
              properties:
                sole_manager:
                  type: array
                  items:
                    $ref: '#/components/schemas/groupIndexAndView'
            folders:
              type: object
              properties:
                sole_owner:
                  type: array
                  items:
                    $ref: '#/components/schemas/folderIndexAndView'
            resources:
              type: object
              properties:
                sole_owner:
                  type: array
                  items:
                    $ref: '#/components/schemas/resourceIndexAndView'
            groups_to_delete:
              type: array
              items:
                $ref: '#/components/schemas/groupIndexAndView'
  responses:
    nullBody:
      description: Operation is successful.
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                type: 'null'
          examples:
            base:
              value:
                header:
                  id: f7be85c0-afb1-4d8e-a9e1-e05abb0bb71a
                  status: success
                  servertime: 1721727753
                  action: e2aa01a9-84ec-55f8-aaed-24ee23259339
                  message: <SUCCESS MESSAGE>
                  url: <API ENDPOINT URL>
                  code: 200
                body: null
    authenticationRequired:
      description: Authentication required.
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                type: string
          examples:
            base:
              value:
                header:
                  id: f7be85c0-afb1-4d8e-a9e1-e05abb0bb71a
                  status: error
                  servertime: 1721727753
                  action: e2aa01a9-84ec-55f8-aaed-24ee23259339
                  message: Authentication is required to continue.
                  url: <API ENDPOINT URL>
                  code: 401
                body: ''
    jwks:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - keys
            properties:
              keys:
                type: array
                items:
                  $ref: '#/components/schemas/jwk'
          examples:
            base:
              value:
                keys:
                  - kty: RSA
                    alg: RS256
                    use: sig
                    e: AQAB
                    'n': sP0CpKdQJF8KgPD9GOLiCssOhi8qHXp0TyyqkWNGWcZD3JTKuuWJhNn...
    notFound:
      description: Not found
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                type: string
          examples:
            example:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: error
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The <MODEL> does not exist.
                  url: <API ENDPOINT URL>
                  code: 404
                body: ''
    login:
      description: Operation is successful.
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/loginResponse'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /auth/jwt/login.json
                  code: 200
                body:
                  challenge: '-----BEGIN PGP MESSAGE-----'
    badRequest:
      description: Bad request
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                type: string
          examples:
            example:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: error
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: <ERROR MESSAGE>
                  url: <API ENDPOINT URL>
                  code: 400
                body: ''
    refresh:
      description: Operation is successful. A new refresh token is set via a cookie.
      headers:
        Set-Cookie:
          schema:
            type: string
            example: refresh_token=12c9392a-ac65-4ccb-b4b3-2c1854ae66dd; HttpOnly
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/refreshResponse'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /auth/jwt/refresh.json
                  code: 200
                body:
                  access_token: 90c0d69c-a508-4cb6-a26c-799e52147ac0
    rsa:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/rsa'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /auth/jwt/rsa.json
                  code: 200
                body:
                  keydata: '-----BEGIN PUBLIC KEY-----'
    authGpg_login:
      description: >-
        Operation is successful. Additional data is sent through cookie and
        headers.
      headers:
        X-GPGAuth-Progress:
          schema:
            type: string
            enum:
              - stage1
              - stage2
              - complete
        X-GPGAuth-User-Auth-Token:
          schema:
            type: string
        X-GPGAuth-Authenticated:
          schema:
            type: boolean
        Set-Cookie:
          schema:
            type: string
            example: passbolt_session=9vknm8fkbqpgj8i1mnk4st332e; HttpOnly
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                type: 'null'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /auth/login.json
                  code: 200
                body: null
    missingCsrfToken:
      description: CSRF token is missing or invalid.
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                type: string
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: Missing or incorrect CSRF cookie type.
                  url: /auth/logout.json
                  code: 403
                body: ''
    verify:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/verify'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /auth/verify.json
                  code: 200
                body:
                  fingerprint: 5FB36DE5C8E69DD4DB185DF2BC9F2749E432CB59
                  keydata: '-----BEGIN PUBLIC KEY-----'
    stage0:
      description: Operation is successful. The decrypted challenge is sent via a header.
      headers:
        X-GPGAuth-Verify-Response:
          schema:
            type: string
            example: >-
              gpgauthv1.3.0|36|10e2074b-f610-42be-8525-100d4e68c481|gpgauthv1.3.0
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                type: 'null'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /auth/verify.json
                  code: 200
                body: null
    view:
      description: Operation is successful
      content:
        image/jpeg:
          schema:
            type: string
            format: binary
    update:
      description: Operation is successful.
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/commentView'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The comment was successfully updated.
                  url: /comments/41aca4aa-430c-4b60-a1f1-c0de1b52a1ce.json
                  code: 200
                body:
                  id: 41aca4aa-430c-4b60-a1f1-c0de1b52a1ce
                  parent_id: null
                  foreign_key: 42968631-0c51-4405-9f2d-c6700c5057be
                  foreign_model: Resource
                  content: no comment
                  created: '2024-09-05T14:15:47+00:00'
                  modified: '2024-09-05T14:43:22+00:00'
                  created_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                  modified_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                  user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
    index:
      description: Operation is successful.
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                type: array
                items:
                  $ref: '#/components/schemas/commentView'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /comments/resource/42968631-0c51-4405-9f2d-c6700c5057be.json
                  code: 200
                body:
                  - id: 41aca4aa-430c-4b60-a1f1-c0de1b52a1ce
                    parent_id: null
                    foreign_key: 42968631-0c51-4405-9f2d-c6700c5057be
                    foreign_model: Resource
                    content: no comment
                    created: '2024-09-05T14:15:47+00:00'
                    modified: '2024-09-05T14:43:22+00:00'
                    created_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    modified_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    children: []
    add:
      description: Operation is successful.
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/commentView'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The comment was successfully added.
                  url: /comments/resource/42968631-0c51-4405-9f2d-c6700c5057be.json
                  code: 200
                body:
                  id: 41aca4aa-430c-4b60-a1f1-c0de1b52a1ce
                  parent_id: null
                  foreign_key: 42968631-0c51-4405-9f2d-c6700c5057be
                  foreign_model: Resource
                  content: no comment
                  created: '2024-09-05T14:15:47+00:00'
                  modified: '2024-09-05T14:43:22+00:00'
                  created_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                  modified_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                  user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
    favorites_add:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/favorite'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The resource was marked as favorite.
                  url: >-
                    /favorites/resource/42968631-0c51-4405-9f2d-c6700c5057be.json
                  code: 200
                body:
                  id: 90a25878-a6c1-43c1-a983-68d27f2f0be8
                  user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                  foreign_key: 42968631-0c51-4405-9f2d-c6700c5057be
                  foreign_model: Resource
                  created: '2024-08-07T13:39:29+00:00'
                  modified: '2024-08-07T13:39:29+00:00'
    folders_index:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/headerWithPagination'
              body:
                type: array
                items:
                  $ref: '#/components/schemas/folderIndexAndView'
          examples:
            index:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /folders.json
                  code: 200
                  pagination:
                    count: 2
                    page: 1
                    limit: null
                body:
                  - id: 162e4717-59a2-439b-86c6-fc651e989939
                    name: Bob
                    created: '2024-07-08T10:13:20+00:00'
                    modified: '2024-07-08T10:13:20+00:00'
                    created_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    modified_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    folder_parent_id: null
                    personal: true
                  - id: b2a72cb2-508c-43ad-b96f-697f7ad21635
                    name: Dylan
                    created: '2024-07-26T08:10:49+00:00'
                    modified: '2024-07-26T08:10:49+00:00'
                    created_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    modified_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    folder_parent_id: 162e4717-59a2-439b-86c6-fc651e989939
                    personal: true
    folders_add:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/folderIndexAndView'
          examples:
            index: &ref_0
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /folders/162e4717-59a2-439b-86c6-fc651e989939.json
                  code: 200
                body:
                  id: 162e4717-59a2-439b-86c6-fc651e989939
                  name: Bob
                  created: '2024-07-08T10:13:20+00:00'
                  modified: '2024-07-08T10:13:20+00:00'
                  created_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                  modified_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                  folder_parent_id: null
                  personal: true
    folders_view:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/folderIndexAndView'
          examples:
            index: *ref_0
    folders_update:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/folderIndexAndView'
          examples:
            index: *ref_0
    gpgkeys_index:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/headerWithPagination'
              body:
                type: array
                items:
                  $ref: '#/components/schemas/gpgkey'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /gpgkeys.json
                  code: 200
                  pagination:
                    count: 1
                    page: 1
                    limit: null
                body:
                  - id: ed4d9ea6-f354-4a74-ad09-4e1dd69041ec
                    user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    armored_key: '-----BEGIN PGP PUBLIC KEY BLOCK-----'
                    bits: 3072
                    uid: Ada Lovelace <ada@passbolt.com>
                    key_id: D277E7A2E45418A0
                    fingerprint: 850C6BDE59E9F126BFB4683BD277E7A2E45418A0
                    type: RSA
                    expires: null
                    key_created: '2024-07-03T12:53:13+00:00'
                    deleted: false
                    created: '2024-07-03T12:53:52+00:00'
                    modified: '2024-07-03T12:53:52+00:00'
    gpgkeys_view:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/gpgkey'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /gpgkeys/ed4d9ea6-f354-4a74-ad09-4e1dd69041ec.json
                  code: 200
                body:
                  id: ed4d9ea6-f354-4a74-ad09-4e1dd69041ec
                  user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                  armored_key: '-----BEGIN PGP PUBLIC KEY BLOCK-----'
                  bits: 3072
                  uid: Ada Lovelace <ada@passbolt.com>
                  key_id: D277E7A2E45418A0
                  fingerprint: 850C6BDE59E9F126BFB4683BD277E7A2E45418A0
                  type: RSA
                  expires: null
                  key_created: '2024-07-03T12:53:13+00:00'
                  deleted: false
                  created: '2024-07-03T12:53:52+00:00'
                  modified: '2024-07-03T12:53:52+00:00'
    groups_index:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                type: array
                items:
                  $ref: '#/components/schemas/groupIndexAndView'
          examples:
            base:
              summary: Base without any extra data
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /groups.json
                  code: 200
                body:
                  - id: 8a3c5c4e-e931-4e6b-854a-9b2e9afcd3bc
                    name: Groupe B
                    deleted: true
                    created: '2024-07-08T10:13:20+00:00'
                    modified: '2024-07-08T10:13:20+00:00'
                    created_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    modified_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
            withGroupsUsersProfiles:
              summary: Groups index with users profile
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /groups.json
                  code: 200
                body:
                  - id: 8a3c5c4e-e931-4e6b-854a-9b2e9afcd3bc
                    name: Groupe B
                    deleted: true
                    created: '2024-07-08T10:13:20+00:00'
                    modified: '2024-07-08T10:13:20+00:00'
                    created_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    modified_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    groups_users:
                      - id: 3b9b9757-1ccb-444a-a3cf-4090364fac4f
                        group_id: 8a3c5c4e-e931-4e6b-854a-9b2e9afcd3bc
                        user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                        is_admin: true
                        created: '2024-07-22T16:01:07+00:00'
                        user:
                          id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                          role_id: 639b50cf-66f9-4b23-8d55-d0609710cd9d
                          username: ada@passbolt.com
                          active: true
                          deleted: false
                          created: '2024-07-03T12:52:06+00:00'
                          modified: '2024-07-03T12:52:06+00:00'
                          disabled: null
                          profile:
                            id: 920edf1e-5ce8-4da4-a8fc-21040fe78d09
                            user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                            first_name: Ada
                            last_name: Lovelace
                            created: '2024-07-03T12:52:06+00:00'
                            modified: '2024-07-03T12:52:06+00:00'
                          last_logged_in: null
    addAndUpdate:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/groupIndexAndView'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /groups.json
                  code: 200
                body:
                  id: 8a3c5c4e-e931-4e6b-854a-9b2e9afcd3bc
                  name: Groupe B
                  deleted: false
                  created: '2024-07-08T10:13:20+00:00'
                  modified: '2024-07-08T10:13:20+00:00'
                  created_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                  modified_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                  groups_users:
                    - id: 3b9b9757-1ccb-444a-a3cf-4090364fac4f
                      group_id: 8a3c5c4e-e931-4e6b-854a-9b2e9afcd3bc
                      user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                      is_admin: true
                      created: '2024-07-22T16:01:07+00:00'
    groups_view:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/groupIndexAndView'
          examples:
            base:
              summary: Base without any extra data
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /groups.json
                  code: 200
                body:
                  id: 8a3c5c4e-e931-4e6b-854a-9b2e9afcd3bc
                  name: Groupe B
                  deleted: true
                  created: '2024-07-08T10:13:20+00:00'
                  modified: '2024-07-08T10:13:20+00:00'
                  created_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                  modified_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
            withGroupsUsersProfiles:
              summary: Groups index with users profile
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /groups.json
                  code: 200
                body:
                  id: 8a3c5c4e-e931-4e6b-854a-9b2e9afcd3bc
                  name: Groupe B
                  deleted: true
                  created: '2024-07-08T10:13:20+00:00'
                  modified: '2024-07-08T10:13:20+00:00'
                  created_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                  modified_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                  groups_users:
                    - id: 3b9b9757-1ccb-444a-a3cf-4090364fac4f
                      group_id: 8a3c5c4e-e931-4e6b-854a-9b2e9afcd3bc
                      user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                      is_admin: true
                      created: '2024-07-22T16:01:07+00:00'
                      user:
                        id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                        role_id: 639b50cf-66f9-4b23-8d55-d0609710cd9d
                        username: ada@passbolt.com
                        active: true
                        deleted: false
                        created: '2024-07-03T12:52:06+00:00'
                        modified: '2024-07-03T12:52:06+00:00'
                        disabled: null
                        profile:
                          id: 920edf1e-5ce8-4da4-a8fc-21040fe78d09
                          user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                          first_name: Ada
                          last_name: Lovelace
                          created: '2024-07-03T12:52:06+00:00'
                          modified: '2024-07-03T12:52:06+00:00'
                        last_logged_in: null
    updateDryRunSuccess:
      description: Operation is successful.
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/groupUpdateDryRun'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /groups/8a3c5c4e-e931-4e6b-854a-9b2e9afcd3bc/dry-run.json
                  code: 200
                body:
                  dry-run:
                    SecretsNeeded: []
                    Secrets: []
    updateDryRunError:
      description: The dry-run failed.
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/groupUpdateDryRun'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /groups/8a3c5c4e-e931-4e6b-854a-9b2e9afcd3bc/dry-run.json
                  code: 200
                body:
                  dry-run:
                    SecretsNeeded:
                      - Secret:
                          resource_id: a736a8aa-7cfe-4466-8294-d130ee23ef88
                          user_id: 8c640fd5-268c-4ae0-9e35-2f120cf1a831
                    Secrets:
                      - Secret:
                          resource_id: a736a8aa-7cfe-4466-8294-d130ee23ef88
                          data: '-----BEGIN PGP MESSAGE-----'
    emptyArrayBody:
      description: Operation is successful.
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                type: array
                items:
                  type: object
          examples:
            base:
              value:
                header:
                  id: f7be85c0-afb1-4d8e-a9e1-e05abb0bb71a
                  status: success
                  servertime: 1721727753
                  action: e2aa01a9-84ec-55f8-aaed-24ee23259339
                  message: <SUCCESS MESSAGE>
                  url: <API ENDPOINT URL>
                  code: 200
                body: []
    deleteDryRun:
      description: The dry-run failed.
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/groupDeleteDryRunError'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: error
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: >-
                    The group cannot be deleted. The group should not be sole
                    owner of shared content, transfer the ownership to other
                    users.
                  url: /groups/8a3c5c4e-e931-4e6b-854a-9b2e9afcd3bc/dry-run.json
                  code: 400
                body:
                  errors:
                    resources:
                      sole_owner:
                        - id: a736a8aa-7cfe-4466-8294-d130ee23ef88
                          name: NextCloud
                          username: ada@passbolt.com
                          uri: https://nextcloud.com
                          description: null
                          deleted: false
                          created: '2024-07-08T08:07:36+00:00'
                          modified: '2024-07-08T08:07:36+00:00'
                          created_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                          modified_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                          resource_type_id: a28a04cd-6f53-518a-967c-9963bf9cec51
                          expired: null
                          permissiions:
                            - id: 836b7e69-578a-4bd6-aee5-ee23b5753f52
                              aco: Resource
                              aco_foreign_key: a736a8aa-7cfe-4466-8294-d130ee23ef88
                              aro: Group
                              aro_foreign_key: 8a3c5c4e-e931-4e6b-854a-9b2e9afcd3bc
                              type: 15
                              created: '2024-07-22T16:01:25+00:00'
                              modified: '2024-07-31T12:59:28+00:00'
                              group:
                                id: 8a3c5c4e-e931-4e6b-854a-9b2e9afcd3bc
                                name: WRC
                                deleted: false
                                created: '2024-07-22T16:01:07+00:00'
                                modified: '2024-07-22T16:01:07+00:00'
                                created_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                                modified_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                              user: null
    healthcheck:
      description: Operation is successful.
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/healthcheck'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /healthcheck.json
                  code: 200
                body:
                  environment:
                    gnupg: true
                    info:
                      phpVersion: 8.2.20
                    phpVersion: true
                    nextMinPhpVersion: true
                    pcre: true
                    mbstring: true
                    intl: true
                    image: true
                    tmpWritable: true
                    logWritable: true
                  configFile:
                    app: true
                    passbolt: false
                  core:
                    cache: true
                    debugDisabled: false
                    salt: true
                    info:
                      fullBaseUrl: https://passbolt.localhost
                    fullBaseUrl: true
                    validFullBaseUrl: true
                    fullBaseUrlReachable: true
                  ssl:
                    info: >-
                      cURL Error (60) SSL certificate problem: self-signed
                      certificate
                    peerValid: false
                    hostValid: false
                    notSelfSigned: false
                  smtpSettings:
                    isEnabled: true
                    errorMessage: false
                    source: env variables
                    isInDb: false
                    areEndpointsDisabled: false
                    customSslOptions: true
                  gpg:
                    lib: true
                    gpgHome: true
                    gpgHomeWritable: true
                    gpgKeyNotDefault: true
                    gpgKeyPublicBlock: true
                    gpgKeyPrivateBlock: true
                    gpgKeyPublicReadable: true
                    gpgKeyPrivateReadable: true
                    gpgKeyPrivateFingerprint: true
                    gpgKeyPublic: true
                    gpgKeyPrivate: true
                    gpgKey: true
                    info:
                      gpgKeyPrivate: /etc/passbolt/gpg/serverkey_private.asc
                      gpgHome: /var/lib/passbolt/.gnupg
                    gpgKeyPublicFingerprint: true
                    gpgKeyPublicInKeyring: true
                    gpgKeyPublicEmail: true
                    canEncrypt: true
                    canSign: true
                    canEncryptSign: true
                    canDecrypt: true
                    canDecryptVerify: true
                    canVerify: true
                    isPublicServerKeyGopengpgCompatible: true
                    isPrivateServerKeyGopengpgCompatible: true
                  applications:
                    configPath: /etc/passbolt/passbolt.php
                    info:
                      remoteVersion: 4.9.1
                      currentVersion: 4.9.0
                    latestVersion: false
                    sslForce: false
                    sslFullBaseUrl: true
                    seleniumDisabled: true
                    robotsIndexDisabled: true
                    registrationClosed:
                      isSelfRegistrationPluginEnabled: true
                      selfRegistrationProvider: null
                      isRegistrationPublicRemovedFromPassbolt: true
                    hostAvailabilityCheckEnabled: false
                    jsProd: true
                    emailNotificationEnabled: false
                    schema: true
                  database:
                    supportedBackend: true
                    connect: true
                    info:
                      tablesCount: 31
                    tablesCount: true
                    defaultContent: true
    status:
      description: Operation is successful.
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                type: string
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: OK
                  url: /healthcheck/status.json
                  code: 200
                body: OK
    invalidOtp:
      description: Invalid OTP code.
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/invalidOtp'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: error
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: Something went wrong when validating the one-time password.
                  url: /mfa/verify/totp.json
                  code: 400
                body:
                  totp:
                    isValidOtp: This OTP is not valid.
    error:
      description: MFA is required.
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/error'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: error
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: MFA authentication is required.
                  url: /mfa/verify/error.json
                  code: 403
                body:
                  mfa_providers:
                    - totp
    permissions_index:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/permissionIndexAndView'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: >-
                    /permissions/resource/42968631-0c51-4405-9f2d-c6700c5057be.json
                  code: 200
                body:
                  - id: c4cc131e-b204-41e3-8e17-0f62be7d1d80
                    aco: Resource
                    aco_foreign_key: 42968631-0c51-4405-9f2d-c6700c5057be
                    aro: User
                    aro_foreign_key: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    type: 15
                    created: '2024-07-30T08:48:28+00:00'
                    modified: '2024-07-30T08:48:28+00:00'
                  - id: 4d664f1b-905e-4de4-ad2a-a7dce650565c
                    aco: Resource
                    aco_foreign_key: 42968631-0c51-4405-9f2d-c6700c5057be
                    aro: User
                    aro_foreign_key: c48863da-32d3-48cd-9d47-de2891386423
                    type: 1
                    created: '2024-08-08T15:38:26+00:00'
                    modified: '2024-08-08T15:38:26+00:00'
    resources_index:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/headerWithPagination'
              body:
                type: array
                items:
                  $ref: '#/components/schemas/resourceIndexAndView'
          examples:
            resourcesWithoutSecret:
              summary: Resources without any extra data
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /resources.json
                  code: 200
                  pagination:
                    count: 2
                    page: 1
                    limit: null
                body:
                  - id: ae60d89c-f13b-4fb1-b2dc-c8dc806cac88
                    name: Hello World
                    username: ada@passbolt.com
                    uri: https://example.com
                    description: null
                    deleted: false
                    created: '2024-07-08T08:06:25+00:00'
                    modified: '2024-07-08T08:06:25+00:00'
                    created_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    modified_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    resource_type_id: a28a04cd-6f53-518a-967c-9963bf9cec51
                    expired: null
                    folder_parent_id: null
                    personal: true
                  - id: ae60d89c-f13b-4fb1-b2dc-c8dc806cac88
                    name: Hello World
                    username: ada@passbolt.com
                    uri: https://example.com
                    description: null
                    deleted: false
                    created: '2024-07-08T08:06:25+00:00'
                    modified: '2024-07-08T08:06:25+00:00'
                    created_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    modified_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    resource_type_id: a28a04cd-6f53-518a-967c-9963bf9cec51
                    expired: null
                    folder_parent_id: null
                    personal: true
            resourcesWithSecret:
              summary: Resources with secrets included
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /resources.json
                  code: 200
                  pagination:
                    count: 2
                    page: 1
                    limit: null
                body:
                  - id: ae60d89c-f13b-4fb1-b2dc-c8dc806cac88
                    name: Hello World
                    username: ada@passbolt.com
                    uri: https://example.com
                    description: null
                    deleted: false
                    created: '2024-07-08T08:06:25+00:00'
                    modified: '2024-07-08T08:06:25+00:00'
                    created_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    modified_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    resource_type_id: a28a04cd-6f53-518a-967c-9963bf9cec51
                    expired: null
                    folder_parent_id: null
                    personal: true
                    secrets:
                      - id: c9e3b8e0-5ea9-4f40-a5e9-e3e4d2002be2
                        user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                        resource_id: ae60d89c-f13b-4fb1-b2dc-c8dc806cac88
                        data: '-----BEGIN PGP MESSAGE-----'
                        created: '2024-07-08T08:06:25+00:00'
                        modified: '2024-07-08T08:06:25+00:00'
                  - id: ae60d89c-f13b-4fb1-b2dc-c8dc806cac88
                    name: Hello World
                    username: ada@passbolt.com
                    uri: https://example.com
                    description: null
                    deleted: false
                    created: '2024-07-08T08:06:25+00:00'
                    modified: '2024-07-08T08:06:25+00:00'
                    created_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    modified_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    resource_type_id: a28a04cd-6f53-518a-967c-9963bf9cec51
                    expired: null
                    folder_parent_id: null
                    personal: true
                    secrets:
                      - id: c9e3b8e0-5ea9-4f40-a5e9-e3e4d2002be2
                        user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                        resource_id: ae60d89c-f13b-4fb1-b2dc-c8dc806cac88
                        data: '-----BEGIN PGP MESSAGE-----'
                        created: '2024-07-08T08:06:25+00:00'
                        modified: '2024-07-08T08:06:25+00:00'
    resources_addAndUpdate:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/resourceIndexAndView'
          examples:
            base:
              value:
                id: ae60d89c-f13b-4fb1-b2dc-c8dc806cac88
                name: NextCloud
                username: ada@passbolt.com
                uri: https://nextcloud.com/
                description: null
                deleted: false
                created: '2024-07-08T08:06:25+00:00'
                modified: '2024-07-08T08:06:25+00:00'
                created_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                modified_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                resource_type_id: a28a04cd-6f53-518a-967c-9963bf9cec51
                expired: null
                personal: true
                folder_parent_id: null
                modifier:
                  id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                  role_id: 639b50cf-66f9-4b23-8d55-d0609710cd9d
                  username: louis@passbolt.com
                  active: true
                  deleted: false
                  created: '2024-07-03T12:52:06+00:00'
                  modified: '2024-07-03T12:52:06+00:00'
                  disabled: null
                  last_logged_in: null
                creator:
                  id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                  role_id: 639b50cf-66f9-4b23-8d55-d0609710cd9d
                  username: louis@passbolt.com
                  active: true
                  deleted: false
                  created: '2024-07-03T12:52:06+00:00'
                  modified: '2024-07-03T12:52:06+00:00'
                  disabled: null
                  last_logged_in: null
                secrets:
                  - id: c9e3b8e0-5ea9-4f40-a5e9-e3e4d2002be2
                    user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    resource_id: ae60d89c-f13b-4fb1-b2dc-c8dc806cac88
                    data: '-----BEGIN PGP MESSAGE-----'
                    created: '2024-07-08T08:06:25+00:00'
                    modified: '2024-07-08T08:06:25+00:00'
                permission:
                  id: 799236fb-6a62-4527-b24e-545a344568c2
                  aco: Resource
                  aco_foreign_key: 43051c9f-7122-4887-81e8-3b390cf0f04a
                  aro: User
                  aro_foreign_key: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                  type: 15
                  created: '2024-07-23T09:55:39+00:00'
                  modified: '2024-07-23T09:55:39+00:00'
    resources_view:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/resourceIndexAndView'
          examples:
            resourceWithoutSecret:
              summary: Resource without any extra data
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /resources/ae60d89c-f13b-4fb1-b2dc-c8dc806cac88.json
                  code: 200
                body:
                  id: ae60d89c-f13b-4fb1-b2dc-c8dc806cac88
                  name: Hello World
                  username: ada@passbolt.com
                  uri: https://example.com
                  description: null
                  deleted: false
                  created: '2024-07-08T08:06:25+00:00'
                  modified: '2024-07-08T08:06:25+00:00'
                  created_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                  modified_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                  resource_type_id: a28a04cd-6f53-518a-967c-9963bf9cec51
                  expired: null
                  folder_parent_id: null
                  personal: true
            resourcesWithSecret:
              summary: Resource with secrets included
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /resources/ae60d89c-f13b-4fb1-b2dc-c8dc806cac88.json
                  code: 200
                body:
                  id: ae60d89c-f13b-4fb1-b2dc-c8dc806cac88
                  name: Hello World
                  username: ada@passbolt.com
                  uri: https://example.com
                  description: null
                  deleted: false
                  created: '2024-07-08T08:06:25+00:00'
                  modified: '2024-07-08T08:06:25+00:00'
                  created_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                  modified_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                  resource_type_id: a28a04cd-6f53-518a-967c-9963bf9cec51
                  expired: null
                  folder_parent_id: null
                  personal: true
                  secrets:
                    - id: c9e3b8e0-5ea9-4f40-a5e9-e3e4d2002be2
                      user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                      resource_id: ae60d89c-f13b-4fb1-b2dc-c8dc806cac88
                      data: '-----BEGIN PGP MESSAGE-----'
                      created: '2024-07-08T08:06:25+00:00'
                      modified: '2024-07-08T08:06:25+00:00'
    resourceTypes_index:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                type: array
                items:
                  $ref: '#/components/schemas/resourceType'
          examples:
            resourceTypes:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /resource-types.json
                  code: 200
                body:
                  - id: 669f8c64-242a-59fb-92fc-81f660975fd3
                    slug: password-and-description
                    name: Password with description
                    description: >-
                      A resource with the password and the description
                      encrypted.
                    definition:
                      resource:
                        type: object
                        required:
                          - name
                        properties:
                          name:
                            type: string
                            maxLength: 255
                          username:
                            anyOf:
                              - type: string
                                maxLength: 255
                              - type: 'null'
                          uri:
                            anyOf:
                              - type: string
                                maxLength: 1024
                              - type: 'null'
                      secret:
                        type: object
                        required:
                          - password
                        properties:
                          password:
                            type: string
                            maxLength: 4096
                          description:
                            anyOf:
                              - type: string
                                maxLength: 10000
                              - type: null
                    created: '2024-07-08T08:06:25+00:00'
                    modified: '2024-07-08T08:06:25+00:00'
    resourceTypes_view:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/resourceType'
          examples:
            resourceType:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /resource-types/669f8c64-242a-59fb-92fc-81f660975fd3.json
                  code: 200
                body:
                  id: 669f8c64-242a-59fb-92fc-81f660975fd3
                  slug: password-and-description
                  name: Password with description
                  description: A resource with the password and the description encrypted.
                  definition:
                    resource:
                      type: object
                      required:
                        - name
                      properties:
                        name:
                          type: string
                          maxLength: 255
                        username:
                          anyOf:
                            - type: string
                              maxLength: 255
                            - type: 'null'
                        uri:
                          anyOf:
                            - type: string
                              maxLength: 1024
                            - type: 'null'
                    secret:
                      type: object
                      required:
                        - password
                      properties:
                        password:
                          type: string
                          maxLength: 4096
                        description:
                          anyOf:
                            - type: string
                              maxLength: 10000
                            - type: null
                  created: '2024-07-08T08:06:25+00:00'
                  modified: '2024-07-08T08:06:25+00:00'
    roles_index:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                type: array
                items:
                  $ref: '#/components/schemas/role'
          examples:
            index:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /roles.json
                  code: 200
                body:
                  - id: 639b50cf-66f9-4b23-8d55-d0609710cd9d
                    name: admin
                    description: Organization administrator
                    created: '2012-07-04T13:39:25+00:00'
                    modified: '2012-07-04T13:39:25+00:00'
                  - id: 50307b17-a097-483b-b388-4bf262348180
                    name: guest
                    description: Non logged in user
                    created: '2012-07-04T13:39:25+00:00'
                    modified: '2012-07-04T13:39:25+00:00'
                  - id: c2f96fb1-611d-466d-80fb-e82beba5ed87
                    name: user
                    description: Logged in user
                    created: '2012-07-04T13:39:25+00:00'
                    modified: '2012-07-04T13:39:25+00:00'
    secrets_view:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/secretIndex'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /secrets/resource/ae60d89c-f13b-4fb1-b2dc-c8dc806cac88.json
                  code: 200
                  pagination:
                    count: 2
                    page: 1
                    limit: null
                body:
                  id: c9e3b8e0-5ea9-4f40-a5e9-e3e4d2002be2
                  user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                  resource_id: ae60d89c-f13b-4fb1-b2dc-c8dc806cac88
                  data: '-----BEGIN PGP MESSAGE-----'
                  created: '2024-07-08T08:06:25+00:00'
                  modified: '2024-07-08T08:06:25+00:00'
    updateError:
      description: Bad request
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/shareUpdateError'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: Could not validate resource data.
                  url: /share/resource/42968631-0c51-4405-9f2d-c6700c5057be.json
                  code: 200
                body:
                  permissions:
                    aco_foreign_key:
                      permission_unique: >-
                        A permission already exists for the given access control
                        object and access request object.
    arosIndex:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                type: array
                items:
                  $ref: '#/components/schemas/shareAros'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /share/search-aros.json
                  code: 200
                body:
                  - id: c48863da-32d3-48cd-9d47-de2891386423
                    role_id: c2f96fb1-611d-466d-80fb-e82beba5ed87
                    username: ada@passbolt.com
                    active: true
                    deleted: false
                    created: '2024-08-08T12:08:58+00:00'
                    modified: '2024-08-08T12:14:38+00:00'
                    disabled: null
                    groups_users:
                      - id: 95accfa0-5c2c-47af-ba63-dd9efb46f99b
                        group_id: 8fa37ef6-f167-4342-8e1c-3488439cf7d1
                        user_id: c48863da-32d3-48cd-9d47-de2891386423
                        is_admin: false
                        created: '2024-08-08T12:25:40+00:00'
                    profile:
                      id: 4d9e9297-b1ec-4aa1-af1c-c6693c3ffe36
                      user_id: c48863da-32d3-48cd-9d47-de2891386423
                      first_name: Ada
                      last_name: Lovelace
                      created: '2024-08-08T12:08:58+00:00'
                      modified: '2024-08-08T12:08:58+00:00'
                      avatar:
                        url:
                          medium: https://passbolt.local/img/avatar/user_medium.png
                          small: https://passbolt.local/img/avatar/user.png
                    gpgkey:
                      id: 6f0f6eb6-ed74-4cb0-8872-3e96ee17b6f9
                      user_id: c48863da-32d3-48cd-9d47-de2891386423
                      armored_key: '-----BEGIN PGP PUBLIC KEY BLOCK-----'
                      bits: 3072
                      uid: Ada Lovelace <ada@passbolt.com>
                      key_id: 08EF12596BC6B07B
                      fingerprint: C4D0E64738F9956CDACC6D4808EF12596BC6B07B
                      type: RSA
                      expires: null
                      key_created: '2024-08-08T12:13:42+00:00'
                      deleted: false
                      created: '2024-08-08T12:14:38+00:00'
                      modified: '2024-08-08T12:14:38+00:00'
                    role:
                      id: c2f96fb1-611d-466d-80fb-e82beba5ed87
                      name: user
                      description: Logged in user
                      created: '2012-07-04T13:39:25+00:00'
                      modified: '2012-07-04T13:39:25+00:00'
                    last_logged_in: null
                  - user_count: 1
                    id: 8fa37ef6-f167-4342-8e1c-3488439cf7d1
                    name: Groupe B
                    deleted: false
                    created: '2024-07-22T16:01:07+00:00'
                    modified: '2024-07-22T16:01:07+00:00'
                    created_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    modified_by: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
    updateDryRun:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/shareUpdateDryRun'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: >-
                    /share/simulate/resource/42968631-0c51-4405-9f2d-c6700c5057be.json
                  code: 200
                body:
                  changes:
                    added: []
                    removed:
                      - User:
                          id: c48863da-32d3-48cd-9d47-de2891386423
    users_index:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/headerWithPagination'
              body:
                type: array
                items:
                  $ref: '#/components/schemas/userIndexAndView'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /users.json
                  code: 200
                  pagination:
                    count: 1
                    page: 1
                    limit: null
                body:
                  - id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    role_id: 639b50cf-66f9-4b23-8d55-d0609710cd9d
                    active: true
                    deleted: false
                    created: '2024-07-03T12:52:06+00:00'
                    modified: '2024-07-03T12:53:52+00:00'
                    disabled: null
                    groups_users:
                      - id: 3b9b9757-1ccb-444a-a3cf-4090364fac4f
                        group_id: 8a3c5c4e-e931-4e6b-854a-9b2e9afcd3bc
                        user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                        is_admin: true
                        created: '2024-07-22T16:01:07+00:00'
                    profile:
                      id: 920edf1e-5ce8-4da4-a8fc-21040fe78d09
                      user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                      first_name: Ada
                      last_name: Lovelace
                      created: '2024-07-03T12:52:06+00:00'
                      modified: '2024-07-03T12:52:06+00:00'
                      avatar:
                        url:
                          medium: https://passbolt.local/img/avatar/user_medium.png
                          small: https://passbolt.local/img/avatar/use.png
                    gpgkey:
                      id: ed4d9ea6-f354-4a74-ad09-4e1dd69041ec
                      user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                      armored_key: '-----BEGIN PGP PUBLIC KEY BLOCK-----'
                      bits: 3072
                      uid: Ada Lovelace <ada@passbolt.com>
                      key_id: D277E7A2E45418A0
                      fingerprint: 850C6BDE59E9F126BFB4683BD277E7A2E45418A0
                      type: RSA
                      expires: null
                      key_created: '2024-07-03T12:53:13+00:00'
                      deleted: false
                      created: '2024-07-03T12:53:52+00:00'
                      modified: '2024-07-03T12:53:52+00:00'
                    role:
                      id: 639b50cf-66f9-4b23-8d55-d0609710cd9d
                      name: admin
                      description: Organization administrator
                      created: '2012-07-04T13:39:25+00:00'
                      modified: '2012-07-04T13:39:25+00:00'
                    last_logged_in: null
    users_add:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                type: array
                items:
                  $ref: '#/components/schemas/userIndexAndView'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: >-
                    The user was successfully added. This user now need to
                    complete the setup.
                  url: /users.json
                  code: 200
                body:
                  id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                  role_id: 639b50cf-66f9-4b23-8d55-d0609710cd9d
                  active: false
                  deleted: false
                  created: '2024-07-03T12:52:06+00:00'
                  modified: '2024-07-03T12:53:52+00:00'
                  disabled: null
                  groups_users: []
                  profile:
                    id: 920edf1e-5ce8-4da4-a8fc-21040fe78d09
                    user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    first_name: Ada
                    last_name: Lovelace
                    created: '2024-07-03T12:52:06+00:00'
                    modified: '2024-07-03T12:52:06+00:00'
                    avatar:
                      url:
                        medium: https://passbolt.local/img/avatar/user_medium.png
                        small: https://passbolt.local/img/avatar/use.png
                  gpgkey: null
                  role:
                    id: c2f96fb1-611d-466d-80fb-e82beba5ed87
                    name: user
                    description: Logged in user
                    created: '2012-07-04T13:39:25+00:00'
                    modified: '2012-07-04T13:39:25+00:00'
                  last_logged_in: null
    users_view:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                type: array
                items:
                  $ref: '#/components/schemas/userIndexAndView'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The operation was successful.
                  url: /users/8bb80df5-700c-48ce-b568-85a60fc3c8f2.json
                  code: 200
                body:
                  is_mfa_enabled: false
                  id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                  role_id: 639b50cf-66f9-4b23-8d55-d0609710cd9d
                  active: true
                  deleted: false
                  created: '2024-07-03T12:52:06+00:00'
                  modified: '2024-07-03T12:53:52+00:00'
                  disabled: null
                  groups_users:
                    - id: 3b9b9757-1ccb-444a-a3cf-4090364fac4f
                      group_id: 8a3c5c4e-e931-4e6b-854a-9b2e9afcd3bc
                      user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                      is_admin: true
                      created: '2024-07-22T16:01:07+00:00'
                  profile:
                    id: 920edf1e-5ce8-4da4-a8fc-21040fe78d09
                    user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    first_name: Ada
                    last_name: Lovelace
                    created: '2024-07-03T12:52:06+00:00'
                    modified: '2024-07-03T12:52:06+00:00'
                    avatar:
                      url:
                        medium: https://passbolt.local/img/avatar/user_medium.png
                        small: https://passbolt.local/img/avatar/use.png
                  gpgkey:
                    id: ed4d9ea6-f354-4a74-ad09-4e1dd69041ec
                    user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    armored_key: '-----BEGIN PGP PUBLIC KEY BLOCK-----'
                    bits: 3072
                    uid: Ada Lovelace <ada@passbolt.com>
                    key_id: D277E7A2E45418A0
                    fingerprint: 850C6BDE59E9F126BFB4683BD277E7A2E45418A0
                    type: RSA
                    expires: null
                    key_created: '2024-07-03T12:53:13+00:00'
                    deleted: false
                    created: '2024-07-03T12:53:52+00:00'
                    modified: '2024-07-03T12:53:52+00:00'
                  role:
                    id: 639b50cf-66f9-4b23-8d55-d0609710cd9d
                    name: admin
                    description: Organization administrator
                    created: '2012-07-04T13:39:25+00:00'
                    modified: '2012-07-04T13:39:25+00:00'
                  last_logged_in: null
    users_update:
      description: Operation is successful
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                type: array
                items:
                  $ref: '#/components/schemas/userIndexAndView'
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: success
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: The user has been updated successfully.
                  url: /users/8bb80df5-700c-48ce-b568-85a60fc3c8f2.json
                  code: 200
                body:
                  id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                  role_id: 639b50cf-66f9-4b23-8d55-d0609710cd9d
                  active: true
                  deleted: false
                  created: '2024-07-03T12:52:06+00:00'
                  modified: '2024-07-03T12:53:52+00:00'
                  disabled: null
                  groups_users:
                    - id: 3b9b9757-1ccb-444a-a3cf-4090364fac4f
                      group_id: 8a3c5c4e-e931-4e6b-854a-9b2e9afcd3bc
                      user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                      is_admin: true
                      created: '2024-07-22T16:01:07+00:00'
                  profile:
                    id: 920edf1e-5ce8-4da4-a8fc-21040fe78d09
                    user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    first_name: Freddy
                    last_name: Mercury
                    created: '2024-07-03T12:52:06+00:00'
                    modified: '2024-07-03T12:52:06+00:00'
                    avatar:
                      url:
                        medium: https://passbolt.local/img/avatar/user_medium.png
                        small: https://passbolt.local/img/avatar/use.png
                  gpgkey:
                    id: ed4d9ea6-f354-4a74-ad09-4e1dd69041ec
                    user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    armored_key: '-----BEGIN PGP PUBLIC KEY BLOCK-----'
                    bits: 3072
                    uid: Ada Lovelace <ada@passbolt.com>
                    key_id: D277E7A2E45418A0
                    fingerprint: 850C6BDE59E9F126BFB4683BD277E7A2E45418A0
                    type: RSA
                    expires: null
                    key_created: '2024-07-03T12:53:13+00:00'
                    deleted: false
                    created: '2024-07-03T12:53:52+00:00'
                    modified: '2024-07-03T12:53:52+00:00'
                  role:
                    id: 639b50cf-66f9-4b23-8d55-d0609710cd9d
                    name: admin
                    description: Organization administrator
                    created: '2012-07-04T13:39:25+00:00'
                    modified: '2012-07-04T13:39:25+00:00'
                  last_logged_in: null
    users_deleteDryRun:
      description: The dry-run failed.
      content:
        application/json:
          schema:
            type: object
            required:
              - header
              - body
            properties:
              header:
                $ref: '#/components/schemas/header'
              body:
                $ref: '#/components/schemas/userDeleteDryRun'
                description: >-
                  Could also be a `string` if the issue is not related to
                  resources or groups.
          examples:
            base:
              value:
                header:
                  id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
                  status: error
                  servertime: 1721207029
                  action: 4d0c0996-ce30-4bce-9918-9062ab35c542
                  message: >-
                    The user cannot be deleted. You need to transfer the user
                    group manager role to other users before deleting this
                    user.You need to transfer the ownership for the shared
                    passwords owned by this user before deleting this user.
                  url: /users/f848277c-5398-58f8-a82a-72397af2d450.json
                  code: 200
                body:
                  errors:
                    groups:
                      sole_manager:
                        id: 73479f22-b387-4d4e-b625-b1cc0b7ed116
                        name: New Group
                        deleted: false
                        created: '2019-04-08T12:10:03+00:00'
                        modified: '2019-04-08T12:10:03+00:00'
                        created_by: d57c10f5-639d-5160-9c81-8a0c6c4ec856
                        modified_by: d57c10f5-639d-5160-9c81-8a0c6c4ec856
                        groups_users:
                          - id: 6809e727-1219-4cfa-a201-1d3e997ca351
                            group_id: 73479f22-b387-4d4e-b625-b1cc0b7ed116
                            user_id: f848277c-5398-58f8-a82a-72397af2d450
                            is_admin: true
                            created: '2019-04-08T12:10:03+00:00'
                            user:
                              id: f848277c-5398-58f8-a82a-72397af2d450
                              role_id: a58de6d3-f52c-5080-b79b-a601a647ac85
                              username: ada@passbolt.com
                              active: true
                              deleted: false
                              created: '2019-02-04T12:05:44+00:00'
                              modified: '2019-03-04T12:05:44+00:00'
                              profile:
                                id: 99522cc9-0acc-5ae2-b996-d03bded3c0a6
                                user_id: f848277c-5398-58f8-a82a-72397af2d450
                                first_name: Ada
                                last_name: Lovelace
                                created: '2019-04-04T12:05:45+00:00'
                                modified: '2019-04-04T12:05:45+00:00'
                              last_logged_in: ''
                    resources:
                      sole_owner:
                        id: 8e3874ae-4b40-590b-968a-418f704b9d9a
                        name: apache
                        username: www-data
                        uri: http://www.apache.org/
                        description: Apache web server software.
                        deleted": false
                        created": '2019-04-02T12:05:58+00:00'
                        modified": '2019-04-03T12:05:58+00:00'
                        created_by": f848277c-5398-58f8-a82a-72397af2d450
                        modified_by": f848277c-5398-58f8-a82a-72397af2d450
                        permissions:
                          - id: 898ce1d0-601f-5194-976b-147a680dd472
                            aco: Resource
                            aco_foreign_key: 8e3874ae-4b40-590b-968a-418f704b9d9a
                            aro: User
                            aro_foreign_key: 640ebc06-5ec1-5322-a1ae-6120ed2f3a74
                            type: 1
                            created: '2019-04-04T12:06:00+00:00'
                            modified: '2019-04-04T12:06:00+00:00'
                            group: null
                            user:
                              id: 640ebc06-5ec1-5322-a1ae-6120ed2f3a74
                              role_id: a58de6d3-f52c-5080-b79b-a601a647ac85
                              username: carol@passbolt.com
                              active: true
                              deleted: false
                              created: '2019-04-02T12:05:44+00:00'
                              modified: '2019-04-03T12:05:44+00:00'
                              profile:
                                id: 48bcd9ac-a520-53e0-b3a4-9da7e57b91aa
                                user_id: 640ebc06-5ec1-5322-a1ae-6120ed2f3a74
                                first_name: Carol
                                last_name: Shaw
                                created: '2019-04-04T12:05:45+00:00'
                                modified: '2019-04-04T12:05:45+00:00'
                                avatar:
                                  id: 8ef95b32-e2a3-4b58-827c-dd67e68cfb48
                                  profile_id: 920edf1e-5ce8-4da4-a8fc-21040fe78d09
                                  created: '2024-08-06T14:58:09+00:00'
                                  modified: '2024-08-06T14:58:09+00:00'
                                  url:
                                    medium: >-
                                      https://passbolt.local/avatars/view/8ef95b32-e2a3-4b58-827c-dd67e68cfb48/medium.jpg
                                    small: >-
                                      https://passbolt.local/avatars/view/8ef95b32-e2a3-4b58-827c-dd67e68cfb48/small.jpg
                              last_logged_in: null
                    groups_to_delete:
                      - id: 05b68bd2-e4e8-4838-ac21-4661b27fb23b
                        name: Another Group
                        deleted: false
                        created: '2019-04-08T12:44:44+00:00'
                        modified: '2019-04-08T12:44:44+00:00'
                        created_by: d57c10f5-639d-5160-9c81-8a0c6c4ec856
                        modified_by: d57c10f5-639d-5160-9c81-8a0c6c4ec856
  requestBodies:
    login:
      description: The user and refresh token for session identification.
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/loginRequest'
          examples:
            base:
              value:
                user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                challenge: '-----BEGIN PGP MESSAGE-----'
    logout:
      description: The session associated to the refresh token you want to revoke.
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/logout'
          examples:
            revokeOneSession:
              summary: Only revoke this session.
              value:
                refresh_token: ad71952e-7842-599e-a19e-3a82e6974b23
            revokeAllSessions:
              summary: Empty body to revoke all sessions.
              value: null
    refresh:
      description: The user and refresh token for session identification.
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/refreshRequest'
          examples:
            base:
              value:
                user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                refresh_token: f8cea352-6bd3-4944-9523-20b31272bef0
    authGpg_login:
      description: The user's key fingerprint and challenge data when required.
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/login'
          examples:
            stage1:
              summary: Obtain a challenge token
              value:
                data:
                  gpg_auth:
                    keyid: 5FB36DE5C8E69DD4DB185DF2BC9F2749E432CB59
            stage2:
              summary: Verify client's identity
              value:
                data:
                  gpg_auth:
                    keyid: 5FB36DE5C8E69DD4DB185DF2BC9F2749E432CB59
                    user_token_result: >-
                      gpgauthv1.3.0|36|10e2074b-f610-42be-8525-100d4e68c481|gpgauthv1.3.0
    verify:
      description: The user's key fingerprint and an encrypted challenge token.
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/login'
          examples:
            base:
              value:
                data:
                  gpg_auth:
                    keyid: 5FB36DE5C8E69DD4DB185DF2BC9F2749E432CB59
                    server_verify_token: '-----BEGIN PGP MESSAGE-----'
    commentUpdate:
      description: The comment you want to update
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/commentUpdate'
          examples:
            base:
              value:
                content: no comment
    commentAdd:
      description: The comment you want to add
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/commentAdd'
          examples:
            base:
              value:
                content: no comment
    folderAdd:
      description: The folder you want to create
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/folderAdd'
          examples:
            without_parent:
              summary: Without a parent folder.
              value:
                name: folder name
            with_parent:
              summary: With a parent folder.
              value:
                name: folder name
                folder_parent_id: 7ff2828c-1092-4897-8e0a-1dc64ada889f
    folderUpdate:
      description: The folder you want to update
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/folderUpdate'
          examples:
            without_parent:
              value:
                name: folder's new name
    groupAdd:
      description: The group you want to create
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/groupAdd'
          examples:
            base:
              value:
                name: Groupe B
                groups_users:
                  - user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    is_admin: true
    groupUpdate:
      description: The group you want to update
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/groupUpdate'
          examples:
            base:
              value:
                name: WRC
                groups_users:
                  - user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    is_admin: true
                  - user_id: 3b9b9757-1ccb-444a-a3cf-4090364fac4f
                    is_admin: false
                  - user_id: 8a3c5c4e-e931-4e6b-854a-9b2e9afcd3bc
                    deleted: true
                secrets:
                  - resource_id: 4d0c0996-ce30-4bce-9918-9062ab35c542
                    user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    data: '-----BEGIN PGP MESSAGE-----'
                  - resource_id: 4d0c0996-ce30-4bce-9918-9062ab35c542
                    user_id: 3b9b9757-1ccb-444a-a3cf-4090364fac4f
                    data: '-----BEGIN PGP MESSAGE-----'
    attempt:
      description: The code for the MFA attempt.
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/mfaAttempt'
          examples:
            totp:
              summary: Attempt MFA with TOTP.
              value:
                totp: '635742'
    move:
      description: The target parent folder ID
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/move'
    resourceAdd:
      description: The resource you want to create
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/resourceAdd'
          examples:
            base:
              value:
                name: NextCloud
                username: ada@passbolt.com
                uri: https://nextcloud.com/
                resource_type_id: a28a04cd-6f53-518a-967c-9963bf9cec51
                secrets:
                  - data: '-----BEGIN PGP MESSAGE-----'
    resourceUpdate:
      description: The resource you want to update
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/resourceUpdate'
          examples:
            base:
              value:
                name: NextCloud
                username: ada@passbolt.com
                uri: https://nextcloud.com/
                resource_type_id: a28a04cd-6f53-518a-967c-9963bf9cec51
                secrets:
                  - user_id: 8bb80df5-700c-48ce-b568-85a60fc3c8f2
                    data: '-----BEGIN PGP MESSAGE-----'
    shareUpdate:
      description: The permissions you want to apply
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/shareUpdate'
          examples:
            addUser:
              summary: Adding a read permission for a user
              value:
                permissions:
                  - aro: User
                    aro_foreign_key: c48863da-32d3-48cd-9d47-de2891386423
                    type: 1
                    is_new: true
                secrets:
                  - data: '-----BEGIN PGP MESSAGE-----'
                    user_id: c48863da-32d3-48cd-9d47-de2891386423
            deleteUser:
              summary: Removing a permission for a user
              value:
                permissions:
                  - aro: User
                    aro_foreign_key: c48863da-32d3-48cd-9d47-de2891386423
                    delete: true
                secrets: []
            updatePermissionLevel:
              summary: Update a permission level
              value:
                permissions:
                  - id: 540174b9-90db-458c-ae90-e9a1912cc656
                    type: 7
            everythingAtOnce:
              summary: Multiple operations at the same time
              value:
                permissions:
                  - aro: User
                    aro_foreign_key: c48863da-32d3-48cd-9d47-de2891386423
                    type: 1
                    is_new: true
                  - id: 540174b9-90db-458c-ae90-e9a1912cc656
                    type: 7
                secrets:
                  - data: '-----BEGIN PGP MESSAGE-----'
                    user_id: c48863da-32d3-48cd-9d47-de2891386423
    shareUpdateDryRun:
      description: The permissions you want to apply
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/shareUpdate'
          examples:
            deleteUser:
              value:
                permissions:
                  - id: 540174b9-90db-458c-ae90-e9a1912cc656
                    delete: true
    userAdd:
      description: The user you want to create
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/userAdd'
          examples:
            base:
              value:
                username: ada@passbolt.com
                profile:
                  first_name: Ada
                  last_name: Lovelace
    userUpdate:
      description: The user you want to update
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/userUpdate'
          examples:
            base:
              value:
                profile:
                  first_name: Freddie
                  last_name: Mercury
  parameters:
    avatarId:
      name: avatarId
      description: ID for the avatar being manipulated.
      in: path
      required: true
      schema:
        type: string
        format: uuid
    avatarFormat:
      name: avatarFormat
      description: Format for the avatar being manipulated.
      in: path
      required: true
      schema:
        type: string
        enum:
          - medium.jpg
          - small.jpg
    commentId:
      name: commentId
      description: ID for the comment being manipulated.
      in: path
      required: true
      schema:
        type: string
        format: uuid
    resourceId:
      name: resourceId
      description: ID for the resource being manipulated.
      in: path
      required: true
      schema:
        type: string
        format: uuid
    containCreator:
      name: contain[creator]
      description: Add creator to response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    containModifier:
      name: contain[modifier]
      description: Add modifier to response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    favoriteId:
      name: favoriteId
      description: ID for the favorite being manipulated.
      in: path
      required: true
      schema:
        type: string
        format: uuid
    favoritesForeignModel:
      name: foreignModel
      description: Type for the foreign model being set as favorite.
      in: path
      required: true
      schema:
        type: string
        enum:
          - resource
    foreignId:
      name: foreignId
      description: ID for the foreign element being manipulated.
      in: path
      required: true
      schema:
        type: string
        format: uuid
    containChildrenResources:
      name: contain[children_resources]
      description: Add children resources to response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    containChildrenFolders:
      name: contain[children_folders]
      description: Add children folders to response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    containCreatorProfile:
      name: contain[creator.profile]
      description: Add creator and their profile to response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    containModifierProfile:
      name: contain[modifier.profile]
      description: Add modifier and their profile to response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    containPermission:
      name: contain[permission]
      description: Add permission to response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    containPermissions:
      name: contain[permissions]
      description: Add permissions to response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    containPermissionsUserProfile:
      name: contain[permissions.user.profile]
      description: Add user profile to permissions in response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    containPermissionsGroup:
      name: contain[permissions.group]
      description: Add group to permissions in response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    filterHasId:
      name: filter[has-id]
      description: Only return elements filtered by their id.
      in: query
      required: false
      schema:
        type: string
        format: uuid
    filterHasParent:
      name: filter[has-parent]
      description: Only return elements filtered by parent folder.
      in: query
      required: false
      schema:
        type: string
        format: uuid
    filterSearch:
      name: filter[search]
      description: Filter using a keyword or a string.
      in: query
      required: false
      schema:
        type: string
    folderId:
      name: folderId
      description: ID for the folder being manipulated.
      in: path
      required: true
      schema:
        type: string
        format: uuid
    cascade:
      name: cascade
      description: Delete element and its children elements.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    filterModifiedAfter:
      name: filter[modified-after]
      description: Only return elements modified after a timestamp.
      in: query
      required: false
      schema:
        type: string
    filterIsDeleted:
      name: filter[is-deleted]
      description: Only return deleted elements.
      in: query
      required: false
      schema:
        type: boolean
    gpgkeyId:
      name: gpgkeyId
      description: ID for the GPG key being manipulated.
      in: path
      required: true
      schema:
        type: string
        format: uuid
    containMyGroupUser:
      name: contain[my_group_user]
      description: Add `my_group_user` to groups in response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    containGroupsUsers:
      name: contain[groups_users]
      description: Add group users to groups in response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    containGroupsUsersUser:
      name: contain[groups_users.user]
      description: Add group users' user data to groups in response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    containGroupsUsersUserProfile:
      name: contain[groups_users.user.profile]
      description: Add group users' user profiles to groups in response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    containGroupsUsersUserGpgkey:
      name: contain[groups_users.user.gpgkey]
      description: Add group users' user gpg key to groups in response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    filterHasUsers:
      name: filter[has-users]
      description: Only return elements filtered by users.
      in: query
      required: false
      schema:
        type: array
        items:
          type: string
          format: uuid
          description: User UUID
    filterHasManagers:
      name: filter[has-managers]
      description: Only return elements filtered by managers.
      in: query
      required: false
      schema:
        type: array
        items:
          type: string
          format: uuid
          description: User UUID
    groupId:
      name: groupId
      description: ID for the group being manipulated.
      in: path
      required: true
      schema:
        type: string
        format: uuid
    containUsers:
      name: contain[users]
      description: Add users to response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    mfaProviderName:
      name: mfaProviderName
      description: Name for the MFA provider.
      in: path
      schema:
        type: string
        enum:
          - totp
          - yubikey
    moveForeignModel:
      name: foreignModel
      description: Type for the foreign model being moved.
      in: path
      required: true
      schema:
        type: string
        enum:
          - resource
          - folder
    containGroup:
      name: contain[group]
      description: Add group to response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    containUser:
      name: contain[user]
      description: Add user to response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    containUserProfile:
      name: contain[user.profile]
      description: Add user profile to user data in response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    containFavorite:
      name: contain[favorite]
      description: Add favorite to response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    containSecret:
      name: contain[secret]
      description: Add secrets to response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    containResourceType:
      name: contain[resource-type]
      description: Add resource type to response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    filterIsFavorite:
      name: filter[is-favorite]
      description: Only return favorite elements.
      in: query
      required: false
      schema:
        type: boolean
    filterIsSharedWithGroup:
      name: filter[is-shared-with-group]
      description: Only return elements shared with group.
      in: query
      required: false
      schema:
        type: string
        format: uuid
        description: Group UUID
    filterIsOwnedByMe:
      name: filter[is-owned-by-me]
      description: Only return elements owned by yourself.
      in: query
      required: false
      schema:
        type: boolean
    filterIsSharedWithMe:
      name: filter[is-shared-with-me]
      description: Only return elements shared to yourself and you are not owner.
      in: query
      required: false
      schema:
        type: boolean
    resourceTypeId:
      name: resourceTypeId
      description: ID for the resource type being manipulated.
      in: path
      required: true
      schema:
        type: string
        format: uuid
    sharesForeignModel:
      name: foreignModel
      description: Type for the foreign model being shared.
      in: path
      required: true
      schema:
        type: string
        enum:
          - resource
          - folder
    containGpgkey:
      name: contain[gpgkey]
      description: Add GPG key data to response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    containRole:
      name: contain[role]
      description: Add role to response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    containLastLoggedIn:
      name: contain[last_logged_in]
      description: Add last logged in to response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    containProfile:
      name: contain[profile]
      description: Add profile to response body.
      in: query
      required: false
      schema:
        type: integer
        enum:
          - 1
          - 0
    filterHasGroups:
      name: filter[has-groups]
      description: Only return elements filtered by groups.
      in: query
      required: false
      schema:
        type: array
        items:
          type: string
          format: uuid
          description: Group UUID
    filterHasAccess:
      name: filter[has-access]
      description: Only return elements where specified users have access.
      in: query
      required: false
      schema:
        type: array
        items:
          type: string
          format: uuid
          description: User UUID
    filterIsAdmin:
      name: filter[is-admin]
      description: Only return admin users.
      in: query
      required: false
      schema:
        type: boolean
    filterIsActive:
      name: filter[is-active]
      description: Only return active elements.
      in: query
      required: false
      schema:
        type: boolean
    userId:
      name: userId
      description: >-
        ID for the user being manipulated. Can be set to `me` when viewing a
        user.
      in: path
      required: true
      schema:
        type: string
        format: uuid
