{
 "openapi": "3.0.4",
 "info": {
  "title": "Karnema Connect API",
  "version": "1.0",
  "description": "API اتصال کارنما برای ERP، CRM و ابزارهای اتوماسیون. راهنمای کامل: https://karnema.ir/developers/",
  "contact": {
   "name": "Karnema",
   "url": "https://karnema.ir"
  }
 },
 "servers": [
  {
   "url": "https://karnema.ir/api/v1/connect",
   "description": "Karnema cloud"
  },
  {
   "url": "{baseUrl}/api/v1/connect",
   "description": "نسخهٔ تک‌سازمانی",
   "variables": {
    "baseUrl": {
     "default": "https://karnema.example.com"
    }
   }
  }
 ],
 "security": [
  {
   "ApiKey": []
  }
 ],
 "tags": [
  {
   "name": "شروع"
  },
  {
   "name": "اعضا و ساختار"
  },
  {
   "name": "فرآیندها"
  },
  {
   "name": "فرم‌ها"
  },
  {
   "name": "اهداف و شاخص‌ها"
  },
  {
   "name": "پروژه‌ها و وظایف"
  },
  {
   "name": "پرونده‌ها"
  },
  {
   "name": "فایل‌ها"
  }
 ],
 "paths": {
  "/me": {
   "get": {
    "tags": [
     "شروع"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectMeDto"
        }
       }
      }
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "اطلاعات کلید، دامنه‌ها و عضو اجراکننده",
    "operationId": "get_me",
    "parameters": [
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     }
    ]
   }
  },
  "/scopes": {
   "get": {
    "tags": [
     "شروع"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/ConnectScopeDto"
         }
        }
       }
      }
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "فهرست دامنه‌ها",
    "operationId": "get_scopes",
    "parameters": [
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     }
    ]
   }
  },
  "/events": {
   "get": {
    "tags": [
     "شروع"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/ConnectEventDto"
         }
        }
       }
      }
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "فهرست رویدادهای وب‌هوک",
    "operationId": "get_events",
    "parameters": [
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     }
    ]
   }
  },
  "/members": {
   "get": {
    "tags": [
     "اعضا و ساختار"
    ],
    "parameters": [
     {
      "name": "search",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/ConnectMemberDto"
         }
        }
       }
      }
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "اعضا با سمت، واحد و کد پرسنلی",
    "operationId": "get_members",
    "description": "دامنهٔ لازم: `connect.directory.read`",
    "x-scope": "connect.directory.read"
   }
  },
  "/org-structure": {
   "get": {
    "tags": [
     "اعضا و ساختار"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectOrgStructureDto"
        }
       }
      }
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "واحدها و جایگاه‌ها",
    "operationId": "get_org_structure",
    "description": "دامنهٔ لازم: `connect.directory.read`",
    "x-scope": "connect.directory.read",
    "parameters": [
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     }
    ]
   }
  },
  "/processes": {
   "get": {
    "tags": [
     "فرآیندها"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/ConnectProcessDto"
         }
        }
       }
      }
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "فرآیندهای قابل ثبت",
    "operationId": "get_processes",
    "description": "دامنهٔ لازم: `connect.processes.read`",
    "x-scope": "connect.processes.read",
    "parameters": [
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     }
    ]
   }
  },
  "/processes/{processId}/form": {
   "get": {
    "tags": [
     "فرآیندها"
    ],
    "parameters": [
     {
      "name": "processId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectFormDto"
        }
       }
      }
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "فیلدهای فرم شروع فرآیند",
    "operationId": "get_processes__processId__form",
    "description": "دامنهٔ لازم: `connect.processes.read`",
    "x-scope": "connect.processes.read"
   }
  },
  "/processes/{processId}/requests": {
   "post": {
    "tags": [
     "فرآیندها"
    ],
    "parameters": [
     {
      "name": "processId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 120
      },
      "description": "کلید تکرار امن؛ تکرار با همان کلید و بدنه همان پاسخ را برمی‌گرداند"
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ConnectStartRequestBody"
       }
      },
      "text/json": {
       "schema": {
        "$ref": "#/components/schemas/ConnectStartRequestBody"
       }
      },
      "application/*+json": {
       "schema": {
        "$ref": "#/components/schemas/ConnectStartRequestBody"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectRequestDto"
        }
       }
      }
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "ثبت درخواست",
    "operationId": "post_processes__processId__requests",
    "description": "دامنهٔ لازم: `connect.processes.start`",
    "x-scope": "connect.processes.start"
   }
  },
  "/requests/{requestId}": {
   "get": {
    "tags": [
     "فرآیندها"
    ],
    "parameters": [
     {
      "name": "requestId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectRequestDetailDto"
        }
       }
      }
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "جزئیات، تاریخچه و پاسخ‌های یک درخواست",
    "operationId": "get_requests__requestId",
    "description": "دامنهٔ لازم: `connect.processes.read`",
    "x-scope": "connect.processes.read"
   }
  },
  "/requests": {
   "get": {
    "tags": [
     "فرآیندها"
    ],
    "parameters": [
     {
      "name": "search",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "processId",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "status",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "from",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date-time"
      }
     },
     {
      "name": "to",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date-time"
      }
     },
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/ConnectRequestDto"
         }
        }
       }
      }
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "جست‌وجوی درخواست‌ها",
    "operationId": "get_requests",
    "description": "دامنهٔ لازم: `connect.processes.read`",
    "x-scope": "connect.processes.read"
   }
  },
  "/forms": {
   "get": {
    "tags": [
     "فرم‌ها"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/ConnectFormSummaryDto"
         }
        }
       }
      }
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "فهرست فرم‌ها",
    "operationId": "get_forms",
    "description": "دامنهٔ لازم: `connect.forms.read`",
    "x-scope": "connect.forms.read",
    "parameters": [
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     }
    ]
   }
  },
  "/forms/{formId}": {
   "get": {
    "tags": [
     "فرم‌ها"
    ],
    "parameters": [
     {
      "name": "formId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectFormDto"
        }
       }
      }
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "فیلدهای فرم",
    "operationId": "get_forms__formId",
    "description": "دامنهٔ لازم: `connect.forms.read`",
    "x-scope": "connect.forms.read"
   }
  },
  "/forms/{formId}/submissions": {
   "post": {
    "tags": [
     "فرم‌ها"
    ],
    "parameters": [
     {
      "name": "formId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 120
      },
      "description": "کلید تکرار امن؛ تکرار با همان کلید و بدنه همان پاسخ را برمی‌گرداند"
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ConnectValuesBody"
       }
      },
      "text/json": {
       "schema": {
        "$ref": "#/components/schemas/ConnectValuesBody"
       }
      },
      "application/*+json": {
       "schema": {
        "$ref": "#/components/schemas/ConnectValuesBody"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectCreatedDto"
        }
       }
      }
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "ارسال پاسخ فرم",
    "operationId": "post_forms__formId__submissions",
    "description": "دامنهٔ لازم: `connect.forms.submit`",
    "x-scope": "connect.forms.submit"
   }
  },
  "/goals": {
   "get": {
    "tags": [
     "اهداف و شاخص‌ها"
    ],
    "parameters": [
     {
      "name": "parentGoalId",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/ConnectGoalDto"
         }
        }
       }
      }
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "اهداف و پیشرفت",
    "operationId": "get_goals",
    "description": "دامنهٔ لازم: `connect.performance.read`",
    "x-scope": "connect.performance.read"
   }
  },
  "/kpis": {
   "get": {
    "tags": [
     "اهداف و شاخص‌ها"
    ],
    "parameters": [
     {
      "name": "goalId",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/ConnectKpiDto"
         }
        }
       }
      }
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "شاخص‌ها",
    "operationId": "get_kpis",
    "description": "دامنهٔ لازم: `connect.performance.read`",
    "x-scope": "connect.performance.read"
   }
  },
  "/kpis/{kpiId}/values": {
   "get": {
    "tags": [
     "اهداف و شاخص‌ها"
    ],
    "parameters": [
     {
      "name": "kpiId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/ConnectKpiValueDto"
         }
        }
       }
      }
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "تاریخچهٔ مقدار شاخص",
    "operationId": "get_kpis__kpiId__values",
    "description": "دامنهٔ لازم: `connect.performance.read`",
    "x-scope": "connect.performance.read"
   },
   "post": {
    "tags": [
     "اهداف و شاخص‌ها"
    ],
    "parameters": [
     {
      "name": "kpiId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 120
      },
      "description": "کلید تکرار امن؛ تکرار با همان کلید و بدنه همان پاسخ را برمی‌گرداند"
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ConnectKpiValueBody"
       }
      },
      "text/json": {
       "schema": {
        "$ref": "#/components/schemas/ConnectKpiValueBody"
       }
      },
      "application/*+json": {
       "schema": {
        "$ref": "#/components/schemas/ConnectKpiValueBody"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectCreatedDto"
        }
       }
      }
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "ثبت مقدار شاخص برای یک دوره",
    "operationId": "post_kpis__kpiId__values",
    "description": "دامنهٔ لازم: `connect.kpis.write`",
    "x-scope": "connect.kpis.write"
   }
  },
  "/projects": {
   "get": {
    "tags": [
     "پروژه‌ها و وظایف"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/ConnectProjectDto"
         }
        }
       }
      }
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "پروژه‌ها",
    "operationId": "get_projects",
    "description": "دامنهٔ لازم: `connect.work.read`",
    "x-scope": "connect.work.read",
    "parameters": [
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     }
    ]
   }
  },
  "/tasks": {
   "get": {
    "tags": [
     "پروژه‌ها و وظایف"
    ],
    "parameters": [
     {
      "name": "projectId",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "assigneeMembershipId",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/ConnectTaskDto"
         }
        }
       }
      }
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "وظایف",
    "operationId": "get_tasks",
    "description": "دامنهٔ لازم: `connect.work.read`",
    "x-scope": "connect.work.read"
   },
   "post": {
    "tags": [
     "پروژه‌ها و وظایف"
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ConnectCreateTaskBody"
       }
      },
      "text/json": {
       "schema": {
        "$ref": "#/components/schemas/ConnectCreateTaskBody"
       }
      },
      "application/*+json": {
       "schema": {
        "$ref": "#/components/schemas/ConnectCreateTaskBody"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectCreatedDto"
        }
       }
      }
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "ساخت وظیفه",
    "operationId": "post_tasks",
    "description": "دامنهٔ لازم: `connect.work.write`",
    "x-scope": "connect.work.write",
    "parameters": [
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 120
      },
      "description": "کلید تکرار امن؛ تکرار با همان کلید و بدنه همان پاسخ را برمی‌گرداند"
     }
    ]
   }
  },
  "/tasks/{taskId}": {
   "get": {
    "tags": [
     "پروژه‌ها و وظایف"
    ],
    "parameters": [
     {
      "name": "taskId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectTaskDto"
        }
       }
      }
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "یک وظیفه",
    "operationId": "get_tasks__taskId",
    "description": "دامنهٔ لازم: `connect.work.read`",
    "x-scope": "connect.work.read"
   }
  },
  "/tasks/{taskId}/progress": {
   "put": {
    "tags": [
     "پروژه‌ها و وظایف"
    ],
    "parameters": [
     {
      "name": "taskId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 120
      },
      "description": "کلید تکرار امن؛ تکرار با همان کلید و بدنه همان پاسخ را برمی‌گرداند"
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ConnectProgressBody"
       }
      },
      "text/json": {
       "schema": {
        "$ref": "#/components/schemas/ConnectProgressBody"
       }
      },
      "application/*+json": {
       "schema": {
        "$ref": "#/components/schemas/ConnectProgressBody"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "درصد پیشرفت وظیفه",
    "operationId": "put_tasks__taskId__progress",
    "description": "دامنهٔ لازم: `connect.work.write`",
    "x-scope": "connect.work.write"
   }
  },
  "/tasks/{taskId}/status": {
   "put": {
    "tags": [
     "پروژه‌ها و وظایف"
    ],
    "parameters": [
     {
      "name": "taskId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 120
      },
      "description": "کلید تکرار امن؛ تکرار با همان کلید و بدنه همان پاسخ را برمی‌گرداند"
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ConnectStatusBody"
       }
      },
      "text/json": {
       "schema": {
        "$ref": "#/components/schemas/ConnectStatusBody"
       }
      },
      "application/*+json": {
       "schema": {
        "$ref": "#/components/schemas/ConnectStatusBody"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "وضعیت وظیفه",
    "operationId": "put_tasks__taskId__status",
    "description": "دامنهٔ لازم: `connect.work.write`",
    "x-scope": "connect.work.write"
   }
  },
  "/files": {
   "post": {
    "tags": [
     "فایل‌ها"
    ],
    "requestBody": {
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "properties": {
         "file": {
          "type": "string",
          "format": "binary"
         }
        }
       },
       "encoding": {
        "file": {
         "style": "form"
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/UploadedFileResult"
        }
       }
      }
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "بارگذاری فایل",
    "operationId": "post_files",
    "description": "دامنهٔ لازم: `connect.forms.submit | connect.processes.start | connect.dossiers.write`",
    "x-scope": "connect.forms.submit | connect.processes.start | connect.dossiers.write",
    "parameters": [
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 120
      },
      "description": "کلید تکرار امن؛ تکرار با همان کلید و بدنه همان پاسخ را برمی‌گرداند"
     }
    ]
   }
  },
  "/files/{fileAssetId}": {
   "get": {
    "tags": [
     "فایل‌ها"
    ],
    "parameters": [
     {
      "name": "fileAssetId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "دریافت فایل",
    "operationId": "get_files__fileAssetId",
    "description": "دامنهٔ لازم: `connect.dossiers.read | connect.forms.read | connect.processes.read`",
    "x-scope": "connect.dossiers.read | connect.forms.read | connect.processes.read"
   }
  },
  "/dossiers/types": {
   "get": {
    "tags": [
     "پرونده‌ها"
    ],
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "انواع سند",
    "operationId": "get_dossiers_types",
    "description": "دامنهٔ لازم: `connect.dossiers.read`",
    "x-scope": "connect.dossiers.read",
    "parameters": [
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     }
    ]
   }
  },
  "/dossiers/search": {
   "get": {
    "tags": [
     "پرونده‌ها"
    ],
    "parameters": [
     {
      "name": "search",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "typeId",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "from",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date-time"
      }
     },
     {
      "name": "to",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date-time"
      }
     },
     {
      "name": "relatedTo",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "targetType",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "targetId",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "take",
      "in": "query",
      "schema": {
       "type": "integer",
       "format": "int32"
      }
     },
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "جست‌وجوی اسناد با جمع مبلغ",
    "operationId": "get_dossiers_search",
    "description": "دامنهٔ لازم: `connect.dossiers.read`",
    "x-scope": "connect.dossiers.read"
   }
  },
  "/dossiers/records/{recordId}": {
   "get": {
    "tags": [
     "پرونده‌ها"
    ],
    "parameters": [
     {
      "name": "recordId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "یک سند و اسناد وصل‌شده",
    "operationId": "get_dossiers_records__recordId",
    "description": "دامنهٔ لازم: `connect.dossiers.read`",
    "x-scope": "connect.dossiers.read"
   }
  },
  "/dossiers/{targetType}/{targetId}/records": {
   "post": {
    "tags": [
     "پرونده‌ها"
    ],
    "parameters": [
     {
      "name": "targetType",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "targetId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 120
      },
      "description": "کلید تکرار امن؛ تکرار با همان کلید و بدنه همان پاسخ را برمی‌گرداند"
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ConnectDossierRecordBody"
       }
      },
      "text/json": {
       "schema": {
        "$ref": "#/components/schemas/ConnectDossierRecordBody"
       }
      },
      "application/*+json": {
       "schema": {
        "$ref": "#/components/schemas/ConnectDossierRecordBody"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "ثبت سند",
    "operationId": "post_dossiers__targetType___targetId__records",
    "description": "دامنهٔ لازم: `connect.dossiers.write`",
    "x-scope": "connect.dossiers.write"
   }
  },
  "/dossiers/{targetType}/{targetId}/records/{recordId}": {
   "put": {
    "tags": [
     "پرونده‌ها"
    ],
    "parameters": [
     {
      "name": "targetType",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "targetId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "recordId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "X-Act-As",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "اجرا به نام عضو دیگر (شناسهٔ عضویت یا موبایل؛ دامنهٔ connect.act-as)"
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 120
      },
      "description": "کلید تکرار امن؛ تکرار با همان کلید و بدنه همان پاسخ را برمی‌گرداند"
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ConnectDossierRecordBody"
       }
      },
      "text/json": {
       "schema": {
        "$ref": "#/components/schemas/ConnectDossierRecordBody"
       }
      },
      "application/*+json": {
       "schema": {
        "$ref": "#/components/schemas/ConnectDossierRecordBody"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "کلید نامعتبر",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "403": {
      "description": "دامنه یا دسترسی کافی نیست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     },
     "429": {
      "description": "سقف درخواست",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConnectError"
        }
       }
      }
     }
    },
    "summary": "ویرایش سند",
    "operationId": "put_dossiers__targetType___targetId__records__recordId",
    "description": "دامنهٔ لازم: `connect.dossiers.write`",
    "x-scope": "connect.dossiers.write"
   }
  }
 },
 "components": {
  "schemas": {
   "ConnectAnswerDto": {
    "type": "object",
    "properties": {
     "form": {
      "type": "string",
      "nullable": true
     },
     "fieldId": {
      "type": "string",
      "format": "uuid"
     },
     "label": {
      "type": "string",
      "nullable": true
     },
     "type": {
      "type": "string",
      "nullable": true
     },
     "value": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ConnectClientDto": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "name": {
      "type": "string",
      "nullable": true
     },
     "scopes": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "nullable": true
     },
     "rateLimitPerMinute": {
      "type": "integer",
      "format": "int32"
     }
    },
    "additionalProperties": false
   },
   "ConnectCreateTaskBody": {
    "type": "object",
    "properties": {
     "projectId": {
      "type": "string",
      "format": "uuid"
     },
     "name": {
      "type": "string",
      "nullable": true
     },
     "description": {
      "type": "string",
      "nullable": true
     },
     "priority": {
      "type": "string",
      "nullable": true
     },
     "plannedStartUtc": {
      "type": "string",
      "format": "date-time",
      "nullable": true
     },
     "plannedDueUtc": {
      "type": "string",
      "format": "date-time",
      "nullable": true
     },
     "estimatedDurationMinutes": {
      "type": "integer",
      "format": "int32",
      "nullable": true
     },
     "parentTaskId": {
      "type": "string",
      "format": "uuid",
      "nullable": true
     },
     "goalId": {
      "type": "string",
      "format": "uuid",
      "nullable": true
     },
     "kpiId": {
      "type": "string",
      "format": "uuid",
      "nullable": true
     },
     "assigneeMembershipIds": {
      "type": "array",
      "items": {
       "type": "string",
       "format": "uuid"
      },
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ConnectCreatedDto": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     }
    },
    "additionalProperties": false
   },
   "ConnectDossierRecordBody": {
    "type": "object",
    "properties": {
     "typeId": {
      "type": "string",
      "format": "uuid"
     },
     "title": {
      "type": "string",
      "nullable": true
     },
     "documentDate": {
      "type": "string",
      "format": "date-time",
      "nullable": true
     },
     "amount": {
      "type": "number",
      "format": "double",
      "nullable": true
     },
     "counterparty": {
      "type": "string",
      "nullable": true
     },
     "referenceNumber": {
      "type": "string",
      "nullable": true
     },
     "notes": {
      "type": "string",
      "nullable": true
     },
     "fields": {
      "type": "object",
      "additionalProperties": {},
      "nullable": true
     },
     "fileAssetIds": {
      "type": "array",
      "items": {
       "type": "string",
       "format": "uuid"
      },
      "nullable": true
     },
     "relatedRecordId": {
      "type": "string",
      "format": "uuid",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ConnectEventDto": {
    "type": "object",
    "properties": {
     "event": {
      "type": "string",
      "nullable": true
     },
     "code": {
      "type": "integer",
      "format": "int32"
     },
     "title": {
      "type": "string",
      "nullable": true
     },
     "description": {
      "type": "string",
      "nullable": true
     },
     "dataFields": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ConnectFieldDto": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "label": {
      "type": "string",
      "nullable": true
     },
     "type": {
      "type": "string",
      "nullable": true
     },
     "required": {
      "type": "boolean"
     },
     "options": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "nullable": true
     },
     "helpText": {
      "type": "string",
      "nullable": true
     },
     "minValue": {
      "type": "number",
      "format": "double",
      "nullable": true
     },
     "maxValue": {
      "type": "number",
      "format": "double",
      "nullable": true
     },
     "maxLength": {
      "type": "integer",
      "format": "int32",
      "nullable": true
     },
     "layoutOnly": {
      "type": "boolean"
     }
    },
    "additionalProperties": false
   },
   "ConnectFieldValue": {
    "type": "object",
    "properties": {
     "fieldId": {
      "type": "string",
      "format": "uuid",
      "nullable": true
     },
     "label": {
      "type": "string",
      "nullable": true
     },
     "value": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ConnectFormDto": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "name": {
      "type": "string",
      "nullable": true
     },
     "description": {
      "type": "string",
      "nullable": true
     },
     "fields": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/ConnectFieldDto"
      },
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ConnectFormSummaryDto": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "name": {
      "type": "string",
      "nullable": true
     },
     "description": {
      "type": "string",
      "nullable": true
     },
     "isActive": {
      "type": "boolean"
     },
     "fieldCount": {
      "type": "integer",
      "format": "int32"
     },
     "submissionCount": {
      "type": "integer",
      "format": "int32"
     }
    },
    "additionalProperties": false
   },
   "ConnectGoalDto": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "parentGoalId": {
      "type": "string",
      "format": "uuid",
      "nullable": true
     },
     "name": {
      "type": "string",
      "nullable": true
     },
     "description": {
      "type": "string",
      "nullable": true
     },
     "ownerLevel": {
      "type": "string",
      "nullable": true
     },
     "ownerEntityId": {
      "type": "string",
      "format": "uuid",
      "nullable": true
     },
     "startDate": {
      "type": "string",
      "format": "date-time",
      "nullable": true
     },
     "endDate": {
      "type": "string",
      "format": "date-time",
      "nullable": true
     },
     "weight": {
      "type": "number",
      "format": "double"
     },
     "targetValue": {
      "type": "number",
      "format": "double",
      "nullable": true
     },
     "currentValue": {
      "type": "number",
      "format": "double"
     },
     "status": {
      "type": "string",
      "nullable": true
     },
     "priority": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ConnectKpiDto": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "goalId": {
      "type": "string",
      "format": "uuid",
      "nullable": true
     },
     "name": {
      "type": "string",
      "nullable": true
     },
     "unit": {
      "type": "string",
      "nullable": true
     },
     "targetValue": {
      "type": "number",
      "format": "double",
      "nullable": true
     },
     "weight": {
      "type": "number",
      "format": "double"
     },
     "frequency": {
      "type": "string",
      "nullable": true
     },
     "dataSource": {
      "type": "string",
      "nullable": true
     },
     "ownerMembershipId": {
      "type": "string",
      "format": "uuid"
     },
     "thresholdWarning": {
      "type": "number",
      "format": "double",
      "nullable": true
     },
     "thresholdCritical": {
      "type": "number",
      "format": "double",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ConnectKpiValueBody": {
    "type": "object",
    "properties": {
     "periodStart": {
      "type": "string",
      "format": "date-time"
     },
     "periodEnd": {
      "type": "string",
      "format": "date-time"
     },
     "value": {
      "type": "number",
      "format": "double"
     }
    },
    "additionalProperties": false
   },
   "ConnectKpiValueDto": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "periodStart": {
      "type": "string",
      "format": "date-time"
     },
     "periodEnd": {
      "type": "string",
      "format": "date-time"
     },
     "value": {
      "type": "number",
      "format": "double"
     },
     "source": {
      "type": "string",
      "nullable": true
     },
     "recordedAtUtc": {
      "type": "string",
      "format": "date-time"
     }
    },
    "additionalProperties": false
   },
   "ConnectMeDto": {
    "type": "object",
    "properties": {
     "organizationId": {
      "type": "string",
      "format": "uuid"
     },
     "client": {
      "$ref": "#/components/schemas/ConnectClientDto"
     },
     "actingMember": {
      "$ref": "#/components/schemas/ConnectMemberRefDto"
     }
    },
    "additionalProperties": false
   },
   "ConnectMemberDto": {
    "type": "object",
    "properties": {
     "membershipId": {
      "type": "string",
      "format": "uuid"
     },
     "firstName": {
      "type": "string",
      "nullable": true
     },
     "lastName": {
      "type": "string",
      "nullable": true
     },
     "phone": {
      "type": "string",
      "nullable": true
     },
     "personnelCode": {
      "type": "string",
      "nullable": true
     },
     "positionId": {
      "type": "string",
      "format": "uuid",
      "nullable": true
     },
     "positionName": {
      "type": "string",
      "nullable": true
     },
     "unitId": {
      "type": "string",
      "format": "uuid",
      "nullable": true
     },
     "unitName": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ConnectMemberRefDto": {
    "type": "object",
    "properties": {
     "membershipId": {
      "type": "string",
      "format": "uuid"
     },
     "name": {
      "type": "string",
      "nullable": true
     },
     "phone": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ConnectOrgStructureDto": {
    "type": "object",
    "properties": {
     "units": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/ConnectUnitDto"
      },
      "nullable": true
     },
     "positions": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/ConnectPositionDto"
      },
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ConnectPositionDto": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "unitId": {
      "type": "string",
      "format": "uuid"
     },
     "name": {
      "type": "string",
      "nullable": true
     },
     "reportsToPositionId": {
      "type": "string",
      "format": "uuid",
      "nullable": true
     },
     "membershipIds": {
      "type": "array",
      "items": {
       "type": "string",
       "format": "uuid"
      },
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ConnectProcessDto": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "name": {
      "type": "string",
      "nullable": true
     },
     "description": {
      "type": "string",
      "nullable": true
     },
     "hasStartForm": {
      "type": "boolean"
     },
     "startStepName": {
      "type": "string",
      "nullable": true
     },
     "linkMode": {
      "type": "string",
      "nullable": true
     },
     "linkTarget": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ConnectProgressBody": {
    "type": "object",
    "properties": {
     "percent": {
      "type": "integer",
      "format": "int32",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ConnectProjectDto": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "name": {
      "type": "string",
      "nullable": true
     },
     "description": {
      "type": "string",
      "nullable": true
     },
     "ownerMembershipId": {
      "type": "string",
      "format": "uuid"
     },
     "managerMembershipId": {
      "type": "string",
      "format": "uuid",
      "nullable": true
     },
     "startDate": {
      "type": "string",
      "format": "date-time",
      "nullable": true
     },
     "endDate": {
      "type": "string",
      "format": "date-time",
      "nullable": true
     },
     "budget": {
      "type": "number",
      "format": "double",
      "nullable": true
     },
     "status": {
      "type": "string",
      "nullable": true
     },
     "priority": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ConnectRequestDetailDto": {
    "type": "object",
    "properties": {
     "request": {
      "$ref": "#/components/schemas/ConnectRequestDto"
     },
     "timeline": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/ConnectTimelineDto"
      },
      "nullable": true
     },
     "answers": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/ConnectAnswerDto"
      },
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ConnectRequestDto": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "trackingNumber": {
      "type": "integer",
      "format": "int64"
     },
     "title": {
      "type": "string",
      "nullable": true
     },
     "processId": {
      "type": "string",
      "format": "uuid"
     },
     "processName": {
      "type": "string",
      "nullable": true
     },
     "status": {
      "type": "string",
      "nullable": true
     },
     "requesterName": {
      "type": "string",
      "nullable": true
     },
     "createdAtUtc": {
      "type": "string",
      "format": "date-time"
     },
     "lastActivityUtc": {
      "type": "string",
      "format": "date-time"
     },
     "currentSteps": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "nullable": true
     },
     "currentAssignees": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "nullable": true
     },
     "progressPercent": {
      "type": "integer",
      "format": "int32"
     },
     "overdue": {
      "type": "boolean"
     },
     "relatedKind": {
      "type": "string",
      "nullable": true
     },
     "relatedId": {
      "type": "string",
      "format": "uuid",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ConnectScopeDto": {
    "type": "object",
    "properties": {
     "key": {
      "type": "string",
      "nullable": true
     },
     "title": {
      "type": "string",
      "nullable": true
     },
     "description": {
      "type": "string",
      "nullable": true
     },
     "endpoints": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ConnectStartRequestBody": {
    "type": "object",
    "properties": {
     "title": {
      "type": "string",
      "nullable": true
     },
     "values": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/ConnectFieldValue"
      },
      "nullable": true
     },
     "relatedKind": {
      "type": "string",
      "nullable": true
     },
     "relatedId": {
      "type": "string",
      "format": "uuid",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ConnectStatusBody": {
    "type": "object",
    "properties": {
     "status": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ConnectTaskDto": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "projectId": {
      "type": "string",
      "format": "uuid"
     },
     "parentTaskId": {
      "type": "string",
      "format": "uuid",
      "nullable": true
     },
     "name": {
      "type": "string",
      "nullable": true
     },
     "description": {
      "type": "string",
      "nullable": true
     },
     "priority": {
      "type": "string",
      "nullable": true
     },
     "status": {
      "type": "string",
      "nullable": true
     },
     "plannedStartUtc": {
      "type": "string",
      "format": "date-time",
      "nullable": true
     },
     "plannedDueUtc": {
      "type": "string",
      "format": "date-time",
      "nullable": true
     },
     "assigneeMembershipIds": {
      "type": "array",
      "items": {
       "type": "string",
       "format": "uuid"
      },
      "nullable": true
     },
     "goalId": {
      "type": "string",
      "format": "uuid",
      "nullable": true
     },
     "kpiId": {
      "type": "string",
      "format": "uuid",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ConnectTimelineDto": {
    "type": "object",
    "properties": {
     "occurredAtUtc": {
      "type": "string",
      "format": "date-time"
     },
     "event": {
      "type": "string",
      "nullable": true
     },
     "step": {
      "type": "string",
      "nullable": true
     },
     "actor": {
      "type": "string",
      "nullable": true
     },
     "details": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ConnectUnitDto": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "parentUnitId": {
      "type": "string",
      "format": "uuid",
      "nullable": true
     },
     "name": {
      "type": "string",
      "nullable": true
     },
     "unitType": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ConnectValuesBody": {
    "type": "object",
    "properties": {
     "values": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/ConnectFieldValue"
      },
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "UploadedFileResult": {
    "type": "object",
    "properties": {
     "fileAssetId": {
      "type": "string",
      "format": "uuid"
     },
     "storageKey": {
      "type": "string",
      "nullable": true
     },
     "sizeBytes": {
      "type": "integer",
      "format": "int64"
     },
     "checksum": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ConnectError": {
    "type": "object",
    "properties": {
     "message": {
      "type": "string"
     },
     "code": {
      "type": "string"
     },
     "details": {
      "type": "object"
     }
    }
   }
  },
  "securitySchemes": {
   "ApiKey": {
    "type": "apiKey",
    "in": "header",
    "name": "X-Api-Key"
   }
  }
 }
}