{
  "info": {
    "name": "Lukhoo Attorney API",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "Use only a dedicated test client for write requests. Set api_key as a secret locally. Keep idempotency_key unchanged when retrying one request; change it for a new action."
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{api_key}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://lukhoo.com/api/attorney/v1"
    },
    {
      "key": "api_key",
      "value": ""
    },
    {
      "key": "video_id",
      "value": ""
    },
    {
      "key": "conversation_id",
      "value": ""
    },
    {
      "key": "message_id",
      "value": ""
    },
    {
      "key": "idempotency_key",
      "value": "REPLACE-WITH-A-UNIQUE-REQUEST-ID"
    }
  ],
  "item": [
    {
      "name": "List visible incident summaries and unlocked details",
      "request": {
        "method": "GET",
        "url": "{{base_url}}/incidents",
        "description": "Required scope: incidents:read. The incidents after parameter is a current-list offset. Rescan from 0 after incident events; do not treat offsets as a durable change cursor.",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ]
      }
    },
    {
      "name": "Read a currently permitted incident",
      "request": {
        "method": "GET",
        "url": "{{base_url}}/incidents/{{video_id}}",
        "description": "Required scope: incidents:read. ",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ]
      }
    },
    {
      "name": "Start or resume the 24-hour contact window",
      "request": {
        "method": "POST",
        "url": "{{base_url}}/incidents/{{video_id}}/contact",
        "description": "Required scope: engagements:write. Client contact permission and reservation rules apply. Membership alone does not create a contact window.",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{idempotency_key}}"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Download permitted evidence",
      "request": {
        "method": "GET",
        "url": "{{base_url}}/incidents/{{video_id}}/artifacts/video",
        "description": "Required scope: incidents:read. kind is video, transcript, or legal_brief. Requires an unlocked incident, current sharing permission and configured S3 storage. Response is the file stream; no reusable storage URL is disclosed.",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ]
      }
    },
    {
      "name": "List this attorney's conversations",
      "request": {
        "method": "GET",
        "url": "{{base_url}}/conversations",
        "description": "Required scope: messages:read. ",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ]
      }
    },
    {
      "name": "Read conversation and both hire confirmations",
      "request": {
        "method": "GET",
        "url": "{{base_url}}/conversations/{{conversation_id}}",
        "description": "Required scope: messages:read. ",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ]
      }
    },
    {
      "name": "Read shared conversation messages",
      "request": {
        "method": "GET",
        "url": "{{base_url}}/conversations/{{conversation_id}}/messages",
        "description": "Required scope: messages:read. ",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ]
      }
    },
    {
      "name": "Send a message to the client",
      "request": {
        "method": "POST",
        "url": "{{base_url}}/conversations/{{conversation_id}}/messages",
        "description": "Required scope: messages:write. ",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{idempotency_key}}"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"body\": \"Test message. Use a designated test client.\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Read one currently permitted message",
      "request": {
        "method": "GET",
        "url": "{{base_url}}/messages/{{message_id}}",
        "description": "Required scope: messages:read. ",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ]
      }
    },
    {
      "name": "Mark received messages read in Lukhoo",
      "request": {
        "method": "POST",
        "url": "{{base_url}}/conversations/{{conversation_id}}/read",
        "description": "Required scope: messages:write. ",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"through_id\": \"{{message_id}}\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Record the attorney's hiring confirmation",
      "request": {
        "method": "POST",
        "url": "{{base_url}}/conversations/{{conversation_id}}/hire-confirmation",
        "description": "Required scope: engagements:write. This never sets the client confirmation. Both parties must confirm. Messaging may continue after confirmation.",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{idempotency_key}}"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"confirm\": true\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Read event references with a durable sequence cursor",
      "request": {
        "method": "GET",
        "url": "{{base_url}}/events",
        "description": "Only events allowed by the key scopes are returned. Fetch referenced resources to obtain current authorized data. Expect at-least-once delivery and deduplicate event_id.",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ]
      }
    }
  ]
}
