{
 "openapi": "3.1.0",
 "info": {
  "title": "MSMEPulse API",
  "version": "1.0.0",
  "description": "Connect other software to MSMEPulse: clients, projects, invoices and payments, sales, proposals, expenses, support tickets, attendance and leave, and reports. Send an API token as Authorization: Bearer <token>; each token works in one workspace and only for the areas it was given. Amounts are in minor units (paise or cents). Errors return { error: { code, message, fields? } }.",
  "contact": {
   "name": "MSMEPulse support",
   "email": "support@msmepulse.com",
   "url": "https://msmepulse.com/developers"
  }
 },
 "servers": [
  {
   "url": "https://app.msmepulse.com/api/v1"
  }
 ],
 "security": [
  {
   "apiToken": []
  }
 ],
 "tags": [
  {
   "name": "Clients",
   "description": "Your clients, their contacts and client portal access.",
   "x-msmepulse-base": "/clients"
  },
  {
   "name": "Projects",
   "description": "Projects, milestones, document checklists and tasks.",
   "x-msmepulse-base": "/projects"
  },
  {
   "name": "Tasks",
   "description": "Tasks across projects.",
   "x-msmepulse-base": "/tasks"
  },
  {
   "name": "Invoices and payments",
   "description": "GST and Singapore GST invoices, payments, credit and debit notes. Amounts are in paise or cents.",
   "x-msmepulse-base": "/invoices"
  },
  {
   "name": "Leads and deals",
   "description": "The sales pipeline: leads, deals and their activities.",
   "x-msmepulse-base": "/sales"
  },
  {
   "name": "Proposals",
   "description": "Proposals and quotes, sending them, and turning accepted ones into projects.",
   "x-msmepulse-base": "/proposals"
  },
  {
   "name": "Expenses and bills",
   "description": "Expense claims, vendors and vendor bills, and the input tax and MSMED reports.",
   "x-msmepulse-base": "/expenses"
  },
  {
   "name": "Support tickets",
   "description": "Support desk tickets and replies.",
   "x-msmepulse-base": "/helpdesk"
  },
  {
   "name": "Attendance and leave",
   "description": "Read-only: attendance, leave, holidays and the employee directory.",
   "x-msmepulse-base": "/hr"
  },
  {
   "name": "Reports",
   "description": "Every standard report the token's areas allow, as JSON or a spreadsheet.",
   "x-msmepulse-base": "/reports"
  }
 ],
 "x-msmepulse-scopes": [
  {
   "area": "clients",
   "label": "Clients",
   "write": true
  },
  {
   "area": "crm",
   "label": "Leads, deals and proposals",
   "write": true
  },
  {
   "area": "projects",
   "label": "Projects and tasks",
   "write": true
  },
  {
   "area": "time",
   "label": "Time logs",
   "write": true
  },
  {
   "area": "invoices",
   "label": "Invoices and payments",
   "write": true
  },
  {
   "area": "expenses",
   "label": "Expenses and bills",
   "write": true
  },
  {
   "area": "support",
   "label": "Support tickets",
   "write": true
  },
  {
   "area": "attendance",
   "label": "Attendance and leave",
   "write": false
  },
  {
   "area": "employees",
   "label": "Employee directory",
   "write": false
  },
  {
   "area": "reports",
   "label": "Reports",
   "write": false
  }
 ],
 "x-msmepulse-webhook-retries-minutes": [
  1,
  5,
  30,
  120,
  720
 ],
 "components": {
  "securitySchemes": {
   "apiToken": {
    "type": "http",
    "scheme": "bearer",
    "description": "An API token from Settings → API and webhooks (starts mp_). Admins create them; each has its own areas and requests a minute."
   }
  },
  "schemas": {
   "Error": {
    "type": "object",
    "required": [
     "error"
    ],
    "properties": {
     "error": {
      "type": "object",
      "required": [
       "code",
       "message"
      ],
      "properties": {
       "code": {
        "type": "string"
       },
       "message": {
        "type": "string",
        "description": "Written for people: you can show it as it is"
       },
       "fields": {
        "type": "object",
        "additionalProperties": {
         "type": "string"
        }
       }
      }
     }
    }
   }
  }
 },
 "paths": {
  "/clients": {
   "get": {
    "tags": [
     "Clients"
    ],
    "summary": "List clients (search, archived=1)",
    "description": "Needs the **Clients** scope with read access.",
    "operationId": "getClients",
    "x-msmepulse-scope": "clients:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "clients": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "string"
             },
             "name": {
              "type": "string"
             },
             "type": {
              "type": "string",
              "description": "business or individual"
             },
             "country": {
              "type": "string",
              "description": "ISO country code"
             },
             "gstin": {
              "anyOf": [
               {
                "type": "string"
               },
               {
                "type": "null"
               }
              ]
             },
             "uen": {
              "anyOf": [
               {
                "type": "string"
               },
               {
                "type": "null"
               }
              ]
             },
             "currency": {
              "type": "string"
             },
             "state": {
              "type": "string",
              "description": "India: state code"
             },
             "email": {
              "anyOf": [
               {
                "type": "string"
               },
               {
                "type": "null"
               }
              ]
             },
             "primaryContact": {
              "anyOf": [
               {
                "type": "string"
               },
               {
                "type": "null"
               }
              ]
             },
             "activeProjects": {
              "type": "number"
             },
             "archived": {
              "type": "boolean"
             },
             "sample": {
              "type": "boolean",
              "description": "Part of the workspace's sample data"
             }
            },
            "required": [
             "id",
             "name",
             "type",
             "country",
             "currency",
             "state",
             "primaryContact",
             "activeProjects",
             "archived",
             "sample"
            ]
           }
          }
         },
         "required": [
          "clients"
         ]
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "tags": [
     "Clients"
    ],
    "summary": "Add a client",
    "description": "Needs the **Clients** scope with read and write access.",
    "operationId": "postClients",
    "x-msmepulse-scope": "clients:write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "description": "The fields depend on the workspace's country: India (GSTIN, PAN, state) or Singapore (UEN, GST registration).",
        "oneOf": [
         {
          "title": "India workspace",
          "type": "object",
          "properties": {
           "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 120
           },
           "type": {
            "type": "string",
            "enum": [
             "business",
             "individual"
            ],
            "default": "business"
           },
           "country": {
            "type": "string"
           },
           "email": {
            "anyOf": [
             {
              "const": ""
             },
             {
              "type": "string",
              "format": "email"
             }
            ],
            "default": ""
           },
           "phone": {
            "type": "string",
            "maxLength": 30,
            "default": ""
           },
           "billingAddress": {
            "type": "object",
            "properties": {
             "line1": {
              "type": "string",
              "maxLength": 200,
              "default": ""
             },
             "line2": {
              "type": "string",
              "maxLength": 200,
              "default": ""
             },
             "city": {
              "type": "string",
              "maxLength": 80,
              "default": ""
             },
             "postalCode": {
              "type": "string",
              "maxLength": 12,
              "default": ""
             },
             "state": {
              "type": "string",
              "maxLength": 4,
              "default": ""
             }
            },
            "default": {}
           },
           "currency": {
            "type": "string",
            "enum": [
             "INR",
             "SGD",
             "USD",
             "EUR",
             "GBP",
             "AED",
             "AUD",
             "MYR",
             "CAD",
             "CHF",
             "HKD",
             "NZD"
            ]
           },
           "paymentTermsDays": {
            "type": "integer",
            "minimum": 0,
            "maximum": 365,
            "default": 30
           },
           "notes": {
            "type": "string",
            "maxLength": 2000,
            "default": ""
           },
           "ownerId": {
            "anyOf": [
             {
              "type": "string"
             },
             {
              "type": "null"
             }
            ]
           },
           "gstin": {
            "type": "string",
            "default": ""
           },
           "pan": {
            "type": "string",
            "default": ""
           },
           "isSez": {
            "type": "boolean",
            "default": false
           },
           "uen": {
            "type": "string",
            "default": ""
           },
           "gstRegistered": {
            "type": "boolean",
            "default": false
           },
           "peppolId": {
            "type": "string",
            "maxLength": 60,
            "default": ""
           }
          },
          "required": [
           "name",
           "country",
           "currency"
          ]
         },
         {
          "title": "Singapore workspace",
          "type": "object",
          "properties": {
           "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 120
           },
           "type": {
            "type": "string",
            "enum": [
             "business",
             "individual"
            ],
            "default": "business"
           },
           "country": {
            "type": "string"
           },
           "email": {
            "anyOf": [
             {
              "const": ""
             },
             {
              "type": "string",
              "format": "email"
             }
            ],
            "default": ""
           },
           "phone": {
            "type": "string",
            "maxLength": 30,
            "default": ""
           },
           "billingAddress": {
            "type": "object",
            "properties": {
             "line1": {
              "type": "string",
              "maxLength": 200,
              "default": ""
             },
             "line2": {
              "type": "string",
              "maxLength": 200,
              "default": ""
             },
             "city": {
              "type": "string",
              "maxLength": 80,
              "default": ""
             },
             "postalCode": {
              "type": "string",
              "maxLength": 12,
              "default": ""
             },
             "state": {
              "type": "string",
              "maxLength": 4,
              "default": ""
             }
            },
            "default": {}
           },
           "currency": {
            "type": "string",
            "enum": [
             "INR",
             "SGD",
             "USD",
             "EUR",
             "GBP",
             "AED",
             "AUD",
             "MYR",
             "CAD",
             "CHF",
             "HKD",
             "NZD"
            ]
           },
           "paymentTermsDays": {
            "type": "integer",
            "minimum": 0,
            "maximum": 365,
            "default": 30
           },
           "notes": {
            "type": "string",
            "maxLength": 2000,
            "default": ""
           },
           "ownerId": {
            "anyOf": [
             {
              "type": "string"
             },
             {
              "type": "null"
             }
            ]
           },
           "gstin": {
            "type": "string",
            "default": ""
           },
           "pan": {
            "type": "string",
            "default": ""
           },
           "isSez": {
            "type": "boolean",
            "default": false
           },
           "uen": {
            "type": "string",
            "default": ""
           },
           "gstRegistered": {
            "type": "boolean",
            "default": false
           },
           "peppolId": {
            "type": "string",
            "maxLength": 60,
            "default": ""
           }
          },
          "required": [
           "name",
           "country",
           "currency"
          ]
         }
        ]
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "id": {
           "type": "string",
           "description": "The new record's id"
          }
         },
         "required": [
          "id"
         ]
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/clients/{id}": {
   "get": {
    "tags": [
     "Clients"
    ],
    "summary": "Get a client, with their projects",
    "description": "Needs the **Clients** scope with read access.",
    "operationId": "getClientsId",
    "x-msmepulse-scope": "clients:read",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "client": {
           "type": "object",
           "properties": {
            "id": {
             "type": "string"
            },
            "name": {
             "type": "string"
            },
            "contacts": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "string"
               },
               "name": {
                "type": "string"
               },
               "email": {
                "anyOf": [
                 {
                  "type": "string"
                 },
                 {
                  "type": "null"
                 }
                ]
               },
               "isPrimary": {
                "type": "boolean"
               }
              },
              "required": [
               "id",
               "name"
              ]
             }
            }
           },
           "required": [
            "id",
            "name",
            "contacts"
           ]
          },
          "ownerName": {
           "anyOf": [
            {
             "type": "string"
            },
            {
             "type": "null"
            }
           ]
          },
          "projects": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "string"
             },
             "name": {
              "type": "string"
             },
             "code": {
              "anyOf": [
               {
                "type": "string"
               },
               {
                "type": "null"
               }
              ]
             },
             "status": {
              "type": "string"
             },
             "billingType": {
              "type": "string"
             },
             "startDate": {
              "anyOf": [
               {
                "type": "string"
               },
               {
                "type": "null"
               }
              ]
             },
             "endDate": {
              "anyOf": [
               {
                "type": "string"
               },
               {
                "type": "null"
               }
              ]
             }
            },
            "required": [
             "id",
             "name",
             "status",
             "billingType"
            ]
           }
          },
          "canEdit": {
           "type": "boolean"
          }
         },
         "required": [
          "client",
          "ownerName",
          "projects",
          "canEdit"
         ]
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "patch": {
    "tags": [
     "Clients"
    ],
    "summary": "Update a client",
    "description": "Needs the **Clients** scope with read and write access.",
    "operationId": "patchClientsId",
    "x-msmepulse-scope": "clients:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "description": "The fields depend on the workspace's country: India (GSTIN, PAN, state) or Singapore (UEN, GST registration).",
        "oneOf": [
         {
          "title": "India workspace",
          "type": "object",
          "properties": {
           "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 120
           },
           "type": {
            "type": "string",
            "enum": [
             "business",
             "individual"
            ],
            "default": "business"
           },
           "country": {
            "type": "string"
           },
           "email": {
            "anyOf": [
             {
              "const": ""
             },
             {
              "type": "string",
              "format": "email"
             }
            ],
            "default": ""
           },
           "phone": {
            "type": "string",
            "maxLength": 30,
            "default": ""
           },
           "billingAddress": {
            "type": "object",
            "properties": {
             "line1": {
              "type": "string",
              "maxLength": 200,
              "default": ""
             },
             "line2": {
              "type": "string",
              "maxLength": 200,
              "default": ""
             },
             "city": {
              "type": "string",
              "maxLength": 80,
              "default": ""
             },
             "postalCode": {
              "type": "string",
              "maxLength": 12,
              "default": ""
             },
             "state": {
              "type": "string",
              "maxLength": 4,
              "default": ""
             }
            },
            "default": {}
           },
           "currency": {
            "type": "string",
            "enum": [
             "INR",
             "SGD",
             "USD",
             "EUR",
             "GBP",
             "AED",
             "AUD",
             "MYR",
             "CAD",
             "CHF",
             "HKD",
             "NZD"
            ]
           },
           "paymentTermsDays": {
            "type": "integer",
            "minimum": 0,
            "maximum": 365,
            "default": 30
           },
           "notes": {
            "type": "string",
            "maxLength": 2000,
            "default": ""
           },
           "ownerId": {
            "anyOf": [
             {
              "type": "string"
             },
             {
              "type": "null"
             }
            ]
           },
           "gstin": {
            "type": "string",
            "default": ""
           },
           "pan": {
            "type": "string",
            "default": ""
           },
           "isSez": {
            "type": "boolean",
            "default": false
           },
           "uen": {
            "type": "string",
            "default": ""
           },
           "gstRegistered": {
            "type": "boolean",
            "default": false
           },
           "peppolId": {
            "type": "string",
            "maxLength": 60,
            "default": ""
           }
          },
          "description": "Send only the fields to change."
         },
         {
          "title": "Singapore workspace",
          "type": "object",
          "properties": {
           "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 120
           },
           "type": {
            "type": "string",
            "enum": [
             "business",
             "individual"
            ],
            "default": "business"
           },
           "country": {
            "type": "string"
           },
           "email": {
            "anyOf": [
             {
              "const": ""
             },
             {
              "type": "string",
              "format": "email"
             }
            ],
            "default": ""
           },
           "phone": {
            "type": "string",
            "maxLength": 30,
            "default": ""
           },
           "billingAddress": {
            "type": "object",
            "properties": {
             "line1": {
              "type": "string",
              "maxLength": 200,
              "default": ""
             },
             "line2": {
              "type": "string",
              "maxLength": 200,
              "default": ""
             },
             "city": {
              "type": "string",
              "maxLength": 80,
              "default": ""
             },
             "postalCode": {
              "type": "string",
              "maxLength": 12,
              "default": ""
             },
             "state": {
              "type": "string",
              "maxLength": 4,
              "default": ""
             }
            },
            "default": {}
           },
           "currency": {
            "type": "string",
            "enum": [
             "INR",
             "SGD",
             "USD",
             "EUR",
             "GBP",
             "AED",
             "AUD",
             "MYR",
             "CAD",
             "CHF",
             "HKD",
             "NZD"
            ]
           },
           "paymentTermsDays": {
            "type": "integer",
            "minimum": 0,
            "maximum": 365,
            "default": 30
           },
           "notes": {
            "type": "string",
            "maxLength": 2000,
            "default": ""
           },
           "ownerId": {
            "anyOf": [
             {
              "type": "string"
             },
             {
              "type": "null"
             }
            ]
           },
           "gstin": {
            "type": "string",
            "default": ""
           },
           "pan": {
            "type": "string",
            "default": ""
           },
           "isSez": {
            "type": "boolean",
            "default": false
           },
           "uen": {
            "type": "string",
            "default": ""
           },
           "gstRegistered": {
            "type": "boolean",
            "default": false
           },
           "peppolId": {
            "type": "string",
            "maxLength": 60,
            "default": ""
           }
          },
          "description": "Send only the fields to change."
         }
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/clients/{id}/360": {
   "get": {
    "tags": [
     "Clients"
    ],
    "summary": "A client's overview: projects, money owed, ageing, sales and timeline",
    "description": "Needs the **Clients** scope with read access.",
    "operationId": "getClientsId360",
    "x-msmepulse-scope": "clients:read",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/clients/{id}/activities": {
   "post": {
    "tags": [
     "Clients"
    ],
    "summary": "Add a note, call or meeting to a client's timeline",
    "description": "Needs the **Clients** scope with read access.",
    "operationId": "postClientsIdActivities",
    "x-msmepulse-scope": "clients:read",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "kind": {
          "type": "string",
          "enum": [
           "note",
           "call",
           "meeting",
           "email",
           "follow_up"
          ]
         },
         "body": {
          "type": "string",
          "maxLength": 2000,
          "default": ""
         },
         "dueDate": {
          "anyOf": [
           {
            "anyOf": [
             {
              "const": ""
             },
             {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
             }
            ]
           },
           {
            "type": "null"
           }
          ]
         }
        },
        "required": [
         "kind"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/clients/{id}/{action}": {
   "post": {
    "tags": [
     "Clients"
    ],
    "summary": "Archive or restore a client",
    "description": "Needs the **Clients** scope with read and write access.",
    "operationId": "postClientsIdAction",
    "x-msmepulse-scope": "clients:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "action",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "archive",
        "restore"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/clients/{id}/contacts": {
   "post": {
    "tags": [
     "Clients"
    ],
    "summary": "Add a contact to a client",
    "description": "Needs the **Clients** scope with read and write access.",
    "operationId": "postClientsIdContacts",
    "x-msmepulse-scope": "clients:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "minLength": 2,
          "maxLength": 80
         },
         "email": {
          "anyOf": [
           {
            "const": ""
           },
           {
            "type": "string",
            "format": "email"
           }
          ],
          "default": ""
         },
         "phone": {
          "type": "string",
          "maxLength": 30,
          "default": ""
         },
         "designation": {
          "type": "string",
          "maxLength": 60,
          "default": ""
         },
         "isPrimary": {
          "type": "boolean",
          "default": false
         }
        },
        "required": [
         "name"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/clients/{id}/contacts/{cid}": {
   "patch": {
    "tags": [
     "Clients"
    ],
    "summary": "Update a client's contact",
    "description": "Needs the **Clients** scope with read and write access.",
    "operationId": "patchClientsIdContactsCid",
    "x-msmepulse-scope": "clients:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "cid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "minLength": 2,
          "maxLength": 80
         },
         "email": {
          "anyOf": [
           {
            "const": ""
           },
           {
            "type": "string",
            "format": "email"
           }
          ],
          "default": ""
         },
         "phone": {
          "type": "string",
          "maxLength": 30,
          "default": ""
         },
         "designation": {
          "type": "string",
          "maxLength": 60,
          "default": ""
         },
         "isPrimary": {
          "type": "boolean",
          "default": false
         }
        },
        "required": [
         "name"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Clients"
    ],
    "summary": "Remove a client's contact",
    "description": "Needs the **Clients** scope with read and write access.",
    "operationId": "deleteClientsIdContactsCid",
    "x-msmepulse-scope": "clients:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "cid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/clients/{id}/portal-access": {
   "get": {
    "tags": [
     "Clients"
    ],
    "summary": "List a client's client portal users",
    "description": "Needs the **Clients** scope with read access.",
    "operationId": "getClientsIdPortalAccess",
    "x-msmepulse-scope": "clients:read",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "tags": [
     "Clients"
    ],
    "summary": "Invite a client contact to the client portal",
    "description": "Needs the **Clients** scope with read and write access.",
    "operationId": "postClientsIdPortalAccess",
    "x-msmepulse-scope": "clients:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/clients/{id}/portal-access/{uid}": {
   "delete": {
    "tags": [
     "Clients"
    ],
    "summary": "Remove someone's client portal access",
    "description": "Needs the **Clients** scope with read and write access.",
    "operationId": "deleteClientsIdPortalAccessUid",
    "x-msmepulse-scope": "clients:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "uid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/projects": {
   "get": {
    "tags": [
     "Projects"
    ],
    "summary": "List projects",
    "description": "Needs the **Projects and tasks** scope with read access.",
    "operationId": "getProjects",
    "x-msmepulse-scope": "projects:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "projects": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "string"
             },
             "name": {
              "type": "string"
             },
             "code": {
              "anyOf": [
               {
                "type": "string"
               },
               {
                "type": "null"
               }
              ]
             },
             "clientId": {
              "anyOf": [
               {
                "type": "string"
               },
               {
                "type": "null"
               }
              ]
             },
             "clientName": {
              "anyOf": [
               {
                "type": "string"
               },
               {
                "type": "null"
               }
              ]
             },
             "billingType": {
              "type": "string"
             },
             "status": {
              "type": "string"
             },
             "startDate": {
              "anyOf": [
               {
                "type": "string"
               },
               {
                "type": "null"
               }
              ]
             },
             "endDate": {
              "anyOf": [
               {
                "type": "string"
               },
               {
                "type": "null"
               }
              ]
             },
             "currency": {
              "type": "string"
             },
             "managerId": {
              "anyOf": [
               {
                "type": "string"
               },
               {
                "type": "null"
               }
              ]
             },
             "managerName": {
              "anyOf": [
               {
                "type": "string"
               },
               {
                "type": "null"
               }
              ]
             },
             "tasksTotal": {
              "type": "number"
             },
             "tasksDone": {
              "type": "number"
             },
             "tasksOverdue": {
              "type": "number"
             },
             "archived": {
              "type": "boolean"
             }
            },
            "required": [
             "id",
             "name",
             "clientId",
             "clientName",
             "billingType",
             "status",
             "managerId",
             "managerName",
             "tasksTotal",
             "tasksDone",
             "tasksOverdue",
             "archived"
            ]
           }
          }
         },
         "required": [
          "projects"
         ]
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "tags": [
     "Projects"
    ],
    "summary": "Create a project (optionally from a template)",
    "description": "Needs the **Projects and tasks** scope with read and write access.",
    "operationId": "postProjects",
    "x-msmepulse-scope": "projects:write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "minLength": 2,
          "maxLength": 120
         },
         "code": {
          "type": "string",
          "maxLength": 20,
          "default": ""
         },
         "clientId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "billingType": {
          "type": "string",
          "enum": [
           "time_and_materials",
           "fixed_price",
           "retainer",
           "non_billable"
          ],
          "default": "time_and_materials"
         },
         "status": {
          "type": "string",
          "enum": [
           "planning",
           "active",
           "on_hold",
           "completed",
           "cancelled"
          ],
          "default": "active"
         },
         "startDate": {
          "anyOf": [
           {
            "anyOf": [
             {
              "const": ""
             },
             {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
             }
            ]
           },
           {
            "type": "null"
           }
          ]
         },
         "endDate": {
          "anyOf": [
           {
            "anyOf": [
             {
              "const": ""
             },
             {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
             }
            ]
           },
           {
            "type": "null"
           }
          ]
         },
         "budgetHours": {
          "anyOf": [
           {
            "type": "number",
            "minimum": 0,
            "maximum": 1000000
           },
           {
            "type": "null"
           }
          ]
         },
         "budgetAmount": {
          "anyOf": [
           {
            "type": "integer",
            "minimum": 0
           },
           {
            "type": "null"
           }
          ]
         },
         "currency": {
          "type": "string",
          "enum": [
           "INR",
           "SGD",
           "USD",
           "EUR",
           "GBP",
           "AED",
           "AUD",
           "MYR",
           "CAD",
           "CHF",
           "HKD",
           "NZD"
          ]
         },
         "managerId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "memberIds": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "maxItems": 200,
          "default": []
         },
         "description": {
          "type": "string",
          "maxLength": 5000,
          "default": ""
         }
        },
        "required": [
         "name"
        ]
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "id": {
           "type": "string",
           "description": "The new record's id"
          }
         },
         "required": [
          "id"
         ]
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{id}": {
   "get": {
    "tags": [
     "Projects"
    ],
    "summary": "Get a project, with milestones and budget",
    "description": "Needs the **Projects and tasks** scope with read access.",
    "operationId": "getProjectsId",
    "x-msmepulse-scope": "projects:read",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "patch": {
    "tags": [
     "Projects"
    ],
    "summary": "Update a project",
    "description": "Needs the **Projects and tasks** scope with read and write access.",
    "operationId": "patchProjectsId",
    "x-msmepulse-scope": "projects:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "minLength": 2,
          "maxLength": 120
         },
         "code": {
          "type": "string",
          "maxLength": 20,
          "default": ""
         },
         "clientId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "billingType": {
          "type": "string",
          "enum": [
           "time_and_materials",
           "fixed_price",
           "retainer",
           "non_billable"
          ],
          "default": "time_and_materials"
         },
         "status": {
          "type": "string",
          "enum": [
           "planning",
           "active",
           "on_hold",
           "completed",
           "cancelled"
          ],
          "default": "active"
         },
         "startDate": {
          "anyOf": [
           {
            "anyOf": [
             {
              "const": ""
             },
             {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
             }
            ]
           },
           {
            "type": "null"
           }
          ]
         },
         "endDate": {
          "anyOf": [
           {
            "anyOf": [
             {
              "const": ""
             },
             {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
             }
            ]
           },
           {
            "type": "null"
           }
          ]
         },
         "budgetHours": {
          "anyOf": [
           {
            "type": "number",
            "minimum": 0,
            "maximum": 1000000
           },
           {
            "type": "null"
           }
          ]
         },
         "budgetAmount": {
          "anyOf": [
           {
            "type": "integer",
            "minimum": 0
           },
           {
            "type": "null"
           }
          ]
         },
         "currency": {
          "type": "string",
          "enum": [
           "INR",
           "SGD",
           "USD",
           "EUR",
           "GBP",
           "AED",
           "AUD",
           "MYR",
           "CAD",
           "CHF",
           "HKD",
           "NZD"
          ]
         },
         "managerId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "memberIds": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "maxItems": 200,
          "default": []
         },
         "description": {
          "type": "string",
          "maxLength": 5000,
          "default": ""
         }
        },
        "description": "Send only the fields to change."
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{id}/columns": {
   "put": {
    "tags": [
     "Projects"
    ],
    "summary": "Set a project's board columns",
    "description": "Needs the **Projects and tasks** scope with read and write access.",
    "operationId": "putProjectsIdColumns",
    "x-msmepulse-scope": "projects:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "columns": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "key": {
             "type": "string",
             "minLength": 1,
             "maxLength": 40
            },
            "name": {
             "type": "string",
             "minLength": 1,
             "maxLength": 40
            },
            "done": {
             "type": "boolean"
            }
           },
           "required": [
            "key",
            "name",
            "done"
           ]
          },
          "minItems": 2,
          "maxItems": 12
         }
        },
        "required": [
         "columns"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{id}/{action}": {
   "post": {
    "tags": [
     "Projects"
    ],
    "summary": "Archive or restore a project",
    "description": "Needs the **Projects and tasks** scope with read and write access.",
    "operationId": "postProjectsIdAction",
    "x-msmepulse-scope": "projects:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "action",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "archive",
        "restore"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{id}/milestones": {
   "post": {
    "tags": [
     "Projects"
    ],
    "summary": "Add a milestone",
    "description": "Needs the **Projects and tasks** scope with read and write access.",
    "operationId": "postProjectsIdMilestones",
    "x-msmepulse-scope": "projects:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "minLength": 2,
          "maxLength": 120
         },
         "dueDate": {
          "anyOf": [
           {
            "anyOf": [
             {
              "const": ""
             },
             {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
             }
            ]
           },
           {
            "type": "null"
           }
          ]
         },
         "amount": {
          "anyOf": [
           {
            "type": "integer",
            "minimum": 0
           },
           {
            "type": "null"
           }
          ]
         },
         "billable": {
          "type": "boolean",
          "default": true
         },
         "clientVisible": {
          "type": "boolean",
          "default": true
         },
         "status": {
          "type": "string",
          "enum": [
           "pending",
           "completed"
          ]
         }
        },
        "required": [
         "name"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{id}/milestones/{mid}": {
   "patch": {
    "tags": [
     "Projects"
    ],
    "summary": "Update a milestone",
    "description": "Needs the **Projects and tasks** scope with read and write access.",
    "operationId": "patchProjectsIdMilestonesMid",
    "x-msmepulse-scope": "projects:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "mid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "minLength": 2,
          "maxLength": 120
         },
         "dueDate": {
          "anyOf": [
           {
            "anyOf": [
             {
              "const": ""
             },
             {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
             }
            ]
           },
           {
            "type": "null"
           }
          ]
         },
         "amount": {
          "anyOf": [
           {
            "type": "integer",
            "minimum": 0
           },
           {
            "type": "null"
           }
          ]
         },
         "billable": {
          "type": "boolean",
          "default": true
         },
         "clientVisible": {
          "type": "boolean",
          "default": true
         },
         "status": {
          "type": "string",
          "enum": [
           "pending",
           "completed"
          ]
         },
         "overrideReason": {
          "type": "string",
          "maxLength": 500
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Projects"
    ],
    "summary": "Delete a milestone",
    "description": "Needs the **Projects and tasks** scope with read and write access.",
    "operationId": "deleteProjectsIdMilestonesMid",
    "x-msmepulse-scope": "projects:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "mid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{id}/documents": {
   "get": {
    "tags": [
     "Projects"
    ],
    "summary": "A project's document checklist",
    "description": "Needs the **Projects and tasks** scope with read access.",
    "operationId": "getProjectsIdDocuments",
    "x-msmepulse-scope": "projects:read",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "tags": [
     "Projects"
    ],
    "summary": "Add an item to the document checklist",
    "description": "Needs the **Projects and tasks** scope with read and write access.",
    "operationId": "postProjectsIdDocuments",
    "x-msmepulse-scope": "projects:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "title": {
          "type": "string",
          "minLength": 2,
          "maxLength": 150
         },
         "about": {
          "type": "string",
          "maxLength": 1000,
          "default": ""
         },
         "compulsory": {
          "type": "boolean",
          "default": false
         },
         "providedBy": {
          "type": "string",
          "enum": [
           "client",
           "internal"
          ],
          "default": "client"
         },
         "milestoneId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "dueDate": {
          "anyOf": [
           {
            "anyOf": [
             {
              "const": ""
             },
             {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
             }
            ]
           },
           {
            "type": "null"
           }
          ]
         }
        },
        "required": [
         "title"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{id}/documents/{did}": {
   "patch": {
    "tags": [
     "Projects"
    ],
    "summary": "Update a checklist item",
    "description": "Needs the **Projects and tasks** scope with read and write access.",
    "operationId": "patchProjectsIdDocumentsDid",
    "x-msmepulse-scope": "projects:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "did",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "title": {
          "type": "string",
          "minLength": 2,
          "maxLength": 150
         },
         "about": {
          "type": "string",
          "maxLength": 1000,
          "default": ""
         },
         "compulsory": {
          "type": "boolean",
          "default": false
         },
         "providedBy": {
          "type": "string",
          "enum": [
           "client",
           "internal"
          ],
          "default": "client"
         },
         "milestoneId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "dueDate": {
          "anyOf": [
           {
            "anyOf": [
             {
              "const": ""
             },
             {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
             }
            ]
           },
           {
            "type": "null"
           }
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Projects"
    ],
    "summary": "Remove a checklist item",
    "description": "Needs the **Projects and tasks** scope with read and write access.",
    "operationId": "deleteProjectsIdDocumentsDid",
    "x-msmepulse-scope": "projects:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "did",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{id}/documents/{did}/status": {
   "post": {
    "tags": [
     "Projects"
    ],
    "summary": "Mark a checklist item received, approved or rejected",
    "description": "Needs the **Projects and tasks** scope with read and write access.",
    "operationId": "postProjectsIdDocumentsDidStatus",
    "x-msmepulse-scope": "projects:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "did",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "status": {
          "type": "string",
          "enum": [
           "pending",
           "received",
           "verified",
           "not_applicable"
          ]
         },
         "note": {
          "type": "string",
          "maxLength": 500,
          "default": ""
         }
        },
        "required": [
         "status"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{id}/documents/{did}/files": {
   "post": {
    "tags": [
     "Projects"
    ],
    "summary": "Upload a file to a checklist item",
    "description": "Needs the **Projects and tasks** scope with read and write access.",
    "operationId": "postProjectsIdDocumentsDidFiles",
    "x-msmepulse-scope": "projects:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "did",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "required": [
         "file"
        ],
        "properties": {
         "file": {
          "type": "string",
          "format": "binary"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{id}/documents/{did}/files/{fid}": {
   "get": {
    "tags": [
     "Projects"
    ],
    "summary": "Download a checklist file",
    "description": "Needs the **Projects and tasks** scope with read access.",
    "operationId": "getProjectsIdDocumentsDidFilesFid",
    "x-msmepulse-scope": "projects:read",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "did",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "fid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{id}/tasks": {
   "get": {
    "tags": [
     "Projects"
    ],
    "summary": "A project's tasks",
    "description": "Needs the **Projects and tasks** scope with read access.",
    "operationId": "getProjectsIdTasks",
    "x-msmepulse-scope": "projects:read",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "tags": [
     "Projects"
    ],
    "summary": "Add a task to a project",
    "description": "Needs the **Projects and tasks** scope with read and write access.",
    "operationId": "postProjectsIdTasks",
    "x-msmepulse-scope": "projects:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
         },
         "description": {
          "type": "string",
          "maxLength": 10000,
          "default": ""
         },
         "columnKey": {
          "type": "string",
          "maxLength": 40
         },
         "assigneeIds": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "maxItems": 20,
          "default": []
         },
         "dueDate": {
          "anyOf": [
           {
            "anyOf": [
             {
              "const": ""
             },
             {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
             }
            ]
           },
           {
            "type": "null"
           }
          ]
         },
         "startDate": {
          "anyOf": [
           {
            "anyOf": [
             {
              "const": ""
             },
             {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
             }
            ]
           },
           {
            "type": "null"
           }
          ]
         },
         "priority": {
          "type": "string",
          "enum": [
           "low",
           "medium",
           "high",
           "urgent"
          ],
          "default": "medium"
         },
         "labels": {
          "type": "array",
          "items": {
           "type": "string",
           "minLength": 1,
           "maxLength": 30
          },
          "maxItems": 10,
          "default": []
         },
         "estimateHours": {
          "anyOf": [
           {
            "type": "number",
            "minimum": 0,
            "maximum": 10000
           },
           {
            "type": "null"
           }
          ]
         },
         "clientVisible": {
          "type": "boolean",
          "default": false
         },
         "dependsOn": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "maxItems": 20,
          "default": []
         },
         "parentId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "milestoneId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         }
        },
        "required": [
         "title"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/tasks/{taskId}": {
   "patch": {
    "tags": [
     "Tasks"
    ],
    "summary": "Update a task (status, assignees, due date…)",
    "description": "Needs the **Projects and tasks** scope with read and write access.",
    "operationId": "patchTasksTaskId",
    "x-msmepulse-scope": "projects:write",
    "parameters": [
     {
      "name": "taskId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
         },
         "description": {
          "type": "string",
          "maxLength": 10000,
          "default": ""
         },
         "columnKey": {
          "type": "string",
          "maxLength": 40
         },
         "assigneeIds": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "maxItems": 20,
          "default": []
         },
         "dueDate": {
          "anyOf": [
           {
            "anyOf": [
             {
              "const": ""
             },
             {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
             }
            ]
           },
           {
            "type": "null"
           }
          ]
         },
         "startDate": {
          "anyOf": [
           {
            "anyOf": [
             {
              "const": ""
             },
             {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
             }
            ]
           },
           {
            "type": "null"
           }
          ]
         },
         "priority": {
          "type": "string",
          "enum": [
           "low",
           "medium",
           "high",
           "urgent"
          ],
          "default": "medium"
         },
         "labels": {
          "type": "array",
          "items": {
           "type": "string",
           "minLength": 1,
           "maxLength": 30
          },
          "maxItems": 10,
          "default": []
         },
         "estimateHours": {
          "anyOf": [
           {
            "type": "number",
            "minimum": 0,
            "maximum": 10000
           },
           {
            "type": "null"
           }
          ]
         },
         "clientVisible": {
          "type": "boolean",
          "default": false
         },
         "dependsOn": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "maxItems": 20,
          "default": []
         },
         "parentId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "milestoneId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "order": {
          "type": "number"
         },
         "confirm": {
          "type": "boolean"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Tasks"
    ],
    "summary": "Delete a task",
    "description": "Needs the **Projects and tasks** scope with read and write access.",
    "operationId": "deleteTasksTaskId",
    "x-msmepulse-scope": "projects:write",
    "parameters": [
     {
      "name": "taskId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/tasks": {
   "get": {
    "tags": [
     "Tasks"
    ],
    "summary": "Open tasks (assignee=anyone for everyone's)",
    "description": "Needs the **Projects and tasks** scope with read access.",
    "operationId": "getTasks",
    "x-msmepulse-scope": "projects:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/invoices": {
   "get": {
    "tags": [
     "Invoices and payments"
    ],
    "summary": "List invoices (status, clientId, kind)",
    "description": "Needs the **Invoices and payments** scope with read access.",
    "operationId": "getInvoices",
    "x-msmepulse-scope": "invoices:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "invoices": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "string"
             },
             "number": {
              "anyOf": [
               {
                "type": "string"
               },
               {
                "type": "null"
               }
              ]
             },
             "status": {
              "type": "string",
              "enum": [
               "draft",
               "issued",
               "partially_paid",
               "paid",
               "cancelled"
              ]
             },
             "kind": {
              "type": "string",
              "enum": [
               "invoice",
               "credit_note",
               "debit_note"
              ]
             },
             "clientId": {
              "type": "string"
             },
             "clientName": {
              "type": "string"
             },
             "issueDate": {
              "anyOf": [
               {
                "type": "string",
                "description": "YYYY-MM-DD"
               },
               {
                "type": "null"
               }
              ]
             },
             "dueDate": {
              "anyOf": [
               {
                "type": "string",
                "description": "YYYY-MM-DD"
               },
               {
                "type": "null"
               }
              ]
             },
             "currency": {
              "type": "string"
             },
             "total": {
              "type": "integer",
              "description": "Total, in minor units (paise or cents)"
             },
             "balance": {
              "type": "integer",
              "description": "Still to pay, in minor units (paise or cents)"
             },
             "overdue": {
              "type": "boolean"
             },
             "sentAt": {
              "anyOf": [
               {
                "type": "string"
               },
               {
                "type": "null"
               }
              ]
             },
             "sample": {
              "type": "boolean"
             }
            },
            "required": [
             "id",
             "number",
             "status",
             "kind",
             "clientId",
             "clientName",
             "issueDate",
             "dueDate",
             "currency",
             "total",
             "balance",
             "overdue",
             "sample"
            ]
           }
          },
          "summary": {
           "type": "object",
           "properties": {
            "currency": {
             "type": "string"
            },
            "outstanding": {
             "type": "integer",
             "description": "Owed to you, in minor units (paise or cents)"
            },
            "overdue": {
             "type": "integer",
             "description": "Overdue, in minor units (paise or cents)"
            },
            "otherCurrencies": {
             "type": "number",
             "description": "Open invoices in other currencies, not in the totals"
            }
           },
           "required": [
            "currency",
            "outstanding",
            "overdue",
            "otherCurrencies"
           ]
          }
         },
         "required": [
          "invoices",
          "summary"
         ]
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "tags": [
     "Invoices and payments"
    ],
    "summary": "Create a draft invoice",
    "description": "Needs the **Invoices and payments** scope with read and write access.",
    "operationId": "postInvoices",
    "x-msmepulse-scope": "invoices:write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "clientId": {
          "type": "string",
          "minLength": 1
         },
         "projectId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "issueDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
         },
         "dueDate": {
          "anyOf": [
           {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
           },
           {
            "type": "null"
           }
          ]
         },
         "currency": {
          "type": "string",
          "enum": [
           "INR",
           "SGD",
           "USD",
           "EUR",
           "GBP",
           "AED",
           "AUD",
           "MYR",
           "CAD",
           "CHF",
           "HKD",
           "NZD"
          ]
         },
         "exchangeRate": {
          "anyOf": [
           {
            "type": "number",
            "exclusiveMinimum": 0
           },
           {
            "type": "null"
           }
          ]
         },
         "poNumber": {
          "type": "string",
          "maxLength": 40,
          "default": ""
         },
         "notes": {
          "type": "string",
          "maxLength": 2000,
          "default": ""
         },
         "exportUnderLut": {
          "type": "boolean",
          "default": false
         },
         "reverseCharge": {
          "type": "boolean",
          "default": false
         },
         "lines": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "description": {
             "type": "string",
             "minLength": 1,
             "maxLength": 1000
            },
            "quantity": {
             "type": "number",
             "minimum": 0.001,
             "maximum": 1000000
            },
            "unit": {
             "type": "string",
             "maxLength": 20,
             "default": ""
            },
            "unitPrice": {
             "type": "integer",
             "minimum": 0
            },
            "discount": {
             "type": "integer",
             "minimum": 0,
             "default": 0
            },
            "hsnSac": {
             "type": "string",
             "maxLength": 8,
             "default": ""
            },
            "rateBps": {
             "type": "integer",
             "minimum": 0,
             "default": 0
            },
            "treatment": {
             "type": "string",
             "enum": [
              "taxable",
              "exempt",
              "nil",
              "non_gst"
             ],
             "default": "taxable"
            },
            "sgTaxCode": {
             "type": "string",
             "enum": [
              "SR",
              "ZR",
              "ES",
              "OS"
             ],
             "default": "SR"
            },
            "catalogueItemId": {
             "anyOf": [
              {
               "type": "string"
              },
              {
               "type": "null"
              }
             ]
            },
            "source": {
             "type": "object",
             "properties": {
              "kind": {
               "type": "string",
               "enum": [
                "time",
                "milestone",
                "item",
                "manual",
                "expense"
               ]
              },
              "timeLogIds": {
               "type": "array",
               "items": {
                "type": "string"
               },
               "default": []
              },
              "milestoneId": {
               "anyOf": [
                {
                 "type": "string"
                },
                {
                 "type": "null"
                }
               ]
              },
              "expenseId": {
               "anyOf": [
                {
                 "type": "string"
                },
                {
                 "type": "null"
                }
               ]
              }
             },
             "required": [
              "kind"
             ],
             "default": {
              "kind": "manual",
              "timeLogIds": []
             }
            }
           },
           "required": [
            "description",
            "quantity",
            "unitPrice"
           ]
          },
          "minItems": 1,
          "maxItems": 200
         }
        },
        "required": [
         "clientId",
         "issueDate",
         "currency",
         "lines"
        ]
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "id": {
           "type": "string",
           "description": "The new record's id"
          }
         },
         "required": [
          "id"
         ]
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/invoices/billable": {
   "get": {
    "tags": [
     "Invoices and payments"
    ],
    "summary": "Unbilled approved time and completed milestones for a client",
    "description": "Needs the **Invoices and payments** scope with read and write access.",
    "operationId": "getInvoicesBillable",
    "x-msmepulse-scope": "invoices:write",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/invoices/preview": {
   "post": {
    "tags": [
     "Invoices and payments"
    ],
    "summary": "Work out an invoice's tax and totals without saving it",
    "description": "Needs the **Invoices and payments** scope with read and write access.",
    "operationId": "postInvoicesPreview",
    "x-msmepulse-scope": "invoices:write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "clientId": {
          "type": "string",
          "minLength": 1
         },
         "projectId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "issueDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
         },
         "dueDate": {
          "anyOf": [
           {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
           },
           {
            "type": "null"
           }
          ]
         },
         "currency": {
          "type": "string",
          "enum": [
           "INR",
           "SGD",
           "USD",
           "EUR",
           "GBP",
           "AED",
           "AUD",
           "MYR",
           "CAD",
           "CHF",
           "HKD",
           "NZD"
          ]
         },
         "exchangeRate": {
          "anyOf": [
           {
            "type": "number",
            "exclusiveMinimum": 0
           },
           {
            "type": "null"
           }
          ]
         },
         "poNumber": {
          "type": "string",
          "maxLength": 40,
          "default": ""
         },
         "notes": {
          "type": "string",
          "maxLength": 2000,
          "default": ""
         },
         "exportUnderLut": {
          "type": "boolean",
          "default": false
         },
         "reverseCharge": {
          "type": "boolean",
          "default": false
         },
         "lines": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "description": {
             "type": "string",
             "minLength": 1,
             "maxLength": 1000
            },
            "quantity": {
             "type": "number",
             "minimum": 0.001,
             "maximum": 1000000
            },
            "unit": {
             "type": "string",
             "maxLength": 20,
             "default": ""
            },
            "unitPrice": {
             "type": "integer",
             "minimum": 0
            },
            "discount": {
             "type": "integer",
             "minimum": 0,
             "default": 0
            },
            "hsnSac": {
             "type": "string",
             "maxLength": 8,
             "default": ""
            },
            "rateBps": {
             "type": "integer",
             "minimum": 0,
             "default": 0
            },
            "treatment": {
             "type": "string",
             "enum": [
              "taxable",
              "exempt",
              "nil",
              "non_gst"
             ],
             "default": "taxable"
            },
            "sgTaxCode": {
             "type": "string",
             "enum": [
              "SR",
              "ZR",
              "ES",
              "OS"
             ],
             "default": "SR"
            },
            "catalogueItemId": {
             "anyOf": [
              {
               "type": "string"
              },
              {
               "type": "null"
              }
             ]
            },
            "source": {
             "type": "object",
             "properties": {
              "kind": {
               "type": "string",
               "enum": [
                "time",
                "milestone",
                "item",
                "manual",
                "expense"
               ]
              },
              "timeLogIds": {
               "type": "array",
               "items": {
                "type": "string"
               },
               "default": []
              },
              "milestoneId": {
               "anyOf": [
                {
                 "type": "string"
                },
                {
                 "type": "null"
                }
               ]
              },
              "expenseId": {
               "anyOf": [
                {
                 "type": "string"
                },
                {
                 "type": "null"
                }
               ]
              }
             },
             "required": [
              "kind"
             ],
             "default": {
              "kind": "manual",
              "timeLogIds": []
             }
            }
           },
           "required": [
            "description",
            "quantity",
            "unitPrice"
           ]
          },
          "minItems": 1,
          "maxItems": 200
         }
        },
        "required": [
         "clientId",
         "issueDate",
         "currency",
         "lines"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/invoices/{id}": {
   "get": {
    "tags": [
     "Invoices and payments"
    ],
    "summary": "Get an invoice, with its lines, tax and payments",
    "description": "Needs the **Invoices and payments** scope with read access.",
    "operationId": "getInvoicesId",
    "x-msmepulse-scope": "invoices:read",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "invoice": {
           "type": "object",
           "properties": {
            "id": {
             "type": "string"
            },
            "number": {
             "anyOf": [
              {
               "type": "string"
              },
              {
               "type": "null"
              }
             ]
            },
            "kind": {
             "type": "string"
            },
            "status": {
             "type": "string"
            },
            "clientId": {
             "type": "string"
            },
            "clientName": {
             "type": "string"
            },
            "projectId": {
             "anyOf": [
              {
               "type": "string"
              },
              {
               "type": "null"
              }
             ]
            },
            "issueDate": {
             "anyOf": [
              {
               "type": "string",
               "description": "YYYY-MM-DD"
              },
              {
               "type": "null"
              }
             ]
            },
            "dueDate": {
             "anyOf": [
              {
               "type": "string",
               "description": "YYYY-MM-DD"
              },
              {
               "type": "null"
              }
             ]
            },
            "currency": {
             "type": "string"
            },
            "exchangeRate": {
             "anyOf": [
              {
               "type": "number"
              },
              {
               "type": "null"
              }
             ]
            },
            "lines": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "description": {
                "type": "string"
               },
               "quantity": {
                "type": "number"
               },
               "unitPrice": {
                "type": "integer",
                "description": "Price, in minor units (paise or cents)"
               },
               "hsnSac": {
                "anyOf": [
                 {
                  "type": "string"
                 },
                 {
                  "type": "null"
                 }
                ]
               },
               "rateBps": {
                "anyOf": [
                 {
                  "type": "number"
                 },
                 {
                  "type": "null"
                 }
                ]
               },
               "taxable": {
                "type": "integer",
                "description": "Taxable value, in minor units (paise or cents)"
               }
              },
              "required": [
               "description",
               "quantity",
               "unitPrice"
              ]
             }
            },
            "placeOfSupply": {
             "anyOf": [
              {
               "type": "string"
              },
              {
               "type": "null"
              }
             ]
            },
            "taxable": {
             "type": "integer",
             "description": "Taxable value, in minor units (paise or cents)"
            },
            "cgst": {
             "type": "integer",
             "description": "CGST, in minor units (paise or cents)"
            },
            "sgst": {
             "type": "integer",
             "description": "SGST, in minor units (paise or cents)"
            },
            "utgst": {
             "type": "integer",
             "description": "UTGST, in minor units (paise or cents)"
            },
            "igst": {
             "type": "integer",
             "description": "IGST, in minor units (paise or cents)"
            },
            "gst": {
             "type": "integer",
             "description": "All GST, in minor units (paise or cents)"
            },
            "total": {
             "type": "integer",
             "description": "Total, in minor units (paise or cents)"
            },
            "balance": {
             "type": "integer",
             "description": "Still to pay, in minor units (paise or cents)"
            },
            "overdue": {
             "type": "boolean"
            },
            "daysOverdue": {
             "type": "number"
            },
            "payments": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "string"
               },
               "date": {
                "type": "string",
                "description": "YYYY-MM-DD"
               },
               "amount": {
                "type": "integer",
                "description": "Received, in minor units (paise or cents)"
               },
               "tdsAmount": {
                "type": "integer",
                "description": "TDS deducted by the client, in minor units (paise or cents)"
               },
               "method": {
                "type": "string"
               },
               "reference": {
                "type": "string"
               }
              },
              "required": [
               "id",
               "date",
               "amount"
              ]
             }
            }
           },
           "required": [
            "id",
            "number",
            "kind",
            "status",
            "clientId",
            "projectId",
            "issueDate",
            "dueDate",
            "currency",
            "lines",
            "taxable",
            "cgst",
            "sgst",
            "utgst",
            "igst",
            "gst",
            "total",
            "balance",
            "overdue",
            "daysOverdue",
            "payments"
           ]
          }
         },
         "required": [
          "invoice"
         ]
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "put": {
    "tags": [
     "Invoices and payments"
    ],
    "summary": "Replace a draft invoice",
    "description": "Needs the **Invoices and payments** scope with read and write access.",
    "operationId": "putInvoicesId",
    "x-msmepulse-scope": "invoices:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "clientId": {
          "type": "string",
          "minLength": 1
         },
         "projectId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "issueDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
         },
         "dueDate": {
          "anyOf": [
           {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
           },
           {
            "type": "null"
           }
          ]
         },
         "currency": {
          "type": "string",
          "enum": [
           "INR",
           "SGD",
           "USD",
           "EUR",
           "GBP",
           "AED",
           "AUD",
           "MYR",
           "CAD",
           "CHF",
           "HKD",
           "NZD"
          ]
         },
         "exchangeRate": {
          "anyOf": [
           {
            "type": "number",
            "exclusiveMinimum": 0
           },
           {
            "type": "null"
           }
          ]
         },
         "poNumber": {
          "type": "string",
          "maxLength": 40,
          "default": ""
         },
         "notes": {
          "type": "string",
          "maxLength": 2000,
          "default": ""
         },
         "exportUnderLut": {
          "type": "boolean",
          "default": false
         },
         "reverseCharge": {
          "type": "boolean",
          "default": false
         },
         "lines": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "description": {
             "type": "string",
             "minLength": 1,
             "maxLength": 1000
            },
            "quantity": {
             "type": "number",
             "minimum": 0.001,
             "maximum": 1000000
            },
            "unit": {
             "type": "string",
             "maxLength": 20,
             "default": ""
            },
            "unitPrice": {
             "type": "integer",
             "minimum": 0
            },
            "discount": {
             "type": "integer",
             "minimum": 0,
             "default": 0
            },
            "hsnSac": {
             "type": "string",
             "maxLength": 8,
             "default": ""
            },
            "rateBps": {
             "type": "integer",
             "minimum": 0,
             "default": 0
            },
            "treatment": {
             "type": "string",
             "enum": [
              "taxable",
              "exempt",
              "nil",
              "non_gst"
             ],
             "default": "taxable"
            },
            "sgTaxCode": {
             "type": "string",
             "enum": [
              "SR",
              "ZR",
              "ES",
              "OS"
             ],
             "default": "SR"
            },
            "catalogueItemId": {
             "anyOf": [
              {
               "type": "string"
              },
              {
               "type": "null"
              }
             ]
            },
            "source": {
             "type": "object",
             "properties": {
              "kind": {
               "type": "string",
               "enum": [
                "time",
                "milestone",
                "item",
                "manual",
                "expense"
               ]
              },
              "timeLogIds": {
               "type": "array",
               "items": {
                "type": "string"
               },
               "default": []
              },
              "milestoneId": {
               "anyOf": [
                {
                 "type": "string"
                },
                {
                 "type": "null"
                }
               ]
              },
              "expenseId": {
               "anyOf": [
                {
                 "type": "string"
                },
                {
                 "type": "null"
                }
               ]
              }
             },
             "required": [
              "kind"
             ],
             "default": {
              "kind": "manual",
              "timeLogIds": []
             }
            }
           },
           "required": [
            "description",
            "quantity",
            "unitPrice"
           ]
          },
          "minItems": 1,
          "maxItems": 200
         }
        },
        "required": [
         "clientId",
         "issueDate",
         "currency",
         "lines"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Invoices and payments"
    ],
    "summary": "Delete a draft invoice",
    "description": "Needs the **Invoices and payments** scope with read and write access.",
    "operationId": "deleteInvoicesId",
    "x-msmepulse-scope": "invoices:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/invoices/{id}/issue": {
   "post": {
    "tags": [
     "Invoices and payments"
    ],
    "summary": "Issue a draft invoice (gives it its number)",
    "description": "Needs the **Invoices and payments** scope with read and write access.",
    "operationId": "postInvoicesIdIssue",
    "x-msmepulse-scope": "invoices:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/invoices/{id}/send": {
   "post": {
    "tags": [
     "Invoices and payments"
    ],
    "summary": "Email an invoice to the client",
    "description": "Needs the **Invoices and payments** scope with read and write access.",
    "operationId": "postInvoicesIdSend",
    "x-msmepulse-scope": "invoices:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "to": {
          "type": "string",
          "format": "email"
         },
         "message": {
          "type": "string",
          "maxLength": 2000,
          "default": ""
         }
        },
        "required": [
         "to"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/invoices/{id}/pay-link": {
   "post": {
    "tags": [
     "Invoices and payments"
    ],
    "summary": "Create an online payment link",
    "description": "Needs the **Invoices and payments** scope with read and write access.",
    "operationId": "postInvoicesIdPayLink",
    "x-msmepulse-scope": "invoices:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/invoices/{id}/payments": {
   "post": {
    "tags": [
     "Invoices and payments"
    ],
    "summary": "Record a payment (with TDS in India)",
    "description": "Needs the **Invoices and payments** scope with read and write access.",
    "operationId": "postInvoicesIdPayments",
    "x-msmepulse-scope": "invoices:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
         },
         "amount": {
          "type": "integer",
          "minimum": 0
         },
         "method": {
          "type": "string",
          "enum": [
           "bank_transfer",
           "upi",
           "paynow",
           "cheque",
           "cash",
           "card",
           "other"
          ]
         },
         "reference": {
          "type": "string",
          "maxLength": 80,
          "default": ""
         },
         "tdsAmount": {
          "type": "integer",
          "minimum": 0,
          "default": 0
         },
         "tdsSection": {
          "type": "string",
          "maxLength": 20,
          "default": ""
         },
         "note": {
          "type": "string",
          "maxLength": 500,
          "default": ""
         }
        },
        "required": [
         "date",
         "amount",
         "method"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "balance": {
           "type": "integer",
           "description": "Still to pay, in minor units (paise or cents)"
          }
         },
         "required": [
          "status",
          "balance"
         ]
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/invoices/{id}/payments/{pid}": {
   "delete": {
    "tags": [
     "Invoices and payments"
    ],
    "summary": "Remove a recorded payment",
    "description": "Needs the **Invoices and payments** scope with read and write access.",
    "operationId": "deleteInvoicesIdPaymentsPid",
    "x-msmepulse-scope": "invoices:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "pid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/invoices/{id}/payments/{pid}/tds-certificate": {
   "patch": {
    "tags": [
     "Invoices and payments"
    ],
    "summary": "Record the client's TDS certificate for a payment",
    "description": "Needs the **Invoices and payments** scope with read and write access.",
    "operationId": "patchInvoicesIdPaymentsPidTdsCertificate",
    "x-msmepulse-scope": "invoices:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "pid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "received": {
          "type": "boolean"
         }
        },
        "required": [
         "received"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/invoices/{id}/cancel": {
   "post": {
    "tags": [
     "Invoices and payments"
    ],
    "summary": "Cancel an issued invoice",
    "description": "Needs the **Invoices and payments** scope with read and write access.",
    "operationId": "postInvoicesIdCancel",
    "x-msmepulse-scope": "invoices:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "reason": {
          "type": "string",
          "minLength": 3,
          "maxLength": 500
         }
        },
        "required": [
         "reason"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/invoices/{id}/credit-notes": {
   "post": {
    "tags": [
     "Invoices and payments"
    ],
    "summary": "Raise a credit note against an invoice",
    "description": "Needs the **Invoices and payments** scope with read and write access.",
    "operationId": "postInvoicesIdCreditNotes",
    "x-msmepulse-scope": "invoices:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "issueDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
         },
         "reason": {
          "type": "string",
          "enum": [
           "discount",
           "deficiency",
           "overcharge",
           "return",
           "other"
          ]
         },
         "reasonNote": {
          "type": "string",
          "maxLength": 500,
          "default": ""
         },
         "lines": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "index": {
             "type": "integer",
             "minimum": 0
            },
            "amount": {
             "type": "integer",
             "minimum": 0
            }
           },
           "required": [
            "index",
            "amount"
           ]
          },
          "minItems": 1
         }
        },
        "required": [
         "issueDate",
         "reason",
         "lines"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/invoices/{id}/debit-notes": {
   "post": {
    "tags": [
     "Invoices and payments"
    ],
    "summary": "Raise a debit note against an invoice",
    "description": "Needs the **Invoices and payments** scope with read and write access.",
    "operationId": "postInvoicesIdDebitNotes",
    "x-msmepulse-scope": "invoices:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "issueDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
         },
         "dueDate": {
          "anyOf": [
           {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
           },
           {
            "type": "null"
           }
          ]
         },
         "reason": {
          "type": "string",
          "enum": [
           "undercharge",
           "additional",
           "tax_shortfall",
           "other"
          ]
         },
         "reasonNote": {
          "type": "string",
          "maxLength": 500,
          "default": ""
         },
         "lines": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "description": {
             "type": "string",
             "minLength": 1,
             "maxLength": 1000
            },
            "quantity": {
             "type": "number",
             "minimum": 0.001,
             "maximum": 1000000
            },
            "unit": {
             "type": "string",
             "maxLength": 20,
             "default": ""
            },
            "unitPrice": {
             "type": "integer",
             "minimum": 0
            },
            "discount": {
             "type": "integer",
             "minimum": 0,
             "default": 0
            },
            "hsnSac": {
             "type": "string",
             "maxLength": 8,
             "default": ""
            },
            "rateBps": {
             "type": "integer",
             "minimum": 0,
             "default": 0
            },
            "treatment": {
             "type": "string",
             "enum": [
              "taxable",
              "exempt",
              "nil",
              "non_gst"
             ],
             "default": "taxable"
            },
            "sgTaxCode": {
             "type": "string",
             "enum": [
              "SR",
              "ZR",
              "ES",
              "OS"
             ],
             "default": "SR"
            }
           },
           "required": [
            "description",
            "quantity",
            "unitPrice"
           ]
          },
          "minItems": 1,
          "maxItems": 50
         }
        },
        "required": [
         "issueDate",
         "reason",
         "lines"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/invoices/{id}/refunds": {
   "post": {
    "tags": [
     "Invoices and payments"
    ],
    "summary": "Record a refund",
    "description": "Needs the **Invoices and payments** scope with read and write access.",
    "operationId": "postInvoicesIdRefunds",
    "x-msmepulse-scope": "invoices:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
         },
         "amount": {
          "type": "integer",
          "minimum": 1
         },
         "method": {
          "type": "string",
          "enum": [
           "bank_transfer",
           "upi",
           "paynow",
           "cheque",
           "cash",
           "card",
           "other"
          ]
         },
         "reference": {
          "type": "string",
          "maxLength": 80,
          "default": ""
         }
        },
        "required": [
         "date",
         "amount",
         "method"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/sales/stages": {
   "get": {
    "tags": [
     "Leads and deals"
    ],
    "summary": "The pipeline's stages",
    "description": "Needs the **Leads, deals and proposals** scope with read access.",
    "operationId": "getSalesStages",
    "x-msmepulse-scope": "crm:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/sales/leads": {
   "get": {
    "tags": [
     "Leads and deals"
    ],
    "summary": "List leads",
    "description": "Needs the **Leads, deals and proposals** scope with read access.",
    "operationId": "getSalesLeads",
    "x-msmepulse-scope": "crm:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "tags": [
     "Leads and deals"
    ],
    "summary": "Add a lead",
    "description": "Needs the **Leads, deals and proposals** scope with read and write access.",
    "operationId": "postSalesLeads",
    "x-msmepulse-scope": "crm:write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "minLength": 2,
          "maxLength": 80
         },
         "company": {
          "type": "string",
          "maxLength": 120,
          "default": ""
         },
         "email": {
          "anyOf": [
           {
            "const": ""
           },
           {
            "type": "string",
            "format": "email"
           }
          ],
          "default": ""
         },
         "phone": {
          "type": "string",
          "maxLength": 30,
          "default": ""
         },
         "designation": {
          "type": "string",
          "maxLength": 60,
          "default": ""
         },
         "source": {
          "type": "string",
          "enum": [
           "referral",
           "website",
           "social",
           "event",
           "outreach",
           "partner",
           "existing_client",
           "marketplace",
           "other"
          ]
         },
         "sourceDetail": {
          "type": "string",
          "maxLength": 120,
          "default": ""
         },
         "ownerId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "estimatedValue": {
          "anyOf": [
           {
            "type": "integer",
            "minimum": 0
           },
           {
            "type": "null"
           }
          ]
         },
         "currency": {
          "type": "string",
          "enum": [
           "INR",
           "SGD",
           "USD",
           "EUR",
           "GBP",
           "AED",
           "AUD",
           "MYR",
           "CAD",
           "CHF",
           "HKD",
           "NZD"
          ]
         },
         "status": {
          "type": "string",
          "enum": [
           "new",
           "contacted",
           "qualified",
           "unqualified"
          ],
          "default": "new"
         },
         "unqualifiedReason": {
          "type": "string",
          "maxLength": 300,
          "default": ""
         },
         "need": {
          "type": "string",
          "maxLength": 2000,
          "default": ""
         },
         "nextFollowUp": {
          "anyOf": [
           {
            "anyOf": [
             {
              "const": ""
             },
             {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
             }
            ]
           },
           {
            "type": "null"
           }
          ]
         }
        },
        "required": [
         "name",
         "source"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/sales/leads/{id}": {
   "get": {
    "tags": [
     "Leads and deals"
    ],
    "summary": "Get a lead",
    "description": "Needs the **Leads, deals and proposals** scope with read access.",
    "operationId": "getSalesLeadsId",
    "x-msmepulse-scope": "crm:read",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "patch": {
    "tags": [
     "Leads and deals"
    ],
    "summary": "Update a lead",
    "description": "Needs the **Leads, deals and proposals** scope with read and write access.",
    "operationId": "patchSalesLeadsId",
    "x-msmepulse-scope": "crm:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "minLength": 2,
          "maxLength": 80
         },
         "company": {
          "type": "string",
          "maxLength": 120,
          "default": ""
         },
         "email": {
          "anyOf": [
           {
            "const": ""
           },
           {
            "type": "string",
            "format": "email"
           }
          ],
          "default": ""
         },
         "phone": {
          "type": "string",
          "maxLength": 30,
          "default": ""
         },
         "designation": {
          "type": "string",
          "maxLength": 60,
          "default": ""
         },
         "source": {
          "type": "string",
          "enum": [
           "referral",
           "website",
           "social",
           "event",
           "outreach",
           "partner",
           "existing_client",
           "marketplace",
           "other"
          ]
         },
         "sourceDetail": {
          "type": "string",
          "maxLength": 120,
          "default": ""
         },
         "ownerId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "estimatedValue": {
          "anyOf": [
           {
            "type": "integer",
            "minimum": 0
           },
           {
            "type": "null"
           }
          ]
         },
         "currency": {
          "type": "string",
          "enum": [
           "INR",
           "SGD",
           "USD",
           "EUR",
           "GBP",
           "AED",
           "AUD",
           "MYR",
           "CAD",
           "CHF",
           "HKD",
           "NZD"
          ]
         },
         "status": {
          "type": "string",
          "enum": [
           "new",
           "contacted",
           "qualified",
           "unqualified"
          ],
          "default": "new"
         },
         "unqualifiedReason": {
          "type": "string",
          "maxLength": 300,
          "default": ""
         },
         "need": {
          "type": "string",
          "maxLength": 2000,
          "default": ""
         },
         "nextFollowUp": {
          "anyOf": [
           {
            "anyOf": [
             {
              "const": ""
             },
             {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
             }
            ]
           },
           {
            "type": "null"
           }
          ]
         }
        },
        "description": "Send only the fields to change."
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Leads and deals"
    ],
    "summary": "Delete a lead",
    "description": "Needs the **Leads, deals and proposals** scope with read and write access.",
    "operationId": "deleteSalesLeadsId",
    "x-msmepulse-scope": "crm:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/sales/leads/{id}/convert": {
   "post": {
    "tags": [
     "Leads and deals"
    ],
    "summary": "Convert a lead into a client and deal",
    "description": "Needs the **Leads, deals and proposals** scope with read and write access.",
    "operationId": "postSalesLeadsIdConvert",
    "x-msmepulse-scope": "crm:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "clientId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "clientName": {
          "type": "string",
          "maxLength": 120,
          "default": ""
         },
         "clientType": {
          "type": "string",
          "enum": [
           "business",
           "individual"
          ],
          "default": "business"
         },
         "country": {
          "type": "string"
         },
         "state": {
          "type": "string",
          "maxLength": 4,
          "default": ""
         },
         "gstin": {
          "type": "string",
          "maxLength": 15,
          "default": ""
         },
         "dealTitle": {
          "type": "string",
          "minLength": 2,
          "maxLength": 120
         },
         "value": {
          "type": "integer",
          "minimum": 0,
          "default": 0
         },
         "currency": {
          "type": "string",
          "enum": [
           "INR",
           "SGD",
           "USD",
           "EUR",
           "GBP",
           "AED",
           "AUD",
           "MYR",
           "CAD",
           "CHF",
           "HKD",
           "NZD"
          ]
         },
         "stageKey": {
          "type": "string",
          "maxLength": 40
         },
         "expectedClose": {
          "anyOf": [
           {
            "anyOf": [
             {
              "const": ""
             },
             {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
             }
            ]
           },
           {
            "type": "null"
           }
          ]
         }
        },
        "required": [
         "dealTitle"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/sales/deals": {
   "get": {
    "tags": [
     "Leads and deals"
    ],
    "summary": "List deals",
    "description": "Needs the **Leads, deals and proposals** scope with read access.",
    "operationId": "getSalesDeals",
    "x-msmepulse-scope": "crm:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "tags": [
     "Leads and deals"
    ],
    "summary": "Add a deal",
    "description": "Needs the **Leads, deals and proposals** scope with read and write access.",
    "operationId": "postSalesDeals",
    "x-msmepulse-scope": "crm:write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "title": {
          "type": "string",
          "minLength": 2,
          "maxLength": 120
         },
         "clientId": {
          "type": "string",
          "minLength": 1
         },
         "contactName": {
          "type": "string",
          "maxLength": 80,
          "default": ""
         },
         "contactEmail": {
          "anyOf": [
           {
            "const": ""
           },
           {
            "type": "string",
            "format": "email"
           }
          ],
          "default": ""
         },
         "contactPhone": {
          "type": "string",
          "maxLength": 30,
          "default": ""
         },
         "ownerId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "value": {
          "type": "integer",
          "minimum": 0,
          "default": 0
         },
         "currency": {
          "type": "string",
          "enum": [
           "INR",
           "SGD",
           "USD",
           "EUR",
           "GBP",
           "AED",
           "AUD",
           "MYR",
           "CAD",
           "CHF",
           "HKD",
           "NZD"
          ]
         },
         "stageKey": {
          "type": "string",
          "maxLength": 40
         },
         "expectedClose": {
          "anyOf": [
           {
            "anyOf": [
             {
              "const": ""
             },
             {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
             }
            ]
           },
           {
            "type": "null"
           }
          ]
         },
         "source": {
          "type": "string",
          "enum": [
           "referral",
           "website",
           "social",
           "event",
           "outreach",
           "partner",
           "existing_client",
           "marketplace",
           "other"
          ]
         },
         "notes": {
          "type": "string",
          "maxLength": 2000,
          "default": ""
         }
        },
        "required": [
         "title",
         "clientId"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/sales/deals/{id}": {
   "get": {
    "tags": [
     "Leads and deals"
    ],
    "summary": "Get a deal",
    "description": "Needs the **Leads, deals and proposals** scope with read access.",
    "operationId": "getSalesDealsId",
    "x-msmepulse-scope": "crm:read",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "patch": {
    "tags": [
     "Leads and deals"
    ],
    "summary": "Update a deal",
    "description": "Needs the **Leads, deals and proposals** scope with read and write access.",
    "operationId": "patchSalesDealsId",
    "x-msmepulse-scope": "crm:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "title": {
          "type": "string",
          "minLength": 2,
          "maxLength": 120
         },
         "clientId": {
          "type": "string",
          "minLength": 1
         },
         "contactName": {
          "type": "string",
          "maxLength": 80,
          "default": ""
         },
         "contactEmail": {
          "anyOf": [
           {
            "const": ""
           },
           {
            "type": "string",
            "format": "email"
           }
          ],
          "default": ""
         },
         "contactPhone": {
          "type": "string",
          "maxLength": 30,
          "default": ""
         },
         "ownerId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "value": {
          "type": "integer",
          "minimum": 0,
          "default": 0
         },
         "currency": {
          "type": "string",
          "enum": [
           "INR",
           "SGD",
           "USD",
           "EUR",
           "GBP",
           "AED",
           "AUD",
           "MYR",
           "CAD",
           "CHF",
           "HKD",
           "NZD"
          ]
         },
         "stageKey": {
          "type": "string",
          "maxLength": 40
         },
         "expectedClose": {
          "anyOf": [
           {
            "anyOf": [
             {
              "const": ""
             },
             {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
             }
            ]
           },
           {
            "type": "null"
           }
          ]
         },
         "source": {
          "type": "string",
          "enum": [
           "referral",
           "website",
           "social",
           "event",
           "outreach",
           "partner",
           "existing_client",
           "marketplace",
           "other"
          ]
         },
         "notes": {
          "type": "string",
          "maxLength": 2000,
          "default": ""
         }
        },
        "description": "Send only the fields to change."
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Leads and deals"
    ],
    "summary": "Delete a deal",
    "description": "Needs the **Leads, deals and proposals** scope with read and write access.",
    "operationId": "deleteSalesDealsId",
    "x-msmepulse-scope": "crm:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/sales/deals/{id}/move": {
   "post": {
    "tags": [
     "Leads and deals"
    ],
    "summary": "Move a deal to another stage (won, lost…)",
    "description": "Needs the **Leads, deals and proposals** scope with read and write access.",
    "operationId": "postSalesDealsIdMove",
    "x-msmepulse-scope": "crm:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "stageKey": {
          "type": "string",
          "minLength": 1,
          "maxLength": 40
         },
         "order": {
          "type": "number"
         },
         "reason": {
          "type": "string",
          "maxLength": 40,
          "default": ""
         },
         "reasonNote": {
          "type": "string",
          "maxLength": 500,
          "default": ""
         }
        },
        "required": [
         "stageKey"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/sales/{type}/{id}/activities": {
   "post": {
    "tags": [
     "Leads and deals"
    ],
    "summary": "Log a call, meeting or follow-up on a lead or deal",
    "description": "Needs the **Leads, deals and proposals** scope with read and write access.",
    "operationId": "postSalesTypeIdActivities",
    "x-msmepulse-scope": "crm:write",
    "parameters": [
     {
      "name": "type",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "leads",
        "deals"
       ]
      }
     },
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "kind": {
          "type": "string",
          "enum": [
           "note",
           "call",
           "meeting",
           "email",
           "follow_up"
          ]
         },
         "body": {
          "type": "string",
          "maxLength": 2000,
          "default": ""
         },
         "dueDate": {
          "anyOf": [
           {
            "anyOf": [
             {
              "const": ""
             },
             {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
             }
            ]
           },
           {
            "type": "null"
           }
          ]
         }
        },
        "required": [
         "kind"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/proposals/templates": {
   "get": {
    "tags": [
     "Proposals"
    ],
    "summary": "Proposal templates",
    "description": "Needs the **Leads, deals and proposals** scope with read access.",
    "operationId": "getProposalsTemplates",
    "x-msmepulse-scope": "crm:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/proposals": {
   "get": {
    "tags": [
     "Proposals"
    ],
    "summary": "List proposals",
    "description": "Needs the **Leads, deals and proposals** scope with read access.",
    "operationId": "getProposals",
    "x-msmepulse-scope": "crm:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "tags": [
     "Proposals"
    ],
    "summary": "Create a draft proposal",
    "description": "Needs the **Leads, deals and proposals** scope with read and write access.",
    "operationId": "postProposals",
    "x-msmepulse-scope": "crm:write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "clientId": {
          "type": "string",
          "minLength": 1
         },
         "title": {
          "type": "string",
          "minLength": 3,
          "maxLength": 150
         },
         "issueDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
         },
         "validUntil": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
         },
         "currency": {
          "type": "string",
          "enum": [
           "INR",
           "SGD",
           "USD",
           "EUR",
           "GBP",
           "AED",
           "AUD",
           "MYR",
           "CAD",
           "CHF",
           "HKD",
           "NZD"
          ]
         },
         "exchangeRate": {
          "anyOf": [
           {
            "type": "number",
            "exclusiveMinimum": 0
           },
           {
            "type": "null"
           }
          ]
         },
         "intro": {
          "type": "string",
          "maxLength": 20000,
          "default": ""
         },
         "terms": {
          "type": "string",
          "maxLength": 20000,
          "default": ""
         },
         "lines": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "description": {
             "type": "string",
             "minLength": 1,
             "maxLength": 1000
            },
            "quantity": {
             "type": "number",
             "minimum": 0.001,
             "maximum": 1000000
            },
            "unit": {
             "type": "string",
             "maxLength": 20,
             "default": ""
            },
            "unitPrice": {
             "type": "integer",
             "minimum": 0
            },
            "discount": {
             "type": "integer",
             "minimum": 0,
             "default": 0
            },
            "hsnSac": {
             "type": "string",
             "maxLength": 8,
             "default": ""
            },
            "rateBps": {
             "type": "integer",
             "minimum": 0,
             "default": 0
            },
            "treatment": {
             "type": "string",
             "enum": [
              "taxable",
              "exempt",
              "nil",
              "non_gst"
             ],
             "default": "taxable"
            },
            "sgTaxCode": {
             "type": "string",
             "enum": [
              "SR",
              "ZR",
              "ES",
              "OS"
             ],
             "default": "SR"
            },
            "catalogueItemId": {
             "anyOf": [
              {
               "type": "string"
              },
              {
               "type": "null"
              }
             ]
            }
           },
           "required": [
            "description",
            "quantity",
            "unitPrice"
           ]
          },
          "minItems": 1,
          "maxItems": 100
         },
         "templateId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "dealId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         }
        },
        "required": [
         "clientId",
         "title",
         "issueDate",
         "validUntil",
         "currency",
         "lines"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/proposals/preview": {
   "post": {
    "tags": [
     "Proposals"
    ],
    "summary": "Work out a proposal's totals without saving it",
    "description": "Needs the **Leads, deals and proposals** scope with read and write access.",
    "operationId": "postProposalsPreview",
    "x-msmepulse-scope": "crm:write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "clientId": {
          "type": "string",
          "minLength": 1
         },
         "title": {
          "type": "string",
          "minLength": 3,
          "maxLength": 150
         },
         "issueDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
         },
         "validUntil": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
         },
         "currency": {
          "type": "string",
          "enum": [
           "INR",
           "SGD",
           "USD",
           "EUR",
           "GBP",
           "AED",
           "AUD",
           "MYR",
           "CAD",
           "CHF",
           "HKD",
           "NZD"
          ]
         },
         "exchangeRate": {
          "anyOf": [
           {
            "type": "number",
            "exclusiveMinimum": 0
           },
           {
            "type": "null"
           }
          ]
         },
         "intro": {
          "type": "string",
          "maxLength": 20000,
          "default": ""
         },
         "terms": {
          "type": "string",
          "maxLength": 20000,
          "default": ""
         },
         "lines": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "description": {
             "type": "string",
             "minLength": 1,
             "maxLength": 1000
            },
            "quantity": {
             "type": "number",
             "minimum": 0.001,
             "maximum": 1000000
            },
            "unit": {
             "type": "string",
             "maxLength": 20,
             "default": ""
            },
            "unitPrice": {
             "type": "integer",
             "minimum": 0
            },
            "discount": {
             "type": "integer",
             "minimum": 0,
             "default": 0
            },
            "hsnSac": {
             "type": "string",
             "maxLength": 8,
             "default": ""
            },
            "rateBps": {
             "type": "integer",
             "minimum": 0,
             "default": 0
            },
            "treatment": {
             "type": "string",
             "enum": [
              "taxable",
              "exempt",
              "nil",
              "non_gst"
             ],
             "default": "taxable"
            },
            "sgTaxCode": {
             "type": "string",
             "enum": [
              "SR",
              "ZR",
              "ES",
              "OS"
             ],
             "default": "SR"
            },
            "catalogueItemId": {
             "anyOf": [
              {
               "type": "string"
              },
              {
               "type": "null"
              }
             ]
            }
           },
           "required": [
            "description",
            "quantity",
            "unitPrice"
           ]
          },
          "minItems": 1,
          "maxItems": 100
         },
         "templateId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "dealId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         }
        },
        "required": [
         "clientId",
         "title",
         "issueDate",
         "validUntil",
         "currency",
         "lines"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/proposals/{id}": {
   "get": {
    "tags": [
     "Proposals"
    ],
    "summary": "Get a proposal",
    "description": "Needs the **Leads, deals and proposals** scope with read access.",
    "operationId": "getProposalsId",
    "x-msmepulse-scope": "crm:read",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "put": {
    "tags": [
     "Proposals"
    ],
    "summary": "Replace a draft proposal",
    "description": "Needs the **Leads, deals and proposals** scope with read and write access.",
    "operationId": "putProposalsId",
    "x-msmepulse-scope": "crm:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "clientId": {
          "type": "string",
          "minLength": 1
         },
         "title": {
          "type": "string",
          "minLength": 3,
          "maxLength": 150
         },
         "issueDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
         },
         "validUntil": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
         },
         "currency": {
          "type": "string",
          "enum": [
           "INR",
           "SGD",
           "USD",
           "EUR",
           "GBP",
           "AED",
           "AUD",
           "MYR",
           "CAD",
           "CHF",
           "HKD",
           "NZD"
          ]
         },
         "exchangeRate": {
          "anyOf": [
           {
            "type": "number",
            "exclusiveMinimum": 0
           },
           {
            "type": "null"
           }
          ]
         },
         "intro": {
          "type": "string",
          "maxLength": 20000,
          "default": ""
         },
         "terms": {
          "type": "string",
          "maxLength": 20000,
          "default": ""
         },
         "lines": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "description": {
             "type": "string",
             "minLength": 1,
             "maxLength": 1000
            },
            "quantity": {
             "type": "number",
             "minimum": 0.001,
             "maximum": 1000000
            },
            "unit": {
             "type": "string",
             "maxLength": 20,
             "default": ""
            },
            "unitPrice": {
             "type": "integer",
             "minimum": 0
            },
            "discount": {
             "type": "integer",
             "minimum": 0,
             "default": 0
            },
            "hsnSac": {
             "type": "string",
             "maxLength": 8,
             "default": ""
            },
            "rateBps": {
             "type": "integer",
             "minimum": 0,
             "default": 0
            },
            "treatment": {
             "type": "string",
             "enum": [
              "taxable",
              "exempt",
              "nil",
              "non_gst"
             ],
             "default": "taxable"
            },
            "sgTaxCode": {
             "type": "string",
             "enum": [
              "SR",
              "ZR",
              "ES",
              "OS"
             ],
             "default": "SR"
            },
            "catalogueItemId": {
             "anyOf": [
              {
               "type": "string"
              },
              {
               "type": "null"
              }
             ]
            }
           },
           "required": [
            "description",
            "quantity",
            "unitPrice"
           ]
          },
          "minItems": 1,
          "maxItems": 100
         },
         "templateId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "dealId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         }
        },
        "required": [
         "clientId",
         "title",
         "issueDate",
         "validUntil",
         "currency",
         "lines"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Proposals"
    ],
    "summary": "Delete a draft proposal",
    "description": "Needs the **Leads, deals and proposals** scope with read and write access.",
    "operationId": "deleteProposalsId",
    "x-msmepulse-scope": "crm:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/proposals/{id}/duplicate": {
   "post": {
    "tags": [
     "Proposals"
    ],
    "summary": "Copy a proposal",
    "description": "Needs the **Leads, deals and proposals** scope with read and write access.",
    "operationId": "postProposalsIdDuplicate",
    "x-msmepulse-scope": "crm:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/proposals/{id}/send": {
   "post": {
    "tags": [
     "Proposals"
    ],
    "summary": "Email a proposal for e-signature",
    "description": "Needs the **Leads, deals and proposals** scope with read and write access.",
    "operationId": "postProposalsIdSend",
    "x-msmepulse-scope": "crm:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "to": {
          "type": "string",
          "format": "email"
         },
         "name": {
          "type": "string",
          "maxLength": 80,
          "default": ""
         },
         "message": {
          "type": "string",
          "maxLength": 2000,
          "default": ""
         }
        },
        "required": [
         "to"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/proposals/{id}/link": {
   "post": {
    "tags": [
     "Proposals"
    ],
    "summary": "Get the client's link to view and sign",
    "description": "Needs the **Leads, deals and proposals** scope with read and write access.",
    "operationId": "postProposalsIdLink",
    "x-msmepulse-scope": "crm:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/proposals/{id}/revise": {
   "post": {
    "tags": [
     "Proposals"
    ],
    "summary": "Start a new revision of a sent proposal",
    "description": "Needs the **Leads, deals and proposals** scope with read and write access.",
    "operationId": "postProposalsIdRevise",
    "x-msmepulse-scope": "crm:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/proposals/{id}/convert": {
   "post": {
    "tags": [
     "Proposals"
    ],
    "summary": "Turn an accepted proposal into a project",
    "description": "Needs the **Projects and tasks** scope with read and write access.",
    "operationId": "postProposalsIdConvert",
    "x-msmepulse-scope": "projects:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "minLength": 2,
          "maxLength": 120
         },
         "as": {
          "type": "string",
          "enum": [
           "milestones",
           "budget"
          ],
          "default": "milestones"
         },
         "startDate": {
          "anyOf": [
           {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
           },
           {
            "type": "null"
           }
          ]
         }
        },
        "required": [
         "name"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/proposals/{id}/pdf": {
   "get": {
    "tags": [
     "Proposals"
    ],
    "summary": "Download a proposal as a PDF",
    "description": "Needs the **Leads, deals and proposals** scope with read access.",
    "operationId": "getProposalsIdPdf",
    "x-msmepulse-scope": "crm:read",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/expenses/vendors": {
   "get": {
    "tags": [
     "Expenses and bills"
    ],
    "summary": "List vendors",
    "description": "Needs the **Expenses and bills** scope with read access.",
    "operationId": "getExpensesVendors",
    "x-msmepulse-scope": "expenses:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "tags": [
     "Expenses and bills"
    ],
    "summary": "Add a vendor",
    "description": "Needs the **Expenses and bills** scope with read and write access.",
    "operationId": "postExpensesVendors",
    "x-msmepulse-scope": "expenses:write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "minLength": 2,
          "maxLength": 150
         },
         "email": {
          "anyOf": [
           {
            "const": ""
           },
           {
            "type": "string",
            "format": "email"
           }
          ],
          "default": ""
         },
         "phone": {
          "type": "string",
          "maxLength": 30,
          "default": ""
         },
         "country": {
          "type": "string",
          "default": "IN"
         },
         "state": {
          "type": "string",
          "maxLength": 2,
          "default": ""
         },
         "gstin": {
          "anyOf": [
           {
            "const": ""
           },
           {
            "type": "string",
            "pattern": "^\\d{2}[A-Z]{5}\\d{4}[A-Z][1-9A-Z]Z[0-9A-Z]$"
           }
          ],
          "default": ""
         },
         "pan": {
          "anyOf": [
           {
            "const": ""
           },
           {
            "type": "string",
            "pattern": "^[A-Z]{5}\\d{4}[A-Z]$"
           }
          ],
          "default": ""
         },
         "udyamNumber": {
          "anyOf": [
           {
            "const": ""
           },
           {
            "type": "string",
            "pattern": "^UDYAM-[A-Z]{2}-\\d{2}-\\d{7}$"
           }
          ],
          "default": ""
         },
         "msmeCategory": {
          "type": "string",
          "enum": [
           "none",
           "micro",
           "small",
           "medium"
          ],
          "default": "none"
         },
         "uen": {
          "type": "string",
          "maxLength": 20,
          "default": ""
         },
         "gstRegistered": {
          "type": "boolean",
          "default": false
         },
         "agreedPaymentDays": {
          "anyOf": [
           {
            "type": "integer",
            "minimum": 0,
            "maximum": 365
           },
           {
            "type": "null"
           }
          ]
         },
         "defaultCategory": {
          "type": "string",
          "maxLength": 30,
          "default": ""
         },
         "notes": {
          "type": "string",
          "maxLength": 1000,
          "default": ""
         }
        },
        "required": [
         "name"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/expenses/vendors/{id}": {
   "put": {
    "tags": [
     "Expenses and bills"
    ],
    "summary": "Update a vendor",
    "description": "Needs the **Expenses and bills** scope with read and write access.",
    "operationId": "putExpensesVendorsId",
    "x-msmepulse-scope": "expenses:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "minLength": 2,
          "maxLength": 150
         },
         "email": {
          "anyOf": [
           {
            "const": ""
           },
           {
            "type": "string",
            "format": "email"
           }
          ],
          "default": ""
         },
         "phone": {
          "type": "string",
          "maxLength": 30,
          "default": ""
         },
         "country": {
          "type": "string",
          "default": "IN"
         },
         "state": {
          "type": "string",
          "maxLength": 2,
          "default": ""
         },
         "gstin": {
          "anyOf": [
           {
            "const": ""
           },
           {
            "type": "string",
            "pattern": "^\\d{2}[A-Z]{5}\\d{4}[A-Z][1-9A-Z]Z[0-9A-Z]$"
           }
          ],
          "default": ""
         },
         "pan": {
          "anyOf": [
           {
            "const": ""
           },
           {
            "type": "string",
            "pattern": "^[A-Z]{5}\\d{4}[A-Z]$"
           }
          ],
          "default": ""
         },
         "udyamNumber": {
          "anyOf": [
           {
            "const": ""
           },
           {
            "type": "string",
            "pattern": "^UDYAM-[A-Z]{2}-\\d{2}-\\d{7}$"
           }
          ],
          "default": ""
         },
         "msmeCategory": {
          "type": "string",
          "enum": [
           "none",
           "micro",
           "small",
           "medium"
          ],
          "default": "none"
         },
         "uen": {
          "type": "string",
          "maxLength": 20,
          "default": ""
         },
         "gstRegistered": {
          "type": "boolean",
          "default": false
         },
         "agreedPaymentDays": {
          "anyOf": [
           {
            "type": "integer",
            "minimum": 0,
            "maximum": 365
           },
           {
            "type": "null"
           }
          ]
         },
         "defaultCategory": {
          "type": "string",
          "maxLength": 30,
          "default": ""
         },
         "notes": {
          "type": "string",
          "maxLength": 1000,
          "default": ""
         }
        },
        "required": [
         "name"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/expenses/vendors/{id}/archive": {
   "post": {
    "tags": [
     "Expenses and bills"
    ],
    "summary": "Archive a vendor",
    "description": "Needs the **Expenses and bills** scope with read and write access.",
    "operationId": "postExpensesVendorsIdArchive",
    "x-msmepulse-scope": "expenses:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/expenses": {
   "get": {
    "tags": [
     "Expenses and bills"
    ],
    "summary": "List expenses (view=company or mine)",
    "description": "Needs the **Expenses and bills** scope with read access.",
    "operationId": "getExpenses",
    "x-msmepulse-scope": "expenses:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "tags": [
     "Expenses and bills"
    ],
    "summary": "Record an expense",
    "description": "Needs the **Expenses and bills** scope with read and write access.",
    "operationId": "postExpenses",
    "x-msmepulse-scope": "expenses:write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
         },
         "category": {
          "type": "string",
          "minLength": 1
         },
         "description": {
          "type": "string",
          "minLength": 2,
          "maxLength": 300
         },
         "vendorId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "vendorName": {
          "type": "string",
          "maxLength": 150,
          "default": ""
         },
         "vendorGstin": {
          "anyOf": [
           {
            "const": ""
           },
           {
            "type": "string",
            "pattern": "^\\d{2}[A-Z]{5}\\d{4}[A-Z][1-9A-Z]Z[0-9A-Z]$"
           }
          ],
          "default": ""
         },
         "projectId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "billable": {
          "type": "boolean",
          "default": false
         },
         "markupBps": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10000,
          "default": 0
         },
         "currency": {
          "type": "string"
         },
         "amount": {
          "type": "integer",
          "minimum": 1
         },
         "taxRateBps": {
          "type": "integer",
          "minimum": 0,
          "maximum": 2800,
          "default": 0
         },
         "sgTaxCode": {
          "type": "string",
          "enum": [
           "TX",
           "IM",
           "ZP",
           "EP",
           "OP",
           "NR"
          ],
          "default": "OP"
         },
         "taxOverride": {
          "anyOf": [
           {
            "type": "integer",
            "minimum": 0
           },
           {
            "type": "null"
           }
          ]
         },
         "paidBy": {
          "type": "string",
          "enum": [
           "company",
           "employee"
          ],
          "default": "company"
         },
         "paymentMethod": {
          "type": "string",
          "maxLength": 30,
          "default": ""
         },
         "reference": {
          "type": "string",
          "maxLength": 80,
          "default": ""
         }
        },
        "required": [
         "date",
         "category",
         "description",
         "currency",
         "amount"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/expenses/item/{id}": {
   "get": {
    "tags": [
     "Expenses and bills"
    ],
    "summary": "Get an expense",
    "description": "Needs the **Expenses and bills** scope with read access.",
    "operationId": "getExpensesItemId",
    "x-msmepulse-scope": "expenses:read",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "put": {
    "tags": [
     "Expenses and bills"
    ],
    "summary": "Update an expense",
    "description": "Needs the **Expenses and bills** scope with read and write access.",
    "operationId": "putExpensesItemId",
    "x-msmepulse-scope": "expenses:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
         },
         "category": {
          "type": "string",
          "minLength": 1
         },
         "description": {
          "type": "string",
          "minLength": 2,
          "maxLength": 300
         },
         "vendorId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "vendorName": {
          "type": "string",
          "maxLength": 150,
          "default": ""
         },
         "vendorGstin": {
          "anyOf": [
           {
            "const": ""
           },
           {
            "type": "string",
            "pattern": "^\\d{2}[A-Z]{5}\\d{4}[A-Z][1-9A-Z]Z[0-9A-Z]$"
           }
          ],
          "default": ""
         },
         "projectId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "billable": {
          "type": "boolean",
          "default": false
         },
         "markupBps": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10000,
          "default": 0
         },
         "currency": {
          "type": "string"
         },
         "amount": {
          "type": "integer",
          "minimum": 1
         },
         "taxRateBps": {
          "type": "integer",
          "minimum": 0,
          "maximum": 2800,
          "default": 0
         },
         "sgTaxCode": {
          "type": "string",
          "enum": [
           "TX",
           "IM",
           "ZP",
           "EP",
           "OP",
           "NR"
          ],
          "default": "OP"
         },
         "taxOverride": {
          "anyOf": [
           {
            "type": "integer",
            "minimum": 0
           },
           {
            "type": "null"
           }
          ]
         },
         "paidBy": {
          "type": "string",
          "enum": [
           "company",
           "employee"
          ],
          "default": "company"
         },
         "paymentMethod": {
          "type": "string",
          "maxLength": 30,
          "default": ""
         },
         "reference": {
          "type": "string",
          "maxLength": 80,
          "default": ""
         }
        },
        "required": [
         "date",
         "category",
         "description",
         "currency",
         "amount"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Expenses and bills"
    ],
    "summary": "Delete a draft expense",
    "description": "Needs the **Expenses and bills** scope with read and write access.",
    "operationId": "deleteExpensesItemId",
    "x-msmepulse-scope": "expenses:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/expenses/item/{id}/submit": {
   "post": {
    "tags": [
     "Expenses and bills"
    ],
    "summary": "Submit a claim for approval",
    "description": "Needs the **Expenses and bills** scope with read and write access.",
    "operationId": "postExpensesItemIdSubmit",
    "x-msmepulse-scope": "expenses:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/expenses/item/{id}/receipts": {
   "post": {
    "tags": [
     "Expenses and bills"
    ],
    "summary": "Attach a receipt",
    "description": "Needs the **Expenses and bills** scope with read and write access.",
    "operationId": "postExpensesItemIdReceipts",
    "x-msmepulse-scope": "expenses:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "required": [
         "file"
        ],
        "properties": {
         "file": {
          "type": "string",
          "format": "binary"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/expenses/attachments/{aid}": {
   "get": {
    "tags": [
     "Expenses and bills"
    ],
    "summary": "Download a receipt",
    "description": "Needs the **Expenses and bills** scope with read access.",
    "operationId": "getExpensesAttachmentsAid",
    "x-msmepulse-scope": "expenses:read",
    "parameters": [
     {
      "name": "aid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/expenses/bills": {
   "get": {
    "tags": [
     "Expenses and bills"
    ],
    "summary": "List vendor bills",
    "description": "Needs the **Expenses and bills** scope with read access.",
    "operationId": "getExpensesBills",
    "x-msmepulse-scope": "expenses:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "tags": [
     "Expenses and bills"
    ],
    "summary": "Record a vendor bill",
    "description": "Needs the **Expenses and bills** scope with read and write access.",
    "operationId": "postExpensesBills",
    "x-msmepulse-scope": "expenses:write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "vendorId": {
          "type": "string",
          "minLength": 1
         },
         "billNumber": {
          "type": "string",
          "minLength": 1,
          "maxLength": 40
         },
         "billDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
         },
         "acceptedOn": {
          "anyOf": [
           {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
           },
           {
            "type": "null"
           }
          ]
         },
         "dueDate": {
          "anyOf": [
           {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
           },
           {
            "type": "null"
           }
          ]
         },
         "currency": {
          "type": "string"
         },
         "lines": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "description": {
             "type": "string",
             "minLength": 1,
             "maxLength": 300
            },
            "category": {
             "type": "string",
             "minLength": 1,
             "default": "other"
            },
            "amount": {
             "type": "integer",
             "minimum": 0
            },
            "taxRateBps": {
             "type": "integer",
             "minimum": 0,
             "maximum": 2800,
             "default": 0
            },
            "sgTaxCode": {
             "type": "string",
             "enum": [
              "TX",
              "IM",
              "ZP",
              "EP",
              "OP",
              "NR"
             ],
             "default": "TX"
            },
            "projectId": {
             "anyOf": [
              {
               "type": "string"
              },
              {
               "type": "null"
              }
             ]
            }
           },
           "required": [
            "description",
            "amount"
           ]
          },
          "minItems": 1,
          "maxItems": 100
         },
         "notes": {
          "type": "string",
          "maxLength": 1000,
          "default": ""
         }
        },
        "required": [
         "vendorId",
         "billNumber",
         "billDate",
         "currency",
         "lines"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/expenses/bills/{id}": {
   "get": {
    "tags": [
     "Expenses and bills"
    ],
    "summary": "Get a vendor bill",
    "description": "Needs the **Expenses and bills** scope with read access.",
    "operationId": "getExpensesBillsId",
    "x-msmepulse-scope": "expenses:read",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "put": {
    "tags": [
     "Expenses and bills"
    ],
    "summary": "Update a vendor bill",
    "description": "Needs the **Expenses and bills** scope with read and write access.",
    "operationId": "putExpensesBillsId",
    "x-msmepulse-scope": "expenses:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "vendorId": {
          "type": "string",
          "minLength": 1
         },
         "billNumber": {
          "type": "string",
          "minLength": 1,
          "maxLength": 40
         },
         "billDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
         },
         "acceptedOn": {
          "anyOf": [
           {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
           },
           {
            "type": "null"
           }
          ]
         },
         "dueDate": {
          "anyOf": [
           {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
           },
           {
            "type": "null"
           }
          ]
         },
         "currency": {
          "type": "string"
         },
         "lines": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "description": {
             "type": "string",
             "minLength": 1,
             "maxLength": 300
            },
            "category": {
             "type": "string",
             "minLength": 1,
             "default": "other"
            },
            "amount": {
             "type": "integer",
             "minimum": 0
            },
            "taxRateBps": {
             "type": "integer",
             "minimum": 0,
             "maximum": 2800,
             "default": 0
            },
            "sgTaxCode": {
             "type": "string",
             "enum": [
              "TX",
              "IM",
              "ZP",
              "EP",
              "OP",
              "NR"
             ],
             "default": "TX"
            },
            "projectId": {
             "anyOf": [
              {
               "type": "string"
              },
              {
               "type": "null"
              }
             ]
            }
           },
           "required": [
            "description",
            "amount"
           ]
          },
          "minItems": 1,
          "maxItems": 100
         },
         "notes": {
          "type": "string",
          "maxLength": 1000,
          "default": ""
         }
        },
        "required": [
         "vendorId",
         "billNumber",
         "billDate",
         "currency",
         "lines"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/expenses/bills/{id}/void": {
   "post": {
    "tags": [
     "Expenses and bills"
    ],
    "summary": "Void a vendor bill",
    "description": "Needs the **Expenses and bills** scope with read and write access.",
    "operationId": "postExpensesBillsIdVoid",
    "x-msmepulse-scope": "expenses:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "reason": {
          "type": "string",
          "minLength": 3,
          "maxLength": 300
         }
        },
        "required": [
         "reason"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/expenses/bills/{id}/payments": {
   "post": {
    "tags": [
     "Expenses and bills"
    ],
    "summary": "Record a payment to a vendor (with TDS in India)",
    "description": "Needs the **Expenses and bills** scope with read and write access.",
    "operationId": "postExpensesBillsIdPayments",
    "x-msmepulse-scope": "expenses:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
         },
         "amount": {
          "type": "integer",
          "minimum": 0
         },
         "tdsAmount": {
          "type": "integer",
          "minimum": 0,
          "default": 0
         },
         "tdsSection": {
          "type": "string",
          "maxLength": 20,
          "default": ""
         },
         "method": {
          "type": "string",
          "enum": [
           "bank_transfer",
           "upi",
           "paynow",
           "cheque",
           "cash",
           "card",
           "other"
          ]
         },
         "reference": {
          "type": "string",
          "maxLength": 80,
          "default": ""
         }
        },
        "required": [
         "date",
         "amount",
         "method"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/expenses/bills/{id}/payments/{pid}": {
   "delete": {
    "tags": [
     "Expenses and bills"
    ],
    "summary": "Remove a vendor payment",
    "description": "Needs the **Expenses and bills** scope with read and write access.",
    "operationId": "deleteExpensesBillsIdPaymentsPid",
    "x-msmepulse-scope": "expenses:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "pid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/expenses/bills/{id}/receipts": {
   "post": {
    "tags": [
     "Expenses and bills"
    ],
    "summary": "Attach the bill document",
    "description": "Needs the **Expenses and bills** scope with read and write access.",
    "operationId": "postExpensesBillsIdReceipts",
    "x-msmepulse-scope": "expenses:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "required": [
         "file"
        ],
        "properties": {
         "file": {
          "type": "string",
          "format": "binary"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/expenses/reports/input-tax": {
   "get": {
    "tags": [
     "Expenses and bills"
    ],
    "summary": "Input tax (GST paid on purchases) for a period",
    "description": "Needs the **Expenses and bills** scope with read access.",
    "operationId": "getExpensesReportsInputTax",
    "x-msmepulse-scope": "expenses:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/expenses/reports/msmed": {
   "get": {
    "tags": [
     "Expenses and bills"
    ],
    "summary": "MSMED Act: payments due to micro and small suppliers",
    "description": "Needs the **Expenses and bills** scope with read access.",
    "operationId": "getExpensesReportsMsmed",
    "x-msmepulse-scope": "expenses:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/expenses/reports/summary": {
   "get": {
    "tags": [
     "Expenses and bills"
    ],
    "summary": "Spending by category and project",
    "description": "Needs the **Expenses and bills** scope with read access.",
    "operationId": "getExpensesReportsSummary",
    "x-msmepulse-scope": "expenses:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/helpdesk/tickets": {
   "get": {
    "tags": [
     "Support tickets"
    ],
    "summary": "List support tickets",
    "description": "Needs the **Support tickets** scope with read access.",
    "operationId": "getHelpdeskTickets",
    "x-msmepulse-scope": "support:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "tags": [
     "Support tickets"
    ],
    "summary": "Open a ticket",
    "description": "Needs the **Support tickets** scope with read and write access.",
    "operationId": "postHelpdeskTickets",
    "x-msmepulse-scope": "support:write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "subject": {
          "type": "string",
          "minLength": 4,
          "maxLength": 200
         },
         "body": {
          "type": "string",
          "minLength": 1,
          "maxLength": 20000
         },
         "type": {
          "type": "string",
          "enum": [
           "question",
           "problem",
           "request",
           "complaint",
           "other"
          ],
          "default": "question"
         },
         "priority": {
          "type": "string",
          "enum": [
           "low",
           "normal",
           "high",
           "urgent"
          ],
          "default": "normal"
         },
         "channel": {
          "type": "string",
          "enum": [
           "email",
           "phone",
           "internal"
          ],
          "default": "phone"
         },
         "clientId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "projectId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "assigneeId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "contactName": {
          "type": "string",
          "maxLength": 120,
          "default": ""
         },
         "contactEmail": {
          "anyOf": [
           {
            "const": ""
           },
           {
            "type": "string",
            "format": "email"
           }
          ],
          "default": ""
         }
        },
        "required": [
         "subject",
         "body"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/helpdesk/meta": {
   "get": {
    "tags": [
     "Support tickets"
    ],
    "summary": "Ticket statuses, priorities, categories and the support team",
    "description": "Needs the **Support tickets** scope with read access.",
    "operationId": "getHelpdeskMeta",
    "x-msmepulse-scope": "support:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/helpdesk/projects": {
   "get": {
    "tags": [
     "Support tickets"
    ],
    "summary": "Projects a ticket can be linked to",
    "description": "Needs the **Support tickets** scope with read access.",
    "operationId": "getHelpdeskProjects",
    "x-msmepulse-scope": "support:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/helpdesk/tickets/{id}": {
   "get": {
    "tags": [
     "Support tickets"
    ],
    "summary": "Get a ticket, with its messages",
    "description": "Needs the **Support tickets** scope with read access.",
    "operationId": "getHelpdeskTicketsId",
    "x-msmepulse-scope": "support:read",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "patch": {
    "tags": [
     "Support tickets"
    ],
    "summary": "Update a ticket (status, priority, assignee…)",
    "description": "Needs the **Support tickets** scope with read and write access.",
    "operationId": "patchHelpdeskTicketsId",
    "x-msmepulse-scope": "support:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "subject": {
          "type": "string",
          "minLength": 4,
          "maxLength": 200
         },
         "type": {
          "type": "string",
          "enum": [
           "question",
           "problem",
           "request",
           "complaint",
           "other"
          ]
         },
         "priority": {
          "type": "string",
          "enum": [
           "low",
           "normal",
           "high",
           "urgent"
          ]
         },
         "status": {
          "type": "string",
          "enum": [
           "open",
           "pending",
           "resolved",
           "closed"
          ]
         },
         "assigneeId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "projectId": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/helpdesk/tickets/{id}/reply": {
   "post": {
    "tags": [
     "Support tickets"
    ],
    "summary": "Reply on a ticket, or add an internal note",
    "description": "Needs the **Support tickets** scope with read and write access.",
    "operationId": "postHelpdeskTicketsIdReply",
    "x-msmepulse-scope": "support:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "body": {
          "type": "string",
          "minLength": 1,
          "maxLength": 20000
         },
         "internal": {
          "type": "boolean",
          "default": false
         },
         "status": {
          "type": "string",
          "enum": [
           "open",
           "pending",
           "resolved",
           "closed"
          ]
         }
        },
        "required": [
         "body"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/helpdesk/tickets/{id}/client": {
   "post": {
    "tags": [
     "Support tickets"
    ],
    "summary": "Link a ticket to a client",
    "description": "Needs the **Support tickets** scope with read and write access.",
    "operationId": "postHelpdeskTicketsIdClient",
    "x-msmepulse-scope": "support:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "clientId": {
          "type": "string"
         }
        },
        "required": [
         "clientId"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/helpdesk/tickets/{id}/merge": {
   "post": {
    "tags": [
     "Support tickets"
    ],
    "summary": "Merge a ticket into another",
    "description": "Needs the **Support tickets** scope with read and write access.",
    "operationId": "postHelpdeskTicketsIdMerge",
    "x-msmepulse-scope": "support:write",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "into": {
          "type": "integer",
          "exclusiveMinimum": 0
         }
        },
        "required": [
         "into"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/helpdesk/report": {
   "get": {
    "tags": [
     "Support tickets"
    ],
    "summary": "Support desk report: volumes and SLA",
    "description": "Needs the **Support tickets** scope with read access.",
    "operationId": "getHelpdeskReport",
    "x-msmepulse-scope": "support:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/hr/attendance/photos/{id}": {
   "get": {
    "tags": [
     "Attendance and leave"
    ],
    "summary": "Download a check-in selfie",
    "description": "Needs the **Attendance and leave** scope with read access.",
    "operationId": "getHrAttendancePhotosId",
    "x-msmepulse-scope": "attendance:read",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/hr/attendance/{userId}/{date}": {
   "get": {
    "tags": [
     "Attendance and leave"
    ],
    "summary": "One person's day: times, where each punch was made, visits",
    "description": "Needs the **Attendance and leave** scope with read access.",
    "operationId": "getHrAttendanceUserIdDate",
    "x-msmepulse-scope": "attendance:read",
    "parameters": [
     {
      "name": "userId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "date",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/hr/attendance": {
   "get": {
    "tags": [
     "Attendance and leave"
    ],
    "summary": "Attendance for a month (month=YYYY-MM)",
    "description": "Needs the **Attendance and leave** scope with read access.",
    "operationId": "getHrAttendance",
    "x-msmepulse-scope": "attendance:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/hr/leave/types": {
   "get": {
    "tags": [
     "Attendance and leave"
    ],
    "summary": "Leave types",
    "description": "Needs the **Attendance and leave** scope with read access.",
    "operationId": "getHrLeaveTypes",
    "x-msmepulse-scope": "attendance:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/hr/leave/balances": {
   "get": {
    "tags": [
     "Attendance and leave"
    ],
    "summary": "Leave balances",
    "description": "Needs the **Attendance and leave** scope with read access.",
    "operationId": "getHrLeaveBalances",
    "x-msmepulse-scope": "attendance:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/hr/leave/requests": {
   "get": {
    "tags": [
     "Attendance and leave"
    ],
    "summary": "Leave requests (view=team, from)",
    "description": "Needs the **Attendance and leave** scope with read access.",
    "operationId": "getHrLeaveRequests",
    "x-msmepulse-scope": "attendance:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/hr/leave/requests/{id}": {
   "get": {
    "tags": [
     "Attendance and leave"
    ],
    "summary": "Get a leave request",
    "description": "Needs the **Attendance and leave** scope with read access.",
    "operationId": "getHrLeaveRequestsId",
    "x-msmepulse-scope": "attendance:read",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/hr/holidays": {
   "get": {
    "tags": [
     "Attendance and leave"
    ],
    "summary": "Holidays (year)",
    "description": "Needs the **Attendance and leave** scope with read access.",
    "operationId": "getHrHolidays",
    "x-msmepulse-scope": "attendance:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/hr/setup": {
   "get": {
    "tags": [
     "Attendance and leave"
    ],
    "summary": "Offices, work sites, shifts and attendance rules",
    "description": "Needs the **Attendance and leave** scope with read access.",
    "operationId": "getHrSetup",
    "x-msmepulse-scope": "attendance:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/hr/employees": {
   "get": {
    "tags": [
     "Attendance and leave"
    ],
    "summary": "The employee directory",
    "description": "Needs the **Employee directory** scope with read access.",
    "operationId": "getHrEmployees",
    "x-msmepulse-scope": "employees:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/hr/employees/{userId}": {
   "get": {
    "tags": [
     "Attendance and leave"
    ],
    "summary": "An employee's record (sensitive fields masked)",
    "description": "Needs the **Employee directory** scope with read access.",
    "operationId": "getHrEmployeesUserId",
    "x-msmepulse-scope": "employees:read",
    "parameters": [
     {
      "name": "userId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/reports": {
   "get": {
    "tags": [
     "Reports"
    ],
    "summary": "List the reports this token can run",
    "description": "Needs the **Reports** scope with read access.",
    "operationId": "getReports",
    "x-msmepulse-scope": "reports:read",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/reports/{key}": {
   "get": {
    "tags": [
     "Reports"
    ],
    "summary": "Run a report (from, to, clientId, projectId, userId, groupBy)",
    "description": "Needs the **Reports** scope with read access.",
    "operationId": "getReportsKey",
    "x-msmepulse-scope": "reports:read",
    "parameters": [
     {
      "name": "key",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/reports/{key}/export": {
   "get": {
    "tags": [
     "Reports"
    ],
    "summary": "Download a report as a spreadsheet (format=xlsx or csv)",
    "description": "Needs the **Reports** scope with read access.",
    "operationId": "getReportsKeyExport",
    "x-msmepulse-scope": "reports:read",
    "parameters": [
     {
      "name": "key",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "The same data the web app shows"
        }
       }
      }
     },
     "400": {
      "description": "Not valid: error.fields says which fields and why",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, wrong or revoked token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The token doesn't have this area, the module is off, or the endpoint isn't public",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Over the token's requests a minute",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  }
 },
 "webhooks": {
  "client.created": {
   "post": {
    "summary": "A client is added",
    "description": "Sent to your webhook address when a client is added. Check the X-MSMEPulse-Signature header, then fetch the record with the API.",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "id": {
          "type": "string",
          "description": "The event's id (evt_…); the same on every retry, so you can ignore repeats"
         },
         "type": {
          "type": "string",
          "description": "The event, e.g. invoice.issued"
         },
         "createdAt": {
          "type": "string",
          "description": "When it happened (ISO 8601)"
         },
         "workspace": {
          "type": "string",
          "description": "The workspace id"
         },
         "data": {
          "type": "object",
          "properties": {
           "subjectType": {
            "type": "string"
           },
           "subjectId": {
            "type": "string"
           },
           "summary": {
            "type": "string"
           },
           "by": {
            "type": "string"
           }
          }
         }
        },
        "required": [
         "id",
         "type",
         "createdAt",
         "workspace",
         "data"
        ],
        "example": {
         "id": "evt_3f9c…",
         "type": "client.created",
         "createdAt": "2026-10-26T09:30:00.000Z",
         "workspace": "65f0…",
         "data": {
          "subjectType": "client",
          "subjectId": "6a1b…",
          "summary": "A client is added",
          "by": "Asha Rao"
         }
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "X-MSMEPulse-Event",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "The event"
     },
     {
      "name": "X-MSMEPulse-Delivery",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "This delivery's id (each retry of an event has its own)"
     },
     {
      "name": "X-MSMEPulse-Signature",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<body>\" with the webhook's secret>"
     }
    ],
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds. Otherwise it's retried after 1 min, 5 min, 30 min, 2 h, 12 h."
     }
    }
   }
  },
  "invoice.issued": {
   "post": {
    "summary": "An invoice is issued",
    "description": "Sent to your webhook address when an invoice is issued. Check the X-MSMEPulse-Signature header, then fetch the record with the API.",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "id": {
          "type": "string",
          "description": "The event's id (evt_…); the same on every retry, so you can ignore repeats"
         },
         "type": {
          "type": "string",
          "description": "The event, e.g. invoice.issued"
         },
         "createdAt": {
          "type": "string",
          "description": "When it happened (ISO 8601)"
         },
         "workspace": {
          "type": "string",
          "description": "The workspace id"
         },
         "data": {
          "type": "object",
          "properties": {
           "subjectType": {
            "type": "string"
           },
           "subjectId": {
            "type": "string"
           },
           "summary": {
            "type": "string"
           },
           "by": {
            "type": "string"
           }
          }
         }
        },
        "required": [
         "id",
         "type",
         "createdAt",
         "workspace",
         "data"
        ],
        "example": {
         "id": "evt_3f9c…",
         "type": "invoice.issued",
         "createdAt": "2026-10-26T09:30:00.000Z",
         "workspace": "65f0…",
         "data": {
          "subjectType": "invoice",
          "subjectId": "6a1b…",
          "summary": "An invoice is issued",
          "by": "Asha Rao"
         }
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "X-MSMEPulse-Event",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "The event"
     },
     {
      "name": "X-MSMEPulse-Delivery",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "This delivery's id (each retry of an event has its own)"
     },
     {
      "name": "X-MSMEPulse-Signature",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<body>\" with the webhook's secret>"
     }
    ],
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds. Otherwise it's retried after 1 min, 5 min, 30 min, 2 h, 12 h."
     }
    }
   }
  },
  "invoice.cancelled": {
   "post": {
    "summary": "An invoice is cancelled",
    "description": "Sent to your webhook address when an invoice is cancelled. Check the X-MSMEPulse-Signature header, then fetch the record with the API.",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "id": {
          "type": "string",
          "description": "The event's id (evt_…); the same on every retry, so you can ignore repeats"
         },
         "type": {
          "type": "string",
          "description": "The event, e.g. invoice.issued"
         },
         "createdAt": {
          "type": "string",
          "description": "When it happened (ISO 8601)"
         },
         "workspace": {
          "type": "string",
          "description": "The workspace id"
         },
         "data": {
          "type": "object",
          "properties": {
           "subjectType": {
            "type": "string"
           },
           "subjectId": {
            "type": "string"
           },
           "summary": {
            "type": "string"
           },
           "by": {
            "type": "string"
           }
          }
         }
        },
        "required": [
         "id",
         "type",
         "createdAt",
         "workspace",
         "data"
        ],
        "example": {
         "id": "evt_3f9c…",
         "type": "invoice.cancelled",
         "createdAt": "2026-10-26T09:30:00.000Z",
         "workspace": "65f0…",
         "data": {
          "subjectType": "invoice",
          "subjectId": "6a1b…",
          "summary": "An invoice is cancelled",
          "by": "Asha Rao"
         }
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "X-MSMEPulse-Event",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "The event"
     },
     {
      "name": "X-MSMEPulse-Delivery",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "This delivery's id (each retry of an event has its own)"
     },
     {
      "name": "X-MSMEPulse-Signature",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<body>\" with the webhook's secret>"
     }
    ],
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds. Otherwise it's retried after 1 min, 5 min, 30 min, 2 h, 12 h."
     }
    }
   }
  },
  "invoice.credit_note": {
   "post": {
    "summary": "A credit note is raised",
    "description": "Sent to your webhook address when a credit note is raised. Check the X-MSMEPulse-Signature header, then fetch the record with the API.",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "id": {
          "type": "string",
          "description": "The event's id (evt_…); the same on every retry, so you can ignore repeats"
         },
         "type": {
          "type": "string",
          "description": "The event, e.g. invoice.issued"
         },
         "createdAt": {
          "type": "string",
          "description": "When it happened (ISO 8601)"
         },
         "workspace": {
          "type": "string",
          "description": "The workspace id"
         },
         "data": {
          "type": "object",
          "properties": {
           "subjectType": {
            "type": "string"
           },
           "subjectId": {
            "type": "string"
           },
           "summary": {
            "type": "string"
           },
           "by": {
            "type": "string"
           }
          }
         }
        },
        "required": [
         "id",
         "type",
         "createdAt",
         "workspace",
         "data"
        ],
        "example": {
         "id": "evt_3f9c…",
         "type": "invoice.credit_note",
         "createdAt": "2026-10-26T09:30:00.000Z",
         "workspace": "65f0…",
         "data": {
          "subjectType": "invoice",
          "subjectId": "6a1b…",
          "summary": "A credit note is raised",
          "by": "Asha Rao"
         }
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "X-MSMEPulse-Event",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "The event"
     },
     {
      "name": "X-MSMEPulse-Delivery",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "This delivery's id (each retry of an event has its own)"
     },
     {
      "name": "X-MSMEPulse-Signature",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<body>\" with the webhook's secret>"
     }
    ],
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds. Otherwise it's retried after 1 min, 5 min, 30 min, 2 h, 12 h."
     }
    }
   }
  },
  "payment.recorded": {
   "post": {
    "summary": "A payment is recorded (manual or online)",
    "description": "Sent to your webhook address when a payment is recorded (manual or online). Check the X-MSMEPulse-Signature header, then fetch the record with the API.",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "id": {
          "type": "string",
          "description": "The event's id (evt_…); the same on every retry, so you can ignore repeats"
         },
         "type": {
          "type": "string",
          "description": "The event, e.g. invoice.issued"
         },
         "createdAt": {
          "type": "string",
          "description": "When it happened (ISO 8601)"
         },
         "workspace": {
          "type": "string",
          "description": "The workspace id"
         },
         "data": {
          "type": "object",
          "properties": {
           "subjectType": {
            "type": "string"
           },
           "subjectId": {
            "type": "string"
           },
           "summary": {
            "type": "string"
           },
           "by": {
            "type": "string"
           }
          }
         }
        },
        "required": [
         "id",
         "type",
         "createdAt",
         "workspace",
         "data"
        ],
        "example": {
         "id": "evt_3f9c…",
         "type": "payment.recorded",
         "createdAt": "2026-10-26T09:30:00.000Z",
         "workspace": "65f0…",
         "data": {
          "subjectType": "payment",
          "subjectId": "6a1b…",
          "summary": "A payment is recorded (manual or online)",
          "by": "Asha Rao"
         }
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "X-MSMEPulse-Event",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "The event"
     },
     {
      "name": "X-MSMEPulse-Delivery",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "This delivery's id (each retry of an event has its own)"
     },
     {
      "name": "X-MSMEPulse-Signature",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<body>\" with the webhook's secret>"
     }
    ],
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds. Otherwise it's retried after 1 min, 5 min, 30 min, 2 h, 12 h."
     }
    }
   }
  },
  "proposal.accepted": {
   "post": {
    "summary": "A proposal is accepted",
    "description": "Sent to your webhook address when a proposal is accepted. Check the X-MSMEPulse-Signature header, then fetch the record with the API.",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "id": {
          "type": "string",
          "description": "The event's id (evt_…); the same on every retry, so you can ignore repeats"
         },
         "type": {
          "type": "string",
          "description": "The event, e.g. invoice.issued"
         },
         "createdAt": {
          "type": "string",
          "description": "When it happened (ISO 8601)"
         },
         "workspace": {
          "type": "string",
          "description": "The workspace id"
         },
         "data": {
          "type": "object",
          "properties": {
           "subjectType": {
            "type": "string"
           },
           "subjectId": {
            "type": "string"
           },
           "summary": {
            "type": "string"
           },
           "by": {
            "type": "string"
           }
          }
         }
        },
        "required": [
         "id",
         "type",
         "createdAt",
         "workspace",
         "data"
        ],
        "example": {
         "id": "evt_3f9c…",
         "type": "proposal.accepted",
         "createdAt": "2026-10-26T09:30:00.000Z",
         "workspace": "65f0…",
         "data": {
          "subjectType": "proposal",
          "subjectId": "6a1b…",
          "summary": "A proposal is accepted",
          "by": "Asha Rao"
         }
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "X-MSMEPulse-Event",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "The event"
     },
     {
      "name": "X-MSMEPulse-Delivery",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "This delivery's id (each retry of an event has its own)"
     },
     {
      "name": "X-MSMEPulse-Signature",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<body>\" with the webhook's secret>"
     }
    ],
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds. Otherwise it's retried after 1 min, 5 min, 30 min, 2 h, 12 h."
     }
    }
   }
  },
  "task.created": {
   "post": {
    "summary": "A task is created",
    "description": "Sent to your webhook address when a task is created. Check the X-MSMEPulse-Signature header, then fetch the record with the API.",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "id": {
          "type": "string",
          "description": "The event's id (evt_…); the same on every retry, so you can ignore repeats"
         },
         "type": {
          "type": "string",
          "description": "The event, e.g. invoice.issued"
         },
         "createdAt": {
          "type": "string",
          "description": "When it happened (ISO 8601)"
         },
         "workspace": {
          "type": "string",
          "description": "The workspace id"
         },
         "data": {
          "type": "object",
          "properties": {
           "subjectType": {
            "type": "string"
           },
           "subjectId": {
            "type": "string"
           },
           "summary": {
            "type": "string"
           },
           "by": {
            "type": "string"
           }
          }
         }
        },
        "required": [
         "id",
         "type",
         "createdAt",
         "workspace",
         "data"
        ],
        "example": {
         "id": "evt_3f9c…",
         "type": "task.created",
         "createdAt": "2026-10-26T09:30:00.000Z",
         "workspace": "65f0…",
         "data": {
          "subjectType": "task",
          "subjectId": "6a1b…",
          "summary": "A task is created",
          "by": "Asha Rao"
         }
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "X-MSMEPulse-Event",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "The event"
     },
     {
      "name": "X-MSMEPulse-Delivery",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "This delivery's id (each retry of an event has its own)"
     },
     {
      "name": "X-MSMEPulse-Signature",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<body>\" with the webhook's secret>"
     }
    ],
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds. Otherwise it's retried after 1 min, 5 min, 30 min, 2 h, 12 h."
     }
    }
   }
  },
  "ticket.created": {
   "post": {
    "summary": "A support ticket is opened",
    "description": "Sent to your webhook address when a support ticket is opened. Check the X-MSMEPulse-Signature header, then fetch the record with the API.",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "id": {
          "type": "string",
          "description": "The event's id (evt_…); the same on every retry, so you can ignore repeats"
         },
         "type": {
          "type": "string",
          "description": "The event, e.g. invoice.issued"
         },
         "createdAt": {
          "type": "string",
          "description": "When it happened (ISO 8601)"
         },
         "workspace": {
          "type": "string",
          "description": "The workspace id"
         },
         "data": {
          "type": "object",
          "properties": {
           "subjectType": {
            "type": "string"
           },
           "subjectId": {
            "type": "string"
           },
           "summary": {
            "type": "string"
           },
           "by": {
            "type": "string"
           }
          }
         }
        },
        "required": [
         "id",
         "type",
         "createdAt",
         "workspace",
         "data"
        ],
        "example": {
         "id": "evt_3f9c…",
         "type": "ticket.created",
         "createdAt": "2026-10-26T09:30:00.000Z",
         "workspace": "65f0…",
         "data": {
          "subjectType": "ticket",
          "subjectId": "6a1b…",
          "summary": "A support ticket is opened",
          "by": "Asha Rao"
         }
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "X-MSMEPulse-Event",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "The event"
     },
     {
      "name": "X-MSMEPulse-Delivery",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "This delivery's id (each retry of an event has its own)"
     },
     {
      "name": "X-MSMEPulse-Signature",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<body>\" with the webhook's secret>"
     }
    ],
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds. Otherwise it's retried after 1 min, 5 min, 30 min, 2 h, 12 h."
     }
    }
   }
  },
  "leave.approved": {
   "post": {
    "summary": "Leave is approved",
    "description": "Sent to your webhook address when leave is approved. Check the X-MSMEPulse-Signature header, then fetch the record with the API.",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "id": {
          "type": "string",
          "description": "The event's id (evt_…); the same on every retry, so you can ignore repeats"
         },
         "type": {
          "type": "string",
          "description": "The event, e.g. invoice.issued"
         },
         "createdAt": {
          "type": "string",
          "description": "When it happened (ISO 8601)"
         },
         "workspace": {
          "type": "string",
          "description": "The workspace id"
         },
         "data": {
          "type": "object",
          "properties": {
           "subjectType": {
            "type": "string"
           },
           "subjectId": {
            "type": "string"
           },
           "summary": {
            "type": "string"
           },
           "by": {
            "type": "string"
           }
          }
         }
        },
        "required": [
         "id",
         "type",
         "createdAt",
         "workspace",
         "data"
        ],
        "example": {
         "id": "evt_3f9c…",
         "type": "leave.approved",
         "createdAt": "2026-10-26T09:30:00.000Z",
         "workspace": "65f0…",
         "data": {
          "subjectType": "leave",
          "subjectId": "6a1b…",
          "summary": "Leave is approved",
          "by": "Asha Rao"
         }
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "X-MSMEPulse-Event",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "The event"
     },
     {
      "name": "X-MSMEPulse-Delivery",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "This delivery's id (each retry of an event has its own)"
     },
     {
      "name": "X-MSMEPulse-Signature",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<body>\" with the webhook's secret>"
     }
    ],
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds. Otherwise it's retried after 1 min, 5 min, 30 min, 2 h, 12 h."
     }
    }
   }
  },
  "claim.approved": {
   "post": {
    "summary": "An expense claim is approved",
    "description": "Sent to your webhook address when an expense claim is approved. Check the X-MSMEPulse-Signature header, then fetch the record with the API.",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "id": {
          "type": "string",
          "description": "The event's id (evt_…); the same on every retry, so you can ignore repeats"
         },
         "type": {
          "type": "string",
          "description": "The event, e.g. invoice.issued"
         },
         "createdAt": {
          "type": "string",
          "description": "When it happened (ISO 8601)"
         },
         "workspace": {
          "type": "string",
          "description": "The workspace id"
         },
         "data": {
          "type": "object",
          "properties": {
           "subjectType": {
            "type": "string"
           },
           "subjectId": {
            "type": "string"
           },
           "summary": {
            "type": "string"
           },
           "by": {
            "type": "string"
           }
          }
         }
        },
        "required": [
         "id",
         "type",
         "createdAt",
         "workspace",
         "data"
        ],
        "example": {
         "id": "evt_3f9c…",
         "type": "claim.approved",
         "createdAt": "2026-10-26T09:30:00.000Z",
         "workspace": "65f0…",
         "data": {
          "subjectType": "claim",
          "subjectId": "6a1b…",
          "summary": "An expense claim is approved",
          "by": "Asha Rao"
         }
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "X-MSMEPulse-Event",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "The event"
     },
     {
      "name": "X-MSMEPulse-Delivery",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "This delivery's id (each retry of an event has its own)"
     },
     {
      "name": "X-MSMEPulse-Signature",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<body>\" with the webhook's secret>"
     }
    ],
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds. Otherwise it's retried after 1 min, 5 min, 30 min, 2 h, 12 h."
     }
    }
   }
  }
 }
}
