{
  "info": {
    "name": "Aylla Vault API v1",
    "description": "All endpoints for the Aylla Vault app and website.\n\n1. Set the `baseUrl` collection variable.\n2. Run 'Auth > Login (password)' — the access and refresh tokens are saved automatically and used by every other request.\n3. When a call returns 401 `unauthenticated`, run 'Refresh token' (access tokens live 15 minutes).\n\nTest accounts (local/staging): alex@aylla.test (user), operator@aylla.test, auditor@aylla.test, admin@aylla.test — password Aylla#Test2026.\n\nFull reference: docs/API.md",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{accessToken}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://ayllaapi.immidots.com/api/v1"
    },
    {
      "key": "accessToken",
      "value": ""
    },
    {
      "key": "refreshToken",
      "value": ""
    },
    {
      "key": "cardId",
      "value": ""
    },
    {
      "key": "fieldId",
      "value": ""
    },
    {
      "key": "shareId",
      "value": ""
    },
    {
      "key": "requestId",
      "value": ""
    },
    {
      "key": "sessionId",
      "value": ""
    },
    {
      "key": "userId",
      "value": ""
    },
    {
      "key": "refId",
      "value": ""
    },
    {
      "key": "institutionId",
      "value": ""
    }
  ],
  "item": [
    {
      "name": "1. Auth",
      "item": [
        {
          "name": "Register",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/auth/register",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "auth",
                "register"
              ],
              "query": []
            },
            "description": "Creates a normal user and signs the device in. Saves tokens automatically.",
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"fullName\": \"Alex Vance Johnson\",\n  \"email\": \"alex.new@example.com\",\n  \"phone\": \"+61412345678\",\n  \"dob\": \"1992-06-15\",\n  \"password\": \"Str0ngPassw0rd\",\n  \"deviceInfo\": {\n    \"deviceName\": \"iPhone 15 Pro\",\n    \"deviceType\": \"ios\",\n    \"pushToken\": \"fcm_or_apns_token\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "if (j.accessToken) pm.collectionVariables.set('accessToken', j.accessToken);",
                  "if (j.refreshToken) pm.collectionVariables.set('refreshToken', j.refreshToken);",
                  "pm.test('status ok', () => pm.expect(pm.response.code).to.be.oneOf([200, 201]));"
                ]
              }
            }
          ]
        },
        {
          "name": "Login (password)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/auth/login",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "auth",
                "login"
              ],
              "query": []
            },
            "description": "5/min per email+IP. Saves tokens automatically.",
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"alex@aylla.test\",\n  \"authMethod\": \"password\",\n  \"credential\": \"Aylla#Test2026\",\n  \"deviceInfo\": {\n    \"deviceName\": \"Postman\",\n    \"deviceType\": \"web\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "if (j.accessToken) pm.collectionVariables.set('accessToken', j.accessToken);",
                  "if (j.refreshToken) pm.collectionVariables.set('refreshToken', j.refreshToken);",
                  "pm.test('status ok', () => pm.expect(pm.response.code).to.be.oneOf([200, 201]));"
                ]
              }
            }
          ]
        },
        {
          "name": "Login (PIN)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/auth/login",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "auth",
                "login"
              ],
              "query": []
            },
            "description": "Works after PUT /auth/pin.",
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"alex@aylla.test\",\n  \"authMethod\": \"pin\",\n  \"credential\": \"482913\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "if (j.accessToken) pm.collectionVariables.set('accessToken', j.accessToken);",
                  "if (j.refreshToken) pm.collectionVariables.set('refreshToken', j.refreshToken);",
                  "pm.test('status ok', () => pm.expect(pm.response.code).to.be.oneOf([200, 201]));"
                ]
              }
            }
          ]
        },
        {
          "name": "Verify email (6-digit code)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/auth/verify-email",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "auth",
                "verify-email"
              ],
              "query": []
            },
            "description": "Enter the code emailed at sign-up (register answers 202 verification_required when verification is on). Verifies the email and signs the device in; the tokens are saved automatically.",
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"you@example.com\",\n  \"code\": \"123456\",\n  \"deviceInfo\": {\n    \"deviceName\": \"Postman\",\n    \"deviceType\": \"other\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "if (j.accessToken) pm.collectionVariables.set('accessToken', j.accessToken);",
                  "if (j.refreshToken) pm.collectionVariables.set('refreshToken', j.refreshToken);"
                ]
              }
            }
          ]
        },
        {
          "name": "Resend verification code",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/auth/resend-verification",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "auth",
                "resend-verification"
              ],
              "query": []
            },
            "description": "Always answers 200. At most one code a minute.",
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"you@example.com\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Forgot password (email a code)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/auth/forgot-password",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "auth",
                "forgot-password"
              ],
              "query": []
            },
            "description": "Always answers 200. Emails a 6-digit reset code to vault users and institution staff.",
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"you@example.com\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Reset password (code + new password)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/auth/reset-password",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "auth",
                "reset-password"
              ],
              "query": []
            },
            "description": "Sets the password, signs every device out and emails a password-changed alert.",
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"you@example.com\",\n  \"code\": \"123456\",\n  \"password\": \"NewPassword9\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Phone: send code (switched off)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{accessToken}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/auth/phone/send-code",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "auth",
                "phone",
                "send-code"
              ],
              "query": []
            },
            "description": "SWITCHED OFF for now: answers 503 sms_not_enabled until a text-message provider is connected. Do not build this screen yet."
          }
        },
        {
          "name": "Phone: verify code (switched off)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{accessToken}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/auth/phone/verify",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "auth",
                "phone",
                "verify"
              ],
              "query": []
            },
            "description": "SWITCHED OFF for now: answers 503 sms_not_enabled until a text-message provider is connected. Do not build this screen yet.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"code\": \"123456\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Refresh token",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/auth/refresh",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "auth",
                "refresh"
              ],
              "query": []
            },
            "description": "Rotates: stores the NEW refresh token. Old one is dead.",
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"refreshToken\": \"{{refreshToken}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "if (j.accessToken) pm.collectionVariables.set('accessToken', j.accessToken);",
                  "if (j.refreshToken) pm.collectionVariables.set('refreshToken', j.refreshToken);",
                  "pm.test('status ok', () => pm.expect(pm.response.code).to.be.oneOf([200, 201]));"
                ]
              }
            }
          ]
        },
        {
          "name": "Refresh token (website cookie mode)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "X-Auth-Mode",
                "value": "cookie"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/auth/refresh",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "auth",
                "refresh"
              ],
              "query": []
            },
            "description": "Browser mode: refresh token lives in an HttpOnly cookie.",
            "auth": {
              "type": "noauth"
            }
          }
        },
        {
          "name": "Server config (what is switched on)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/config",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "config"
              ],
              "query": []
            },
            "description": "Public. { emailVerificationRequired, channels: { email, sms }, sharePasscodeInEmail }. Hide options that are false.",
            "auth": {
              "type": "noauth"
            }
          }
        },
        {
          "name": "Me",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/auth/me",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "auth",
                "me"
              ],
              "query": []
            },
            "description": ""
          }
        },
        {
          "name": "Update profile",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/auth/me",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "auth",
                "me"
              ],
              "query": []
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"fullName\": \"Alex V. Johnson\",\n  \"phone\": \"+61412345678\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Set PIN",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/auth/pin",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "auth",
                "pin"
              ],
              "query": []
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"pin\": \"482913\",\n  \"currentPassword\": \"Aylla#Test2026\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Change password",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/auth/password",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "auth",
                "password"
              ],
              "query": []
            },
            "description": "Signs out all OTHER devices.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"currentPassword\": \"Aylla#Test2026\",\n  \"password\": \"N3wPassword99\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "List device sessions",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/auth/sessions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "auth",
                "sessions"
              ],
              "query": []
            },
            "description": ""
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "try { pm.collectionVariables.set('sessionId', (j.find(s => !s.isCurrent) || j[0]).id); } catch (e) {}"
                ]
              }
            }
          ]
        },
        {
          "name": "Revoke a device",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/auth/sessions/{{sessionId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "auth",
                "sessions",
                "{{sessionId}}"
              ],
              "query": []
            },
            "description": ""
          }
        },
        {
          "name": "Logout (this device)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/auth/logout",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "auth",
                "logout"
              ],
              "query": []
            },
            "description": ""
          }
        },
        {
          "name": "Logout everywhere",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/auth/logout-all",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "auth",
                "logout-all"
              ],
              "query": []
            },
            "description": ""
          }
        }
      ]
    },
    {
      "name": "2. Schemes & 100-point",
      "item": [
        {
          "name": "Document schemas (default scheme)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/schemes",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "schemes"
              ],
              "query": []
            },
            "description": "Add ?schemeId=NSW_FIREARMS_ADULT, ?scope=catalogue, ?q=passport"
          }
        },
        {
          "name": "Document schemas (WA Police)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/schemes?schemeId=WA_POLICE_NPC",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "schemes"
              ],
              "query": [
                {
                  "key": "schemeId",
                  "value": "WA_POLICE_NPC"
                }
              ]
            },
            "description": ""
          }
        },
        {
          "name": "Scheme registry",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/schemes/registry",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "schemes",
                "registry"
              ],
              "query": []
            },
            "description": ""
          }
        },
        {
          "name": "Scheme detail",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/schemes/registry/NSW_FIREARMS_ADULT",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "schemes",
                "registry",
                "NSW_FIREARMS_ADULT"
              ],
              "query": []
            },
            "description": ""
          }
        },
        {
          "name": "Evaluate score",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/schemes/evaluate-score",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "schemes",
                "evaluate-score"
              ],
              "query": []
            },
            "description": "Preliminary result only; always show the disclaimer.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schemeId\": \"GENERAL_100_TEMPLATE\",\n  \"cardIds\": [\n    \"{{cardId}}\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Dropdown lists",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/lookups/dropdowns?list=STATE_TERRITORY,YES_NO",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "lookups",
                "dropdowns"
              ],
              "query": [
                {
                  "key": "list",
                  "value": "STATE_TERRITORY,YES_NO"
                }
              ]
            },
            "description": ""
          }
        },
        {
          "name": "State variants",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/lookups/state-variants",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "lookups",
                "state-variants"
              ],
              "query": []
            },
            "description": ""
          }
        },
        {
          "name": "Sources",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/lookups/sources",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "lookups",
                "sources"
              ],
              "query": []
            },
            "description": ""
          }
        },
        {
          "name": "Identity Score (plain-language 100 points)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/identity-score",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "identity-score"
              ],
              "query": []
            },
            "description": "Where the signed-in person stands against the general 100-point guide, what is missing, and which documents to add next. Use this for the user-facing score screen."
          }
        }
      ]
    },
    {
      "name": "3. Cards",
      "item": [
        {
          "name": "List cards",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/cards?masked=1",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "cards"
              ],
              "query": [
                {
                  "key": "masked",
                  "value": "1"
                }
              ]
            },
            "description": "Filters: category, status, documentTypeId, q. masked=1 hides sensitive values. Each card returns displayStatus, expiryDate and lastSharedWith. Show displayStatus; points are not on cards (see GET /identity-score)."
          }
        },
        {
          "name": "Create card",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/cards",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "cards"
              ],
              "query": []
            },
            "description": "Saves cardId / fieldId.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"title\": \"Australian Passport (Alex Vance)\",\n  \"category\": \"Passport\",\n  \"documentTypeId\": \"AU_PASSPORT\",\n  \"status\": \"valid\",\n  \"notes\": \"Renew in 2031\",\n  \"fields\": [\n    {\n      \"key\": \"passport_number\",\n      \"label\": \"Passport number\",\n      \"value\": \"PA9823410\",\n      \"type\": \"text\",\n      \"isRequired\": true\n    },\n    {\n      \"key\": \"name_as_printed\",\n      \"label\": \"Name exactly as printed\",\n      \"value\": \"Alex Vance Johnson\",\n      \"type\": \"text\"\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.collectionVariables.set('cardId', j.id);",
                  "pm.collectionVariables.set('fieldId', j.fields[0].id);"
                ]
              }
            }
          ]
        },
        {
          "name": "Get card",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/cards/{{cardId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "cards",
                "{{cardId}}"
              ],
              "query": []
            },
            "description": ""
          }
        },
        {
          "name": "Update card (fields replaced by id)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/cards/{{cardId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "cards",
                "{{cardId}}"
              ],
              "query": []
            },
            "description": "Sending fields = the complete list. Omitted fields are deleted.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"title\": \"Australian Passport (renewed)\",\n  \"fields\": [\n    {\n      \"id\": \"{{fieldId}}\",\n      \"key\": \"passport_number\",\n      \"label\": \"Passport number\",\n      \"value\": \"PB0000001\"\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Delete card",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/cards/{{cardId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "cards",
                "{{cardId}}"
              ],
              "query": []
            },
            "description": ""
          }
        },
        {
          "name": "Upload attachment",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/cards/{{cardId}}/attachments",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "cards",
                "{{cardId}}",
                "attachments"
              ],
              "query": []
            },
            "description": "multipart/form-data, field 'file' (jpg/png/webp/pdf, <=8MB).",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "file",
                  "type": "file",
                  "src": []
                }
              ]
            }
          }
        },
        {
          "name": "OCR scan",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/cards/ocr-scan",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "cards",
                "ocr-scan"
              ],
              "query": []
            },
            "description": "503 until the server has a Gemini key.",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "file",
                  "type": "file",
                  "src": []
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "4. Sharing",
      "item": [
        {
          "name": "Create share",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/shares",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "shares"
              ],
              "query": []
            },
            "description": "Saves shareId. Set neverExpires: true for a link with no expiry date (needs a passcode, no sensitive fields; up to 1000 views). expirationMinutes goes up to 525600 (1 year). deliveryChannel: email sends the link to recipientContact (sms answers 422 channel_unavailable for now; push is not a share channel). A no-expiry link: send neverExpires true with a passcode and no sensitive fields.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"cardId\": \"{{cardId}}\",\n  \"selectedFieldIds\": [\n    \"{{fieldId}}\"\n  ],\n  \"recipientName\": \"Qantas Airways Check-in\",\n  \"recipientContact\": \"checkin@qantas.com\",\n  \"deliveryChannel\": \"email\",\n  \"expirationMinutes\": 60,\n  \"maxAccessCount\": 3,\n  \"passcode\": \"7821\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.collectionVariables.set('shareId', j.shareId);"
                ]
              }
            }
          ]
        },
        {
          "name": "List my shares",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/shares",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "shares"
              ],
              "query": []
            },
            "description": ""
          }
        },
        {
          "name": "Share detail + access log",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/shares/{{shareId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "shares",
                "{{shareId}}"
              ],
              "query": []
            },
            "description": ""
          }
        },
        {
          "name": "Revoke share",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/shares/{{shareId}}/revoke",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "shares",
                "{{shareId}}",
                "revoke"
              ],
              "query": []
            },
            "description": ""
          }
        },
        {
          "name": "Resume a paused link",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/shares/{{shareId}}/resume",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "shares",
                "{{shareId}}",
                "resume"
              ],
              "query": []
            },
            "description": "Turns a paused link back on (a link with no expiry date pauses itself after 90 days without a view)."
          }
        },
        {
          "name": "PUBLIC: recipient metadata",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/shares/public/{{shareId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "shares",
                "public",
                "{{shareId}}"
              ],
              "query": []
            },
            "description": "No account needed. Does not use up a view.",
            "auth": {
              "type": "noauth"
            }
          }
        },
        {
          "name": "PUBLIC: unlock",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/shares/public/{{shareId}}/unlock",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "shares",
                "public",
                "{{shareId}}",
                "unlock"
              ],
              "query": []
            },
            "description": "Uses one view. 5 wrong passcodes lock the link.",
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"passcode\": \"7821\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "5. Requests & institutions",
      "item": [
        {
          "name": "List requests",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/requests?status=pending",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "requests"
              ],
              "query": [
                {
                  "key": "status",
                  "value": "pending"
                }
              ]
            },
            "description": "Users see requests sent to them; operators see the ones they created."
          }
        },
        {
          "name": "Get request",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/requests/{{requestId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "requests",
                "{{requestId}}"
              ],
              "query": []
            },
            "description": ""
          }
        },
        {
          "name": "User: fulfil",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/requests/{{requestId}}/fulfill",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "requests",
                "{{requestId}}",
                "fulfill"
              ],
              "query": []
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"submittedData\": [\n    {\n      \"cardId\": \"{{cardId}}\",\n      \"fieldLabel\": \"Passport number\"\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "User: decline",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/requests/{{requestId}}/decline",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "requests",
                "{{requestId}}",
                "decline"
              ],
              "query": []
            },
            "description": ""
          }
        },
        {
          "name": "User: withdraw what I sent",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/requests/{{requestId}}/withdraw",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "requests",
                "{{requestId}}",
                "withdraw"
              ],
              "query": []
            },
            "description": ""
          }
        },
        {
          "name": "Find an institution",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/institutions?q=mira",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "institutions"
              ],
              "query": []
            },
            "description": ""
          }
        },
        {
          "name": "Send fields to an institution",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"message\": \"Documents for my policy\",\n  \"items\": [\n    {\n      \"cardId\": \"{{cardId}}\",\n      \"fieldIds\": [\n        \"{{fieldId}}\"\n      ]\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/institutions/{{institutionId}}/share",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "institutions",
                "{{institutionId}}",
                "share"
              ],
              "query": []
            },
            "description": ""
          }
        }
      ]
    },
    {
      "name": "6. Voice",
      "item": [
        {
          "name": "Voice query",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/voice/query",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "voice",
                "query"
              ],
              "query": []
            },
            "description": "503 until the server has Gemini + TTS keys.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"prompt\": \"What is my passport expiry date?\",\n  \"language\": \"en-AU\",\n  \"accent\": \"Australian\",\n  \"vaultContextCardIds\": [\n    \"{{cardId}}\"\n  ],\n  \"includeAudio\": true,\n  \"audioFormat\": \"mp3\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "7. Notifications",
      "item": [
        {
          "name": "List notifications",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/notifications?unread=1",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "notifications"
              ],
              "query": [
                {
                  "key": "unread",
                  "value": "1"
                }
              ]
            },
            "description": ""
          }
        },
        {
          "name": "Mark read (ids)",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/notifications/mark-read",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "notifications",
                "mark-read"
              ],
              "query": []
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"ids\": [\n    \"ntf_...\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Mark all read",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/notifications/mark-read",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "notifications",
                "mark-read"
              ],
              "query": []
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"all\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Get preferences",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/notifications/preferences",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "notifications",
                "preferences"
              ],
              "query": []
            },
            "description": ""
          }
        },
        {
          "name": "Update preferences",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/notifications/preferences",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "notifications",
                "preferences"
              ],
              "query": []
            },
            "description": "Any subset. emailKyc = email for document requests and answers (default on); emailSharing = email when a link you shared is opened (default off). Security emails are always sent.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"pushEnabled\": true,\n  \"smsEnabled\": false,\n  \"emailEnabled\": true,\n  \"emailKyc\": true,\n  \"emailSharing\": false\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "My audit trail",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/audit-logs?limit=50",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "audit-logs"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "50"
                }
              ]
            },
            "description": ""
          }
        },
        {
          "name": "Clear all notifications",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/notifications",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "notifications"
              ],
              "query": []
            },
            "description": ""
          }
        }
      ]
    }
  ]
}