{
  "info": {
    "_postman_id": "d9d9f65a-5ac2-4ab4-95ff-8fdfc163dd2b",
    "name": "Imployer Full API",
    "description": "Complete Postman collection for the Imployer project (Auth, Companies, Documents).",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "name": "Auth",
      "item": [
        {
          "name": "Signup",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json", "type": "text" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"username\": \"john_doe\",\n  \"email\": \"john@example.com\",\n  \"first_name\": \"John\",\n  \"last_name\": \"Doe\",\n  \"password\": \"Pass12345!\",\n  \"password_confirm\": \"Pass12345!\"\n}"
            },
            "url": "{{base_url}}/v1/api/auth/signup/"
          }
        },
        {
          "name": "Login",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json", "type": "text" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"john@example.com\",\n  \"password\": \"Pass12345!\"\n}"
            },
            "url": "{{base_url}}/v1/api/auth/login/"
          }
        },
        {
          "name": "Logout",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Token {{token}}", "type": "text" }
            ],
            "url": "{{base_url}}/v1/api/auth/logout/"
          }
        },
        {
          "name": "Me",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Authorization", "value": "Token {{token}}", "type": "text" }
            ],
            "url": "{{base_url}}/v1/api/auth/me/"
          }
        },
        {
          "name": "Switch Company",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Token {{token}}", "type": "text" },
              { "key": "Content-Type", "value": "application/json", "type": "text" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"company_id\": {{company_id}}\n}"
            },
            "url": "{{base_url}}/v1/api/auth/company/switch/"
          }
        },
        {
          "name": "Switch Out Company",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Token {{token}}", "type": "text" },
              { "key": "Content-Type", "value": "application/json", "type": "text" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{}"
            },
            "url": "{{base_url}}/v1/api/auth/company/switch-out/"
          }
        },
        {
          "name": "Employee Companies",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Authorization", "value": "Token {{token}}", "type": "text" }
            ],
            "url": "{{base_url}}/v1/api/auth/employee/companies/"
          }
        }
      ]
    },
    {
      "name": "Companies",
      "item": [
        {
          "name": "Create Company",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Token {{token}}", "type": "text" },
              { "key": "Content-Type", "value": "application/json", "type": "text" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"company_name\": \"Acme Ltd\",\n  \"company_description\": \"Staffing and payroll\"\n}"
            },
            "url": "{{base_url}}/v1/api/companies/"
          }
        },
        {
          "name": "Invite Employees (Bulk)",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Token {{token}}", "type": "text" },
              { "key": "Content-Type", "value": "application/json", "type": "text" }
            ],
            "body": {
              "mode": "raw",
              "raw": "[\n  {\n    \"first_name\": \"Anna\",\n    \"last_name\": \"Stone\",\n    \"email\": \"anna.stone@example.com\",\n    \"job_title\": \"Engineer\"\n  },\n  {\n    \"first_name\": \"Ben\",\n    \"last_name\": \"Cole\",\n    \"email\": \"ben.cole@example.com\",\n    \"job_title\": \"Designer\"\n  }\n]"
            },
            "url": "{{base_url}}/v1/api/companies/{{company_id}}/employees/invite/"
          }
        },
        {
          "name": "Get Company Employees (Paginated + Search)",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Authorization", "value": "Token {{token}}", "type": "text" }
            ],
            "url": "{{base_url}}/v1/api/companies/{{company_id}}/employees/?page=1&page_size=10&search={{search}}"
          }
        },
        {
          "name": "Get Employee by Employment Number",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Authorization", "value": "Token {{token}}", "type": "text" }
            ],
            "url": "{{base_url}}/v1/api/companies/{{company_id}}/employees/by-number/{{employment_number}}/"
          }
        },
        {
          "name": "Update Company User",
          "request": {
            "method": "PATCH",
            "header": [
              { "key": "Authorization", "value": "Token {{token}}", "type": "text" },
              { "key": "Content-Type", "value": "application/json", "type": "text" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"employment_number\": \"EMP-UPDATED-01\",\n  \"work_email_address\": \"new.work@example.com\",\n  \"phone_number\": \"08012345678\",\n  \"status\": \"Active\",\n  \"start_date\": \"2026-06-01\",\n  \"section_field_responses\": [\n    {\n      \"section_field_id\": {{section_field_id}},\n      \"response_value\": \"12 New Street\"\n    }\n  ]\n}"
            },
            "url": "{{base_url}}/v1/api/companies/{{company_id}}/users/{{company_user_id}}/"
          }
        },
        {
          "name": "Terminate Employee (Single)",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Token {{token}}", "type": "text" },
              { "key": "Content-Type", "value": "application/json", "type": "text" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"user_id\": {{user_id}},\n  \"company_id\": {{company_id}}\n}"
            },
            "url": "{{base_url}}/v1/api/companies/employees/terminate/"
          }
        },
        {
          "name": "Terminate Employees (Bulk)",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Token {{token}}", "type": "text" },
              { "key": "Content-Type", "value": "application/json", "type": "text" }
            ],
            "body": {
              "mode": "raw",
              "raw": "[\n  { \"user_id\": {{user_id}}, \"company_id\": {{company_id}} },\n  { \"user_id\": 999999, \"company_id\": {{company_id}} }\n]"
            },
            "url": "{{base_url}}/v1/api/companies/employees/terminate/bulk/"
          }
        }
      ]
    },
    {
      "name": "Documents",
      "item": [
        {
          "name": "Add Employee Document",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Token {{token}}", "type": "text" },
              { "key": "Content-Type", "value": "application/json", "type": "text" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Tax Clearance\",\n  \"description\": \"Latest tax clearance document\",\n  \"sort_id\": 10,\n  \"user\": {{user_id}},\n  \"company\": {{company_id}},\n  \"is_required\": true\n}"
            },
            "url": "{{base_url}}/v1/api/documents/employee-documents/"
          }
        },
        {
          "name": "Get Employee Documents (Filter Required)",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Authorization", "value": "Token {{token}}", "type": "text" }
            ],
            "url": "{{base_url}}/v1/api/documents/employee-documents/?company_id={{company_id}}&user_id={{user_id}}&is_required=true"
          }
        },
        {
          "name": "Edit Employee Document",
          "request": {
            "method": "PATCH",
            "header": [
              { "key": "Authorization", "value": "Token {{token}}", "type": "text" },
              { "key": "Content-Type", "value": "application/json", "type": "text" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"description\": \"Updated description\",\n  \"is_required\": false\n}"
            },
            "url": "{{base_url}}/v1/api/documents/employee-documents/{{document_id}}/"
          }
        },
        {
          "name": "Delete Employee Document",
          "request": {
            "method": "DELETE",
            "header": [
              { "key": "Authorization", "value": "Token {{token}}", "type": "text" }
            ],
            "url": "{{base_url}}/v1/api/documents/employee-documents/{{document_id}}/"
          }
        },
        {
          "name": "Reorder Employee Documents",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Token {{token}}", "type": "text" },
              { "key": "Content-Type", "value": "application/json", "type": "text" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"company_id\": {{company_id}},\n  \"user_id\": {{user_id}},\n  \"documents\": [\n    { \"id\": {{document_id}}, \"sort_id\": 1 }\n  ]\n}"
            },
            "url": "{{base_url}}/v1/api/documents/employee-documents/reorder/"
          }
        },
        {
          "name": "Request Document Record",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Token {{token}}", "type": "text" },
              { "key": "Content-Type", "value": "application/json", "type": "text" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"employee_document_id\": {{document_id}},\n  \"deadline\": \"2026-12-31\"\n}"
            },
            "url": "{{base_url}}/v1/api/documents/document-records/request/"
          }
        },
        {
          "name": "Approve Document Record",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Token {{token}}", "type": "text" }
            ],
            "url": "{{base_url}}/v1/api/documents/document-records/{{record_id}}/approve/"
          }
        },
        {
          "name": "Reject Document Record",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Token {{token}}", "type": "text" }
            ],
            "url": "{{base_url}}/v1/api/documents/document-records/{{record_id}}/reject/"
          }
        },
        {
          "name": "Get Records by User + Company",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Authorization", "value": "Token {{token}}", "type": "text" }
            ],
            "url": "{{base_url}}/v1/api/documents/document-records/by-user-company/?company_id={{company_id}}&user_id={{user_id}}"
          }
        },
        {
          "name": "Get Record by ID",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Authorization", "value": "Token {{token}}", "type": "text" }
            ],
            "url": "{{base_url}}/v1/api/documents/document-records/{{record_id}}/"
          }
        }
      ]
    }
  ],
  "variable": [
    { "key": "base_url", "value": "http://127.0.0.1:8000" },
    { "key": "token", "value": "" },
    { "key": "search", "value": "" },
    { "key": "company_id", "value": "1" },
    { "key": "user_id", "value": "1" },
    { "key": "company_user_id", "value": "1" },
    { "key": "employment_number", "value": "EMP-EXAMPLE-001" },
    { "key": "section_field_id", "value": "1" },
    { "key": "document_id", "value": "1" },
    { "key": "record_id", "value": "1" }
  ]
}
