{"openapi":"3.1.2","info":{"title":"SendPulse CRM Public API","description":"Using the API for the CRM service, you can integrate your system with CRM from SendPulse and receive detailed information on pipelines, deals, contacts, companies, tasks, products and their attributes and users. You can also create and update deals, contacts, companies and tasks, assign and remove fields, tags, contact details and instant messengers. Requests are authorized with an OAuth2 access token (client credentials flow): obtain it at https:\/\/api.sendpulse.com\/oauth\/access_token with the ID and Secret from your account and pass it in the `Authorization: Bearer <token>` header. On this page, click \"Authorize\", insert the ID and Secret, then use \"Try it out\" within each method block.","version":"0.1.0"},"servers":[{"url":"https:\/\/api.sendpulse.com\/crm\/v1","description":"Production server"}],"tags":[{"name":"Users","description":"Team members of the account who have access to CRM."},{"name":"Messenger types","description":"Reference list of messenger types used in contact and company messengers."},{"name":"Pipelines","description":"Deal pipelines: create, update and read pipelines with their steps and settings."},{"name":"Pipeline steps","description":"Steps (stages) of a deal pipeline."},{"name":"Fail reasons","description":"Reasons that can be selected when a deal in a pipeline is closed as failed."},{"name":"Deals","description":"Deals: search, create, read, update, delete, move between pipelines, deal history and expiration date."},{"name":"Deal attributes","description":"Custom deal fields of a pipeline and their values on deals."},{"name":"Deal contacts","description":"Links between deals and contacts."},{"name":"Deal expenses","description":"Expenses recorded on a deal."},{"name":"Deal products","description":"Products added to deals: add, update, remove and list deal products."},{"name":"Contacts","description":"Contacts: search, create, read, update, delete, history, related deals and companies, education service data."},{"name":"Contact attributes","description":"Custom contact fields and their values on contacts."},{"name":"Contact channels","description":"Contact phone numbers, email addresses and messengers."},{"name":"Companies","description":"Companies: search, create, read, update, delete and history."},{"name":"Company attributes","description":"Custom company fields and their values on companies."},{"name":"Company channels","description":"Company email addresses, phone numbers and messengers."},{"name":"Comments","description":"Comments (notes) on deals, contacts, companies and tasks."},{"name":"Tags","description":"Tags of the account. Contact tags and task tags are the same set of tags."},{"name":"Telephony","description":"Telephony call records and their links to deals and contacts."},{"name":"Payments","description":"Payments of deals and contacts, manual payments and payment links."},{"name":"Boards","description":"Task boards with their steps and custom task fields."},{"name":"Tasks","description":"Tasks: search, create, read, update, delete, links to other entities, custom field values and history."},{"name":"Task checklists","description":"Checklists of a task and checklist items."},{"name":"Attachments","description":"File upload to the file manager and file attachments of deals, contacts, companies, tasks and comments."},{"name":"Products","description":"Product catalog: products, prices and product sections."},{"name":"Product categories","description":"Product catalog categories."},{"name":"Custom tabs","description":"Custom tabs that group custom fields on contact, deal, task and company cards."},{"name":"Manager settings","description":"Settings that define which team members manage specific CRM sections."}],"paths":{"\/users":{"get":{"operationId":"listUsers","tags":["Users"],"summary":"Get a list of team members","description":"Returns the account owner and the invited team members who confirmed the invitation and have access to CRM. Use their IDs as `responsibleId` in deals, contacts, companies and tasks.","responses":{"200":{"description":"List of team members.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/User"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"}}}},"\/pipelines":{"post":{"operationId":"createPipeline","tags":["Pipelines"],"summary":"Create a pipeline","description":"Creates a new active pipeline at the end of the pipeline list. Default steps and settings are created for it; settings passed in the request override the defaults. The number of pipelines is limited by the tariff plan.","requestBody":{"required":false,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreatePipelineRequest"}}}},"responses":{"201":{"description":"The created pipeline.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/Pipeline"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"get":{"operationId":"listPipelines","tags":["Pipelines"],"summary":"Get a list of pipelines","description":"Returns active pipelines available to the user, ordered by `order`, with their active steps and settings.","responses":{"200":{"description":"List of pipelines.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Pipeline"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"}}}},"\/pipelines\/{pipelineId}":{"get":{"operationId":"getPipeline","tags":["Pipelines"],"summary":"Get a pipeline by ID","description":"Returns the specified active pipeline with its active steps (ordered by `order`) and settings.","parameters":[{"$ref":"#\/components\/parameters\/PipelineId"}],"responses":{"200":{"description":"The pipeline.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/Pipeline"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"put":{"operationId":"updatePipeline","tags":["Pipelines"],"summary":"Update a pipeline","description":"Updates the name and position of the specified pipeline and, optionally, its settings. Settings that are not passed keep their current values.","parameters":[{"$ref":"#\/components\/parameters\/PipelineId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdatePipelineRequest"}}}},"responses":{"200":{"description":"The updated pipeline.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/Pipeline"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/pipelines\/{pipelineId}\/steps":{"post":{"operationId":"createPipelineStep","tags":["Pipeline steps"],"summary":"Create a pipeline step","description":"Adds a new step to the pipeline at the specified position; the following steps are shifted. A pipeline can have at most 30 active steps.","parameters":[{"$ref":"#\/components\/parameters\/PipelineId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SavePipelineStepRequest"}}}},"responses":{"201":{"description":"The created step.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/PipelineStep"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"get":{"operationId":"listPipelineSteps","tags":["Pipeline steps"],"summary":"Get pipeline steps","description":"Returns the active steps of the pipeline, ordered by `order`.","parameters":[{"$ref":"#\/components\/parameters\/PipelineId"}],"responses":{"200":{"description":"List of steps.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/PipelineStep"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/pipelines\/{pipelineId}\/steps\/{stepId}":{"put":{"operationId":"updatePipelineStep","tags":["Pipeline steps"],"summary":"Update a pipeline step","description":"Replaces the step data with the passed values: optional fields that are not passed are reset (`addEndHours`, `notifyIn`, `description` to `null`, `productRequired`, `productSumMatchesDealSum` to `false`).","parameters":[{"$ref":"#\/components\/parameters\/PipelineId"},{"$ref":"#\/components\/parameters\/StepId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SavePipelineStepRequest"}}}},"responses":{"200":{"description":"The updated step.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/PipelineStep"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deletePipelineStep","tags":["Pipeline steps"],"summary":"Delete a pipeline step","description":"Deletes the step. A step that has deals or the last step of a pipeline cannot be deleted.","parameters":[{"$ref":"#\/components\/parameters\/PipelineId"},{"$ref":"#\/components\/parameters\/StepId"}],"responses":{"204":{"description":"The step is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"description":"The step has deals or is the last step of the pipeline.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"success":false,"error":{"code":422,"message":"You have deals in this step"}}}}}}}},"\/deals\/get-list":{"post":{"operationId":"searchDeals","tags":["Deals"],"summary":"Search deals","description":"Returns active, won and lost deals that match the filters, with their attribute values, expiration date and attachments. Deals of pipelines not available to the user are excluded. Numeric filter operators other than `between` require a tariff with advanced filter operators, otherwise 403.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/DealSearchRequest"}}}},"responses":{"200":{"description":"Found deals.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Deal"}},"meta":{"$ref":"#\/components\/schemas\/ListMeta"}},"required":["success","data","meta"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/deals":{"post":{"operationId":"createDeal","tags":["Deals"],"summary":"Create a deal","description":"Creates an active deal in the specified pipeline step. If `responsibleId` is not passed, the default responsible user of the pipeline is assigned; if `price` and `currency` are not passed, the pipeline currency and zero amount are used.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateDealRequest"}}}},"responses":{"201":{"description":"The created deal. `attributes` and `attachments` are present only if they were passed in the request.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/Deal"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/deals\/{dealId}":{"get":{"operationId":"getDeal","tags":["Deals"],"summary":"Get a deal by ID","description":"Returns the deal with its attribute values, expiration date, linked tasks and attachments.","parameters":[{"$ref":"#\/components\/parameters\/DealId"}],"responses":{"200":{"description":"The deal.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/Deal"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"put":{"operationId":"updateDeal","tags":["Deals"],"summary":"Update a deal","description":"Updates the deal fields. The deal stays in its pipeline (use \"Move a deal to another pipeline\" to change it); `stepId` must belong to the current pipeline. Changing `status` to won (3) or lost (2) closes the deal; for a lost deal `failReasonId` defaults to the pipeline default reason.","parameters":[{"$ref":"#\/components\/parameters\/DealId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateDealRequest"}}}},"responses":{"200":{"description":"The updated deal.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/Deal"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteDeal","tags":["Deals"],"summary":"Delete a deal","description":"Deletes the deal.","parameters":[{"$ref":"#\/components\/parameters\/DealId"}],"responses":{"204":{"description":"The deal is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/deals\/{dealId}\/change-pipeline":{"post":{"operationId":"changeDealPipeline","tags":["Deals"],"summary":"Move a deal to another pipeline","description":"Moves the deal to a step of another pipeline. Values of the target pipeline attributes can be passed in `attributes`; mandatory attributes of the target pipeline and its product requirements must be satisfied.","parameters":[{"$ref":"#\/components\/parameters\/DealId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ChangeDealPipelineRequest"}}}},"responses":{"200":{"description":"The deal is moved.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/EmptySuccessResponse"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/deals\/{dealId}\/comments":{"get":{"operationId":"listDealComments","tags":["Comments"],"summary":"Get deal comments","description":"Returns top-level comments of the deal. Pagination is applied only when both `limit` and `offset` are passed; otherwise all comments are returned.","parameters":[{"$ref":"#\/components\/parameters\/DealId"},{"name":"message","in":"query","required":false,"description":"Part of the comment text.","schema":{"type":"string","maxLength":5000},"example":"invoice"},{"name":"limit","in":"query","required":false,"description":"Number of comments to return. Required together with `offset`.","schema":{"type":"integer"},"example":20},{"name":"offset","in":"query","required":false,"description":"Number of comments to skip. Required together with `limit`.","schema":{"type":"integer"},"example":0}],"responses":{"200":{"description":"List of comments.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CommentList"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"post":{"operationId":"createDealComment","tags":["Comments"],"summary":"Create a deal comment","description":"Adds a comment to the deal. Team members mentioned in the text are notified.","parameters":[{"$ref":"#\/components\/parameters\/DealId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateCommentRequest"}}}},"responses":{"201":{"description":"The created comment.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Comment"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/deals\/{dealId}\/comments\/{commentId}":{"put":{"operationId":"updateDealComment","tags":["Comments"],"summary":"Update a deal comment","description":"Replaces the text of the comment.","parameters":[{"$ref":"#\/components\/parameters\/DealId"},{"$ref":"#\/components\/parameters\/CommentId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateCommentRequest"}}}},"responses":{"200":{"description":"The updated comment.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Comment"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteDealComment","tags":["Comments"],"summary":"Delete a deal comment","description":"Deletes the comment together with its replies.","parameters":[{"$ref":"#\/components\/parameters\/DealId"},{"$ref":"#\/components\/parameters\/CommentId"}],"responses":{"204":{"description":"The comment is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/deals\/{dealId}\/contacts":{"get":{"operationId":"listDealContacts","tags":["Deal contacts"],"summary":"Get deal contacts","description":"Returns active contacts linked to the deal.","parameters":[{"$ref":"#\/components\/parameters\/DealId"}],"responses":{"200":{"description":"List of contacts.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Contact"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/deals\/{dealId}\/contacts\/{contactId}":{"post":{"operationId":"attachContactToDeal","tags":["Deal contacts"],"summary":"Link a contact to a deal","description":"Links the contact to the deal. Linking an already linked contact has no effect.","parameters":[{"$ref":"#\/components\/parameters\/DealId"},{"$ref":"#\/components\/parameters\/ContactId"}],"responses":{"201":{"description":"The contact is linked.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/EmptySuccessResponse"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"delete":{"operationId":"detachContactFromDeal","tags":["Deal contacts"],"summary":"Unlink a contact from a deal","description":"Removes the link between the contact and the deal.","parameters":[{"$ref":"#\/components\/parameters\/DealId"},{"$ref":"#\/components\/parameters\/ContactId"}],"responses":{"204":{"description":"The contact is unlinked."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/pipelines\/{pipelineId}\/attributes":{"get":{"operationId":"listDealAttributes","tags":["Deal attributes"],"summary":"Get deal attributes of a pipeline","description":"Returns active and hidden custom deal fields of the pipeline, ordered by `order`.","parameters":[{"$ref":"#\/components\/parameters\/PipelineId"}],"responses":{"200":{"description":"List of deal attributes.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/EntityAttribute"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"post":{"operationId":"createDealAttribute","tags":["Deal attributes"],"summary":"Create a deal attribute","description":"Creates a custom deal field in the pipeline at the end of the field list. The name must be unique among active and hidden deal fields of this pipeline.","parameters":[{"$ref":"#\/components\/parameters\/PipelineId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateEntityAttributeRequest"}}}},"responses":{"201":{"description":"The created deal attribute.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/EntityAttribute"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/pipelines\/{pipelineId}\/attributes\/{attributeId}":{"put":{"operationId":"updateDealAttribute","tags":["Deal attributes"],"summary":"Update a deal attribute","description":"Updates the deal field. Changing `order` moves the field and shifts the others. The name must be unique among active deal fields of this pipeline.","parameters":[{"$ref":"#\/components\/parameters\/PipelineId"},{"$ref":"#\/components\/parameters\/AttributeId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateEntityAttributeRequest"}}}},"responses":{"200":{"description":"The updated deal attribute.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/EntityAttribute"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteDealAttribute","tags":["Deal attributes"],"summary":"Delete a deal attribute","description":"Deletes the deal field together with all its values on deals.","parameters":[{"$ref":"#\/components\/parameters\/PipelineId"},{"$ref":"#\/components\/parameters\/AttributeId"}],"responses":{"204":{"description":"The deal attribute is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/pipelines\/{pipelineId}\/fail-reasons":{"get":{"operationId":"listFailReasons","tags":["Fail reasons"],"summary":"Get fail reasons of a pipeline","description":"Returns all fail reasons of the pipeline, including disabled ones, ordered by `order`.","parameters":[{"$ref":"#\/components\/parameters\/PipelineId"}],"responses":{"200":{"description":"List of fail reasons.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/FailReason"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"post":{"operationId":"createFailReason","tags":["Fail reasons"],"summary":"Create a fail reason","description":"Adds an enabled fail reason to the end of the pipeline fail reason list.","parameters":[{"$ref":"#\/components\/parameters\/PipelineId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateFailReasonRequest"}}}},"responses":{"201":{"description":"The created fail reason.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/FailReason"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/pipelines\/{pipelineId}\/fail-reasons\/{reasonId}":{"put":{"operationId":"updateFailReason","tags":["Fail reasons"],"summary":"Update a fail reason","description":"Updates the passed fields of the fail reason; fields that are not passed keep their values. Changing `order` moves the reason and shifts the others.","parameters":[{"$ref":"#\/components\/parameters\/PipelineId"},{"$ref":"#\/components\/parameters\/ReasonId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateFailReasonRequest"}}}},"responses":{"200":{"description":"The updated fail reason.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/FailReason"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteFailReason","tags":["Fail reasons"],"summary":"Delete a fail reason","description":"Deletes the fail reason from the pipeline.","parameters":[{"$ref":"#\/components\/parameters\/PipelineId"},{"$ref":"#\/components\/parameters\/ReasonId"}],"responses":{"204":{"description":"The fail reason is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/pipelines\/{pipelineId}\/deals\/{dealId}\/fail-reasons":{"get":{"operationId":"listDealFailReasonEntries","tags":["Fail reasons"],"summary":"Get fail reason entries of a deal","description":"Returns the fail reasons selected when the deal was closed as failed, newest first. Each closing as failed with a reason creates a separate entry, so a deal that was failed, reopened and failed again has several entries.","parameters":[{"$ref":"#\/components\/parameters\/PipelineId"},{"$ref":"#\/components\/parameters\/DealId"},{"name":"limit","in":"query","required":true,"description":"Number of entries to return.","schema":{"type":"integer","minimum":1,"maximum":100},"example":20},{"name":"offset","in":"query","required":true,"description":"Number of entries to skip.","schema":{"type":"integer","minimum":0},"example":0},{"name":"fromDate","in":"query","required":true,"description":"Start of the period (UTC): a date (`2026-01-01`, means 00:00:00) or a date and time (`2026-01-01 10:00:00`).","schema":{"type":"string"},"example":"2026-01-01"},{"name":"toDate","in":"query","required":true,"description":"End of the period (UTC), in the same formats. A date without time means 00:00:00 of that day, so the day itself is not included: `2026-11-01` returns entries up to `2026-11-01 00:00:00`. To include the whole day, pass `2026-11-01 23:59:59` or the next date (`2026-11-02`).","schema":{"type":"string"},"example":"2026-01-31 23:59:59"}],"responses":{"200":{"description":"List of fail reason entries.","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/FailReasonEntry"}},"meta":{"$ref":"#\/components\/schemas\/ListMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/deals\/{dealId}\/attributes":{"get":{"operationId":"listDealAttributeValues","tags":["Deal attributes"],"summary":"Get deal attribute values","description":"Returns the attributes that have a value on the deal, with their values.","parameters":[{"$ref":"#\/components\/parameters\/DealId"}],"responses":{"200":{"description":"Attributes with values.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/EntityAttributeWithValue"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"post":{"operationId":"setDealAttributeValue","tags":["Deal attributes"],"summary":"Set a deal attribute value","description":"Sets the value of an attribute of the deal pipeline. If the deal already has a value of this attribute, it is replaced.","parameters":[{"$ref":"#\/components\/parameters\/DealId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SetAttributeValueRequest"}}}},"responses":{"201":{"description":"The saved value.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/EntityAttributeValue"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/deals\/{dealId}\/attributes\/{attributeId}":{"put":{"operationId":"updateDealAttributeValue","tags":["Deal attributes"],"summary":"Update a deal attribute value","description":"Updates an existing value of the attribute on the deal.","parameters":[{"$ref":"#\/components\/parameters\/DealId"},{"$ref":"#\/components\/parameters\/AttributeId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateAttributeValueRequest"}}}},"responses":{"200":{"description":"The saved value.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/EntityAttributeValue"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteDealAttributeValue","tags":["Deal attributes"],"summary":"Delete a deal attribute value","description":"Deletes the value of the attribute on the deal.","parameters":[{"$ref":"#\/components\/parameters\/DealId"},{"$ref":"#\/components\/parameters\/AttributeId"}],"responses":{"204":{"description":"The value is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/deals\/attributes\/{pipelineId}":{"get":{"operationId":"listDealAttributesByPipeline","tags":["Deal attributes"],"summary":"Get deal attributes of a pipeline (alternative)","description":"Returns active and hidden custom deal fields of the specified active pipeline, ordered by `order`. Same data as \"Get deal attributes of a pipeline\".","parameters":[{"$ref":"#\/components\/parameters\/PipelineId"}],"responses":{"200":{"description":"List of deal attributes.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/EntityAttribute"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/messenger-types":{"get":{"operationId":"listMessengerTypes","tags":["Messenger types"],"summary":"Get a list of messenger types","description":"Returns all messenger types that can be used as `typeId` of contact and company messengers.","responses":{"200":{"description":"List of messenger types.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/MessengerType"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"}}}},"\/payments\/all":{"get":{"operationId":"listPayments","tags":["Payments"],"summary":"Get all payments","description":"Returns all payments of the account, newest first.","responses":{"200":{"description":"List of payments.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/PaymentListItem"}},"total":{"type":"integer","description":"Total number of payments.","example":42}},"required":["success","data","total"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"}}}},"\/payments\/deals\/{dealId}":{"get":{"operationId":"listDealPayments","tags":["Payments"],"summary":"Get deal payments","description":"Returns payments of the deal.","parameters":[{"$ref":"#\/components\/parameters\/DealId"}],"responses":{"200":{"description":"List of payments.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/PaymentList"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/payments\/contacts\/{contactId}":{"get":{"operationId":"listContactPayments","tags":["Payments"],"summary":"Get contact payments","description":"Returns payments of the contact.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"}],"responses":{"200":{"description":"List of payments.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/PaymentList"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/contacts\/get-list":{"post":{"operationId":"searchContacts","tags":["Contacts"],"summary":"Search contacts","description":"Returns active contacts available to the user that match the filters, with their tags, phones, emails, messengers, attribute values, sources, popup data, NPS and location. Numeric filter operators other than `between` require a tariff with advanced filter operators, otherwise 403.","requestBody":{"required":false,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ContactSearchRequest"}}}},"responses":{"200":{"description":"Found contacts.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/ContactSearchResult"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/contacts\/get-list-by-email":{"post":{"operationId":"searchContactsByEmail","tags":["Contacts"],"summary":"Search contacts by email","description":"Returns up to 100 active contacts whose email starts with the given value (case-insensitive). A full email address also finds an exact match.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","maxLength":128,"description":"Email address. Contacts whose email starts with this value are returned (case-insensitive).","example":"anna@example.com"},"isEmailFullSearch":{"type":["boolean","null"],"deprecated":true,"description":"Deprecated and ignored: email is always searched by prefix (\"starts with\").","example":true}},"required":["email"]}}}},"responses":{"200":{"description":"Found contacts.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/ContactSearchResult"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/contacts":{"post":{"operationId":"createContactLegacy","deprecated":true,"tags":["Contacts"],"summary":"Create a contact with details (deprecated)","description":"Creates a contact together with phones, emails, tags, messengers and attribute values. Deprecated: use \"Create a contact\" and the dedicated methods for contact details. The number of contacts is limited by the tariff plan.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateContactWithDetailsRequest"}}}},"responses":{"201":{"description":"The created contact.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/Contact"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/contacts\/create":{"post":{"operationId":"createContact","tags":["Contacts"],"summary":"Create a contact","description":"Creates a contact. If `responsibleId` is not passed, the default responsible user from the CRM settings is assigned. The number of contacts is limited by the tariff plan.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateContactRequest"}}}},"responses":{"201":{"description":"The created contact.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/Contact"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/contacts\/{contactId}":{"get":{"operationId":"getContact","tags":["Contacts"],"summary":"Get a contact by ID","description":"Returns the contact with all its details.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"}],"responses":{"200":{"description":"The contact.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/Contact"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"put":{"operationId":"updateContact","tags":["Contacts"],"summary":"Update a contact","description":"Updates the contact name and responsible user. Use the dedicated methods to change phones, emails, messengers, tags and attribute values.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateContactRequest"}}}},"responses":{"200":{"description":"The updated contact.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/Contact"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteContact","tags":["Contacts"],"summary":"Delete a contact","description":"Deletes the contact.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"}],"responses":{"204":{"description":"The contact is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/contacts\/{contactId}\/deals":{"get":{"operationId":"listContactDeals","tags":["Contacts"],"summary":"Get contact deals","description":"Returns active, won and lost deals linked to the contact, newest first.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"}],"responses":{"200":{"description":"List of deals.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Deal"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/contacts\/{contactId}\/comments":{"get":{"operationId":"listContactComments","tags":["Comments"],"summary":"Get contact comments","description":"Returns top-level comments of the contact. Pagination is applied only when both `limit` and `offset` are passed; otherwise all comments are returned.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"},{"name":"message","in":"query","required":false,"description":"Part of the comment text.","schema":{"type":"string","maxLength":5000},"example":"invoice"},{"name":"limit","in":"query","required":false,"description":"Number of comments to return. Required together with `offset`.","schema":{"type":"integer"},"example":20},{"name":"offset","in":"query","required":false,"description":"Number of comments to skip. Required together with `limit`.","schema":{"type":"integer"},"example":0}],"responses":{"200":{"description":"List of comments.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CommentList"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"post":{"operationId":"createContactComment","tags":["Comments"],"summary":"Create a contact comment","description":"Adds a comment to the contact. Team members mentioned in the text are notified.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateCommentRequest"}}}},"responses":{"201":{"description":"The created comment.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Comment"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/contacts\/{contactId}\/comments\/{commentId}":{"put":{"operationId":"updateContactComment","tags":["Comments"],"summary":"Update a contact comment","description":"Replaces the text of the comment.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"},{"$ref":"#\/components\/parameters\/CommentId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateCommentRequest"}}}},"responses":{"200":{"description":"The updated comment.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Comment"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteContactComment","tags":["Comments"],"summary":"Delete a contact comment","description":"Deletes the comment together with its replies.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"},{"$ref":"#\/components\/parameters\/CommentId"}],"responses":{"204":{"description":"The comment is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/contacts\/{contactId}\/phones":{"post":{"operationId":"addContactPhone","tags":["Contact channels"],"summary":"Add a contact phone","description":"Adds a phone number to the contact. Returns 403 if contact data is hidden for the user.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"phone":{"type":["string","integer"],"description":"Phone number (1\u201350 digits; other characters are removed).","example":"+380501234567"}},"required":["phone"]}}}},"responses":{"201":{"description":"The added phone.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/ContactPhone"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/contacts\/{contactId}\/phones\/{phoneId}":{"put":{"operationId":"updateContactPhone","tags":["Contact channels"],"summary":"Update a contact phone","description":"Updates the phone number and its main flag.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"},{"$ref":"#\/components\/parameters\/PhoneId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"phone":{"type":["string","integer"],"description":"Phone number (1\u201350 digits).","example":"+380501234567"},"isMain":{"type":["boolean","null"],"description":"Whether this is the main phone; not passed \u2014 `false`.","example":true}},"required":["phone"]}}}},"responses":{"200":{"description":"The updated phone.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/ContactPhone"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteContactPhone","tags":["Contact channels"],"summary":"Delete a contact phone","description":"Deletes the phone number of the contact.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"},{"$ref":"#\/components\/parameters\/PhoneId"}],"responses":{"204":{"description":"The phone is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/contacts\/{contactId}\/emails":{"post":{"operationId":"addContactEmails","tags":["Contact channels"],"summary":"Add contact emails","description":"Adds email addresses to the contact; addresses the contact already has are returned without duplication. At most one email can be main.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"emails":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"Email address.","example":"anna@example.com"},"isMain":{"type":"boolean","description":"Whether this is the main email.","example":true}},"required":["email","isMain"]}},"initCreation":{"type":"boolean","description":"Pass `true` when filling emails of a newly created contact: the change is not reported as a contact email creation event.","example":false}},"required":["emails"]}}}},"responses":{"201":{"description":"The contact emails from the request.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/ContactEmail"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/contacts\/{contactId}\/emails\/{emailId}":{"put":{"operationId":"updateContactEmail","tags":["Contact channels"],"summary":"Update a contact email","description":"Updates the email address and its main flag.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"},{"$ref":"#\/components\/parameters\/EmailId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"email":{"type":"string","minLength":1,"maxLength":128,"description":"Email address.","example":"anna@example.com"},"isMain":{"type":["boolean","null"],"description":"Whether this is the main email; not passed \u2014 `false`.","example":true}},"required":["email"]}}}},"responses":{"200":{"description":"The updated email.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/ContactEmail"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteContactEmail","tags":["Contact channels"],"summary":"Delete a contact email","description":"Deletes the email address of the contact.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"},{"$ref":"#\/components\/parameters\/EmailId"}],"responses":{"204":{"description":"The email is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/contacts\/{contactId}\/messengers":{"post":{"operationId":"addContactMessenger","tags":["Contact channels"],"summary":"Add a contact messenger","description":"Adds a messenger to the contact.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SaveContactMessengerRequest"}}}},"responses":{"201":{"description":"The added messenger.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/ContactMessenger"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/contacts\/{contactId}\/messengers\/{messengerId}":{"put":{"operationId":"updateContactMessenger","tags":["Contact channels"],"summary":"Update a contact messenger","description":"Replaces the messenger data with the passed values.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"},{"$ref":"#\/components\/parameters\/MessengerId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SaveContactMessengerRequest"}}}},"responses":{"200":{"description":"The updated messenger.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/ContactMessenger"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteContactMessenger","tags":["Contact channels"],"summary":"Delete a contact messenger","description":"Deletes the messenger of the contact.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"},{"$ref":"#\/components\/parameters\/MessengerId"}],"responses":{"204":{"description":"The messenger is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/contact-tags":{"get":{"operationId":"listContactTags","tags":["Tags"],"summary":"Get contact tags","description":"Returns active tags of the account. Contact tags and task tags are the same set of tags.","parameters":[{"name":"name","in":"query","required":false,"description":"Exact tag name.","schema":{"type":"string","maxLength":64},"example":"VIP"},{"name":"search","in":"query","required":false,"description":"Part of the tag name.","schema":{"type":"string","maxLength":64},"example":"VI"}],"responses":{"200":{"description":"List of tags.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Tag"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"post":{"operationId":"createContactTag","tags":["Tags"],"summary":"Create a contact tag","description":"Creates a tag. Contact tags and task tags are the same set of tags.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateTagRequest"}}}},"responses":{"201":{"description":"The created tag.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/Tag"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/contact-tags\/{tagId}":{"put":{"operationId":"updateContactTag","tags":["Tags"],"summary":"Update a contact tag","description":"Updates the tag. Contact tags and task tags are the same set of tags.","parameters":[{"$ref":"#\/components\/parameters\/TagId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateTagRequest"}}}},"responses":{"200":{"description":"The updated tag.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/Tag"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteContactTag","tags":["Tags"],"summary":"Delete a contact tag","description":"Deletes the tag and removes it from contacts and tasks. Contact tags and task tags are the same set of tags.","parameters":[{"$ref":"#\/components\/parameters\/TagId"}],"responses":{"204":{"description":"The tag is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/contact-tags\/{tagId}\/contact\/{contactId}":{"post":{"operationId":"attachTagToContact","tags":["Tags"],"summary":"Add a tag to a contact","description":"Adds the tag to the contact. Adding a tag the contact already has has no effect.","parameters":[{"$ref":"#\/components\/parameters\/TagId"},{"$ref":"#\/components\/parameters\/ContactId"}],"responses":{"201":{"description":"The tag is added.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/EmptySuccessResponse"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"delete":{"operationId":"detachTagFromContact","tags":["Tags"],"summary":"Remove a tag from a contact","description":"Removes the tag from the contact.","parameters":[{"$ref":"#\/components\/parameters\/TagId"},{"$ref":"#\/components\/parameters\/ContactId"}],"responses":{"204":{"description":"The tag is removed."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/contacts\/attributes":{"get":{"operationId":"listContactAttributes","tags":["Contact attributes"],"summary":"Get contact attributes","description":"Returns active and hidden custom contact fields, ordered by `order`.","responses":{"200":{"description":"List of contact attributes.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/EntityAttribute"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"}}},"post":{"operationId":"createContactAttribute","tags":["Contact attributes"],"summary":"Create a contact attribute","description":"Creates a custom contact field at the end of the field list. The name must be unique among active and hidden contact fields.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateEntityAttributeRequest"}}}},"responses":{"201":{"description":"The created contact attribute.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/EntityAttribute"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/contacts\/attributes\/{attributeId}":{"put":{"operationId":"updateContactAttribute","tags":["Contact attributes"],"summary":"Update a contact attribute","description":"Updates the contact field. Changing `order` moves the field and shifts the others.","parameters":[{"$ref":"#\/components\/parameters\/AttributeId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateEntityAttributeRequest"}}}},"responses":{"200":{"description":"The updated contact attribute.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/EntityAttribute"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteContactAttribute","tags":["Contact attributes"],"summary":"Delete a contact attribute","description":"Deletes the contact field together with all its values.","parameters":[{"$ref":"#\/components\/parameters\/AttributeId"}],"responses":{"204":{"description":"The contact attribute is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/contacts\/{contactId}\/attributes":{"get":{"operationId":"listContactAttributeValues","tags":["Contact attributes"],"summary":"Get contact attribute values","description":"Returns the attributes that have a value on the contact, with their values.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"}],"responses":{"200":{"description":"Attributes with values.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/EntityAttributeWithValue"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"post":{"operationId":"setContactAttributeValue","tags":["Contact attributes"],"summary":"Set a contact attribute value","description":"Sets the value of a contact attribute. If the contact already has a value of this attribute, it is replaced.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SetAttributeValueRequest"}}}},"responses":{"201":{"description":"The saved value.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/EntityAttributeValue"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/contacts\/{contactId}\/attributes\/{attributeId}":{"put":{"operationId":"updateContactAttributeValue","tags":["Contact attributes"],"summary":"Update a contact attribute value","description":"Updates an existing value of the attribute on the contact.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"},{"$ref":"#\/components\/parameters\/AttributeId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateAttributeValueRequest"}}}},"responses":{"200":{"description":"The saved value.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/EntityAttributeValue"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteContactAttributeValue","tags":["Contact attributes"],"summary":"Delete a contact attribute value","description":"Deletes the value of the attribute on the contact.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"},{"$ref":"#\/components\/parameters\/AttributeId"}],"responses":{"204":{"description":"The value is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/contacts\/{contactId}\/attributes\/batch":{"post":{"operationId":"batchSetContactAttributeValues","tags":["Contact attributes"],"summary":"Set several contact attribute values","description":"Sets values of several contact attributes; existing values are replaced.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BatchSetAttributeValuesRequest"}}}},"responses":{"201":{"description":"The saved values.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/AttributeValueBatchItem"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/boards":{"get":{"operationId":"listBoards","tags":["Boards"],"summary":"Get a list of boards","description":"Returns active task boards available to the user, with their steps, task attributes and settings.","responses":{"200":{"description":"List of boards.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/BoardList"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"}}},"post":{"operationId":"createBoard","tags":["Boards"],"summary":"Create a board","description":"Creates a task board with three default steps. The number of boards is limited by the tariff plan.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateBoardRequest"}}}},"responses":{"201":{"description":"The created board.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/Board"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/boards\/{boardId}":{"get":{"operationId":"getBoard","tags":["Boards"],"summary":"Get a board by ID","description":"Returns the board with its steps, task attributes and settings.","parameters":[{"$ref":"#\/components\/parameters\/BoardId"}],"responses":{"200":{"description":"The board.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/Board"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"put":{"operationId":"updateBoard","tags":["Boards"],"summary":"Update a board","description":"Updates the board name and settings.","parameters":[{"$ref":"#\/components\/parameters\/BoardId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateBoardRequest"}}}},"responses":{"200":{"description":"The updated board.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/Board"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/boards\/{boardId}\/attributes":{"get":{"operationId":"listBoardAttributes","tags":["Boards"],"summary":"Get task attributes of a board","description":"Returns active custom task fields of the board.","parameters":[{"$ref":"#\/components\/parameters\/BoardId"}],"responses":{"200":{"description":"List of task attributes.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/BoardAttribute"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"post":{"operationId":"createBoardAttribute","tags":["Boards"],"summary":"Create a task attribute","description":"Creates a custom task field on the board at the end of the field list.","parameters":[{"$ref":"#\/components\/parameters\/BoardId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateBoardAttributeRequest"}}}},"responses":{"201":{"description":"The created task attribute.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/BoardAttribute"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/boards\/{boardId}\/attributes\/{attributeId}":{"put":{"operationId":"updateBoardAttribute","tags":["Boards"],"summary":"Update a task attribute","description":"Updates the passed fields of the task attribute. Changing `order` moves the field and shifts the others.","parameters":[{"$ref":"#\/components\/parameters\/BoardId"},{"$ref":"#\/components\/parameters\/AttributeId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateBoardAttributeRequest"}}}},"responses":{"200":{"description":"The updated task attribute.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/BoardAttribute"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/boards\/{boardId}\/steps":{"post":{"operationId":"createBoardStep","tags":["Boards"],"summary":"Create a board step","description":"Adds a step to the board at the specified position (default \u2014 the last one); the following steps are shifted. A board can have at most 30 steps.","parameters":[{"$ref":"#\/components\/parameters\/BoardId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SaveBoardStepRequest"}}}},"responses":{"201":{"description":"The created step.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/BoardStep"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/boards\/{boardId}\/steps\/{stepId}":{"put":{"operationId":"updateBoardStep","tags":["Boards"],"summary":"Update a board step","description":"Updates the board step.","parameters":[{"$ref":"#\/components\/parameters\/BoardId"},{"$ref":"#\/components\/parameters\/StepId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateBoardStepRequest"}}}},"responses":{"200":{"description":"The updated step.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/BoardStep"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/tasks\/list":{"post":{"operationId":"searchTasks","tags":["Tasks"],"summary":"Search tasks","description":"Returns active tasks of the board that match the filters.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/TaskSearchRequest"}}}},"responses":{"200":{"description":"Found tasks.","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/TaskListItem"}},"meta":{"$ref":"#\/components\/schemas\/SearchMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/tasks":{"post":{"operationId":"createTask","tags":["Tasks"],"summary":"Create a task","description":"Creates a task on the board step, with optional checklists, links to deals, contacts and tasks, attribute values, tags and attachments. If `responsibleId` is not passed, the current user is assigned.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateTaskRequest"}}}},"responses":{"201":{"description":"The created task.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/Task"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/tasks\/{taskId}":{"get":{"operationId":"getTask","tags":["Tasks"],"summary":"Get a task by ID","description":"Returns the task with its description, attributes with values, repeat settings, checklists, links and attachments.","parameters":[{"$ref":"#\/components\/parameters\/TaskId"}],"responses":{"200":{"description":"The task.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/Task"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"put":{"operationId":"updateTask","tags":["Tasks"],"summary":"Update a task","description":"Updates the task fields.","parameters":[{"$ref":"#\/components\/parameters\/TaskId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateTaskRequest"}}}},"responses":{"200":{"description":"The updated task.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/Task"}},"required":["success","data"]}}}},"400":{"description":"The task is not available to the user or cannot be updated.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/LegacyErrorResponse"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteTask","tags":["Tasks"],"summary":"Delete a task","description":"Deletes the task.","parameters":[{"$ref":"#\/components\/parameters\/TaskId"}],"responses":{"204":{"description":"The task is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/tasks\/{taskId}\/parent":{"post":{"operationId":"setTaskParent","tags":["Tasks"],"summary":"Set a parent task","description":"Makes the task a subtask of the specified task, or detaches it from its parent when `parentId` is `null`.","parameters":[{"$ref":"#\/components\/parameters\/TaskId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"parentId":{"type":["integer","null"],"description":"ID of the parent task; `null` \u2014 remove the parent.","example":77000}},"required":["parentId"]}}}},"responses":{"200":{"description":"The parent is set.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/EmptySuccessResponse"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/tasks\/{taskId}\/steps\/{stepId}\/order":{"post":{"operationId":"changeTaskOrder","tags":["Tasks"],"summary":"Move a task within or between steps","description":"Changes the position of the task in its current step (`stepId`) or moves it to `newStepId`.","parameters":[{"$ref":"#\/components\/parameters\/TaskId"},{"$ref":"#\/components\/parameters\/StepId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"order":{"type":"number","minimum":0,"description":"New position of the task.","example":3},"newStepId":{"type":"integer","description":"ID of the step to move the task to.","example":6102}},"required":["order"]}}}},"responses":{"200":{"description":"The new position.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/TaskOrder"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/tasks\/{taskId}\/comments":{"get":{"operationId":"listTaskComments","tags":["Comments"],"summary":"Get task comments","description":"Returns top-level comments of the task. Pagination is applied only when both `limit` and `offset` are passed; otherwise all comments are returned.","parameters":[{"$ref":"#\/components\/parameters\/TaskId"},{"name":"message","in":"query","required":false,"description":"Part of the comment text.","schema":{"type":"string","maxLength":5000},"example":"invoice"},{"name":"limit","in":"query","required":false,"description":"Number of comments to return. Required together with `offset`.","schema":{"type":"integer"},"example":20},{"name":"offset","in":"query","required":false,"description":"Number of comments to skip. Required together with `limit`.","schema":{"type":"integer"},"example":0}],"responses":{"200":{"description":"List of comments.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CommentList"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"post":{"operationId":"createTaskComment","tags":["Comments"],"summary":"Create a task comment","description":"Adds a comment to the task. Team members mentioned in the text are notified.","parameters":[{"$ref":"#\/components\/parameters\/TaskId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateCommentRequest"}}}},"responses":{"201":{"description":"The created comment.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Comment"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/tasks\/{taskId}\/comments\/{commentId}":{"put":{"operationId":"updateTaskComment","tags":["Comments"],"summary":"Update a task comment","description":"Replaces the text of the comment.","parameters":[{"$ref":"#\/components\/parameters\/TaskId"},{"$ref":"#\/components\/parameters\/CommentId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateCommentRequest"}}}},"responses":{"200":{"description":"The updated comment.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Comment"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteTaskComment","tags":["Comments"],"summary":"Delete a task comment","description":"Deletes the comment together with its replies.","parameters":[{"$ref":"#\/components\/parameters\/TaskId"},{"$ref":"#\/components\/parameters\/CommentId"}],"responses":{"204":{"description":"The comment is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/task-tags":{"get":{"operationId":"listTaskTags","tags":["Tags"],"summary":"Get task tags","description":"Returns active tags of the account. Contact tags and task tags are the same set of tags.","parameters":[{"name":"name","in":"query","required":false,"description":"Exact tag name.","schema":{"type":"string","maxLength":64},"example":"VIP"},{"name":"search","in":"query","required":false,"description":"Part of the tag name.","schema":{"type":"string","maxLength":64},"example":"VI"}],"responses":{"200":{"description":"List of tags.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Tag"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"post":{"operationId":"createTaskTag","tags":["Tags"],"summary":"Create a task tag","description":"Creates a tag. Contact tags and task tags are the same set of tags.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateTagRequest"}}}},"responses":{"201":{"description":"The created tag.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/Tag"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/task-tags\/{tagId}":{"put":{"operationId":"updateTaskTag","tags":["Tags"],"summary":"Update a task tag","description":"Updates the tag. Contact tags and task tags are the same set of tags.","parameters":[{"$ref":"#\/components\/parameters\/TagId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateTagRequest"}}}},"responses":{"200":{"description":"The updated tag.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/Tag"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteTaskTag","tags":["Tags"],"summary":"Delete a task tag","description":"Deletes the tag and removes it from contacts and tasks. Contact tags and task tags are the same set of tags.","parameters":[{"$ref":"#\/components\/parameters\/TagId"}],"responses":{"204":{"description":"The tag is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/task-tags\/{tagId}\/task\/{taskId}":{"delete":{"operationId":"detachTagFromTask","tags":["Tags"],"summary":"Remove a tag from a task","description":"Removes the tag from the task.","parameters":[{"$ref":"#\/components\/parameters\/TagId"},{"$ref":"#\/components\/parameters\/TaskId"}],"responses":{"204":{"description":"The tag is removed."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/task-contacts\/{taskId}\/contact\/{contactId}":{"delete":{"operationId":"detachContactFromTask","tags":["Tasks"],"summary":"Unlink a contact from a task","description":"Removes the link between the task and the contact.","parameters":[{"$ref":"#\/components\/parameters\/TaskId"},{"$ref":"#\/components\/parameters\/ContactId"}],"responses":{"204":{"description":"The link is removed."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/task-deals\/{taskId}\/deal\/{dealId}":{"delete":{"operationId":"detachDealFromTask","tags":["Tasks"],"summary":"Unlink a deal from a task","description":"Removes the link between the task and the deal.","parameters":[{"$ref":"#\/components\/parameters\/TaskId"},{"$ref":"#\/components\/parameters\/DealId"}],"responses":{"204":{"description":"The link is removed."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/task-to-task\/{taskHeadId}\/task\/{taskId}":{"delete":{"operationId":"detachTaskFromTask","tags":["Tasks"],"summary":"Unlink two tasks","description":"Removes the link between the task `taskHeadId` and the linked task `taskId`.","parameters":[{"name":"taskHeadId","in":"path","required":true,"description":"ID of the task the link belongs to.","schema":{"type":"integer"},"example":77001},{"$ref":"#\/components\/parameters\/TaskId"}],"responses":{"204":{"description":"The link is removed."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/tasks\/{taskId}\/entity-attach":{"post":{"operationId":"attachEntitiesToTask","tags":["Tasks"],"summary":"Link deals, contacts and tasks to a task","description":"Links deals, contacts and related tasks to the task and makes the listed tasks its subtasks.","parameters":[{"$ref":"#\/components\/parameters\/TaskId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"connections":{"$ref":"#\/components\/schemas\/TaskConnectionsInput"}},"required":["connections"]}}}},"responses":{"201":{"description":"The linked entities.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/TaskConnections"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/tasks\/{taskId}\/checklists\/single":{"post":{"operationId":"createTaskChecklist","tags":["Task checklists"],"summary":"Create a checklist","description":"Creates an empty checklist in the task.","parameters":[{"$ref":"#\/components\/parameters\/TaskId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":250,"description":"Checklist name.","example":"Preparation"}},"required":["name"]}}}},"responses":{"201":{"description":"The created checklist.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/TaskChecklistShort"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/tasks\/{taskId}\/checklists\/{checklistId}\/single":{"put":{"operationId":"updateTaskChecklist","tags":["Task checklists"],"summary":"Rename a checklist","description":"Changes the checklist name.","parameters":[{"$ref":"#\/components\/parameters\/TaskId"},{"$ref":"#\/components\/parameters\/ChecklistId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":250,"description":"Checklist name.","example":"Preparation"}},"required":["name"]}}}},"responses":{"200":{"description":"The updated checklist.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/TaskChecklistShort"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/tasks\/{taskId}\/checklists":{"get":{"operationId":"listTaskChecklists","tags":["Task checklists"],"summary":"Get task checklists","description":"Returns checklists of the task with their items.","parameters":[{"$ref":"#\/components\/parameters\/TaskId"}],"responses":{"200":{"description":"List of checklists.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/TaskChecklist"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"post":{"operationId":"createTaskChecklists","tags":["Task checklists"],"summary":"Create checklists with items","description":"Creates several checklists with items in the task.","parameters":[{"$ref":"#\/components\/parameters\/TaskId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"checklists":{"type":"array","items":{"$ref":"#\/components\/schemas\/ChecklistInput"}}},"required":["checklists"]}}}},"responses":{"201":{"description":"The checklists are created.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/EmptySuccessResponse"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"put":{"operationId":"updateTaskChecklists","tags":["Task checklists"],"summary":"Update checklists with items","description":"Updates names of existing checklists and names, statuses and responsible users of their items.","parameters":[{"$ref":"#\/components\/parameters\/TaskId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"checklists":{"type":"array","items":{"$ref":"#\/components\/schemas\/ChecklistUpdateInput"}}},"required":["checklists"]}}}},"responses":{"200":{"description":"The checklists are updated.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/EmptySuccessResponse"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/tasks\/{taskId}\/checklists\/{checklistId}":{"delete":{"operationId":"deleteTaskChecklist","tags":["Task checklists"],"summary":"Delete a checklist","description":"Deletes the checklist with its items.","parameters":[{"$ref":"#\/components\/parameters\/TaskId"},{"$ref":"#\/components\/parameters\/ChecklistId"}],"responses":{"204":{"description":"The checklist is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/checklists\/{checklistId}\/items":{"post":{"operationId":"createChecklistItem","tags":["Task checklists"],"summary":"Add a checklist item","description":"Adds an item to the end of the checklist.","parameters":[{"$ref":"#\/components\/parameters\/ChecklistId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":250,"description":"Item name.","example":"Prepare the offer"}},"required":["name"]}}}},"responses":{"201":{"description":"The added item.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/ChecklistItem"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/checklists\/{checklistId}\/items\/{itemId}":{"post":{"operationId":"changeChecklistItemOrder","tags":["Task checklists"],"summary":"Move a checklist item","description":"Changes the position of the item in the checklist.","parameters":[{"$ref":"#\/components\/parameters\/ChecklistId"},{"$ref":"#\/components\/parameters\/ChecklistItemId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"order":{"type":"number","minimum":1,"description":"New position of the item.","example":2}},"required":["order"]}}}},"responses":{"200":{"description":"The item is moved.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/EmptySuccessResponse"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"put":{"operationId":"updateChecklistItem","tags":["Task checklists"],"summary":"Update a checklist item","description":"Updates the item name or its done status.","parameters":[{"$ref":"#\/components\/parameters\/ChecklistId"},{"$ref":"#\/components\/parameters\/ChecklistItemId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":250,"description":"Item name.","example":"Prepare the offer"},"isDone":{"type":"integer","enum":[0,1],"description":"`1` \u2014 done, `0` \u2014 not done.","example":1}}}}}},"responses":{"200":{"description":"The updated item.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/ChecklistItem"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteChecklistItem","tags":["Task checklists"],"summary":"Delete a checklist item","description":"Deletes the item from the checklist.","parameters":[{"$ref":"#\/components\/parameters\/ChecklistId"},{"$ref":"#\/components\/parameters\/ChecklistItemId"}],"responses":{"204":{"description":"The item is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/tasks\/{taskId}\/attributes":{"post":{"operationId":"setTaskAttributeValue","tags":["Tasks"],"summary":"Set a task attribute value","description":"Adds a value of a board task attribute to the task. For `multiList` attributes pass an array to add several values.","parameters":[{"$ref":"#\/components\/parameters\/TaskId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"attributeId":{"type":"integer","description":"ID of an active task attribute of the board.","example":3301},"value":{"type":["string","number","boolean","array"],"items":{"type":"string"},"description":"Value; an array of options for `multiList`.","example":"High"}},"required":["attributeId","value"]}}}},"responses":{"200":{"description":"The saved values.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/TaskAttributeValueRecord"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/{boardId}\/attributes\/{attributeId}\/values\/{valueId}":{"put":{"operationId":"updateTaskAttributeValue","tags":["Tasks"],"summary":"Update a task attribute value","description":"Updates a value of a task attribute (`valueId` from `attributes[].values[].id` of \"Get a task by ID\").","parameters":[{"$ref":"#\/components\/parameters\/BoardId"},{"$ref":"#\/components\/parameters\/AttributeId"},{"$ref":"#\/components\/parameters\/ValueId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"value":{"type":["string","number","boolean"],"description":"New value.","example":"Kyiv"}},"required":["value"]}}}},"responses":{"200":{"description":"The value is updated.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/EmptySuccessResponse"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteTaskAttributeValue","tags":["Tasks"],"summary":"Delete a task attribute value","description":"Deletes a value of a task attribute.","parameters":[{"$ref":"#\/components\/parameters\/BoardId"},{"$ref":"#\/components\/parameters\/AttributeId"},{"$ref":"#\/components\/parameters\/ValueId"}],"responses":{"204":{"description":"The value is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/telephony\/calls\/get-list":{"post":{"operationId":"listCalls","tags":["Telephony"],"summary":"Search calls","description":"Returns telephony calls that match the filters, newest first.","requestBody":{"required":false,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CallSearchRequest"}}}},"responses":{"200":{"description":"Found calls.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/CallList"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/contacts\/{contactId}\/get-calls":{"post":{"operationId":"listContactCalls","tags":["Telephony"],"summary":"Get contact calls","description":"Returns all calls of the contact that match the filters, grouped by date (UTC), newest first.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"}],"requestBody":{"required":false,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CallFilter"}}}},"responses":{"200":{"description":"Calls grouped by date.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/CallsByDate"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/deals\/{dealId}\/get-calls":{"post":{"operationId":"listDealCalls","tags":["Telephony"],"summary":"Get deal calls","description":"Returns all calls linked to the deal that match the filters, grouped by date (UTC), newest first.","parameters":[{"$ref":"#\/components\/parameters\/DealId"}],"requestBody":{"required":false,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CallFilter"}}}},"responses":{"200":{"description":"Calls grouped by date.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/CallsByDate"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/deals\/{dealId}\/attach-call":{"post":{"operationId":"attachCallToDeal","tags":["Telephony"],"summary":"Link a call to a deal","description":"Links the call to the deal (replaces its current deal link).","parameters":[{"$ref":"#\/components\/parameters\/DealId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"callId":{"type":"integer","description":"Call ID.","example":99001}},"required":["callId"]}}}},"responses":{"200":{"description":"The linked call.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/TelephonyCall"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/deals\/{dealId}\/expiration":{"put":{"operationId":"setDealExpiration","tags":["Deals"],"summary":"Set a deal expiration date","description":"Sets or replaces the expiration date of the deal and the notification before it.","parameters":[{"$ref":"#\/components\/parameters\/DealId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SetDealExpirationRequest"}}}},"responses":{"200":{"description":"The deal expiration date.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/DealExpiration"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteDealExpiration","tags":["Deals"],"summary":"Delete a deal expiration date","description":"Removes the expiration date of the deal.","parameters":[{"$ref":"#\/components\/parameters\/DealId"}],"responses":{"204":{"description":"The expiration date is removed."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/contacts\/{contactId}\/edu-payments":{"get":{"operationId":"listContactEduPayments","tags":["Contacts"],"summary":"Get contact payments in Education","description":"Returns course payments of the students linked to the contact in the SendPulse Education service, newest first. The contact must have the `education` source.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"}],"responses":{"200":{"description":"Course payments.","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/EduPaymentList"}},"required":["data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"description":"The contact is not available to the user or is not linked to an Education student.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}}},"\/contacts\/{contactId}\/edu-statistic":{"get":{"operationId":"getContactEduStatistics","tags":["Contacts"],"summary":"Get contact statistics in Education","description":"Returns learning statistics of the students linked to the contact in the SendPulse Education service: schools, courses with progress, groups and responsible team members. The contact must have the `education` source.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"}],"responses":{"200":{"description":"Learning statistics.","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/EduStatistics"}},"required":["data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"description":"The contact is not available to the user or is not linked to an Education student.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}}},"\/files\/upload":{"post":{"operationId":"uploadFiles","tags":["Attachments"],"summary":"Upload files","description":"Uploads files to the file manager of the account. Use the returned `link` values in `attachments` of deals, contacts, tasks and comments or in \"Create an attachment\".","requestBody":{"required":true,"content":{"multipart\/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","maxItems":20,"description":"Files to upload.","items":{"type":"string","format":"binary"}}},"required":["files"]}}}},"responses":{"200":{"description":"Uploaded files.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/UploadedFile"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/attachments":{"post":{"operationId":"createAttachment","tags":["Attachments"],"summary":"Create an attachment","description":"Attaches a file uploaded to the file manager to a deal, contact, company, task or comment.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateAttachmentRequest"}}}},"responses":{"201":{"description":"The created attachment.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/Attachment"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/attachments\/batch":{"post":{"operationId":"batchCreateAttachments","tags":["Attachments"],"summary":"Create several attachments","description":"Attaches several files to entities.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"attachments":{"type":"array","items":{"$ref":"#\/components\/schemas\/CreateAttachmentRequest"}}},"required":["attachments"]}}}},"responses":{"201":{"description":"The created attachments (raw records).","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/AttachmentRecord"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/attachments\/{attachmentId}":{"put":{"operationId":"updateAttachment","tags":["Attachments"],"summary":"Update an attachment","description":"Replaces the file link of the attachment.","parameters":[{"$ref":"#\/components\/parameters\/AttachmentId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"link":{"type":"string","maxLength":255,"description":"File path in the file manager.","example":"\/personal\/crm\/attachments\/contract-v2.pdf"}},"required":["link"]}}}},"responses":{"200":{"description":"The updated attachment.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/Attachment"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteAttachment","tags":["Attachments"],"summary":"Delete an attachment","description":"Removes the attachment from the entity.","parameters":[{"$ref":"#\/components\/parameters\/AttachmentId"}],"responses":{"204":{"description":"The attachment is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/companies\/short-data":{"post":{"operationId":"searchCompaniesShort","tags":["Companies"],"summary":"Search companies (short data)","description":"Returns main fields of companies that match the filters.","requestBody":{"required":false,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanySearchRequest"}}}},"responses":{"200":{"description":"Found companies.","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/CompanyShort"}},"metadata":{"$ref":"#\/components\/schemas\/SearchMeta"}},"required":["data","metadata"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/companies\/list":{"post":{"operationId":"searchCompanies","tags":["Companies"],"summary":"Search companies","description":"Returns companies that match the filters, with their emails, phones, messengers, attribute values, contacts and attachments.","requestBody":{"required":false,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanySearchRequest"}}}},"responses":{"200":{"description":"Found companies.","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Company"}},"metadata":{"$ref":"#\/components\/schemas\/SearchMeta"}},"required":["data","metadata"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/companies\/batch-delete":{"delete":{"operationId":"batchDeleteCompanies","tags":["Companies"],"summary":"Delete several companies","description":"Deletes the companies with the specified IDs, or all companies that match a `searchRequest` returned by \"Search companies\".","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","description":"`companyIds` is required if `searchRequest` is not passed; if `searchRequest` is passed, `companyIds` is ignored.","properties":{"companyIds":{"type":["array","null"],"description":"IDs of companies to delete.","items":{"type":"integer","minimum":0},"example":[4401,4402]},"searchRequest":{"type":["string","null"],"description":"`metadata.searchRequest` from \"Search companies\".","example":"eyJuYW1lIjoiQWNtZSJ9"}}}}}},"responses":{"204":{"description":"The companies are deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/companies":{"post":{"operationId":"createCompany","tags":["Companies"],"summary":"Create a company","description":"Creates a company. If `responsibleId` is not passed, the account owner is assigned.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateCompanyRequest"}}}},"responses":{"201":{"description":"The created company.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyShort"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/companies\/{companyId}":{"get":{"operationId":"getCompany","tags":["Companies"],"summary":"Get a company by ID","description":"Returns the company with its emails, phones, messengers, attribute values, contacts and attachments.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"}],"responses":{"200":{"description":"The company.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Company"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"description":"Validation failed or the company is not available to the user.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}},"put":{"operationId":"updateCompany","tags":["Companies"],"summary":"Update a company","description":"Replaces the main fields of the company.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateCompanyRequest"}}}},"responses":{"200":{"description":"The updated company.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyShort"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"description":"Validation failed or the company is not available to the user.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}},"delete":{"operationId":"deleteCompany","tags":["Companies"],"summary":"Delete a company","description":"Deletes the company and unlinks its contacts, deals and tasks.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"}],"responses":{"204":{"description":"The company is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"description":"Validation failed or the company is not available to the user.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}}},"\/companies\/{companyId}\/comments":{"get":{"operationId":"listCompanyComments","tags":["Comments"],"summary":"Get company comments","description":"Returns top-level comments of the company. Pagination is applied only when both `limit` and `offset` are passed; otherwise all comments are returned.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"},{"name":"message","in":"query","required":false,"description":"Part of the comment text.","schema":{"type":"string","maxLength":5000},"example":"invoice"},{"name":"limit","in":"query","required":false,"description":"Number of comments to return. Required together with `offset`.","schema":{"type":"integer"},"example":20},{"name":"offset","in":"query","required":false,"description":"Number of comments to skip. Required together with `limit`.","schema":{"type":"integer"},"example":0}],"responses":{"200":{"description":"List of comments.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CommentList"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"post":{"operationId":"createCompanyComment","tags":["Comments"],"summary":"Create a company comment","description":"Adds a comment to the company. Team members mentioned in the text are notified.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateCommentRequest"}}}},"responses":{"201":{"description":"The created comment.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Comment"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/companies\/{companyId}\/comments\/{commentId}":{"put":{"operationId":"updateCompanyComment","tags":["Comments"],"summary":"Update a company comment","description":"Replaces the text of the comment.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"},{"$ref":"#\/components\/parameters\/CommentId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateCommentRequest"}}}},"responses":{"200":{"description":"The updated comment.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Comment"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteCompanyComment","tags":["Comments"],"summary":"Delete a company comment","description":"Deletes the comment together with its replies.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"},{"$ref":"#\/components\/parameters\/CommentId"}],"responses":{"204":{"description":"The comment is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/companies\/{companyId}\/history":{"get":{"operationId":"getCompanyHistory","tags":["Companies"],"summary":"Get company history","description":"Returns company history events. Without `limit` and `offset` all events are returned.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"},{"name":"dateFrom","in":"query","required":false,"description":"Start of the period (UTC).","schema":{"type":"string"},"example":"2026-01-01"},{"name":"dateTo","in":"query","required":false,"description":"End of the period (UTC).","schema":{"type":"string"},"example":"2026-01-31 23:59:59"},{"name":"limit","in":"query","required":false,"description":"Number of events to return.","schema":{"type":"integer"},"example":50},{"name":"offset","in":"query","required":false,"description":"Number of events to skip.","schema":{"type":"integer"},"example":0}],"responses":{"200":{"description":"History events.","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/CompanyHistoryEvent"}},"meta":{"$ref":"#\/components\/schemas\/ListMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/companies\/attributes":{"get":{"operationId":"listCompanyAttributes","tags":["Company attributes"],"summary":"Get company attributes","description":"Returns active and hidden custom company fields, ordered by `order`.","responses":{"200":{"description":"List of company attributes.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/EntityAttribute"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"}}},"post":{"operationId":"createCompanyAttribute","tags":["Company attributes"],"summary":"Create a company attribute","description":"Creates a custom company field at the end of the field list. The name must be unique among active and hidden company fields.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateEntityAttributeRequest"}}}},"responses":{"201":{"description":"The created company attribute.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/EntityAttribute"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/companies\/attributes\/{attributeId}":{"put":{"operationId":"updateCompanyAttribute","tags":["Company attributes"],"summary":"Update a company attribute","description":"Updates the company field. Changing `order` moves the field and shifts the others.","parameters":[{"$ref":"#\/components\/parameters\/AttributeId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateEntityAttributeRequest"}}}},"responses":{"200":{"description":"The updated company attribute.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/EntityAttribute"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteCompanyAttribute","tags":["Company attributes"],"summary":"Delete a company attribute","description":"Deletes the company field together with all its values.","parameters":[{"$ref":"#\/components\/parameters\/AttributeId"}],"responses":{"204":{"description":"The company attribute is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/companies\/{companyId}\/attributes":{"get":{"operationId":"listCompanyAttributeValues","tags":["Company attributes"],"summary":"Get company attribute values","description":"Returns the attributes that have a value on the company, with their values.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"}],"responses":{"200":{"description":"Attributes with values.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/EntityAttributeWithValue"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"post":{"operationId":"setCompanyAttributeValue","tags":["Company attributes"],"summary":"Set a company attribute value","description":"Sets the value of a company attribute. If the company already has a value of this attribute, it is replaced.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SetAttributeValueRequest"}}}},"responses":{"201":{"description":"The saved value.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/EntityAttributeValue"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/companies\/{companyId}\/attributes\/{attributeId}":{"put":{"operationId":"updateCompanyAttributeValue","tags":["Company attributes"],"summary":"Update a company attribute value","description":"Updates an existing value of the attribute on the company.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"},{"$ref":"#\/components\/parameters\/AttributeId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateAttributeValueRequest"}}}},"responses":{"200":{"description":"The saved value.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/EntityAttributeValue"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteCompanyAttributeValue","tags":["Company attributes"],"summary":"Delete a company attribute value","description":"Deletes the value of the attribute on the company.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"},{"$ref":"#\/components\/parameters\/AttributeId"}],"responses":{"204":{"description":"The value is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/companies\/{companyId}\/attributes\/batch":{"post":{"operationId":"batchSetCompanyAttributeValues","tags":["Company attributes"],"summary":"Set several company attribute values","description":"Sets values of several company attributes; existing values are replaced.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BatchSetAttributeValuesRequest"}}}},"responses":{"201":{"description":"The saved values.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/AttributeValueBatchItem"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/companies\/{companyId}\/emails":{"get":{"operationId":"listCompanyEmails","tags":["Company channels"],"summary":"Get company emails","description":"Returns emails of the company. The main email goes first. Without `limit` and `offset` all emails are returned.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"},{"name":"email","in":"query","required":false,"description":"Part of the email address.","schema":{"type":"string"},"example":"info@"},{"name":"limit","in":"query","required":false,"description":"Number of emails to return. Required together with `offset`.","schema":{"type":"integer"},"example":20},{"name":"offset","in":"query","required":false,"description":"Number of emails to skip. Required together with `limit`.","schema":{"type":"integer"},"example":0}],"responses":{"200":{"description":"List of emails.","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/CompanyEmail"}},"meta":{"$ref":"#\/components\/schemas\/ListMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"description":"Validation failed, or the company or the item is not available to the user.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}},"post":{"operationId":"addCompanyEmail","tags":["Company channels"],"summary":"Add a company email","description":"Adds a email to the company.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","minLength":3,"maxLength":128,"description":"Email address.","example":"info@acme.com"},"isMain":{"type":"boolean","description":"Whether this is the main email.","example":true}},"required":["email","isMain"]}}}},"responses":{"201":{"description":"The added email.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyEmail"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"description":"Validation failed, or the company or the item is not available to the user.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}}},"\/companies\/{companyId}\/emails\/batch":{"post":{"operationId":"batchAddCompanyEmails","tags":["Company channels"],"summary":"Add several company emails","description":"Adds several emails to the company.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"emails":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string","format":"email","minLength":3,"maxLength":128,"description":"Email address.","example":"info@acme.com"},"isMain":{"type":"boolean","description":"Whether this is the main email.","example":true}},"required":["email","isMain"]}}},"required":["emails"]}}}},"responses":{"201":{"description":"The added emails.","content":{"application\/json":{"schema":{"type":"array","items":{"$ref":"#\/components\/schemas\/CompanyEmail"}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"description":"Validation failed, or the company or the item is not available to the user.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}}},"\/companies\/{companyId}\/emails\/{emailId}":{"put":{"operationId":"updateCompanyEmail","tags":["Company channels"],"summary":"Update a company email","description":"Updates the email of the company.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"},{"$ref":"#\/components\/parameters\/EmailId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","minLength":3,"maxLength":128,"description":"Email address.","example":"info@acme.com"},"isMain":{"type":"boolean","description":"Whether this is the main email.","example":true}},"required":["email","isMain"]}}}},"responses":{"200":{"description":"The updated item.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyEmail"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"description":"Validation failed, or the company or the item is not available to the user.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}},"delete":{"operationId":"deleteCompanyEmail","tags":["Company channels"],"summary":"Delete a company email","description":"Deletes the email of the company.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"},{"$ref":"#\/components\/parameters\/EmailId"}],"responses":{"204":{"description":"The email is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"description":"Validation failed, or the company or the item is not available to the user.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}}},"\/companies\/{companyId}\/phones":{"get":{"operationId":"listCompanyPhones","tags":["Company channels"],"summary":"Get company phones","description":"Returns phones of the company.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"}],"responses":{"200":{"description":"List of phones.","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/CompanyPhone"}},"meta":{"$ref":"#\/components\/schemas\/ListMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"description":"Validation failed, or the company or the item is not available to the user.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}},"post":{"operationId":"addCompanyPhone","tags":["Company channels"],"summary":"Add a company phone","description":"Adds a phone to the company.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"phone":{"type":["string","integer"],"description":"Phone number (1\u201350 digits).","example":"+380441234567"},"isMain":{"type":"boolean","description":"Whether this is the main phone.","example":true}},"required":["phone","isMain"]}}}},"responses":{"201":{"description":"The added phone.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyPhone"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"description":"Validation failed, or the company or the item is not available to the user.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}}},"\/companies\/{companyId}\/phones\/batch":{"post":{"operationId":"batchAddCompanyPhones","tags":["Company channels"],"summary":"Add several company phones","description":"Adds several phones to the company.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"phones":{"type":"array","items":{"type":"object","properties":{"phone":{"type":["string","integer"],"description":"Phone number (1\u201350 digits).","example":"+380441234567"},"isMain":{"type":"boolean","description":"Whether this is the main phone.","example":true}},"required":["phone","isMain"]}}},"required":["phones"]}}}},"responses":{"201":{"description":"The added phones.","content":{"application\/json":{"schema":{"type":"array","items":{"$ref":"#\/components\/schemas\/CompanyPhone"}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"description":"Validation failed, or the company or the item is not available to the user.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}}},"\/companies\/{companyId}\/phones\/{phoneId}":{"put":{"operationId":"updateCompanyPhone","tags":["Company channels"],"summary":"Update a company phone","description":"Updates the phone of the company.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"},{"$ref":"#\/components\/parameters\/PhoneId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"phone":{"type":["string","integer"],"description":"Phone number (1\u201350 digits).","example":"+380441234567"},"isMain":{"type":"boolean","description":"Whether this is the main phone.","example":true}},"required":["phone","isMain"]}}}},"responses":{"200":{"description":"The updated item.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyPhone"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"description":"Validation failed, or the company or the item is not available to the user.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}},"delete":{"operationId":"deleteCompanyPhone","tags":["Company channels"],"summary":"Delete a company phone","description":"Deletes the phone of the company.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"},{"$ref":"#\/components\/parameters\/PhoneId"}],"responses":{"200":{"description":"Done. The body is an empty JSON string.","content":{"application\/json":{"schema":{"type":"string","example":""}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"description":"Validation failed, or the company or the item is not available to the user.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}}},"\/companies\/{companyId}\/messengers":{"get":{"operationId":"listCompanyMessengers","tags":["Company channels"],"summary":"Get company messengers","description":"Returns messengers of the company.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"}],"responses":{"200":{"description":"List of messengers.","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/CompanyMessenger"}},"meta":{"$ref":"#\/components\/schemas\/ListMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"description":"Validation failed, or the company or the item is not available to the user.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}},"post":{"operationId":"addCompanyMessenger","tags":["Company channels"],"summary":"Add a company messenger","description":"Adds a messenger to the company.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"typeId":{"$ref":"#\/components\/schemas\/MessengerTypeProperty"},"login":{"type":"string","maxLength":255,"description":"Messenger login.","example":"acme_support"},"botId":{"type":["string","null"],"maxLength":255,"description":"Chatbot ID in SendPulse.","example":"6123abc"}},"required":["typeId","login"]}}}},"responses":{"201":{"description":"The added messenger.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CompanyMessenger"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"description":"Validation failed, or the company or the item is not available to the user.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}}},"\/companies\/{companyId}\/messengers\/batch":{"post":{"operationId":"batchAddCompanyMessengers","tags":["Company channels"],"summary":"Add several company messengers","description":"Adds several messengers to the company.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"messengers":{"type":"array","items":{"type":"object","properties":{"typeId":{"$ref":"#\/components\/schemas\/MessengerTypeProperty"},"login":{"type":"string","maxLength":255,"description":"Messenger login.","example":"acme_support"},"botId":{"type":["string","null"],"maxLength":255,"description":"Chatbot ID in SendPulse.","example":"6123abc"}},"required":["typeId","login"]}}},"required":["messengers"]}}}},"responses":{"201":{"description":"The added messengers.","content":{"application\/json":{"schema":{"type":"array","items":{"$ref":"#\/components\/schemas\/CompanyMessenger"}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"description":"Validation failed, or the company or the item is not available to the user.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}}},"\/companies\/{companyId}\/messengers\/{messengerId}":{"put":{"operationId":"updateCompanyMessenger","tags":["Company channels"],"summary":"Update a company messenger","description":"Updates the messenger of the company.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"},{"$ref":"#\/components\/parameters\/MessengerId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"login":{"type":"string","maxLength":255,"description":"Messenger login.","example":"acme_support"}},"required":["login"]}}}},"responses":{"204":{"description":"The messenger is updated."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"description":"Validation failed, or the company or the item is not available to the user.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}},"delete":{"operationId":"deleteCompanyMessenger","tags":["Company channels"],"summary":"Delete a company messenger","description":"Deletes the messenger of the company.","parameters":[{"$ref":"#\/components\/parameters\/CompanyId"},{"$ref":"#\/components\/parameters\/MessengerId"}],"responses":{"200":{"description":"Done. The body is an empty JSON string.","content":{"application\/json":{"schema":{"type":"string","example":""}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"description":"Validation failed, or the company or the item is not available to the user.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}}},"\/deals\/{dealId}\/history":{"get":{"operationId":"getDealHistory","tags":["Deals"],"summary":"Get deal history","description":"Returns deal history events in the specified period, newest first.","parameters":[{"$ref":"#\/components\/parameters\/DealId"},{"name":"fromDate","in":"query","required":true,"description":"Start of the period (UTC): a date (`2026-01-01`, means 00:00:00) or a date and time (`2026-01-01 10:00:00`).","schema":{"type":"string"},"example":"2026-01-01"},{"name":"toDate","in":"query","required":true,"description":"End of the period (UTC), not earlier than `fromDate`, in the same formats.","schema":{"type":"string"},"example":"2026-01-31 23:59:59"}],"responses":{"200":{"description":"History events.","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/DealHistoryEvent"}}},"required":["data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/contacts\/{contactId}\/history":{"get":{"operationId":"getContactHistory","tags":["Contacts"],"summary":"Get contact history","description":"Returns contact history events in the specified period, newest first. Sensitive data is masked if contact data is hidden for the user.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"},{"name":"fromDate","in":"query","required":true,"description":"Start of the period (UTC): a date (`2026-01-01`, means 00:00:00) or a date and time (`2026-01-01 10:00:00`).","schema":{"type":"string"},"example":"2026-01-01"},{"name":"toDate","in":"query","required":true,"description":"End of the period (UTC), not earlier than `fromDate`, in the same formats.","schema":{"type":"string"},"example":"2026-01-31 23:59:59"}],"responses":{"200":{"description":"History events.","content":{"application\/json":{"schema":{"type":"array","items":{"$ref":"#\/components\/schemas\/ContactHistoryEvent"}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/tasks\/{taskId}\/history":{"get":{"operationId":"getTaskHistory","tags":["Tasks"],"summary":"Get task history","description":"Returns task history events in the specified period, newest first.","parameters":[{"$ref":"#\/components\/parameters\/TaskId"},{"name":"fromDate","in":"query","required":true,"description":"Start of the period (UTC): a date (`2026-01-01`, means 00:00:00) or a date and time.","schema":{"type":"string"},"example":"2026-01-01"},{"name":"toDate","in":"query","required":true,"description":"End of the period (UTC), not earlier than `fromDate`.","schema":{"type":"string"},"example":"2026-01-31 23:59:59"}],"responses":{"200":{"description":"History events.","content":{"application\/json":{"schema":{"type":"array","items":{"$ref":"#\/components\/schemas\/TaskHistoryEvent"}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/products\/all":{"post":{"operationId":"searchProducts","tags":["Products"],"summary":"Search products","description":"Returns active products of the catalog that match the filters. Numeric filter operators other than `between` require a tariff with advanced filter operators, otherwise 403.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProductSearchRequest"}}}},"responses":{"200":{"description":"Found products.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/ProductListItem"}},"total":{"type":"integer","description":"Number of matching products of the kind `product` (1).","example":42},"totalSubscription":{"type":"integer","description":"Number of matching subscription products.","example":3}},"required":["success","data","total","totalSubscription"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/products\/categories":{"get":{"operationId":"listProductCategories","tags":["Product categories"],"summary":"Get product categories","description":"Returns the tree of active product categories of the account.","responses":{"200":{"description":"Category tree.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/ProductCategoryTree"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"}}},"post":{"operationId":"createProductCategory","tags":["Product categories"],"summary":"Create a product category","description":"Creates a product category, optionally nested and with sections (characteristics). The number of categories is limited by the tariff plan.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateProductCategoryRequest"}}}},"responses":{"201":{"description":"The created category.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/ProductCategory"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/products\/categories\/{categoryId}":{"put":{"operationId":"updateProductCategory","tags":["Product categories"],"summary":"Update a product category","description":"Changes the category name and parent.","parameters":[{"$ref":"#\/components\/parameters\/CategoryId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateProductCategoryRequest"}}}},"responses":{"200":{"description":"The updated category.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/ProductCategory"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteProductCategory","tags":["Product categories"],"summary":"Delete a product category","description":"Deletes the category; its products are moved to another category of the account.","parameters":[{"$ref":"#\/components\/parameters\/CategoryId"}],"responses":{"204":{"description":"The category is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/products\/categories\/{categoryId}\/{productId}":{"get":{"operationId":"getCategoryProduct","deprecated":true,"tags":["Products"],"summary":"Get a product by ID (deprecated)","description":"Deprecated: use \"Get a product by ID\" (`GET \/products\/{productId}`). Returns the product.","parameters":[{"$ref":"#\/components\/parameters\/CategoryId"},{"$ref":"#\/components\/parameters\/ProductId"}],"responses":{"200":{"description":"The product.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["success"],"example":"success"},"data":{"$ref":"#\/components\/schemas\/Product"}},"required":["status","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/products\/deals":{"post":{"operationId":"addProductToDeal","tags":["Deal products"],"summary":"Add a product to a deal","description":"Adds the product to an active deal (or updates it if the product is already in the deal). For physical products the stock balance is decreased.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/AddProductToDealRequest"}}}},"responses":{"200":{"description":"The product is added.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["success"],"example":"success"},"data":{"type":"null"}},"required":["status","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/products\/deals\/{id}":{"get":{"operationId":"listDealProducts","tags":["Deal products"],"summary":"Get deal products","description":"Returns products of the deal with amounts and discounts.","parameters":[{"name":"id","in":"path","required":true,"description":"Deal ID.","schema":{"type":"integer"},"example":950001}],"responses":{"200":{"description":"Deal products.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["success"],"example":"success"},"data":{"$ref":"#\/components\/schemas\/DealProducts"}},"required":["status","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"put":{"operationId":"updateDealProduct","tags":["Deal products"],"summary":"Update a product in a deal","description":"Updates quantity, price, tax and discount of the product in the deal.","parameters":[{"name":"id","in":"path","required":true,"description":"ID of the product in the deal (`items[].headId` from \"Get deal products\").","schema":{"type":"integer"},"example":4501}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateDealProductRequest"}}}},"responses":{"200":{"description":"The product is updated.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/EmptySuccessResponse"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/products\/contacts\/{contactId}\/deals":{"get":{"operationId":"listContactDealProducts","tags":["Deal products"],"summary":"Get products of contact deals","description":"Returns products of the deals of the contact, grouped by deal.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"}],"responses":{"200":{"description":"Products grouped by deal ID.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["success"],"example":"success"},"data":{"type":"object","description":"Map of deal ID to the deal products. Note: an empty map is serialized as an empty array `[]`.","additionalProperties":{"$ref":"#\/components\/schemas\/ContactDealProducts"}}},"required":["status","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/products\/categories\/{categoryId}\/{productId}\/deals\/{headId}":{"delete":{"operationId":"removeProductFromDeal","tags":["Deal products"],"summary":"Remove a product from a deal","description":"Removes the product from the deal. For physical products the stock balance is restored.","parameters":[{"$ref":"#\/components\/parameters\/CategoryId"},{"$ref":"#\/components\/parameters\/ProductId"},{"name":"headId","in":"path","required":true,"description":"ID of the product in the deal (`items[].headId` from \"Get deal products\").","schema":{"type":"integer"},"example":4501}],"responses":{"204":{"description":"The product is removed."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/products\/{productId}":{"get":{"operationId":"getProduct","tags":["Products"],"summary":"Get a product by ID","description":"Returns the product with prices, sections, attributes and digital\/physical details.","parameters":[{"$ref":"#\/components\/parameters\/ProductId"}],"responses":{"200":{"description":"The product.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["success"],"example":"success"},"data":{"$ref":"#\/components\/schemas\/Product"}},"required":["status","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"put":{"operationId":"updateProduct","tags":["Products"],"summary":"Update a product","description":"Updates the passed product fields. Prices and sections are changed with the dedicated methods.","parameters":[{"$ref":"#\/components\/parameters\/ProductId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateProductRequest"}}}},"responses":{"200":{"description":"The updated product.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["success"],"example":"success"},"data":{"$ref":"#\/components\/schemas\/Product"}},"required":["status","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteProduct","tags":["Products"],"summary":"Delete a product","description":"Deletes the product. A subscription product with active subscriptions cannot be deleted.","parameters":[{"$ref":"#\/components\/parameters\/ProductId"}],"responses":{"204":{"description":"The product is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/contacts\/external\/{externalContactId}":{"get":{"operationId":"getContactByExternalId","tags":["Contacts"],"summary":"Get a contact by external ID","description":"Returns the contact whose source has the specified external contact ID (`contactSource[].externalContactId`).","parameters":[{"name":"externalContactId","in":"path","required":true,"description":"External contact ID. Must not contain `\/`.","schema":{"type":"string"},"example":"ext-1001"}],"responses":{"200":{"description":"The contact.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/Contact"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/products\/{productId}\/prices":{"put":{"operationId":"updateProductPrices","tags":["Products"],"summary":"Update product prices","description":"Updates existing prices of the product.","parameters":[{"$ref":"#\/components\/parameters\/ProductId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"prices":{"type":"array","items":{"$ref":"#\/components\/schemas\/UpdateProductPriceInput"}}},"required":["prices"]}}}},"responses":{"200":{"description":"The prices are updated.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/EmptySuccessResponse"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/products\/{productId}\/sections":{"post":{"operationId":"addProductSections","tags":["Products"],"summary":"Add product sections","description":"Adds sections (characteristics) with key-value pairs to the product.","parameters":[{"$ref":"#\/components\/parameters\/ProductId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"sections":{"type":"array","items":{"$ref":"#\/components\/schemas\/ProductSectionInput"}}},"required":["sections"]}}}},"responses":{"201":{"description":"The sections are added.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/EmptySuccessResponse"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"put":{"operationId":"updateProductSections","tags":["Products"],"summary":"Update product sections","description":"Updates existing sections of the product and their values.","parameters":[{"$ref":"#\/components\/parameters\/ProductId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"sections":{"type":"array","items":{"$ref":"#\/components\/schemas\/UpdateProductSectionInput"}}},"required":["sections"]}}}},"responses":{"200":{"description":"The sections are updated.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/EmptySuccessResponse"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/products\/{productId}\/sections\/{sectionId}":{"delete":{"operationId":"deleteProductSection","tags":["Products"],"summary":"Delete a product section","description":"Deletes the section of the product.","parameters":[{"$ref":"#\/components\/parameters\/ProductId"},{"name":"sectionId","in":"path","required":true,"description":"Product section ID.","schema":{"type":"integer"},"example":3501}],"responses":{"204":{"description":"The section is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/contacts\/messenger-external\/{messengerContactId}":{"get":{"operationId":"getContactByMessengerContactId","tags":["Contacts"],"summary":"Get a contact by messenger contact ID","description":"Returns the first contact that has an active messenger with the specified chatbot contact ID (`messengers[].contactId`).","parameters":[{"name":"messengerContactId","in":"path","required":true,"description":"Contact ID in the SendPulse chatbot. Must not contain `\/`.","schema":{"type":"string"},"example":"6456def"}],"responses":{"200":{"description":"The contact.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/Contact"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/contacts\/{contactId}\/relation\/{companyId}":{"post":{"operationId":"attachContactToCompany","tags":["Contacts"],"summary":"Link a contact to a company","description":"Links the contact to the company.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"},{"$ref":"#\/components\/parameters\/CompanyId"}],"responses":{"200":{"description":"Done. The body is an empty JSON string.","content":{"application\/json":{"schema":{"type":"string","example":""}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"description":"The contact or the company is not available to the user.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}},"delete":{"operationId":"detachContactFromCompany","tags":["Contacts"],"summary":"Unlink a contact from a company","description":"Removes the link between the contact and the company.","parameters":[{"$ref":"#\/components\/parameters\/ContactId"},{"$ref":"#\/components\/parameters\/CompanyId"}],"responses":{"200":{"description":"Done. The body is an empty JSON string.","content":{"application\/json":{"schema":{"type":"string","example":""}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"description":"The contact or the company is not available to the user.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}}},"\/manager-settings\/sections":{"get":{"operationId":"listManagerSettingSections","tags":["Manager settings"],"summary":"Get manager setting sections","description":"Returns the map of CRM section names to section IDs used in manager settings.","responses":{"200":{"description":"Section name to ID map.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ManagerSettingSections"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"}}}},"\/manager-settings\/managers":{"get":{"operationId":"listManagerSettings","tags":["Manager settings"],"summary":"Get all manager settings","description":"Returns manager settings of all sections.","responses":{"200":{"description":"List of manager settings.","content":{"application\/json":{"schema":{"type":"array","items":{"$ref":"#\/components\/schemas\/ManagerSetting"}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"}}}},"\/manager-settings":{"post":{"operationId":"createManagerSettings","tags":["Manager settings"],"summary":"Create manager settings for a section","description":"Defines which team members manage the section. A section can have only one setting.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"sectionId":{"$ref":"#\/components\/schemas\/ManagerSectionId"},"responsibleIds":{"type":["array","null"],"description":"IDs of team members.","items":{"type":"integer"},"example":[8001234]}},"required":["sectionId"]}}}},"responses":{"201":{"description":"The created setting.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ManagerSetting"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/manager-settings\/{id}":{"get":{"operationId":"getManagerSettingsBySection","tags":["Manager settings"],"summary":"Get manager settings of a section","description":"Returns manager settings of the section.","parameters":[{"name":"id","in":"path","required":true,"description":"Section ID (see \"Get manager setting sections\").","schema":{"type":"integer"},"example":3}],"responses":{"200":{"description":"List of manager settings.","content":{"application\/json":{"schema":{"type":"array","items":{"$ref":"#\/components\/schemas\/ManagerSetting"}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"put":{"operationId":"updateManagerSettings","tags":["Manager settings"],"summary":"Update manager settings","description":"Replaces the list of team members of the setting.","parameters":[{"name":"id","in":"path","required":true,"description":"Manager setting ID.","schema":{"type":"integer"},"example":71}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"responsibleIds":{"type":["array","null"],"description":"IDs of team members; not passed \u2014 the list is cleared.","items":{"type":"integer"},"example":[8001234,8001235]}}}}}},"responses":{"200":{"description":"The updated setting.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ManagerSetting"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteManagerSettings","tags":["Manager settings"],"summary":"Delete manager settings","description":"Deletes the manager setting.","parameters":[{"name":"id","in":"path","required":true,"description":"Manager setting ID.","schema":{"type":"integer"},"example":71}],"responses":{"204":{"description":"The setting is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/custom-tab":{"get":{"operationId":"listCustomTabs","tags":["Custom tabs"],"summary":"Get custom tabs","description":"Returns custom tabs grouped by entity type.","responses":{"200":{"description":"Custom tabs by entity type.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CustomTabsByEntity"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"}}},"post":{"operationId":"createCustomTab","tags":["Custom tabs"],"summary":"Create a custom tab","description":"Creates a custom tab for contact, deal (pipeline), task (board) or company cards. Available on paid tariff plans.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"entityType":{"$ref":"#\/components\/schemas\/CustomTabEntityType"},"entityId":{"type":["integer","null"],"description":"Pipeline ID (`entityType: 1`) or board ID (`entityType: 2`); required for them.","example":1201},"name":{"type":"string","maxLength":128,"description":"Tab name, unique for the entity.","example":"Delivery"}},"required":["entityType","name"]}}}},"responses":{"201":{"description":"The created tab.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CustomTabShort"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/custom-tab\/{customTabId}":{"put":{"operationId":"updateCustomTab","tags":["Custom tabs"],"summary":"Update a custom tab","description":"Renames, moves or hides the tab. System tabs cannot be renamed.","parameters":[{"$ref":"#\/components\/parameters\/CustomTabId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"entityType":{"$ref":"#\/components\/schemas\/CustomTabEntityType"},"entityId":{"type":["integer","null"],"description":"Pipeline ID (`entityType: 1`) or board ID (`entityType: 2`); required for them.","example":1201},"name":{"type":"string","maxLength":128,"description":"Tab name.","example":"Delivery"},"order":{"type":"integer","minimum":1,"description":"Position of the tab.","example":2},"isVisible":{"type":"boolean","description":"Whether the tab is visible.","example":true}},"required":["entityType"]}}}},"responses":{"200":{"description":"The updated tab.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CustomTabShort"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"deleteCustomTab","tags":["Custom tabs"],"summary":"Delete a custom tab","description":"Deletes the custom tab. System tabs cannot be deleted.","parameters":[{"$ref":"#\/components\/parameters\/CustomTabId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"entityType":{"$ref":"#\/components\/schemas\/CustomTabEntityType"},"entityId":{"type":["integer","null"],"description":"Pipeline ID (`entityType: 1`) or board ID (`entityType: 2`); required for them.","example":1201}},"required":["entityType"]}}}},"responses":{"204":{"description":"The tab is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/custom-tab\/{customTabId}\/relation":{"post":{"operationId":"addCustomTabAttributes","tags":["Custom tabs"],"summary":"Add attributes to a custom tab","description":"Places custom fields of the entity on the tab.","parameters":[{"$ref":"#\/components\/parameters\/CustomTabId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CustomTabRelationRequest"}}}},"responses":{"200":{"description":"The attributes are added. The body is an empty array.","content":{"application\/json":{"schema":{"type":"array","maxItems":0,"items":{"type":"integer"},"example":[]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}},"delete":{"operationId":"removeCustomTabAttributes","tags":["Custom tabs"],"summary":"Remove attributes from a custom tab","description":"Removes custom fields from the tab.","parameters":[{"$ref":"#\/components\/parameters\/CustomTabId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CustomTabRelationRequest"}}}},"responses":{"200":{"description":"The attributes are removed. The body is an empty array.","content":{"application\/json":{"schema":{"type":"array","maxItems":0,"items":{"type":"integer"},"example":[]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/products":{"post":{"operationId":"createProduct","tags":["Products"],"summary":"Create a product","description":"Creates a product, service or subscription in the catalog. The number of products and subscriptions is limited by the tariff plan.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateProductRequest"}}}},"responses":{"201":{"description":"The created product.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["success"],"example":"success"},"data":{"$ref":"#\/components\/schemas\/Product"}},"required":["status","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/payments":{"post":{"operationId":"createPayment","tags":["Payments"],"summary":"Create a manual payment","description":"Records a manually created payment (status 610) for the contact and, optionally, the deal; the deal must be linked to the contact.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateManualPaymentRequest"}}}},"responses":{"200":{"description":"The created payment.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/Payment"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/payments\/{paymentId}\/approve":{"post":{"operationId":"approvePayment","tags":["Payments"],"summary":"Approve a payment","description":"Sets the payment status to manually approved (600). A successful payment cannot be changed.","parameters":[{"$ref":"#\/components\/parameters\/PaymentId"}],"responses":{"200":{"description":"The status is changed.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/EmptySuccessResponse"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/payments\/{paymentId}\/cancel":{"post":{"operationId":"cancelPayment","tags":["Payments"],"summary":"Cancel a payment","description":"Sets the payment status to manually canceled (620). A successful payment cannot be changed.","parameters":[{"$ref":"#\/components\/parameters\/PaymentId"}],"responses":{"200":{"description":"The status is changed.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/EmptySuccessResponse"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/ValidationFailed"}}}},"\/payments\/user-payment-methods":{"get":{"operationId":"listPaymentMethods","tags":["Payments"],"summary":"Get payment methods","description":"Returns payment methods connected in the account that have a currency set. Use `paymentId` and `paymentType` to generate payment links.","responses":{"200":{"description":"List of payment methods.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/UserPaymentMethod"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"}}}},"\/payments\/contact-generate-payment-link":{"post":{"operationId":"generateContactPaymentLink","tags":["Payments"],"summary":"Generate a payment link for a contact","description":"Generates a payment link for the contact using a connected payment method. When the link is paid, a deal is created or updated in the specified pipeline step.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/GeneratePaymentLinkRequest"}}}},"responses":{"200":{"description":"The payment link.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/PaymentLink"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/payments\/deal-generate-payment-link":{"post":{"operationId":"generateDealPaymentLink","tags":["Payments"],"summary":"Generate a payment link for a deal","description":"Generates a payment link for the contact using a connected payment method. When the link is paid, a deal is created or updated in the specified pipeline step.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/GeneratePaymentLinkRequest"}}}},"responses":{"200":{"description":"The payment link.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/PaymentLink"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/deal-expenses":{"post":{"operationId":"createDealExpense","tags":["Deal expenses"],"summary":"Create a deal expense","description":"Adds an expense to an active deal. The amount is in the deal currency; the deal profit is recalculated.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateDealExpenseRequest"}}}},"responses":{"201":{"description":"The created expense.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/DealExpense"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/deal-expenses\/{id}":{"get":{"operationId":"getDealExpense","tags":["Deal expenses"],"summary":"Get a deal expense","description":"Returns the expense.","parameters":[{"$ref":"#\/components\/parameters\/ExpenseId"}],"responses":{"200":{"description":"The expense.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/DealExpense"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}},"put":{"operationId":"updateDealExpense","tags":["Deal expenses"],"summary":"Update a deal expense","description":"Updates the passed fields of the expense of an active deal; the deal profit is recalculated.","parameters":[{"$ref":"#\/components\/parameters\/ExpenseId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateDealExpenseRequest"}}}},"responses":{"200":{"description":"The updated expense.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#\/components\/schemas\/DealExpense"}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}},"delete":{"operationId":"deleteDealExpense","tags":["Deal expenses"],"summary":"Delete a deal expense","description":"Deletes the expense of an active deal; the deal profit is recalculated.","parameters":[{"$ref":"#\/components\/parameters\/ExpenseId"}],"responses":{"204":{"description":"The expense is deleted."},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"description":"The deal is closed (won or lost); its expenses cannot be changed.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"success":false,"error":{"code":422,"message":"Cannot modify expenses for closed deal"}}}}}}}},"\/deal-expenses\/deal\/{dealId}":{"get":{"operationId":"listDealExpenses","tags":["Deal expenses"],"summary":"Get deal expenses","description":"Returns all expenses of the deal.","parameters":[{"$ref":"#\/components\/parameters\/DealId"}],"responses":{"200":{"description":"List of expenses.","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/DealExpense"}}},"required":["success","data"]}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}}},"components":{"schemas":{"ErrorItem":{"type":"object","properties":{"code":{"type":"integer","description":"HTTP status code.","example":404},"message":{"type":"string","description":"Error message.","example":"Not found"}},"required":["code","message"]},"ErrorResponse":{"type":"object","description":"Error with a single error object.","properties":{"success":{"type":"boolean","example":false},"error":{"$ref":"#\/components\/schemas\/ErrorItem"}},"required":["success","error"]},"ErrorList":{"type":"object","description":"Error with a list of error objects.","properties":{"errors":{"type":"array","items":{"$ref":"#\/components\/schemas\/ErrorItem"}}},"required":["errors"]},"ValidationError":{"type":"object","description":"Validation error. `errors` maps a request field to its validation messages.","properties":{"message":{"type":"string","description":"Summary message.","example":"The name field is required."},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"example":{"name":["The name field is required."]}}},"required":["message","errors"]},"EmptySuccessResponse":{"type":"object","description":"Successful response without data.","properties":{"success":{"type":"boolean","example":true},"data":{"type":"null"}},"required":["success","data"]},"ListMeta":{"type":"object","properties":{"total":{"type":"integer","description":"Total number of records that match the request.","example":25}},"required":["total"]},"SearchMeta":{"type":"object","properties":{"total":{"type":"integer","description":"Total number of records that match the request.","example":25},"searchRequest":{"type":"string","description":"Base64-encoded JSON of the applied search parameters.","example":"eyJsaW1pdCI6MTB9"}},"required":["total","searchRequest"]},"CompanyShort":{"type":"object","properties":{"id":{"type":"integer","description":"Company ID.","example":4401},"companyName":{"type":"string","description":"Company name.","example":"Acme Inc."},"responsibleId":{"type":"integer","description":"ID of the responsible team member.","example":8001234},"address":{"type":["string","null"],"description":"Address.","example":"Kyiv, Khreshchatyk 1"},"annualBusinessVolume":{"type":["integer","null"],"description":"Annual business volume.","example":1000000},"currency":{"type":["string","null"],"description":"Currency code of the annual business volume.","example":"USD"}},"required":["id","companyName","responsibleId","address","annualBusinessVolume","currency"]},"Company":{"type":"object","properties":{"id":{"type":"integer","description":"Company ID.","example":4401},"companyName":{"type":"string","description":"Company name.","example":"Acme Inc."},"responsibleId":{"type":"integer","description":"ID of the responsible team member.","example":8001234},"address":{"type":["string","null"],"description":"Address.","example":"Kyiv, Khreshchatyk 1"},"annualBusinessVolume":{"type":["integer","null"],"description":"Annual business volume.","example":1000000},"currency":{"type":["string","null"],"description":"Currency code of the annual business volume.","example":"USD"},"messengers":{"type":"array","items":{"$ref":"#\/components\/schemas\/CompanyMessenger"}},"phones":{"type":"array","items":{"$ref":"#\/components\/schemas\/CompanyPhone"}},"emails":{"type":"array","items":{"$ref":"#\/components\/schemas\/CompanyEmail"}},"attributes":{"type":"array","description":"Attribute values of the company.","items":{"$ref":"#\/components\/schemas\/EntityAttributeItem"}},"contacts":{"type":"array","description":"IDs of linked contacts.","items":{"type":"integer"},"example":[700101]},"attachments":{"type":"array","items":{"$ref":"#\/components\/schemas\/Attachment"}},"createdAt":{"type":"string","format":"date-time","description":"Creation date and time (UTC).","example":"2026-01-15T10:00:00.000000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Last update date and time (UTC).","example":"2026-01-16T08:30:00.000000Z"}},"required":["id","companyName","responsibleId","address","annualBusinessVolume","currency","messengers","phones","emails","attributes","contacts","attachments","createdAt","updatedAt"]},"CompanyEmail":{"type":"object","properties":{"id":{"type":"integer","description":"Email ID.","example":91001},"email":{"type":"string","description":"Email address.","example":"info@acme.com"},"isMain":{"type":"boolean","description":"Whether this is the main email.","example":true}},"required":["id","email","isMain"]},"CompanyPhone":{"type":"object","properties":{"id":{"type":"integer","description":"Phone ID.","example":92001},"phone":{"type":"integer","description":"Phone number (digits as a number).","example":380441234567},"isMain":{"type":"boolean","description":"Whether this is the main phone.","example":true}},"required":["id","phone","isMain"]},"CompanyMessenger":{"type":"object","properties":{"id":{"type":"integer","description":"Messenger ID.","example":93001},"typeId":{"$ref":"#\/components\/schemas\/MessengerTypeProperty"},"login":{"type":"string","description":"Messenger login.","example":"acme_support"},"botId":{"type":["string","null"],"description":"Chatbot ID in SendPulse.","example":"6123abc"}},"required":["id","typeId","login","botId"]},"CompanyHistoryEvent":{"type":"object","properties":{"id":{"type":"integer","description":"Event ID.","example":77001},"userId":{"type":["integer","null"],"description":"ID of the team member who made the change.","example":8001234},"eventType":{"type":"string","enum":["company_create","company_update","company_attach_contact","company_detach_contact","company_attach_deal","company_detach_deal","company_attach_task","company_detach_task","company_attribute_field_added","company_attribute_field_updated","company_attribute_field_deleted","company_email_added","company_email_updated","company_email_deleted","company_phone_added","company_phone_updated","company_phone_deleted","company_messenger_added","company_messenger_updated","company_messenger_deleted"],"description":"Event type.","example":"company_update"},"eventData":{"description":"Event details; the shape depends on `eventType`: `company_create` \u2014 empty array `[]`; `company_attach_*` \/ `company_detach_*` \u2014 array of `CompanyHistorySubject`; `company_update` \u2014 array of single-item arrays of `CompanyHistoryFieldChange`, one per changed field; email, phone, messenger and attribute events \u2014 object with the changed fields (e.g. `{\"email\": \"info@acme.com\", \"isMain\": true}` or `{\"emailId\": 5}`), an empty set is serialized as an empty array `[]`.","oneOf":[{"type":"array","items":{"anyOf":[{"$ref":"#\/components\/schemas\/CompanyHistorySubject"},{"type":"array","items":{"$ref":"#\/components\/schemas\/CompanyHistoryFieldChange"}}]}},{"type":"object","additionalProperties":true}],"example":[[{"fieldName":"name","modifiedFrom":"Acme","modifiedTo":"Acme Inc."}]]},"eventTime":{"type":"string","format":"date-time","description":"Event date and time (UTC).","example":"2026-01-15T10:00:00.000000Z"},"currentData":{"type":"null","description":"Always `null`; kept for backward compatibility.","example":null}},"required":["id","userId","eventType","eventData","eventTime","currentData"]},"CompanyHistorySubject":{"type":"object","properties":{"subjectsName":{"type":"string","description":"Name of the attached or detached contact, deal or task.","example":"John Smith"},"subjectsId":{"type":"integer","description":"ID of the attached or detached contact, deal or task.","example":700101}},"required":["subjectsName","subjectsId"]},"CompanyHistoryFieldChange":{"type":"object","properties":{"fieldName":{"type":"string","enum":["name","responsibleId","address","annualBusinessVolume","currency"],"description":"Name of the changed company field.","example":"name"},"modifiedFrom":{"type":["string","integer","null"],"description":"Previous value.","example":"Acme"},"modifiedTo":{"type":["string","integer","null"],"description":"New value.","example":"Acme Inc."}},"required":["fieldName","modifiedFrom","modifiedTo"]},"CreateCompanyRequest":{"type":"object","properties":{"companyName":{"type":"string","minLength":1,"maxLength":100,"description":"Company name.","example":"Acme Inc."},"responsibleId":{"type":["integer","null"],"minimum":1,"description":"ID of the responsible team member.","example":8001234},"address":{"type":["string","null"],"maxLength":255,"description":"Address.","example":"Kyiv, Khreshchatyk 1"},"annualBusinessVolume":{"type":["integer","null"],"minimum":0,"maximum":99999999999999,"description":"Annual business volume.","example":1000000},"currency":{"type":["string","null"],"description":"Currency code.","example":"USD"}},"required":["companyName"]},"UpdateCompanyRequest":{"type":"object","properties":{"companyName":{"type":"string","minLength":1,"maxLength":255,"description":"Company name.","example":"Acme Inc."},"responsibleId":{"type":"integer","minimum":1,"description":"ID of the responsible team member.","example":8001234},"address":{"type":["string","null"],"maxLength":255,"description":"Address.","example":"Kyiv, Khreshchatyk 1"},"annualBusinessVolume":{"type":["integer","null"],"minimum":0,"maximum":99999999999999,"description":"Annual business volume.","example":1000000},"currency":{"type":["string","null"],"description":"Currency code.","example":"USD"}},"required":["companyName","responsibleId"]},"CompanySearchRequest":{"type":"object","properties":{"companyName":{"type":["string","null"],"minLength":1,"maxLength":100,"description":"Part of the company name.","example":"Acme"},"companyIds":{"type":["array","null"],"description":"Company IDs.","items":{"type":"integer"},"example":[4401]},"dateFrom":{"type":["string","null"],"format":"date","description":"Companies created on or after this date; required with `dateTo`.","example":"2026-01-01"},"dateTo":{"type":["string","null"],"format":"date","description":"Companies created on or before this date; required with `dateFrom`.","example":"2026-01-31"},"email":{"type":["string","null"],"description":"Part of a company email.","example":"info@"},"phone":{"type":["string","null"],"description":"Part of a company phone.","example":"38044"},"messengerLogin":{"type":["string","null"],"description":"Messenger login.","example":"acme_support"},"messengerTypeIds":{"type":["array","null"],"description":"Companies with a messenger of these types.","items":{"$ref":"#\/components\/schemas\/MessengerTypeProperty"}},"responsibleIds":{"type":["array","null"],"description":"IDs of responsible team members.","items":{"type":"integer"},"example":[8001234]},"withoutContacts":{"type":["boolean","null"],"description":"`true` \u2014 only companies without contacts.","example":false},"attributes":{"type":"array","maxItems":50,"description":"Conditions on company attribute values; all conditions must match.","items":{"$ref":"#\/components\/schemas\/AttributeFilter"}},"sortBy":{"type":"object","description":"Sorting. Default \u2014 by `createdAt` ascending.","properties":{"fieldName":{"type":["string","null"],"enum":["companyName","address","annualBusinessVolume","createdAt",null],"default":"createdAt","description":"Company field to sort by.","example":"companyName"},"attributeId":{"type":["integer","null"],"description":"ID of a sortable company attribute to sort by.","example":3101},"direction":{"type":["string","null"],"enum":["asc","desc",null],"default":"asc","description":"Sort direction.","example":"asc"}}}}},"Pipeline":{"type":"object","properties":{"id":{"type":"integer","description":"Pipeline ID.","example":1201},"userId":{"type":"integer","description":"Account owner ID.","example":8001234},"name":{"type":"string","description":"Pipeline name.","example":"Sales"},"order":{"type":"integer","description":"Position of the pipeline in the pipeline list.","example":0},"steps":{"type":"array","description":"Active steps of the pipeline.","items":{"$ref":"#\/components\/schemas\/PipelineStep"}},"settings":{"type":"array","description":"Pipeline settings.","items":{"$ref":"#\/components\/schemas\/PipelineSetting"}}},"required":["id","userId","name","order","steps","settings"]},"PipelineStep":{"type":"object","properties":{"id":{"type":"integer","description":"Step ID.","example":5301},"pipelineId":{"type":"integer","description":"Pipeline ID.","example":1201},"name":{"type":"string","description":"Step name.","example":"Negotiation"},"order":{"type":"integer","description":"Position of the step in the pipeline.","example":2},"color":{"type":"string","description":"Step color.","example":"#4C9AFF"},"addEndHours":{"type":["integer","null"],"description":"Time limit for a deal in this step, in hours. `null` if not set.","example":24},"notifyIn":{"type":["string","null"],"description":"When to notify the responsible user before the step time limit ends. `null` if not set.","enum":["15min","30min","1h","2h","3h","6h","12h","24h","2d","3d","4d","5d","6d","7d",null],"example":"1h"},"description":{"type":["string","null"],"description":"Step description. Always `null` on the free tariff plan.","example":"Agree on price and terms"},"productRequired":{"type":"boolean","description":"Whether a deal must have products to be moved to this step. Always `false` if the tariff plan does not include this feature.","example":false},"productSumMatchesDealSum":{"type":"boolean","description":"Whether the sum of deal products must match the deal amount to move a deal to this step. Always `false` if the tariff plan does not include this feature.","example":false}},"required":["id","pipelineId","name","order","color","addEndHours","notifyIn","description","productRequired","productSumMatchesDealSum"]},"SavePipelineStepRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":45,"description":"Step name.","example":"Negotiation"},"order":{"type":"integer","minimum":1,"maximum":255,"description":"Position of the step in the pipeline.","example":2},"color":{"type":"string","minLength":1,"maxLength":16,"description":"Step color.","example":"#4C9AFF"},"addEndHours":{"type":["integer","null"],"minimum":0,"maximum":9600,"description":"Time limit for a deal in this step, in whole hours. `0` or `null` \u2014 no limit.","example":24},"notifyIn":{"type":["string","null"],"enum":["0","15min","30min","1h","2h","3h","6h","12h","24h","2d","3d","4d","5d","6d","7d",null],"description":"When to notify the responsible user before the step time limit ends. Requires `addEndHours` and must not exceed it. `0` or `null` \u2014 no notification.","example":"1h"},"description":{"type":["string","null"],"maxLength":500,"description":"Step description. Saved only on a paid tariff plan.","example":"Agree on price and terms"},"productRequired":{"type":["boolean","null"],"description":"Whether a deal must have products to be moved to this step. Saved only if the tariff plan includes this feature.","example":false},"productSumMatchesDealSum":{"type":["boolean","null"],"description":"Whether the sum of deal products must match the deal amount to move a deal to this step. Applied only together with `productRequired: true`.","example":false}},"required":["name","order","color"]},"FailReason":{"type":"object","properties":{"id":{"type":"integer","description":"Fail reason ID.","example":701},"pipelineId":{"type":"integer","description":"Pipeline ID.","example":1201},"name":{"type":"string","description":"Reason name. For default reasons it is a translation key (e.g. `default_fail_reason_other`), for custom reasons the user-defined text.","example":"Too expensive"},"isEnabled":{"type":"boolean","description":"Whether the reason can be selected when closing a deal as failed.","example":true},"order":{"type":"integer","description":"Position of the reason in the list.","example":7},"createdAt":{"type":"string","format":"date-time","description":"Creation date and time (UTC).","example":"2026-01-15T10:00:00.000000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Last update date and time (UTC).","example":"2026-01-15T10:00:00.000000Z"}},"required":["id","pipelineId","name","isEnabled","order","createdAt","updatedAt"]},"FailReasonEntry":{"type":"object","properties":{"id":{"type":"integer","description":"Fail reason entry ID.","example":35001},"dealId":{"type":"integer","description":"Deal ID.","example":950001},"userId":{"type":"integer","description":"Account owner ID.","example":8001234},"failReasonId":{"type":"integer","description":"ID of the selected fail reason.","example":701},"failReasonName":{"type":["string","null"],"description":"Name of the selected fail reason. For default reasons it is a translation key (e.g. `default_fail_reason_other`), for custom reasons the user-defined text. `null` if the reason has been deleted.","example":"Too expensive"},"comment":{"type":["string","null"],"description":"Comment entered when the deal was closed as failed.","example":"Chose a cheaper competitor"},"eventTime":{"type":"string","format":"date-time","description":"Date and time the deal was closed as failed (UTC).","example":"2026-01-15T10:00:00.000000Z"}},"required":["id","dealId","userId","failReasonId","failReasonName","comment","eventTime"]},"CreateFailReasonRequest":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"Reason name.","example":"Too expensive"}},"required":["name"]},"UpdateFailReasonRequest":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"Reason name.","example":"Too expensive"},"isEnabled":{"type":"boolean","description":"Whether the reason can be selected when closing a deal as failed.","example":false},"order":{"type":"integer","minimum":1,"maximum":10000,"description":"New position of the reason in the list.","example":1}}},"PipelineSetting":{"type":"object","description":"Pipeline setting. The type of `value` depends on `name`:\n* `currency` \u2014 string, currency code (e.g. `USD`);\n* `color` \u2014 string, HEX color (e.g. `#4C9AFF`);\n* `responsible` \u2014 non-empty array of unique user IDs (the account owner or their users); new deals created without a responsible are assigned to them in turn (round-robin), in the array order. More than one ID requires a paid tariff;\n* `stepForNewPaymentDeal`, `stepForSuccessfulPaymentDeal`, `stepForFailedPaymentDeal` \u2014 integer step ID of this pipeline or `null`;\n* `stepsForDisableAutomation` \u2014 array of step IDs of this pipeline;\n* `paymentAutomation`, `expenses`, `singleDealPerPaymentLink` \u2014 boolean;\n* `timeToFail` \u2014 integer number of hours (1, 2, 6, 12, 24 or 48) or `null`.\n","properties":{"name":{"type":"string","description":"Setting name.","enum":["currency","color","responsible","stepForNewPaymentDeal","stepForSuccessfulPaymentDeal","stepForFailedPaymentDeal","stepsForDisableAutomation","paymentAutomation","expenses","timeToFail","singleDealPerPaymentLink"],"example":"currency"},"value":{"type":["string","integer","boolean","array","null"],"items":{"type":"integer"},"description":"Setting value; see the type for each setting name above.","example":"USD"}},"required":["name","value"]},"CreatePipelineRequest":{"type":"object","properties":{"name":{"type":["string","null"],"minLength":1,"maxLength":45,"description":"Pipeline name, unique among the active pipelines of the account. If omitted, `default_pipeline` is used.","example":"Sales"},"settings":{"type":"array","description":"Settings to apply instead of the defaults. Step settings (`stepFor*PaymentDeal`, `stepsForDisableAutomation`) cannot be set on creation because the pipeline steps do not exist yet; set them with \"Update a pipeline\".","items":{"$ref":"#\/components\/schemas\/PipelineSetting"}}}},"UpdatePipelineRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":45,"description":"Pipeline name, unique among the active pipelines of the account.","example":"Sales"},"order":{"type":"integer","minimum":0,"description":"Position of the pipeline in the pipeline list. Values greater than the last position are set to the last position.","example":1},"settings":{"type":"array","description":"Settings to change. Only the passed settings are updated.","items":{"$ref":"#\/components\/schemas\/PipelineSetting"}}},"required":["name","order"]},"Deal":{"type":"object","properties":{"id":{"type":"integer","description":"Deal ID.","example":950001},"pipelineId":{"type":"integer","description":"Pipeline ID.","example":1201},"status":{"$ref":"#\/components\/schemas\/DealStatus"},"stepId":{"type":"integer","description":"Pipeline step ID.","example":5301},"name":{"type":"string","description":"Deal name. If it was not set on creation, it is `#` followed by the deal number.","example":"Website redesign"},"responsibleId":{"type":["integer","null"],"description":"ID of the responsible team member.","example":8001234},"number":{"type":"integer","description":"Sequential deal number in the account.","example":154},"price":{"type":["number","null"],"description":"Deal amount in major currency units.","example":1500.5},"currency":{"type":["string","null"],"description":"Deal currency code.","example":"USD"},"sourceType":{"oneOf":[{"$ref":"#\/components\/schemas\/SourceType"},{"type":"null"}],"description":"Source the deal was created from."},"sourceId":{"type":["integer","null"],"description":"ID of the deal in the external source.","example":42},"order":{"type":"integer","description":"Position of the deal in the pipeline step.","example":8192},"createdAt":{"type":"string","format":"date-time","description":"Creation date and time (UTC).","example":"2026-01-15T10:00:00.000000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Last update date and time (UTC).","example":"2026-01-16T08:30:00.000000Z"},"commentsCount":{"type":["integer","null"],"description":"Number of comments on the deal. `null` in the responses of \"Create a deal\" and \"Update a deal\".","example":3},"attributes":{"type":"array","description":"Attribute values of the deal. Present in \"Search deals\" and \"Get a deal by ID\", and in \"Create a deal\" if attributes were passed.","items":{"$ref":"#\/components\/schemas\/EntityAttributeWithValue"}},"integration":{"oneOf":[{"$ref":"#\/components\/schemas\/IntegrationInfo"},{"type":"null"}],"description":"CRM integration the deal was created by."},"expiration":{"oneOf":[{"$ref":"#\/components\/schemas\/DealExpiration"},{"type":"null"}],"description":"Deal expiration date. Present in \"Search deals\" and \"Get a deal by ID\"."},"tasks":{"type":"array","description":"IDs of linked tasks. Present in \"Get a deal by ID\".","items":{"type":"integer"},"example":[77001]},"attachments":{"type":"array","description":"Attached files. Present in \"Search deals\" and \"Get a deal by ID\", and in \"Create a deal\" if attachments were passed.","items":{"$ref":"#\/components\/schemas\/Attachment"}},"isAutoUpdatePrice":{"type":"boolean","description":"Whether the deal amount is recalculated from the deal products.","example":false},"hasExpense":{"type":"boolean","description":"Whether expenses are enabled in the deal pipeline.","example":false},"profit":{"type":["number","null"],"description":"Deal profit in major currency units: the amount minus expenses, or the amount if the deal has no expenses.","example":1200}},"required":["id","pipelineId","status","stepId","name","responsibleId","number","price","currency","sourceType","sourceId","order","createdAt","updatedAt","commentsCount","integration","isAutoUpdatePrice","hasExpense","profit"]},"DealStatus":{"type":"integer","description":"Deal status:\n* 1 \u2014 active\n* 2 \u2014 lost\n* 3 \u2014 won\n","enum":[1,2,3],"example":1},"SourceType":{"type":"object","description":"Source of an entity.","properties":{"id":{"type":"integer","description":"Source ID:\n* 1 \u2014 chatbot\n* 2 \u2014 manually\n* 3 \u2014 subscription_form\n* 4 \u2014 landing\n* 5 \u2014 a360\n* 6 \u2014 payments\n* 7 \u2014 import\n* 8 \u2014 public_api\n* 9 \u2014 education\n* 10 \u2014 integration\n* 11 \u2014 popup\n* 12 \u2014 emailService\n* 13 \u2014 marketplace\n* 14 \u2014 mailer\n* 15 \u2014 telephony\n","enum":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],"example":8},"name":{"type":"string","description":"Source name.","example":"public_api"}},"required":["id","name"]},"IntegrationInfo":{"type":"object","description":"CRM integration.","properties":{"id":{"type":"integer","description":"Integration ID.","example":310},"name":{"type":"string","description":"Integration name.","example":"My telephony"},"status":{"type":"integer","description":"Integration status.","example":1},"groupKey":{"type":"string","description":"Integration group key.","example":"telephony"}},"required":["id","name","status","groupKey"]},"DealExpiration":{"type":"object","properties":{"dateTime":{"type":"string","format":"date-time","description":"Expiration date and time (UTC).","example":"2026-02-01T15:00:00.000000Z"},"notificationEnabled":{"type":"boolean","description":"Whether the responsible user is notified before the deal expires.","example":true},"notifyIn":{"type":"string","enum":["0","15min","30min","1h","2h","3h","6h","12h","24h","2d","3d","4d","5d","6d","7d"],"description":"When to notify before the deal expires; `0` \u2014 no notification.","example":"1h"},"expired":{"type":"boolean","description":"Whether the deal has expired.","example":false},"expires_within_day":{"type":"boolean","description":"Whether the deal expires within the next 24 hours.","example":false}},"required":["dateTime","notificationEnabled","notifyIn","expired","expires_within_day"]},"Attachment":{"type":"object","description":"File attached to an entity.","properties":{"id":{"type":"integer","description":"Attachment ID.","example":51001},"link":{"type":"string","description":"File path in the file manager.","example":"\/personal\/deal\/contract.pdf"},"entityId":{"type":"integer","description":"ID of the entity the file is attached to.","example":950001},"entityType":{"type":"string","enum":["task","deal","contact","company","comment"],"description":"Type of the entity the file is attached to.","example":"deal"},"createdAt":{"type":"string","format":"date-time","description":"Creation date and time (UTC).","example":"2026-01-15T10:00:00.000000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Last update date and time (UTC).","example":"2026-01-15T10:00:00.000000Z"}},"required":["id","link","entityId","entityType","createdAt","updatedAt"]},"UploadedFile":{"type":"object","properties":{"link":{"type":"string","description":"File path in the file manager.","example":"\/personal\/crm\/attachments\/contract.pdf"}},"required":["link"]},"EntityAttributeWithValue":{"type":"object","description":"Custom field (attribute) with its value on an entity.","properties":{"id":{"type":"integer","description":"Attribute ID.","example":3101},"pipelineId":{"type":"integer","description":"Pipeline ID. Present for deal attributes.","example":1201},"name":{"type":"string","description":"Attribute name.","example":"Delivery address"},"status":{"$ref":"#\/components\/schemas\/EntityAttributeStatus"},"type":{"$ref":"#\/components\/schemas\/EntityAttributeFieldType"},"order":{"type":"integer","description":"Position of the attribute in the field list.","example":3},"options":{"type":["array","null"],"description":"Options of `select` and `multiSelect` attributes; `null` for other types.","items":{"type":["string","null"]},"example":null},"mandatory":{"type":"boolean","description":"Whether the field is mandatory.","example":false},"default":{"type":"boolean","description":"Whether this is a system (default) attribute.","example":false},"contactCardShow":{"type":"boolean","description":"Whether the field is shown on the contact card.","example":false},"value":{"$ref":"#\/components\/schemas\/EntityAttributeValue"}},"required":["id","name","status","type","order","options","mandatory","default","contactCardShow","value"]},"EntityAttributeValue":{"type":"object","description":"Value of a custom field. Dates are returned in UTC; `multiSelect` values are a JSON-encoded array of options; checkbox values are `0` or `1`.","properties":{"value":{"type":["string","null"],"description":"Field value.","example":"Kyiv, Khreshchatyk 1"}},"required":["value"]},"DealAttributeInput":{"type":"object","description":"Value of a deal attribute. Pass `attributeId` of an existing attribute of the pipeline, or `name` and `type` to use the attribute with this name and type or create it.","properties":{"attributeId":{"type":"integer","description":"ID of an attribute of the deal pipeline.","example":3101},"name":{"type":"string","maxLength":255,"description":"Attribute name. Required if `attributeId` is not passed.","example":"Delivery address"},"type":{"allOf":[{"$ref":"#\/components\/schemas\/EntityAttributeFieldType"}],"description":"Attribute field type. Required if `attributeId` is not passed."},"value":{"type":"string","maxLength":5500,"description":"Attribute value. Dates \u2014 `Y-m-d H:i:s` in the account time zone; checkbox \u2014 `0` or `1`; multiSelect \u2014 JSON array of options.","example":"Kyiv, Khreshchatyk 1"}},"required":["value"]},"CreateDealRequest":{"type":"object","properties":{"pipelineId":{"type":"integer","description":"ID of an active pipeline. It can be obtained with the \"Get a list of pipelines\" method.","example":1201},"stepId":{"type":"integer","description":"ID of an active step of the pipeline.","example":5301},"name":{"type":["string","null"],"maxLength":255,"description":"Deal name. Default \u2014 `#` followed by the deal number.","example":"Website redesign"},"responsibleId":{"type":["integer","null"],"description":"ID of the responsible team member. It can be obtained with the \"Get a list of team members\" method.","example":8001234},"price":{"type":["number","null"],"minimum":0,"maximum":99999999999999,"description":"Deal amount. Required together with `currency`.","example":1500.5},"currency":{"type":["string","null"],"description":"Deal currency code (e.g. `USD`, `EUR`, `UAH`). Required together with `price`.","example":"USD"},"sourceId":{"type":["integer","null"],"minimum":1,"maximum":2147483647,"description":"ID of the deal in your external source.","example":42},"externalDealId":{"type":["string","null"],"maxLength":128,"description":"Unique ID of the deal in your system.","example":"ORDER-2026-0001"},"attributes":{"type":["array","null"],"description":"Attribute values of the deal.","items":{"$ref":"#\/components\/schemas\/DealAttributeInput"}},"contact":{"type":["array","null"],"maxItems":5,"description":"IDs of active contacts to link to the deal.","items":{"type":"integer"},"example":[700101]},"tasks":{"type":["array","null"],"description":"IDs of active tasks to link to the deal.","items":{"type":"integer"},"example":[77001]},"attachments":{"type":"array","description":"Paths of files uploaded to the file manager to attach to the deal.","items":{"type":"string","maxLength":255},"example":["\/personal\/deal\/contract.pdf"]},"utm":{"type":["string","null"],"maxLength":5000,"description":"UTM query string; UTM parameters are saved as deal attributes.","example":"utm_source=google&utm_medium=cpc"},"originalDealId":{"type":["integer","null"],"description":"ID of the deal this deal is copied from.","example":949990}},"required":["pipelineId","stepId"]},"UpdateDealRequest":{"type":"object","properties":{"pipelineId":{"type":"integer","description":"Current pipeline ID of the deal.","example":1201},"stepId":{"type":"integer","description":"ID of an active step of the current pipeline.","example":5302},"status":{"$ref":"#\/components\/schemas\/DealStatus"},"name":{"type":"string","maxLength":255,"description":"Deal name.","example":"Website redesign"},"responsibleId":{"type":["integer","null"],"description":"ID of the responsible team member. If not passed, the next user from the pipeline `responsible` setting is assigned (round-robin).","example":8001234},"price":{"type":"number","minimum":0,"maximum":99999999999999,"description":"Deal amount.","example":1500.5},"currency":{"type":"string","description":"Deal currency code.","example":"USD"},"sourceId":{"type":["integer","null"],"minimum":1,"maximum":2147483647,"description":"ID of the deal in your external source.","example":42},"order":{"type":["number","null"],"minimum":-2,"maximum":4284967295,"description":"Position of the deal in the step. Ignored when the deal is closed (status 2 or 3).","example":8192},"tasks":{"type":["array","null"],"description":"IDs of active tasks to link to the deal.","items":{"type":"integer"},"example":[77001]},"failReasonId":{"type":["integer","null"],"description":"Fail reason ID for a lost deal (status 2). It can be obtained with the \"Get fail reasons of a pipeline\" method. Default \u2014 the pipeline default reason.","example":701},"failReasonComment":{"type":["string","null"],"maxLength":1000,"description":"Comment to the fail reason.","example":"Chose a cheaper offer"}},"required":["pipelineId","stepId","status","name","price","currency"]},"ChangeDealPipelineRequest":{"type":"object","properties":{"pipelineId":{"type":"integer","description":"ID of the target pipeline; must differ from the current pipeline of the deal.","example":1202},"stepId":{"type":"integer","description":"ID of an active step of the target pipeline.","example":5401},"attributes":{"type":["array","null"],"description":"Values of the target pipeline attributes.","items":{"type":"object","properties":{"attributeId":{"type":"integer","minimum":1,"description":"Attribute ID of the target pipeline.","example":3201},"value":{"type":"string","maxLength":5500,"description":"Attribute value.","example":"Kyiv"}},"required":["attributeId","value"]}}},"required":["pipelineId","stepId"]},"DealSearchRequest":{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":100,"default":10,"description":"Number of deals to return.","example":10},"offset":{"type":["integer","null"],"minimum":0,"default":0,"description":"Number of deals to skip.","example":0},"pipelineIds":{"type":"array","description":"IDs of pipelines to search in. Required unless `messengerExternalContactId` is passed.","items":{"type":"integer"},"example":[1201]},"filter":{"type":"array","description":"Conditions on deal fields; all conditions must match. A `price` condition requires a `currency` condition.","items":{"$ref":"#\/components\/schemas\/DealFieldFilter"}},"attributes":{"type":"array","maxItems":50,"description":"Conditions on deal attribute values; all conditions must match.","items":{"$ref":"#\/components\/schemas\/AttributeFilter"}},"sortBy":{"type":["object","null"],"description":"Sorting. Default \u2014 by `createdAt` ascending.","properties":{"fieldName":{"type":["string","null"],"enum":["id","pipelineId","status","stepId","name","responsibleId","number","price","currency","sourceType","sourceId","order","createdAt","updatedAt",null],"description":"Deal field to sort by.","example":"createdAt"},"attributeId":{"type":["integer","null"],"description":"ID of a sortable deal attribute to sort by (instead of `fieldName`).","example":3101},"direction":{"type":"string","enum":["asc","desc"],"default":"asc","description":"Sort direction.","example":"desc"}}},"name":{"type":"string","description":"Part of the deal name.","example":"redesign"},"email":{"type":"string","description":"Part of an email of a linked contact.","example":"anna@"},"phone":{"type":"string","description":"Part of a phone number of a linked contact.","example":"38050"},"firstName":{"type":"string","description":"Part of the first name of a linked contact.","example":"Anna"},"lastName":{"type":"string","description":"Part of the last name of a linked contact.","example":"Smith"},"messengerExternalContactId":{"type":"string","description":"External contact ID of a messenger of a linked contact.","example":"5f1b2c3d4e"},"failReasonIds":{"type":"array","description":"IDs of fail reasons of lost deals.","items":{"type":"integer"},"example":[701]},"completionDateFrom":{"type":"string","format":"date","description":"Deals closed on or after this date.","example":"2026-01-01"},"completionDateTo":{"type":"string","format":"date","description":"Deals closed on or before this date; not earlier than `completionDateFrom`.","example":"2026-01-31"},"from":{"type":"string","format":"date","description":"Deals with an expiration date on or after this date.","example":"2026-02-01"},"to":{"type":"string","format":"date","description":"Deals with an expiration date before this date.","example":"2026-03-01"},"expiration":{"type":"integer","enum":[1,2,3,4,5],"description":"Expiration state:\n* 1 \u2014 without expiration date\n* 2 \u2014 overdue\n* 3 \u2014 expires within a day\n* 4 \u2014 expires within a week\n* 5 \u2014 expires within a month\n","example":2},"productName":{"type":"string","description":"Part of the name of a deal product.","example":"Logo"},"productVendorCode":{"type":"string","description":"Part of the vendor code of a deal product.","example":"SKU-1"},"productQuantity":{"$ref":"#\/components\/schemas\/ProductQuantityFilter"},"productPrice":{"$ref":"#\/components\/schemas\/DealProductPriceFilter"},"productSumPrice":{"$ref":"#\/components\/schemas\/DealProductPriceFilter"},"price":{"$ref":"#\/components\/schemas\/DealAmountFilter"},"profit":{"$ref":"#\/components\/schemas\/DealAmountFilter"}}},"DealFieldFilter":{"type":"object","properties":{"name":{"type":"string","enum":["id","pipelineId","status","stepId","name","responsibleId","number","price","currency","sourceType","sourceId","order","createdAt","updatedAt"],"description":"Deal field.","example":"status"},"expression":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","like"],"description":"Comparison operator. `currency` supports only `eq`, `neq` and `like`.","example":"eq"},"value":{"type":["string","number"],"description":"Value to compare with. `status` \u2014 1, 2 or 3; `price` \u2014 amount in major units; dates \u2014 `Y-m-d` or `Y-m-d H:i:s`.","example":1}},"required":["name","expression","value"]},"AttributeFilter":{"type":"object","properties":{"id":{"type":"integer","description":"Attribute ID.","example":3101},"expression":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","like","in","between","empty","notEmpty"],"description":"Comparison operator. `empty` \/ `notEmpty` \u2014 the attribute has no value \/ has a value; `in` \u2014 the value is one of the listed values; `between` \u2014 numeric value in the `from`\u2013`to` range (inclusive).","example":"eq"},"value":{"type":["string","array"],"maxLength":255,"items":{"type":"string"},"description":"Value to compare with: an array of strings for `in`, a string for other operators. Required for all operators except `between`, `empty` and `notEmpty`; must be omitted for `empty` and `notEmpty`.","example":"Kyiv"},"from":{"type":"number","description":"Lower bound for `between` (required with it); must be omitted for `empty` and `notEmpty`.","example":10},"to":{"type":"number","description":"Upper bound for `between` (required with it, not less than `from`); must be omitted for `empty` and `notEmpty`.","example":100}},"required":["id","expression"]},"ProductCategoryTree":{"type":"object","properties":{"tree":{"type":"array","description":"Top-level categories with nested children.","items":{"$ref":"#\/components\/schemas\/ProductCategoryNode"}},"count":{"type":"integer","description":"Total number of categories.","example":5}},"required":["tree","count"]},"ProductCategoryNode":{"type":"object","properties":{"id":{"type":"integer","example":1101},"name":{"type":"string","example":"Design"},"parent_id":{"type":["integer","null"],"example":null},"depth":{"type":"integer","description":"Nesting level, `0` for top-level categories.","example":0},"path":{"type":"string","description":"IDs of the category ancestors and the category, separated by dots.","example":"1101"},"children":{"type":"array","items":{"$ref":"#\/components\/schemas\/ProductCategoryNode"}}},"required":["id","name","parent_id","depth","path","children"]},"ProductCategory":{"type":"object","properties":{"id":{"type":"integer","example":1101},"userId":{"type":"integer","example":8001234},"name":{"type":"string","example":"Design"},"parentId":{"type":["integer","null"],"example":null},"sections":{"type":"array","items":{"$ref":"#\/components\/schemas\/CategorySection"}}},"required":["id","userId","name","parentId","sections"]},"CategorySection":{"type":"object","properties":{"id":{"type":"integer","example":1301},"name":{"type":["string","null"],"example":"Characteristics"},"categoryId":{"type":"integer","example":1101},"order":{"type":"integer","example":1},"status":{"type":"integer","enum":[0,1],"description":"`1` \u2014 active, `0` \u2014 inactive.","example":1},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","example":1401},"sectionId":{"type":"integer","example":1301},"key":{"type":["string","null"],"example":"Format"},"value":{"type":["string","null"],"example":"PNG"},"status":{"type":"integer","example":1}},"required":["id","sectionId","key","value","status"]}}},"required":["id","name","categoryId","order","status","values"]},"CreateProductCategoryRequest":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"Category name.","example":"Design"},"parentId":{"type":["integer","null"],"minimum":1,"description":"ID of an active parent category.","example":null},"sections":{"type":["array","null"],"description":"Category sections (characteristics) with key-value pairs.","items":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":255,"example":"Characteristics"},"status":{"type":["integer","null"],"enum":[0,1,null],"example":1},"values":{"type":"array","items":{"type":"object","properties":{"key":{"type":["string","null"],"maxLength":255,"example":"Format"},"value":{"type":["string","null"],"maxLength":2000,"example":"PNG"}}}}},"required":["values"]}}},"required":["name"]},"UpdateProductCategoryRequest":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"Category name.","example":"Design"},"parentId":{"type":["integer","null"],"minimum":1,"description":"ID of an active parent category; `null` \u2014 top level.","example":null}},"required":["name"]},"DealProductDiscount":{"type":"object","properties":{"type":{"type":["string","null"],"enum":["percentage","fixed",null],"example":"percentage"},"value":{"type":["number","null"],"example":10},"amount":{"type":["number","null"],"description":"Discount amount.","example":5},"startAt":{"type":["string","null"],"description":"Discount start date and time.","example":"2026-01-01T00:00:00Z"},"endAt":{"type":["string","null"],"description":"Discount end date and time.","example":"2026-02-01T00:00:00Z"},"discountTimezone":{"type":["string","null"],"example":"Europe\/Kyiv"}}},"DealProductExtra":{"type":"object","properties":{"quantity":{"type":["number","null"],"example":2},"amount":{"type":["string","null"],"description":"Unit price as a decimal string.","example":"50.00"},"currency":{"type":["string","null"],"example":"USD"},"totalAmount":{"type":["number","null"],"description":"Total amount of the line.","example":95},"discount":{"$ref":"#\/components\/schemas\/DealProductDiscount"},"hasDiscount":{"type":"boolean","example":true},"outOfStock":{"type":"boolean","description":"Whether the product was added without stock.","example":false}},"required":["quantity","amount","currency","totalAmount","discount","hasDiscount","outOfStock"]},"DealProductItem":{"type":"object","properties":{"headId":{"type":"integer","description":"ID of the product in the deal.","example":4501},"id":{"type":"integer","description":"Product ID.","example":2201},"name":{"type":["string","null"],"example":"Logo design"},"variantId":{"type":["integer","null"],"description":"Variant of the product attached to the deal.","example":7101},"variantName":{"type":["string","null"],"description":"Variant name: attribute values joined in the product variantAttributes order.","example":"Black \/ M"},"description":{"type":["string","null"],"example":"Vector logo"},"shortDescription":{"type":["string","null"],"example":"Logo"},"images":{"type":"array","description":"Image URLs.","items":{"type":"string"},"example":["https:\/\/cdn.example.com\/abc123\/products\/logo.png"]},"vendorCode":{"type":["string","null"],"example":"SKU-1"},"categoryId":{"type":["integer","null"],"example":1101},"productType":{"type":["integer","null"],"description":"`1` \u2014 physical, `2` \u2014 digital.","example":2},"balance":{"type":"object","properties":{"type":{"type":["integer","null"],"example":1},"value":{"type":["number","null"],"example":10}}},"extra":{"$ref":"#\/components\/schemas\/DealProductExtra"}},"required":["headId","id","name","images","productType","extra"]},"DealProducts":{"type":"object","properties":{"totalAmount":{"type":"number","description":"Total amount of the deal products.","example":95},"totalDiscountAmount":{"type":"number","description":"Total discount amount.","example":5},"currency":{"type":["string","null"],"example":"USD"},"items":{"type":"array","items":{"$ref":"#\/components\/schemas\/DealProductItem"}}},"required":["totalAmount","totalDiscountAmount","currency","items"]},"ContactDealProducts":{"type":"object","properties":{"id":{"type":"integer","description":"Deal ID.","example":950001},"name":{"type":"string","description":"Deal name.","example":"Website redesign"},"totalAmount":{"type":"number","example":95},"totalDiscountAmount":{"type":["number","null"],"example":5},"currency":{"type":["string","null"],"example":"USD"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","example":2201},"name":{"type":["string","null"],"example":"Logo design"},"variantId":{"type":["integer","null"],"description":"Variant of the product attached to the deal.","example":7101},"variantName":{"type":["string","null"],"description":"Variant name: attribute values joined in the product variantAttributes order.","example":"Black \/ M"},"description":{"type":["string","null"],"example":"Vector logo"},"shortDescription":{"type":["string","null"],"example":"Logo"},"images":{"type":"array","items":{"type":"string"},"example":[]},"vendorCode":{"type":["string","null"],"example":"SKU-1"},"productType":{"type":["integer","null"],"example":2},"extra":{"$ref":"#\/components\/schemas\/DealProductExtra"}},"required":["id","name","images","extra"]}}},"required":["id","name","totalAmount","totalDiscountAmount","currency","items"]},"AddProductToDealRequest":{"type":"object","properties":{"productId":{"type":"integer","description":"ID of an active product.","example":2201},"dealId":{"type":"integer","description":"ID of an active deal.","example":950001},"productPriceISO":{"type":"string","maxLength":3,"description":"Currency code of the product price to use.","example":"USD"},"productPriceValue":{"type":"number","minimum":0,"description":"Unit price.","example":50},"quantity":{"type":["number","null"],"description":"Quantity; required for physical products and must not exceed the stock unless `allow_out_of_stock` is `true`.","example":2},"allow_out_of_stock":{"type":"boolean","description":"Allow adding a physical product without enough stock.","example":false},"variantId":{"type":["integer","null"],"description":"Variant of the product being attached. Required when the product has `hasVariants` = `true`; for a physical product the quantity is then checked against the variant stock and taken from it.","example":7101}},"required":["productId","dealId","productPriceISO","productPriceValue"]},"UpdateDealProductRequest":{"type":"object","description":"`quantity` or `amount` is required.","properties":{"quantity":{"type":["number","null"],"minimum":1,"description":"Quantity; for physical products limited by the stock.","example":3},"amount":{"type":["number","null"],"minimum":0,"description":"Unit price.","example":45},"taxName":{"type":["string","null"],"maxLength":255,"description":"Tax name; required with `taxValue`.","example":"VAT"},"taxValue":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"Tax rate, %.","example":20},"isTaxAddedToAmount":{"type":["boolean","null"],"description":"Whether the tax is added on top of the amount.","example":false},"discountType":{"type":["string","null"],"enum":["percentage","fixed",null],"description":"Discount type; required with `discountValue`.","example":"percentage"},"discountValue":{"type":["number","null"],"minimum":0.01,"description":"Discount value: 1\u201399 for `percentage`; less than the price for `fixed`.","example":10},"discountStartAt":{"type":["string","null"],"description":"Discount start date and time.","example":"2026-01-01 00:00:00"},"discountEndAt":{"type":["string","null"],"description":"Discount end date and time; in the future and not earlier than `discountStartAt`.","example":"2026-12-31 23:59:59"}}},"Product":{"type":"object","properties":{"id":{"type":"integer","description":"Product ID.","example":2201},"name":{"type":"string","example":"Logo design"},"description":{"type":["string","null"],"example":"Vector logo in three variants"},"shortDescription":{"type":["string","null"],"example":"Vector logo"},"images":{"type":"array","description":"Image URLs.","items":{"type":"string"},"example":["https:\/\/cdn.example.com\/abc123\/products\/logo.png"]},"vendorCode":{"type":["string","null"],"example":"SKU-1"},"type":{"$ref":"#\/components\/schemas\/ProductKind"},"categoryId":{"type":"integer","example":1101},"categoryName":{"type":"string","example":"Design"},"balance":{"type":"object","description":"Stock balance; `null` values for non-physical products.","properties":{"type":{"type":["integer","null"],"description":"Unit: `1` \u2014 piece, `2` \u2014 service, `3` \u2014 meter, `4` \u2014 set, `5` \u2014 liter, `6` \u2014 kilogram, `7` \u2014 package.","example":1},"value":{"type":["number","null"],"example":10}},"required":["type","value"]},"availability":{"type":"integer","enum":[1,2,3],"description":"`1` \u2014 available, `2` \u2014 unavailable, `3` \u2014 expecting.","example":1},"visible":{"type":"boolean","example":true},"userId":{"type":"integer","example":8001234},"authorId":{"type":["integer","null"],"example":8001234},"editAuthorId":{"type":["integer","null"],"example":8001234},"seo":{"type":"object","properties":{"name":{"type":["string","null"],"example":"Logo design"},"description":{"type":["string","null"],"example":"Professional logo design"},"keys":{"type":["string","null"],"example":"logo, design"}},"required":["name","description","keys"]},"prices":{"type":"array","items":{"$ref":"#\/components\/schemas\/ProductPrice"}},"sections":{"type":"array","items":{"$ref":"#\/components\/schemas\/ProductSection"}},"categorySections":{"type":"array","description":"Sections of the product category.","items":{"$ref":"#\/components\/schemas\/CategorySection"}},"productType":{"type":"integer","enum":[1,2],"description":"`1` \u2014 physical, `2` \u2014 digital.","example":2},"digitalInfo":{"type":"object","properties":{"productLink":{"type":["string","null"],"example":"https:\/\/example.com\/download"},"productLinkPreview":{"type":["string","null"],"example":null},"isProductLinkExternal":{"type":"boolean","example":true},"isProductLinkPreviewExternal":{"type":"boolean","example":false}},"required":["productLink","productLinkPreview","isProductLinkExternal","isProductLinkPreviewExternal"]},"dimensions":{"type":["object","null"],"description":"Dimensions of a physical product.","properties":{"weight":{"type":["object","null"],"properties":{"value":{"type":["string","null"],"description":"Decimal value.","example":"1.50"},"unit":{"type":["string","null"],"enum":["g","kg",null],"example":"kg"}}},"length":{"type":["string","null"],"example":"10.00"},"width":{"type":["string","null"],"example":"5.00"},"height":{"type":["string","null"],"example":"2.00"}}},"hasVariants":{"type":"boolean","description":"The product is sold in variants \u2014 price, stock and dimensions live on the variant, not on the product.","example":true},"variantAttributes":{"type":"array","description":"Characteristics the variants are generated from, up to 3.","items":{"$ref":"#\/components\/schemas\/ProductVariantAttribute"}},"variants":{"type":"array","description":"Only visible variants are returned.","items":{"$ref":"#\/components\/schemas\/ProductVariant"}},"attributes":{"type":"array","description":"Custom product fields with values.","items":{"$ref":"#\/components\/schemas\/BoardAttributeWithValues"}},"createdAt":{"type":"string","format":"date-time","example":"2026-01-15T10:00:00.000000Z"},"updatedAt":{"type":"string","format":"date-time","example":"2026-01-15T10:00:00.000000Z"}},"required":["id","name","description","shortDescription","images","vendorCode","type","categoryId","categoryName","balance","availability","visible","userId","seo","prices","sections","categorySections","productType","digitalInfo","dimensions","attributes","createdAt","updatedAt"]},"ProductKind":{"type":"integer","description":"Product kind: `1` \u2014 product, `2` \u2014 service, `3` \u2014 subscription.","enum":[1,2,3],"example":1},"ProductPrice":{"type":"object","properties":{"id":{"type":"integer","example":3401},"currency":{"type":"string","example":"USD"},"value":{"type":"number","example":50},"oldValue":{"type":["number","string","null"],"description":"Old (crossed-out) price.","example":null},"isDefault":{"type":"boolean","example":true},"productId":{"type":"integer","example":2201},"discountType":{"type":["string","null"],"enum":["percentage","fixed",null],"example":null},"discountValue":{"type":["number","null"],"example":null},"discountStartAt":{"type":["string","null"],"description":"Discount start (UTC, ISO 8601).","example":null},"discountEndAt":{"type":["string","null"],"description":"Discount end (UTC, ISO 8601).","example":null},"discountTimezone":{"type":["string","null"],"example":null},"discountedPrice":{"type":["number","null"],"deprecated":true,"description":"Price with the active discount.","example":null},"isDiscountActive":{"type":"boolean","deprecated":true,"description":"Whether the discount is active now.","example":false}},"required":["id","currency","value","oldValue","isDefault","productId","discountType","discountValue","discountStartAt","discountEndAt","discountTimezone"]},"ProductSection":{"type":"object","properties":{"id":{"type":"integer","example":3501},"name":{"type":["string","null"],"example":"Characteristics"},"productId":{"type":"integer","example":2201},"order":{"type":"integer","example":1},"status":{"type":"integer","example":1},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","example":3601},"sectionId":{"type":"integer","example":3501},"key":{"type":["string","null"],"example":"Format"},"value":{"type":["string","null"],"example":"SVG"},"status":{"type":"integer","example":1}},"required":["id","sectionId","key","value","status"]}}},"required":["id","name","productId","order","status","values"]},"ProductVariantAttribute":{"type":"object","properties":{"id":{"type":"integer","example":5101},"sectionValueId":{"type":"integer","description":"Product characteristic the attribute is built from.","example":3301},"name":{"type":["string","null"],"description":"Key of the characteristic the attribute is built from.","example":"Color"},"isVisual":{"type":"boolean","example":true},"order":{"type":"integer","example":1},"values":{"type":"array","items":{"$ref":"#\/components\/schemas\/ProductVariantAttributeValue"}}},"required":["id","sectionValueId","name","isVisual","order","values"]},"ProductVariantAttributeValue":{"type":"object","properties":{"id":{"type":"integer","example":6101},"value":{"type":"string","example":"Black"},"images":{"type":["array","null"],"items":{"type":"string"},"example":["https:\/\/cdn.example.com\/abc123\/products\/black.png"]},"order":{"type":"integer","example":1}},"required":["id","value","images","order"]},"ProductVariant":{"type":"object","properties":{"id":{"type":"integer","example":7101},"name":{"type":"string","description":"Attribute values joined in the variantAttributes order.","example":"Black \/ M"},"vendorCode":{"type":["string","null"],"example":"SKU-1-BLK-M"},"balanceValue":{"type":["integer","null"],"example":10},"weightValue":{"type":["string","null"],"example":"500.00"},"length":{"type":["string","null"],"example":"20.00"},"width":{"type":["string","null"],"example":"15.00"},"height":{"type":["string","null"],"example":"10.00"},"visible":{"type":"boolean","example":true},"prices":{"type":"array","items":{"$ref":"#\/components\/schemas\/ProductVariantPrice"}},"attributeValueIds":{"type":"array","description":"Ids of the variantAttributes values this combination is built from.","items":{"type":"integer"},"example":[6101,6105]}},"required":["id","name","vendorCode","balanceValue","weightValue","length","width","height","visible","prices","attributeValueIds"]},"ProductVariantPrice":{"type":"object","properties":{"id":{"type":"integer","example":8101},"currency":{"type":"string","example":"USD"},"value":{"type":"number","example":50},"oldValue":{"type":["number","null"],"example":60},"isDefault":{"type":"boolean","example":true},"variantId":{"type":"integer","example":7101},"discountType":{"type":["string","null"],"enum":["percentage","fixed",null],"example":"percentage"},"discountValue":{"type":["number","null"],"example":10},"discountStartAt":{"type":["string","null"],"format":"date-time","description":"Discount start (UTC, ISO 8601, Z).","example":"2026-09-01T00:00:00Z"},"discountEndAt":{"type":["string","null"],"format":"date-time","description":"Discount end (UTC, ISO 8601, Z).","example":"2026-09-30T23:59:59Z"},"discountTimezone":{"type":["string","null"],"example":"Europe\/Kyiv"},"discountedPrice":{"type":["number","null"],"description":"Unit price after discount when the discount window is active, otherwise null.","example":45},"isDiscountActive":{"type":"boolean","description":"Whether the discount is active now.","example":true}},"required":["id","currency","value","oldValue","isDefault","variantId","discountType","discountValue","discountStartAt","discountEndAt","discountTimezone"]},"ProductListItem":{"type":"object","properties":{"id":{"type":"integer","example":2201},"name":{"type":"string","example":"Logo design"},"slug":{"type":["string","null"],"example":"logo-design"},"images":{"type":"array","description":"Image URLs.","items":{"type":"string"},"example":["https:\/\/cdn.example.com\/abc123\/products\/logo.png"]},"vendorCode":{"type":["string","null"],"example":"SKU-1"},"type":{"$ref":"#\/components\/schemas\/ProductKind"},"categoryId":{"type":"integer","example":1101},"visible":{"type":"boolean","example":true},"balance":{"type":"object","properties":{"type":{"type":["integer","null"],"example":1},"value":{"type":["number","null"],"example":10}}},"description":{"type":["string","null"],"example":"Vector logo in three variants"},"userId":{"type":"integer","example":8001234},"price":{"type":"object","description":"Default price.","properties":{"id":{"type":["integer","null"],"example":3401},"currency":{"type":["string","null"],"example":"USD"},"value":{"type":["number","null"],"example":50},"oldValue":{"type":["number","string","null"],"example":null},"discount":{"type":"object","properties":{"type":{"type":["string","null"],"enum":["percentage","fixed",null],"example":null},"value":{"type":["number","null"],"example":null},"discountedPrice":{"type":["number","null"],"deprecated":true,"example":null},"startAt":{"type":["string","null"],"example":null},"endAt":{"type":["string","null"],"example":null},"isActive":{"type":"boolean","deprecated":true,"example":false}}}}},"countSales":{"type":"integer","description":"Number of sales.","example":12},"createdAt":{"type":"string","format":"date-time","example":"2026-01-15T10:00:00.000000Z"},"typeProduct":{"type":"integer","enum":[1,2],"description":"`1` \u2014 physical, `2` \u2014 digital.","example":2}},"required":["id","name","images","type","categoryId","visible","balance","userId","price","countSales","createdAt","typeProduct"]},"ProductSearchRequest":{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":300,"description":"Number of products to return.","example":20},"offset":{"type":"integer","minimum":0,"description":"Number of products to skip.","example":0},"orderBy":{"type":"object","description":"Sorting.","properties":{"fieldName":{"type":"string","enum":["id","name","balance","price","createdAt"],"example":"createdAt"},"direction":{"type":"string","enum":["asc","desc"],"example":"desc"}}},"search":{"type":["string","null"],"description":"Part of the product name or vendor code.","example":"logo"},"categoryId":{"type":["integer","null"],"description":"Category ID (products of nested categories are included).","example":1101},"categoryIds":{"type":["array","null"],"description":"Category IDs.","items":{"type":"integer"},"example":[1101]},"ids":{"type":["array","null"],"description":"Product IDs.","items":{"type":"integer"},"example":[2201]},"type":{"oneOf":[{"$ref":"#\/components\/schemas\/ProductKind"},{"type":"null"}]},"typeProduct":{"type":["integer","null"],"enum":[1,2,null],"description":"`1` \u2014 physical, `2` \u2014 digital.","example":2},"visible":{"type":["integer","null"],"enum":[0,1,null],"description":"`1` \u2014 visible, `0` \u2014 hidden.","example":1},"dateFrom":{"type":["string","null"],"format":"date","description":"Products created on or after this date.","example":"2026-01-01"},"dateTo":{"type":["string","null"],"format":"date","description":"Products created on or before this date.","example":"2026-01-31"},"fromUpdatedAt":{"type":["string","null"],"description":"Products updated on or after this date and time.","example":"2026-01-01 00:00:00"},"balance":{"type":["object","null"],"description":"Stock balance condition.","properties":{"operator":{"$ref":"#\/components\/schemas\/NullableNumericFilterOperator"},"expression":{"type":"string","enum":["=",">=","<="],"deprecated":true,"description":"DEPRECATED legacy operator, still accepted until the sunset date (`=` \u2192 `eq`, `>=` \u2192 `gte`, `<=` \u2192 `lte`); ignored when `operator` is passed. Use `operator`.","example":">="},"type":{"type":"integer","enum":[1,2,3,4,5,6,7],"description":"Unit of the balance.","example":1},"value":{"type":["number","null"],"description":"Value to compare with. Required for all operators except `between`, `empty` and `notEmpty`; must be omitted for `empty` and `notEmpty`.","example":5},"from":{"type":["number","null"],"description":"Lower bound. Required for `between`.","example":1},"to":{"type":["number","null"],"description":"Upper bound, not less than `from`. Required for `between`.","example":10}},"required":["type"]},"purchases":{"type":["object","null"],"description":"Number of sales condition.","properties":{"operator":{"$ref":"#\/components\/schemas\/NullableNumericFilterOperator"},"expression":{"type":"string","enum":["=",">=","<="],"deprecated":true,"description":"DEPRECATED legacy operator, still accepted until the sunset date (`=` \u2192 `eq`, `>=` \u2192 `gte`, `<=` \u2192 `lte`); ignored when `operator` is passed. Use `operator`.","example":">="},"value":{"type":["number","null"],"description":"Value to compare with. Required for all operators except `between`, `empty` and `notEmpty`; must be omitted for `empty` and `notEmpty`.","example":1},"from":{"type":["number","null"],"description":"Lower bound. Required for `between`.","example":1},"to":{"type":["number","null"],"description":"Upper bound, not less than `from`. Required for `between`.","example":20}}},"price":{"type":["object","null"],"description":"Price condition on the default price.","properties":{"operator":{"$ref":"#\/components\/schemas\/NumericFilterOperator"},"expression":{"type":"string","enum":["=",">=","<="],"deprecated":true,"description":"DEPRECATED legacy operator, still accepted until the sunset date (`=` \u2192 `eq`, `>=` \u2192 `gte`, `<=` \u2192 `lte`); ignored when `operator` is passed. Use `operator`.","example":"<="},"currency":{"type":["string","null"],"description":"Currency code. Required with `operator` or `expression`.","example":"USD"},"value":{"type":["number","null"],"description":"Value to compare with. Required for all operators except `between`.","example":100},"from":{"type":["number","null"],"description":"Lower bound. Required for `between`.","example":10},"to":{"type":["number","null"],"description":"Upper bound, not less than `from`. Required for `between`.","example":500}}},"priceFrom":{"type":["number","null"],"minimum":0,"description":"Minimum price.","example":10},"priceTo":{"type":["number","null"],"minimum":0,"description":"Maximum price.","example":100},"sections":{"type":["array","null"],"description":"Conditions on product section values.","items":{"type":"object","properties":{"key":{"type":"string","example":"Format"},"value":{"type":"string","description":"Part of the value.","example":"SVG"}},"required":["key","value"]}},"subscriptions":{"type":["object","null"],"description":"Return only subscription products; `recurringMode` limits them to the billing period.","properties":{"type":{"type":"integer","example":2},"recurringMode":{"type":["string","null"],"enum":["daily","weekly","monthly","quarterly","halfyearly","yearly",null],"example":"monthly"}},"required":["type"]}},"required":["limit","offset","orderBy"]},"ProductDimensionsInput":{"type":["object","null"],"description":"Dimensions of a physical product.","properties":{"weight":{"type":["object","null"],"properties":{"value":{"type":["number","null"],"minimum":0.01,"maximum":99999999.99,"example":1.5},"unit":{"type":["string","null"],"enum":["g","kg",null],"example":"kg"}}},"length":{"type":["number","null"],"minimum":0.01,"maximum":99999999.99,"example":10},"width":{"type":["number","null"],"minimum":0.01,"maximum":99999999.99,"example":5},"height":{"type":["number","null"],"minimum":0.01,"maximum":99999999.99,"example":2}}},"ProductPriceInput":{"type":"object","properties":{"currency":{"type":"string","description":"Currency code.","example":"USD"},"value":{"type":"number","minimum":0,"maximum":999999999.99,"description":"Price, up to 2 decimal places.","example":50},"oldValue":{"type":["number","null"],"minimum":0,"maximum":999999999.99,"description":"Old (crossed-out) price.","example":60},"isDefault":{"type":"boolean","description":"Whether this is the default price.","example":true},"discountType":{"type":["string","null"],"enum":["percentage","fixed",null],"description":"Discount type.","example":"percentage"},"discountValue":{"type":["number","null"],"minimum":1,"description":"Discount value.","example":10},"discountStartAt":{"type":["string","null"],"description":"Discount start date and time.","example":"2026-01-01 00:00:00"},"discountEndAt":{"type":["string","null"],"description":"Discount end date and time; in the future and not earlier than `discountStartAt`.","example":"2026-12-31 23:59:59"}},"required":["currency","value","isDefault"]},"UpdateProductPriceInput":{"type":"object","properties":{"id":{"type":"integer","description":"ID of a price of the product.","example":3401},"currency":{"type":"string","description":"Currency code.","example":"USD"},"value":{"type":"number","minimum":0,"maximum":999999999.99,"description":"Price, up to 2 decimal places.","example":50},"oldValue":{"type":["number","null"],"minimum":0,"maximum":999999999.99,"description":"Old (crossed-out) price.","example":60},"isDefault":{"type":"boolean","description":"Whether this is the default price.","example":true},"discountType":{"type":["string","null"],"enum":["percentage","fixed",null],"description":"Discount type.","example":"percentage"},"discountValue":{"type":["number","null"],"minimum":1,"description":"Discount value.","example":10},"discountStartAt":{"type":["string","null"],"description":"Discount start date and time.","example":"2026-01-01 00:00:00"},"discountEndAt":{"type":["string","null"],"description":"Discount end date and time; in the future and not earlier than `discountStartAt`.","example":"2026-12-31 23:59:59"}},"required":["id","currency","value","isDefault"]},"CreateProductRequest":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"Product name.","example":"Logo design"},"type":{"$ref":"#\/components\/schemas\/ProductKind"},"productType":{"type":["integer","null"],"enum":[1,2,null],"description":"`1` \u2014 physical, `2` \u2014 digital; must be `2` for subscriptions.","example":2},"categoryId":{"type":"integer","description":"ID of an active category.","example":1101},"availability":{"type":"integer","enum":[1,2,3],"description":"`1` \u2014 available, `2` \u2014 unavailable, `3` \u2014 expecting.","example":1},"visible":{"type":"integer","enum":[0,1],"description":"`1` \u2014 visible, `0` \u2014 hidden.","example":1},"prices":{"type":"array","description":"Prices in different currencies. Required unless the product is created in variant mode (`hasVariants: true`, or `variantAttributes` \/ `variants` sent without `hasVariants`); in that mode it may be omitted and the prices live in `variants[].prices`.","items":{"$ref":"#\/components\/schemas\/ProductPriceInput"}},"recurringMode":{"type":["string","null"],"enum":["daily","weekly","monthly","quarterly","halfyearly","yearly",null],"description":"Billing period; required for subscriptions.","example":"monthly"},"sections":{"type":["array","null"],"description":"Sections (characteristics) with key-value pairs.","items":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":255,"example":"Characteristics"},"values":{"type":"array","items":{"type":"object","properties":{"key":{"type":["string","null"],"maxLength":255,"example":"Format"},"value":{"type":["string","null"],"maxLength":2000,"example":"SVG"}}}}},"required":["values"]}},"description":{"type":["string","null"],"maxLength":10000,"description":"Full description.","example":"Vector logo in three variants"},"shortDescription":{"type":["string","null"],"maxLength":10000,"description":"Short description.","example":"Vector logo"},"images":{"type":["array","null"],"description":"Paths of images uploaded to the file manager.","items":{"type":"string"},"example":["\/products\/logo.png"]},"vendorCode":{"type":["string","null"],"maxLength":255,"description":"Vendor code (SKU).","example":"SKU-1"},"balance":{"type":["object","null"],"description":"Stock balance; required for physical products unless the product is in variant mode (`hasVariants: true`, or `variantAttributes` \/ `variants` sent without `hasVariants`); in that mode it may be omitted and the stock lives in `variants[].balanceValue`.","properties":{"type":{"type":["integer","null"],"enum":[1,2,3,4,5,6,7,null],"description":"Unit: `1` \u2014 piece, `2` \u2014 service, `3` \u2014 meter, `4` \u2014 set, `5` \u2014 liter, `6` \u2014 kilogram, `7` \u2014 package.","example":1},"value":{"type":["number","null"],"description":"Quantity in stock.","example":10}}},"seo":{"type":["object","null"],"properties":{"name":{"type":["string","null"],"maxLength":255,"example":"Logo design"},"description":{"type":["string","null"],"maxLength":255,"example":"Professional logo design"},"keys":{"type":["string","null"],"maxLength":255,"example":"logo, design"}}},"digitalInfo":{"type":["object","null"],"description":"Details of a digital product.","properties":{"productLink":{"type":["string","null"],"maxLength":255,"description":"Link to the digital product.","example":"https:\/\/example.com\/download"},"productLinkPreview":{"type":["string","null"],"maxLength":255,"description":"Preview link or file path.","example":null},"isProductLinkExternal":{"type":["boolean","null"],"example":true},"isProductLinkPreviewExternal":{"type":["boolean","null"],"example":false}}},"taxes":{"type":["array","null"],"description":"Taxes applied to the product.","items":{"type":"object","properties":{"id":{"type":"integer","description":"Tax ID.","example":11},"isAddedToAmount":{"type":"boolean","description":"Whether the tax is added on top of the price.","example":false}},"required":["id","isAddedToAmount"]}},"dimensions":{"$ref":"#\/components\/schemas\/ProductDimensionsInput"},"digitalType":{"type":["integer","null"],"enum":[1,null],"description":"Digital product kind: `1` \u2014 education course.","example":1},"digitalOptions":{"type":["object","null"],"description":"Course access for `digitalType: 1`.","properties":{"courseId":{"type":"integer","example":501},"courseTariffId":{"type":"integer","example":9001}},"required":["courseId","courseTariffId"]},"hasVariants":{"type":["boolean","null"],"description":"Turns the variant mode on for the product. Sending `false` keeps the stored variants untouched and only hides them from the card.","example":true},"variantAttributes":{"type":"array","maxItems":3,"description":"Characteristics the variants are generated from. Reference an existing characteristic value with `sectionValueId`, or a characteristic sent in the same payload with `sectionValueKey` \u2014 exactly one of the two per attribute. One characteristic can back only one attribute.","items":{"$ref":"#\/components\/schemas\/ProductVariantAttributeInput"},"example":[{"sectionValueKey":"Color","isVisual":true,"values":[{"value":"Black","images":["https:\/\/cdn.example.com\/black.jpg"]},{"value":"White","images":["https:\/\/cdn.example.com\/white.jpg"]}]},{"sectionValueKey":"Size","isVisual":false,"values":[{"value":"M"},{"value":"L"}]}]},"variants":{"type":"array","minItems":1,"maxItems":100,"description":"Required when `hasVariants` is `true`. Each variant carries one value per attribute, in the `variantAttributes` order; combinations must be unique.","items":{"$ref":"#\/components\/schemas\/ProductVariantInput"},"example":[{"values":["Black","M"],"prices":[{"currency":"UAH","value":1200,"oldValue":1500,"isDefault":true}],"vendorCode":"TS-BLK-M","images":["https:\/\/cdn.example.com\/black-m-front.jpg","https:\/\/cdn.example.com\/black-m-back.jpg"],"balanceValue":10,"weightValue":500,"visible":true},{"values":["Black","L"],"prices":[{"currency":"UAH","value":1250,"isDefault":true}],"vendorCode":"TS-BLK-L","balanceValue":5,"visible":true}]}},"required":["name","type","categoryId","availability","visible"]},"UpdateProductRequest":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":255,"description":"Product name.","example":"Logo design"},"slug":{"type":["string","null"],"maxLength":255,"description":"URL slug, unique in the account.","example":"logo-design"},"categoryId":{"type":["integer","null"],"description":"ID of an active category.","example":1101},"availability":{"type":["integer","null"],"enum":[1,2,3,null],"description":"`1` \u2014 available, `2` \u2014 unavailable, `3` \u2014 expecting.","example":1},"visible":{"type":["integer","null"],"enum":[0,1,null],"description":"`1` \u2014 visible, `0` \u2014 hidden.","example":1},"description":{"type":["string","null"],"maxLength":10000,"description":"Full description.","example":"Vector logo in three variants"},"shortDescription":{"type":["string","null"],"maxLength":10000,"description":"Short description.","example":"Vector logo"},"images":{"type":["array","null"],"description":"Paths of images uploaded to the file manager.","items":{"type":"string"},"example":["\/products\/logo.png"]},"vendorCode":{"type":["string","null"],"maxLength":255,"description":"Vendor code (SKU).","example":"SKU-1"},"balance":{"type":["object","null"],"description":"Stock balance; required for physical products unless the product is in variant mode (`hasVariants: true`, or `variantAttributes` \/ `variants` sent without `hasVariants`); in that mode it may be omitted and the stock lives in `variants[].balanceValue`.","properties":{"type":{"type":["integer","null"],"enum":[1,2,3,4,5,6,7,null],"description":"Unit: `1` \u2014 piece, `2` \u2014 service, `3` \u2014 meter, `4` \u2014 set, `5` \u2014 liter, `6` \u2014 kilogram, `7` \u2014 package.","example":1},"value":{"type":["number","null"],"description":"Quantity in stock.","example":10}}},"seo":{"type":["object","null"],"properties":{"name":{"type":["string","null"],"maxLength":255,"example":"Logo design"},"description":{"type":["string","null"],"maxLength":255,"example":"Professional logo design"},"keys":{"type":["string","null"],"maxLength":255,"example":"logo, design"}}},"digitalInfo":{"type":["object","null"],"description":"Details of a digital product.","properties":{"productLink":{"type":["string","null"],"maxLength":255,"description":"Link to the digital product.","example":"https:\/\/example.com\/download"},"productLinkPreview":{"type":["string","null"],"maxLength":255,"description":"Preview link or file path.","example":null},"isProductLinkExternal":{"type":["boolean","null"],"example":true},"isProductLinkPreviewExternal":{"type":["boolean","null"],"example":false}}},"taxes":{"type":["array","null"],"description":"Taxes applied to the product.","items":{"type":"object","properties":{"id":{"type":"integer","description":"Tax ID.","example":11},"isAddedToAmount":{"type":"boolean","description":"Whether the tax is added on top of the price.","example":false},"isDelete":{"type":["boolean","null"],"description":"Pass `true` to remove the tax from the product.","example":false}},"required":["id","isAddedToAmount"]}},"dimensions":{"$ref":"#\/components\/schemas\/ProductDimensionsInput"},"digitalType":{"type":["integer","null"],"enum":[1,null],"description":"Digital product kind: `1` \u2014 education course.","example":1},"digitalOptions":{"type":["object","null"],"description":"Course access for `digitalType: 1`.","properties":{"courseId":{"type":"integer","example":501},"courseTariffId":{"type":"integer","example":9001}},"required":["courseId","courseTariffId"]},"hasVariants":{"type":["boolean","null"],"description":"Turns the variant mode on for the product. Sending `false` keeps the stored variants untouched and only hides them from the card.","example":true},"variantAttributes":{"type":"array","maxItems":3,"description":"Characteristics the variants are generated from. Reference an existing characteristic value with `sectionValueId`, or a characteristic sent in the same payload with `sectionValueKey` \u2014 exactly one of the two per attribute. Attributes and values missing from the payload are deleted together with the variants built from them; if any of those variants is used in a deal the request is rejected with 422.","items":{"$ref":"#\/components\/schemas\/ProductVariantAttributeInput"},"example":[{"id":41,"sectionValueId":915,"isVisual":true,"values":[{"id":77,"value":"Black","images":["https:\/\/cdn.example.com\/black.jpg"]},{"id":78,"value":"White","images":["https:\/\/cdn.example.com\/white.jpg"]}]},{"id":42,"sectionValueId":916,"isVisual":false,"values":[{"id":79,"value":"M"},{"id":80,"value":"L"}]}]},"variants":{"type":"array","minItems":1,"maxItems":100,"description":"Required when `hasVariants` is `true`. Each variant carries one value per attribute, in the `variantAttributes` order; combinations must be unique. Variants with an `id` are updated, variants without an `id` are created, persisted variants missing from the payload are deleted \u2014 or hidden instead when they are used in a deal. Variant `images` are replaced as a whole: sending `null` or omitting the field clears the stored photos.","items":{"$ref":"#\/components\/schemas\/ProductVariantInput"},"example":[{"id":310,"values":["Black","M"],"prices":[{"currency":"UAH","value":1200,"oldValue":1500,"isDefault":true}],"vendorCode":"TS-BLK-M","balanceValue":10,"weightValue":500,"visible":true},{"id":311,"values":["Black","L"],"prices":[{"currency":"UAH","value":1250,"isDefault":true}],"vendorCode":"TS-BLK-L","balanceValue":5,"visible":true},{"values":["White","M"],"prices":[{"currency":"UAH","value":1200,"isDefault":true}],"vendorCode":"TS-WHT-M","balanceValue":8,"visible":true},{"values":["White","L"],"prices":[{"currency":"UAH","value":1250,"isDefault":true}],"vendorCode":"TS-WHT-L","balanceValue":0,"visible":false}]}}},"ProductVariantAttributeInput":{"type":"object","properties":{"id":{"type":["integer","null"],"description":"Existing attribute to update; omit to create one.","example":41},"sectionValueId":{"type":["integer","null"],"description":"Existing product characteristic value the attribute is built from.","example":915},"sectionValueKey":{"type":["string","null"],"maxLength":255,"description":"Key of a characteristic sent in the same payload.","example":"Color"},"isVisual":{"type":"boolean","description":"Only one attribute can be visual.","example":true},"values":{"type":"array","minItems":1,"maxItems":100,"items":{"$ref":"#\/components\/schemas\/ProductVariantAttributeValueInput"}}},"required":["values"]},"ProductVariantAttributeValueInput":{"type":"object","properties":{"id":{"type":["integer","null"],"description":"Existing value to update; omit to create one.","example":77},"value":{"type":"string","maxLength":80,"example":"Black"},"images":{"type":["array","null"],"maxItems":10,"items":{"type":"string","maxLength":2048},"example":["https:\/\/cdn.example.com\/black.jpg"]}},"required":["value"]},"ProductVariantInput":{"type":"object","properties":{"id":{"type":["integer","null"],"description":"Existing variant to update; omit to create one.","example":310},"values":{"type":"array","minItems":1,"description":"One attribute value per attribute, in the `variantAttributes` order.","items":{"type":"string","maxLength":255},"example":["Black","M"]},"prices":{"type":"array","minItems":1,"maxItems":10,"description":"One price per currency \u2014 a currency may not repeat inside a variant.","items":{"$ref":"#\/components\/schemas\/ProductVariantPriceInput"}},"vendorCode":{"type":["string","null"],"maxLength":255,"example":"TS-BLK-M"},"images":{"type":["array","null"],"maxItems":10,"description":"Photos of the variant, stored on the variant itself \u2014 separate from the product images and from the visual attribute value images.","items":{"type":"string","maxLength":2048},"example":["https:\/\/cdn.example.com\/black-m-front.jpg"]},"balanceValue":{"type":["integer","null"],"minimum":0,"example":10},"weightValue":{"type":["number","null"],"minimum":0.01,"maximum":99999999.99,"multipleOf":0.01,"example":500},"length":{"type":["number","null"],"minimum":0.01,"maximum":99999999.99,"multipleOf":0.01,"example":20},"width":{"type":["number","null"],"minimum":0.01,"maximum":99999999.99,"multipleOf":0.01,"example":15},"height":{"type":["number","null"],"minimum":0.01,"maximum":99999999.99,"multipleOf":0.01,"example":10},"visible":{"type":"boolean","default":true,"example":true}},"required":["values","prices"]},"ProductVariantPriceInput":{"type":"object","properties":{"currency":{"type":"string","example":"UAH"},"value":{"type":"number","exclusiveMinimum":0,"example":1200},"oldValue":{"type":["number","null"],"example":1500},"isDefault":{"type":"boolean","example":true},"discountType":{"type":["string","null"],"enum":["percentage","fixed",null],"example":"percentage"},"discountValue":{"type":["number","null"],"description":"Percentage 1-99; fixed must be less than the variant price value.","example":10},"discountStartAt":{"type":["string","null"],"format":"date-time","description":"Absolute ISO 8601 moment with offset or Z; stored normalized to UTC.","example":"2026-09-01T00:00:00+03:00"},"discountEndAt":{"type":["string","null"],"format":"date-time","description":"Absolute ISO 8601 moment with offset or Z; must be in the future and not before `discountStartAt`.","example":"2026-09-30T23:59:59+03:00"},"discountTimezone":{"type":["string","null"],"description":"Opaque display timezone string (e.g. `+03:00` or `Europe\/Kyiv`).","example":"Europe\/Kyiv"}},"required":["currency","value"]},"ProductSectionInput":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":255,"example":"Characteristics"},"order":{"type":["integer","null"],"example":1},"status":{"type":["integer","null"],"description":"Section status.","example":1},"values":{"type":"array","items":{"type":"object","properties":{"key":{"type":["string","null"],"maxLength":255,"example":"Format"},"value":{"type":["string","null"],"maxLength":4000,"example":"SVG"},"status":{"type":["integer","null"],"example":1}}}}},"required":["values"]},"UpdateProductSectionInput":{"type":"object","properties":{"id":{"type":"integer","description":"ID of a section of the product.","example":3501},"name":{"type":["string","null"],"maxLength":255,"example":"Characteristics"},"order":{"type":["integer","null"],"example":1},"status":{"type":["integer","null"],"example":1},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":["integer","null"],"description":"ID of an existing value; omit to add a value.","example":3601},"key":{"type":["string","null"],"maxLength":255,"example":"Format"},"value":{"type":["string","null"],"maxLength":4000,"example":"SVG"},"status":{"type":["integer","null"],"example":1}}}}},"required":["id","values"]},"NumericFilterOperator":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","between"],"description":"Comparison operator. `between` \u2014 inclusive `from`\u2013`to` range; other operators compare with `value`. Operators other than `between` require a tariff with advanced filter operators, otherwise 403. Legacy-shape filters are not restricted.","example":"gte"},"NullableNumericFilterOperator":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","between","empty","notEmpty"],"description":"Comparison operator. `between` \u2014 inclusive `from`\u2013`to` range; `empty` \/ `notEmpty` \u2014 the field has no value \/ has a value; other operators compare with `value`. Operators other than `between` require a tariff with advanced filter operators, otherwise 403. Legacy-shape filters are not restricted.","example":"gte"},"ProductQuantityFilter":{"type":"object","description":"Quantity condition on a deal product. Omitting `operator` is the deprecated legacy shape, still accepted until the sunset date: `from` + `to` \u2192 `between`, only `from` \u2192 `gte`, only `to` \u2192 `lte`.","properties":{"operator":{"$ref":"#\/components\/schemas\/NumericFilterOperator"},"value":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"Value to compare with. Required for all operators except `between`.","example":2},"from":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"Lower bound. Required for `between`.","example":1},"to":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"Upper bound, not less than `from`. Required for `between`.","example":10}}},"DealProductPriceFilter":{"type":"object","description":"Price condition on a deal product. Omitting `operator` is the deprecated legacy shape, still accepted until the sunset date: `from` + `to` \u2192 `between`, only `from` \u2192 `gte`, only `to` \u2192 `lte`.","properties":{"operator":{"$ref":"#\/components\/schemas\/NumericFilterOperator"},"value":{"type":["number","null"],"minimum":0.01,"maximum":1000000,"description":"Value to compare with. Required for all operators except `between`.","example":100},"from":{"type":["number","null"],"minimum":0.01,"maximum":1000000,"description":"Lower bound. Required for `between`.","example":10},"to":{"type":["number","null"],"minimum":0.01,"maximum":1000000,"description":"Upper bound, not less than `from`. Required for `between`.","example":500},"currency":{"type":["string","null"],"minLength":3,"maxLength":3,"description":"Currency code.","example":"USD"}}},"DealAmountFilter":{"type":"object","description":"Amount condition in major currency units. Omitting `operator` is the deprecated legacy shape, still accepted until the sunset date: `from` + `to` \u2192 `between`, only `from` \u2192 `gte`, only `to` \u2192 `lte`.","properties":{"operator":{"$ref":"#\/components\/schemas\/NullableNumericFilterOperator"},"value":{"type":["number","null"],"description":"Value to compare with. Required for all operators except `between`, `empty` and `notEmpty`; must be omitted for `empty` and `notEmpty`. For `price` \u2014 at least 0.01.","example":1000},"from":{"type":["number","null"],"description":"Lower bound. Required for `between`; must be omitted for `empty` and `notEmpty`. For `price` \u2014 at least 0.01.","example":100},"to":{"type":["number","null"],"description":"Upper bound, not less than `from`. Required for `between`; must be omitted for `empty` and `notEmpty`.","example":5000},"currency":{"type":["string","null"],"minLength":3,"maxLength":3,"description":"Currency code. Required unless `operator` is `empty` or `notEmpty` (in the legacy shape \u2014 with `from` or `to`).","example":"USD"}}},"LegacyErrorResponse":{"type":"object","description":"Error in the legacy envelope: `data` contains the error message.","properties":{"success":{"type":"boolean","example":false},"data":{"type":["string","null"],"description":"Error message.","example":"Not found"},"error_code":{"type":"integer","description":"HTTP status code.","example":400}},"required":["success","data","error_code"]},"TaskPriority":{"type":"integer","description":"Task priority: `0` \u2014 low, `1` \u2014 middle, `2` \u2014 high.","enum":[0,1,2],"example":1},"TaskStatus":{"type":"integer","description":"Task status: `1` \u2014 active, `2` \u2014 completed.","enum":[1,2],"example":1},"TaskTagRef":{"type":"object","properties":{"id":{"type":"integer","example":301},"name":{"type":"string","example":"Urgent"},"colorText":{"type":["string","null"],"example":"#7A4100"},"colorBackground":{"type":["string","null"],"example":"#FFE8CC"}},"required":["id","name","colorText","colorBackground"]},"TaskListItem":{"type":"object","properties":{"id":{"type":"integer","description":"Task ID.","example":77001},"name":{"type":"string","description":"Task name.","example":"Call the client"},"responsibleId":{"type":["integer","null"],"description":"ID of the responsible team member.","example":8001234},"boardId":{"type":"integer","description":"Board ID.","example":2101},"stepId":{"type":"integer","description":"Board step ID.","example":6101},"priority":{"$ref":"#\/components\/schemas\/TaskPriority"},"order":{"type":"integer","description":"Position of the task in the step.","example":8192},"hasDescription":{"type":"boolean","description":"Whether the task has a description.","example":true},"createdAt":{"type":"string","format":"date-time","description":"Creation date and time (UTC).","example":"2026-01-15T10:00:00.000000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Last update date and time (UTC).","example":"2026-01-15T10:00:00.000000Z"},"endedAt":{"type":["string","null"],"description":"Completion date and time (UTC), `Y-m-d H:i:s`.","example":"2026-01-20 12:00:00"},"startAt":{"type":["string","null"],"format":"date-time","description":"Start date and time (UTC).","example":"2026-01-16T09:00:00.000000Z"},"finishAt":{"type":["string","null"],"format":"date-time","description":"Due date and time (UTC).","example":"2026-01-18T18:00:00.000000Z"},"observers":{"type":["array","null"],"description":"IDs of observers.","items":{"type":"integer"},"example":[8001235]},"tags":{"type":"array","items":{"$ref":"#\/components\/schemas\/TaskTagRef"}},"subTasks":{"type":"array","description":"IDs of subtasks.","items":{"type":"integer"},"example":[77002]},"sourceType":{"oneOf":[{"$ref":"#\/components\/schemas\/SourceType"},{"type":"null"}]},"status":{"$ref":"#\/components\/schemas\/TaskStatus"},"attributeValues":{"type":"array","description":"Values of task attributes.","items":{"type":"object","properties":{"attributeableType":{"type":"string","example":"task"},"attributeableId":{"type":"integer","example":77001},"value":{"type":["string","null"],"example":"High"},"attributeId":{"type":"integer","example":3301}},"required":["attributeableType","attributeableId","value","attributeId"]}}},"required":["id","name","responsibleId","boardId","stepId","priority","order","hasDescription","createdAt","updatedAt","endedAt","startAt","finishAt","observers","tags","subTasks","sourceType","status","attributeValues"]},"Task":{"type":"object","properties":{"id":{"type":"integer","description":"Task ID.","example":77001},"name":{"type":"string","description":"Task name.","example":"Call the client"},"responsibleId":{"type":["integer","null"],"description":"ID of the responsible team member.","example":8001234},"parentId":{"type":["integer","null"],"description":"ID of the parent task.","example":null},"boardId":{"type":"integer","description":"Board ID.","example":2101},"stepId":{"type":"integer","description":"Board step ID.","example":6101},"priority":{"$ref":"#\/components\/schemas\/TaskPriority"},"sourceType":{"oneOf":[{"$ref":"#\/components\/schemas\/SourceType"},{"type":"null"}]},"order":{"type":"integer","description":"Position of the task in the step.","example":8192},"description":{"type":["string","null"],"description":"Task description. Present in \"Get a task by ID\" and \"Update a task\".","example":"Discuss the proposal"},"alert":{"type":"string","description":"Reminder before the due date; `0` \u2014 no reminder.","example":"1h"},"type":{"type":"integer","enum":[1,2],"description":"Task type: `1` \u2014 task, `2` \u2014 recurring task template.","example":1},"startAt":{"type":["string","null"],"format":"date-time","description":"Start date and time (UTC).","example":"2026-01-16T09:00:00.000000Z"},"finishAt":{"type":["string","null"],"format":"date-time","description":"Due date and time (UTC).","example":"2026-01-18T18:00:00.000000Z"},"repeat":{"type":"integer","enum":[0,1],"description":"`1` for a recurring task template, `0` otherwise.","example":0},"observers":{"type":["array","null"],"description":"IDs of observers.","items":{"type":"integer"},"example":[8001235]},"checklists":{"type":"object","properties":{"option":{"type":["string","null"],"description":"Checklist progress, `done\/all`.","example":"1\/3"},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/TaskChecklist"}}},"required":["option","data"]},"attachments":{"type":"array","items":{"$ref":"#\/components\/schemas\/Attachment"}},"attributes":{"type":"array","description":"Board task attributes with the task values. Present in \"Get a task by ID\" and \"Update a task\".","items":{"$ref":"#\/components\/schemas\/BoardAttributeWithValues"}},"repeatSetting":{"oneOf":[{"$ref":"#\/components\/schemas\/TaskRepeatSetting"},{"type":"null"}],"description":"Repeat settings. Present in \"Get a task by ID\" and \"Update a task\"."},"tags":{"type":"array","items":{"$ref":"#\/components\/schemas\/TaskTagRef"}},"deals":{"type":"array","description":"IDs of linked deals.","items":{"type":"integer"},"example":[950001]},"tasks":{"type":"array","description":"IDs of linked tasks.","items":{"type":"integer"},"example":[]},"subTasks":{"type":"array","description":"IDs of subtasks.","items":{"type":"integer"},"example":[77002]},"contacts":{"type":"array","description":"IDs of linked contacts.","items":{"type":"integer"},"example":[700101]},"createdAt":{"type":"string","format":"date-time","description":"Creation date and time (UTC).","example":"2026-01-15T10:00:00.000000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Last update date and time (UTC).","example":"2026-01-15T10:00:00.000000Z"},"endedAt":{"type":["string","null"],"description":"Completion date and time (UTC), `Y-m-d H:i:s`.","example":null},"createdDaysAt":{"type":"number","description":"Days since creation. Present in \"Get a task by ID\" and \"Update a task\".","example":3},"updatedDaysAt":{"type":"number","description":"Days since the last update. Present in \"Get a task by ID\" and \"Update a task\".","example":1},"status":{"$ref":"#\/components\/schemas\/TaskStatus"}},"required":["id","name","responsibleId","parentId","boardId","stepId","priority","sourceType","order","alert","type","startAt","finishAt","repeat","observers","checklists","attachments","tags","deals","tasks","subTasks","contacts","createdAt","updatedAt","endedAt","status"]},"TaskOrder":{"type":"object","properties":{"order":{"type":"integer","description":"New position of the task in the step.","example":3}},"required":["order"]},"TaskChecklist":{"type":"object","properties":{"id":{"type":"integer","description":"Checklist ID.","example":1201},"name":{"type":["string","null"],"description":"Checklist name.","example":"Preparation"},"taskId":{"type":"integer","description":"Task ID.","example":77001},"order":{"type":"integer","description":"Position of the checklist.","example":1},"isDone":{"type":"boolean","description":"Whether all items are done.","example":false},"items":{"type":"array","items":{"$ref":"#\/components\/schemas\/ChecklistItem"}}},"required":["id","name","taskId","order","isDone","items"]},"TaskChecklistShort":{"type":"object","properties":{"id":{"type":"integer","description":"Checklist ID.","example":1201},"name":{"type":["string","null"],"description":"Checklist name.","example":"Preparation"},"taskId":{"type":"integer","description":"Task ID.","example":77001},"order":{"type":"integer","description":"Position of the checklist.","example":1}},"required":["id","name","taskId","order"]},"ChecklistInput":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":250,"description":"Checklist name.","example":"Preparation"},"items":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":250,"description":"Item name.","example":"Prepare the offer"},"isDone":{"type":"integer","enum":[0,1],"description":"`1` \u2014 done, `0` \u2014 not done.","example":0},"responsibleId":{"type":["integer","null"],"description":"ID of the responsible team member.","example":null}},"required":["name"]}}}},"ChecklistUpdateInput":{"type":"object","properties":{"id":{"type":"integer","description":"Checklist ID.","example":1201},"name":{"type":["string","null"],"maxLength":250,"description":"Checklist name.","example":"Preparation"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","description":"Item ID.","example":2301},"name":{"type":"string","maxLength":250,"description":"Item name.","example":"Prepare the offer"},"isDone":{"type":"integer","enum":[0,1],"description":"`1` \u2014 done, `0` \u2014 not done.","example":1},"responsibleId":{"type":["integer","null"],"description":"ID of the responsible team member.","example":null}},"required":["id"]}}},"required":["id"]},"ChecklistItem":{"type":"object","properties":{"id":{"type":"integer","description":"Item ID.","example":2301},"responsibleId":{"type":["integer","null"],"description":"ID of the responsible team member.","example":null},"name":{"type":"string","description":"Item name.","example":"Prepare the offer"},"order":{"type":"integer","description":"Position of the item.","example":1},"isDone":{"type":"boolean","description":"Whether the item is done.","example":true}},"required":["id","responsibleId","name","order","isDone"]},"TaskRepeatSetting":{"type":"object","properties":{"id":{"type":"integer","example":51},"taskId":{"type":"integer","example":77001},"type":{"type":"integer","description":"Repeat type.","example":1},"startDate":{"type":"string","description":"Start date, `Y-m-d H:i`.","example":"2026-01-16 09:00"},"endSetting":{"type":["object","null"],"additionalProperties":true,"description":"End condition of the repetition.","example":null},"setting":{"type":["object","null"],"additionalProperties":true,"description":"Repetition settings.","example":null}},"required":["id","taskId","type","startDate","endSetting","setting"]},"BoardAttributeWithValues":{"type":"object","properties":{"id":{"type":"integer","example":3301},"name":{"type":"string","example":"Priority level"},"type":{"$ref":"#\/components\/schemas\/BoardAttributeType"},"mandatory":{"type":"boolean","example":false},"options":{"type":["array","null"],"items":{"type":["string","null"]},"example":["Low","High"]},"status":{"type":["integer","null"],"description":"Whether the field is shown in the task filter.","example":1},"order":{"type":"integer","example":1},"values":{"type":"array","description":"Values of the field on the task.","items":{"type":"object","properties":{"id":{"type":"integer","description":"Value ID (`valueId`).","example":7701},"value":{"type":["string","null"],"example":"High"}},"required":["id","value"]}}},"required":["id","name","type","mandatory","options","status","order","values"]},"TaskShortRef":{"type":"object","properties":{"id":{"type":"integer","example":77002},"name":{"type":"string","example":"Prepare documents"},"status":{"$ref":"#\/components\/schemas\/TaskStatus"},"responsibleId":{"type":["integer","null"],"example":8001234},"boardId":{"type":"integer","example":2101},"stepId":{"type":"integer","example":6101},"observers":{"type":["array","null"],"items":{"type":"integer"},"example":[]}},"required":["id","name","status","responsibleId","boardId","stepId","observers"]},"TaskConnections":{"type":"object","properties":{"tasks":{"type":"array","items":{"$ref":"#\/components\/schemas\/TaskShortRef"}},"deals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","example":950001},"name":{"type":"string","example":"Website redesign"},"responsibleId":{"type":["integer","null"],"example":8001234},"stepId":{"type":"integer","example":5301},"pipelineId":{"type":"integer","example":1201},"status":{"$ref":"#\/components\/schemas\/DealStatus"}},"required":["id","name","responsibleId","stepId","pipelineId","status"]}},"contacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","example":700101},"firstName":{"type":"string","example":"Anna"},"lastName":{"type":"string","example":"Smith"},"email":{"type":["string","null"],"example":"anna@example.com"},"phone":{"type":["string","null"],"example":"380501234567"}},"required":["id","firstName","lastName","email","phone"]}},"subTasks":{"type":"array","items":{"$ref":"#\/components\/schemas\/TaskShortRef"}}},"required":["tasks","deals","contacts","subTasks"]},"TaskConnectionsInput":{"type":"object","properties":{"dealIds":{"type":"array","description":"IDs of deals to link.","items":{"type":"integer"},"example":[950001]},"contactIds":{"type":"array","description":"IDs of contacts to link.","items":{"type":"integer"},"example":[700101]},"taskIds":{"type":"array","description":"IDs of tasks to link.","items":{"type":"integer"},"example":[77003]},"subTasksIds":{"type":"array","description":"IDs of tasks to make subtasks.","items":{"type":"integer"},"example":[77002]}}},"TaskAttributeValueRecord":{"type":"object","description":"Saved task attribute value (raw record).","properties":{"id":{"type":"integer","example":7701},"attributeable_type":{"type":"string","example":"task"},"attributeable_id":{"type":"integer","example":77001},"attribute_id":{"type":"integer","example":3301},"value":{"type":["string","null"],"example":"High"},"user_id":{"type":"integer","example":8001234}},"required":["id","attributeable_type","attributeable_id","attribute_id","value","user_id"]},"TaskHistoryEvent":{"type":"object","properties":{"id":{"type":"integer","example":66001},"userId":{"type":["integer","null"],"description":"ID of the team member who made the change.","example":8001234},"taskId":{"type":"integer","example":77001},"eventType":{"type":"string","description":"Event type, e.g. `task_field_updated`, `task_tag_field_added`, `task_tag_field_deleted`, `task_attribute_field_added`, `task_attribute_field_updated`, `task_attribute_field_deleted`, `task_checklist_field_added`, `task_checklist_items_field_updated`.","example":"task_field_updated"},"eventData":{"type":"object","additionalProperties":true,"description":"Event details; the set of keys depends on `eventType`. Note: an empty set is serialized as an empty array `[]`.","example":{"updatingField":{"name":"Call the client"}}},"eventTime":{"type":"string","format":"date-time","description":"Event date and time (UTC).","example":"2026-01-15T10:00:00.000000Z"}},"required":["id","userId","taskId","eventType","eventData","eventTime"]},"TaskSearchRequest":{"type":"object","properties":{"boardId":{"type":"integer","description":"Board ID.","example":2101},"limit":{"type":"number","maximum":50,"default":10,"description":"Number of tasks to return.","example":10},"offset":{"type":"number","minimum":0,"default":0,"description":"Number of tasks to skip.","example":0},"name":{"type":"string","maxLength":200,"description":"Part of the task name.","example":"client"},"stepId":{"type":"array","items":{"type":"integer"},"description":"Board step IDs.","example":[6101]},"parentId":{"type":"array","items":{"type":"integer"},"description":"Parent task IDs.","example":[77000]},"responsibleId":{"type":"array","minItems":1,"items":{"type":"integer"},"description":"IDs of responsible team members.","example":[8001234]},"observers":{"type":"array","items":{"type":"integer"},"description":"IDs of observers.","example":[8001235]},"priority":{"type":"array","items":{"$ref":"#\/components\/schemas\/TaskPriority"},"description":"Priorities."},"type":{"type":"integer","enum":[1,2],"description":"`1` \u2014 tasks, `2` \u2014 recurring task templates.","example":1},"status":{"type":["integer","null"],"enum":[1,2,null],"description":"`1` \u2014 active, `2` \u2014 completed.","example":1},"tags":{"type":"array","items":{"type":"integer"},"description":"Tag IDs.","example":[301]},"tagMatch":{"type":["string","null"],"enum":["all","any",null],"description":"`any` \u2014 a task has at least one of `tags`; `all` \u2014 all of them.","example":"any"},"dealName":{"type":"string","description":"Part of the name of a linked deal.","example":"redesign"},"contacts":{"type":"string","description":"Part of the name, phone or email of a linked contact.","example":"anna"},"startAtFrom":{"type":"string","description":"Start date from.","example":"2026-01-01"},"startAtTo":{"type":"string","description":"Start date to.","example":"2026-01-31"},"finishAtFrom":{"type":"string","description":"Due date from.","example":"2026-01-01"},"finishAtTo":{"type":"string","description":"Due date to.","example":"2026-01-31"},"createdAtFrom":{"type":"string","description":"Creation date from.","example":"2026-01-01"},"createdAtTo":{"type":"string","description":"Creation date to.","example":"2026-01-31"},"updatedAtFrom":{"type":"string","description":"Update date from.","example":"2026-01-01"},"updatedAtTo":{"type":"string","description":"Update date to.","example":"2026-01-31"},"endedAtFrom":{"type":"string","description":"Completion date from.","example":"2026-01-01"},"endedAtTo":{"type":"string","description":"Completion date to.","example":"2026-01-31"},"from":{"type":"string","format":"date","description":"Due date on or after this date.","example":"2026-01-01"},"to":{"type":"string","format":"date","description":"Due date on or before this date.","example":"2026-01-31"},"startOrEndRange":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string"},"description":"Tasks whose start or due date is within the range `[from, to]`.","example":["2026-01-01","2026-01-31"]},"attributes":{"type":"array","description":"Conditions on task attribute values. A task matches if it matches any of the conditions.","items":{"type":"object","properties":{"id":{"type":"integer","description":"Task attribute ID.","example":3301},"expression":{"type":["string","null"],"enum":["eq","neq","gt","gte","lt","lte","like","in","between","empty","notEmpty",null],"description":"Comparison operator. `empty` \/ `notEmpty` \u2014 the attribute has no value \/ has a value; `between` \u2014 numeric value in the `from`\u2013`to` range (inclusive); `gt`\/`gte`\/`lt`\/`lte` compare numerically. Without `expression` the value is matched by the attribute `type`.","example":"gte"},"type":{"$ref":"#\/components\/schemas\/BoardAttributeType"},"value":{"type":["string","number","array"],"maxLength":255,"items":{"type":"string"},"description":"Value to match. With `expression` \u2014 a string, required for all operators except `between`, `empty` and `notEmpty` (must be omitted for `empty` and `notEmpty`). Without `expression` \u2014 an array of options for `multiList`, a date range `[from, to]` for `date`.","example":"High"},"from":{"type":"number","description":"Lower bound for `between` (required with it).","example":10},"to":{"type":"number","description":"Upper bound for `between` (required with it, not less than `from`).","example":100}},"required":["id"]}},"sort":{"type":"object","description":"Sorting.","properties":{"field":{"type":"string","enum":["boardName","name","priority","startAt","stepName","createdAt","order","endedAt","taskId"],"description":"Field to sort by.","example":"createdAt"},"direction":{"type":"string","enum":["asc","desc"],"description":"Sort direction.","example":"desc"}}}},"required":["boardId"]},"CreateTaskRequest":{"type":"object","properties":{"boardId":{"type":"integer","description":"ID of an active board.","example":2101},"stepId":{"type":"integer","description":"ID of an active step of the board.","example":6101},"priority":{"$ref":"#\/components\/schemas\/TaskPriority"},"name":{"type":["string","null"],"maxLength":250,"description":"Task name. Default \u2014 `#` followed by the task number.","example":"Call the client"},"description":{"type":["string","null"],"description":"Task description.","example":"Discuss the proposal"},"responsibleId":{"type":"integer","description":"ID of the responsible team member.","example":8001234},"observers":{"type":"array","items":{"type":"integer"},"description":"IDs of observers.","example":[8001235]},"parentId":{"type":["integer","null"],"description":"ID of an active parent task.","example":null},"startAt":{"type":["string","null"],"description":"Start date and time.","example":"2026-01-16 09:00"},"finishAt":{"type":["string","null"],"description":"Due date and time.","example":"2026-01-18 18:00"},"alert":{"type":["string","null"],"enum":["0","0d","15min","30min","1h","2h","3h","6h","12h","24h","1d","2d","3d","4d","5d","6d","7d",null],"description":"Reminder before the due date.","example":"1h"},"tags":{"type":"array","items":{"type":"integer"},"description":"Tag IDs.","example":[301]},"attributes":{"type":"array","description":"Values of board task attributes.","items":{"type":"object","properties":{"attributeId":{"type":"integer","example":3301},"value":{"type":"string","example":"High"}},"required":["attributeId","value"]}},"checklists":{"type":"array","description":"Checklists to create.","items":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":250,"example":"Preparation"},"items":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":250,"example":"Prepare the offer"},"isDone":{"type":"integer","enum":[0,1],"example":0},"responsibleId":{"type":["integer","null"],"example":null}}}}}}},"connections":{"$ref":"#\/components\/schemas\/TaskConnectionsInput"},"attachments":{"type":"array","description":"Paths of files uploaded to the file manager to attach to the task.","items":{"type":"string","maxLength":255},"example":["\/personal\/task\/brief.pdf"]},"originalTaskId":{"type":["integer","null"],"description":"ID of the task this task is copied from.","example":null}},"required":["boardId","stepId","priority"]},"UpdateTaskRequest":{"type":"object","properties":{"boardId":{"type":"integer","description":"ID of an active board.","example":2101},"stepId":{"type":"integer","description":"ID of an active step of the board.","example":6102},"priority":{"$ref":"#\/components\/schemas\/TaskPriority"},"name":{"type":["string","null"],"maxLength":250,"description":"Task name.","example":"Call the client"},"description":{"type":["string","null"],"description":"Task description.","example":"Discuss the proposal"},"responsibleId":{"type":"integer","description":"ID of the responsible team member.","example":8001234},"observers":{"type":"array","items":{"type":"integer"},"description":"IDs of observers.","example":[8001235]},"parentId":{"type":["integer","null"],"description":"ID of the parent task.","example":null},"startAt":{"type":["string","null"],"description":"Start date and time.","example":"2026-01-16 09:00"},"finishAt":{"type":["string","null"],"description":"Due date and time.","example":"2026-01-18 18:00"},"alert":{"type":["string","null"],"enum":["0","0d","15min","30min","1h","2h","3h","6h","12h","24h","1d","2d","3d","4d","5d","6d","7d",null],"description":"Reminder before the due date.","example":"1h"},"tags":{"type":"array","items":{"type":"integer"},"description":"Tag IDs.","example":[301]}},"required":["boardId","stepId"]},"DealHistoryEvent":{"type":"object","properties":{"id":{"type":"integer","description":"Event ID.","example":880001},"userId":{"type":["integer","null"],"description":"ID of the team member who made the change; `null` for system events.","example":8001234},"dealId":{"type":"integer","description":"Deal ID.","example":950001},"eventType":{"type":"string","description":"Event type, e.g. `deal_created`, `deal_step_changed`, `deal_price_changed`, `deal_responsible_changed`, `deal_succeed`, `deal_failed`, `deal_returned_to_active`, `deal_contact_added`, `deal_contact_deleted`, `deal_task_attach`, `deal_task_detach`, `change_pipeline`, `call_ended`, `order_received`, `manually_create_payment`, `manually_approved_payment`, `manually_canceled_payment`, `payment_auto_failed`, `deal_merged`, `deal_joined`.","example":"deal_step_changed"},"eventData":{"type":"object","additionalProperties":true,"description":"Event details; the set of keys depends on `eventType`. Note: an empty set is serialized by the backend as an empty array `[]`.","example":{"oldStep":{"id":5301,"name":"Qualification"},"newStep":{"id":5302,"name":"Negotiation"},"sourceType":{"id":8,"name":"public_api"}}},"eventTime":{"type":"string","format":"date-time","description":"Event date and time (UTC).","example":"2026-01-15T10:00:00.000000Z"},"currentData":{"type":["object","null"],"description":"Current data of the related contact for `deal_contact_added` and `deal_contact_deleted` events; `null` for other events.","properties":{"contactFirstName":{"type":"string","example":"Anna"},"contactLastName":{"type":"string","example":"Smith"}}}},"required":["id","userId","dealId","eventType","eventData","eventTime","currentData"]},"SetDealExpirationRequest":{"type":"object","properties":{"date":{"type":"string","description":"Expiration date and time (UTC), e.g. `2026-02-01 15:00:00` or `2026-02-01T15:00:00Z`.","example":"2026-02-01 15:00:00"},"notifyIn":{"type":["string","null"],"enum":["0","15min","30min","1h","2h","3h","6h","12h","24h","2d","3d","4d","5d","6d","7d",null],"description":"When to notify the responsible user before the deal expires; `0` or `null` \u2014 no notification.","example":"1h"},"dealAction":{"type":["integer","null"],"enum":[1,2,null],"description":"`2` (default) \u2014 report a changed expiration date as a deal update (deal updated event); `1` \u2014 do not.","example":2}},"required":["date"]},"MessengerType":{"type":"object","properties":{"id":{"$ref":"#\/components\/schemas\/MessengerTypeProperty"},"name":{"type":"string","description":"Messenger type name.","example":"telegram"}},"required":["id","name"]},"OrderStatus":{"type":"integer","description":"Payment status:\n* 100 \u2014 processing\n* 101 \u2014 pending_payment\n* 102 \u2014 pending\n* 103 \u2014 pending_review\n* 104 \u2014 on_hold\n* 200 \u2014 complete\n* 201 \u2014 closed\n* 300 \u2014 canceled\n* 301 \u2014 refunded\n* 302 \u2014 reversed\n* 303 \u2014 denied\n* 304 \u2014 not_paid\n* 305 \u2014 refunded_partial\n* 400 \u2014 incomplete\n* 500 \u2014 error\n* 501 \u2014 fraud\n* 600 \u2014 manually_approved\n* 610 \u2014 manually_created\n* 620 \u2014 manually_canceled\n","enum":[100,101,102,103,104,200,201,300,301,302,303,304,305,400,500,501,600,610,620],"example":200},"PaymentMethodName":{"type":"string","description":"Payment method.","enum":["YooMoney","PayPal","Fondy","YooKassa","ROBOKASSA","Stripe","MERCADOPAGO","LiqPay","Wayforpay","Flutterwave","Monobank","Cryptomus","Whitepay","TELEGRAM","Klarna","StripeConnect","RozetkaPay","Novapay","ManualPayment"],"example":"Stripe"},"PaymentPrice":{"type":"object","properties":{"amount":{"type":"number","description":"Amount in major currency units.","example":49.99},"currency":{"type":"string","description":"Currency code.","example":"USD"}},"required":["amount","currency"]},"PaymentListItem":{"type":"object","properties":{"id":{"type":"integer","description":"Payment ID.","example":300501},"orderId":{"type":["string","null"],"description":"Order ID.","example":"ord_8f2a1c"},"userId":{"type":"integer","description":"Account owner ID.","example":8001234},"contactId":{"type":["integer","null"],"description":"Contact ID.","example":700101},"dealId":{"type":["integer","null"],"description":"Deal ID.","example":950001},"dealName":{"type":["string","null"],"description":"Deal name.","example":"Website redesign"},"dealResponsibleId":{"type":["integer","null"],"description":"ID of the team member responsible for the deal.","example":8001234},"dealPipelineId":{"type":["integer","null"],"description":"Deal pipeline ID.","example":1201},"dealStepId":{"type":["integer","null"],"description":"Deal step ID.","example":5301},"dealStatus":{"type":["integer","null"],"description":"Deal status (1 \u2014 active, 2 \u2014 lost, 3 \u2014 won).","example":1},"status":{"$ref":"#\/components\/schemas\/OrderStatus"},"firstName":{"type":["string","null"],"description":"Contact first name.","example":"Anna"},"lastName":{"type":["string","null"],"description":"Contact last name.","example":"Smith"},"price":{"$ref":"#\/components\/schemas\/PaymentPrice"},"description":{"type":["string","null"],"description":"Payment description.","example":"Logo design"},"merchantName":{"type":["string","null"],"description":"Merchant name.","example":"My Shop"},"paymentMethod":{"oneOf":[{"$ref":"#\/components\/schemas\/PaymentMethodName"},{"type":"null"}]},"promoCode":{"type":["string","null"],"description":"Applied promo code.","example":"SPRING10"},"promoCodeDiscount":{"type":["integer","null"],"description":"Promo code discount value.","example":10},"promoCodeType":{"type":["string","null"],"description":"Promo code discount type.","example":"percentage"},"createdAt":{"type":"string","format":"date-time","description":"Creation date and time (UTC).","example":"2026-01-15T10:00:00.000000Z"},"additionalData":{"type":["object","null"],"additionalProperties":true,"description":"Additional payment data; the set of keys depends on the payment source.","example":null}},"required":["id","orderId","userId","contactId","dealId","dealName","dealResponsibleId","dealPipelineId","dealStepId","dealStatus","status","firstName","lastName","price","description","merchantName","paymentMethod","promoCode","promoCodeDiscount","promoCodeType","createdAt","additionalData"]},"Payment":{"type":"object","properties":{"id":{"type":"integer","description":"Payment ID.","example":300501},"name":{"type":["string","null"],"description":"Deal name.","example":"Website redesign"},"price":{"$ref":"#\/components\/schemas\/PaymentPrice"},"status":{"$ref":"#\/components\/schemas\/OrderStatus"},"paymentMethod":{"oneOf":[{"$ref":"#\/components\/schemas\/PaymentMethodName"},{"type":"null"}]},"merchantUuid":{"type":["string","null"],"description":"Merchant ID.","example":"c5d1e0a2"},"merchantName":{"type":["string","null"],"description":"Merchant name.","example":"My Shop"},"paymentDescription":{"type":["string","null"],"description":"Payment description.","example":"Logo design"},"orderId":{"type":["string","null"],"description":"Order ID.","example":"ord_8f2a1c"},"createdAt":{"type":"string","format":"date-time","description":"Creation date and time (UTC).","example":"2026-01-15T10:00:00.000000Z"},"promoCode":{"type":["string","null"],"description":"Applied promo code.","example":"SPRING10"},"promoCodeDiscount":{"type":["number","null"],"description":"Promo code discount value.","example":10},"promoCodeType":{"type":["string","null"],"description":"Promo code discount type.","example":"percentage"},"additionalData":{"type":["object","null"],"additionalProperties":true,"description":"Additional payment data; the set of keys depends on the payment source.","example":null},"originalService":{"type":["string","null"],"enum":["messenger","telegram","whats_app","instagram","viber","liveChat","landing","education","emailService","crm","marketplace","popup",null],"description":"Service the payment came from.","example":"crm"},"items":{"type":"array","description":"Payment items.","items":{"$ref":"#\/components\/schemas\/PaymentItem"}},"contactId":{"type":["integer","null"],"description":"Contact ID.","example":700101},"dealId":{"type":["integer","null"],"description":"Deal ID.","example":950001},"userId":{"type":"integer","description":"Account owner ID.","example":8001234}},"required":["id","name","price","status","paymentMethod","merchantUuid","merchantName","paymentDescription","orderId","createdAt","promoCode","promoCodeDiscount","promoCodeType","additionalData","originalService","items","contactId","dealId","userId"]},"PaymentItem":{"type":"object","properties":{"id":{"type":"integer","description":"Item ID.","example":1},"paymentId":{"type":"integer","description":"Payment ID.","example":300501},"name":{"type":["string","null"],"description":"Item name.","example":"Logo"},"type":{"type":"integer","enum":[1,2,3],"description":"Item type: `1` \u2014 product, `2` \u2014 CRM product, `3` \u2014 delivery.","example":2},"productId":{"type":["integer","null"],"description":"Product ID.","example":2201},"quantity":{"type":["integer","null"],"description":"Quantity.","example":1},"amount":{"type":["number","null"],"description":"Item amount.","example":49.99},"balanceType":{"type":["integer","null"],"description":"Balance type of the product.","example":1},"internalProductType":{"type":["integer","null"],"description":"Product type.","example":1}},"required":["id","paymentId","name","type","productId","quantity","amount","balanceType","internalProductType"]},"PaymentList":{"type":"object","properties":{"list":{"type":"array","items":{"$ref":"#\/components\/schemas\/Payment"}},"total":{"type":"integer","description":"Number of payments.","example":3}},"required":["list","total"]},"CreateManualPaymentRequest":{"type":"object","properties":{"contactId":{"type":"integer","description":"Contact ID.","example":700101},"dealId":{"type":"integer","description":"ID of a deal linked to the contact.","example":950001},"description":{"type":"string","maxLength":255,"description":"Payment description.","example":"Cash payment"},"price":{"type":"number","minimum":0.1,"maximum":99999999999999,"description":"Amount in major currency units.","example":49.99},"currency":{"type":"string","description":"Currency code.","example":"USD"}},"required":["contactId","description","price","currency"]},"GeneratePaymentLinkRequest":{"type":"object","properties":{"paymentCategory":{"type":"integer","enum":[1,2,3],"description":"Payment category: `1` \u2014 education course, `2` \u2014 personal payment, `3` \u2014 subscription.","example":2},"paymentType":{"$ref":"#\/components\/schemas\/PaymentMethodName"},"paymentId":{"type":"string","description":"Payment method ID from \"Get payment methods\".","example":"1543"},"paymentName":{"type":["string","null"],"maxLength":50,"description":"Payment name shown to the payer.","example":"Logo design"},"contactId":{"type":"integer","description":"ID of an active contact.","example":700101},"dealId":{"type":["integer","null"],"description":"ID of an active deal to link the payment to.","example":950001},"pipelineId":{"type":"integer","description":"Pipeline in which the deal is created or updated after payment.","example":1201},"stepId":{"type":"integer","description":"Active step of the pipeline.","example":5301},"price":{"type":"number","minimum":0.1,"maximum":99999999999999,"description":"Amount in major currency units.","example":49.99},"currency":{"type":"string","description":"Currency code.","example":"USD"},"description":{"type":"string","maxLength":255,"description":"Payment description.","example":"Logo design"},"untilDate":{"type":"string","format":"date","description":"Date until which the link is valid.","example":"2026-02-01"},"email":{"type":["string","null"],"format":"email","minLength":1,"maxLength":128,"description":"Payer email. Required for category `1`.","example":"anna@example.com"},"courseId":{"type":["integer","null"],"description":"Education course ID (category `1`).","example":501},"courseTariffId":{"type":["integer","null"],"description":"Course tariff ID. Required for category `1`.","example":9001},"productId":{"type":["integer","null"],"description":"ID of an active subscription product. Required for category `3`.","example":2201},"withDelivery":{"type":["boolean","null"],"description":"Whether to request delivery details from the payer.","example":false},"rro":{"type":["string","null"],"maxLength":256,"description":"Fiscal receipt (RRO) data for Monobank and LiqPay.","example":null}},"required":["paymentCategory","paymentType","paymentId","contactId","pipelineId","stepId","price","currency","description","untilDate"]},"PaymentLink":{"type":"object","properties":{"link":{"type":"string","description":"Payment link URL.","example":"https:\/\/pay.sendpulse.com\/abc123"}},"required":["link"]},"UserPaymentMethod":{"type":"object","properties":{"paymentId":{"type":"integer","description":"Payment method ID; pass it as `paymentId` when generating a payment link.","example":1543},"paymentType":{"oneOf":[{"$ref":"#\/components\/schemas\/PaymentMethodName"},{"type":"null"}]},"paymentMethodType":{"type":["integer","null"],"description":"Numeric payment method type.","example":6},"currency":{"type":"string","description":"Currency code.","example":"USD"},"name":{"type":"string","description":"Payment method name.","example":"Stripe EU"},"merchantId":{"type":["string","null"],"description":"Merchant ID.","example":"acct_1Hh1"},"status":{"type":"string","description":"Payment method status.","example":"active"}},"required":["paymentId","paymentType","paymentMethodType","currency","name","merchantId","status"]},"Contact":{"type":"object","properties":{"id":{"type":"integer","description":"Contact ID.","example":700101},"userId":{"type":"integer","description":"Account owner ID.","example":8001234},"responsibleId":{"type":"integer","description":"ID of the responsible team member.","example":8001234},"firstName":{"type":"string","description":"First name; empty string if not set.","example":"Anna"},"lastName":{"type":"string","description":"Last name; empty string if not set.","example":"Smith"},"tags":{"type":"array","items":{"$ref":"#\/components\/schemas\/Tag"}},"phones":{"type":"array","items":{"$ref":"#\/components\/schemas\/ContactPhone"}},"emails":{"type":"array","items":{"$ref":"#\/components\/schemas\/ContactEmail"}},"messengers":{"type":"array","items":{"$ref":"#\/components\/schemas\/ContactMessenger"}},"attributes":{"type":"array","description":"Attribute values of the contact.","items":{"$ref":"#\/components\/schemas\/EntityAttributeItem"}},"contactSource":{"type":"array","description":"Sources the contact came from.","items":{"$ref":"#\/components\/schemas\/ContactSource"}},"dealsQty":{"type":"integer","description":"Number of deals of the contact. Filled in \"Get a contact by ID\"; `0` in other responses.","example":2},"createdAt":{"type":"string","format":"date-time","description":"Creation date and time (UTC).","example":"2026-01-15T10:00:00.000000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Last update date and time (UTC).","example":"2026-01-16T08:30:00.000000Z"},"integration":{"oneOf":[{"$ref":"#\/components\/schemas\/IntegrationInfo"},{"type":"null"}],"description":"CRM integration the contact was created by. Filled in \"Get a contact by ID\"."},"contactPopupSettings":{"type":"array","description":"Data collected by a popup for contacts created from a popup.","items":{"$ref":"#\/components\/schemas\/ContactPopupData"}},"attachments":{"type":"array","description":"Attached files. Filled in \"Get a contact by ID\".","items":{"$ref":"#\/components\/schemas\/Attachment"}},"tasks":{"type":"array","description":"IDs of linked tasks. Filled in \"Get a contact by ID\".","items":{"type":"integer"},"example":[77001]},"nps":{"type":"array","description":"NPS responses of the contact.","items":{"$ref":"#\/components\/schemas\/ContactNps"}},"location":{"type":["array","null"],"description":"Locations detected for the contact.","items":{"$ref":"#\/components\/schemas\/ContactLocation"}},"companies":{"type":["array","null"],"description":"Companies the contact belongs to.","items":{"$ref":"#\/components\/schemas\/CompanyShortRef"}}},"required":["id","userId","responsibleId","firstName","lastName","tags","phones","emails","messengers","attributes","contactSource","dealsQty","createdAt","updatedAt","integration","contactPopupSettings","attachments","tasks","nps","location","companies"]},"ContactSearchResult":{"type":"object","properties":{"list":{"type":"array","items":{"$ref":"#\/components\/schemas\/Contact"}},"total":{"type":"integer","description":"Total number of contacts that match the filters.","example":25},"searchRequest":{"type":["string","null"],"description":"Base64-encoded JSON of the applied search parameters.","example":"eyJsaW1pdCI6MTB9"}},"required":["list","total","searchRequest"]},"Tag":{"type":"object","properties":{"id":{"type":"integer","description":"Tag ID.","example":301},"name":{"type":"string","description":"Tag name.","example":"VIP"},"colorBackground":{"type":["string","null"],"description":"Background color.","example":"#FFE8CC"},"colorText":{"type":["string","null"],"description":"Text color.","example":"#7A4100"},"contactCount":{"type":"integer","description":"Number of contacts with the tag.","example":12},"taskCount":{"type":"integer","description":"Number of tasks with the tag.","example":3}},"required":["id","name","colorBackground","colorText","contactCount","taskCount"]},"ContactPhone":{"type":"object","properties":{"id":{"type":"integer","description":"Phone ID.","example":81001},"phone":{"type":"string","description":"Phone number (digits only).","example":"380501234567"},"isMain":{"type":"boolean","description":"Whether this is the main phone of the contact.","example":true}},"required":["id","phone","isMain"]},"ContactEmail":{"type":"object","properties":{"id":{"type":"integer","description":"Email ID.","example":82001},"email":{"type":"string","description":"Email address.","example":"anna@example.com"},"isMain":{"type":"boolean","description":"Whether this is the main email of the contact.","example":true}},"required":["id","email","isMain"]},"ContactMessenger":{"type":"object","properties":{"id":{"type":"integer","description":"Messenger ID.","example":83001},"typeId":{"$ref":"#\/components\/schemas\/MessengerTypeProperty"},"login":{"type":["string","null"],"description":"Messenger login.","example":"anna_smith"},"botId":{"type":["string","null"],"description":"Chatbot ID in SendPulse.","example":"6123abc"},"contactId":{"type":["string","null"],"description":"Contact ID in the SendPulse chatbot.","example":"6456def"},"chatbotUrl":{"type":["string","null"],"description":"Link to the conversation in SendPulse chatbots.","example":"https:\/\/login.sendpulse.com\/messengers\/chats\/6123abc\/6456def"},"isMainChatbot":{"type":"boolean","description":"Whether this is the main chatbot of the contact.","example":false}},"required":["id","typeId","login","botId","contactId","chatbotUrl","isMainChatbot"]},"EntityAttributeItem":{"type":"object","description":"Custom field with its value, as embedded in a contact or company.","properties":{"id":{"type":"integer","description":"Attribute ID.","example":3101},"name":{"type":"string","description":"Attribute name.","example":"Birthday"},"status":{"$ref":"#\/components\/schemas\/EntityAttributeStatus"},"order":{"type":"integer","description":"Position of the attribute in the field list.","example":2},"options":{"type":["array","null"],"description":"Options of `select` and `multiSelect` attributes.","items":{"type":["string","null"]},"example":null},"type":{"$ref":"#\/components\/schemas\/EntityAttributeFieldType"},"mandatory":{"type":"boolean","description":"Whether the field is mandatory.","example":false},"default":{"type":"boolean","description":"Whether this is a system (default) attribute.","example":false},"value":{"$ref":"#\/components\/schemas\/EntityAttributeValue"}},"required":["id","name","status","order","options","type","mandatory","default"]},"ContactSource":{"type":"object","properties":{"sourceType":{"$ref":"#\/components\/schemas\/SourceType"},"externalContactId":{"type":["string","null"],"description":"Contact ID in the source.","example":"ext-1001"}},"required":["sourceType","externalContactId"]},"ContactPopupData":{"type":"object","description":"Popup data of the contact (raw record).","properties":{"id":{"type":"integer","example":9001},"contact_id":{"type":"integer","example":700101},"user_id":{"type":"integer","example":8001234},"widget_id":{"type":["string","null"],"example":"w-123"},"popup_id":{"type":["string","null"],"example":"p-456"},"type":{"type":"integer","example":1},"client_id":{"type":["string","null"],"example":"c-789"},"avatar":{"type":["string","null"],"example":null},"city":{"type":["string","null"],"example":"Kyiv"},"gender":{"type":["integer","null"],"example":null},"popups_were_closed":{"type":"object","additionalProperties":true,"description":"Popups closed by the visitor. Note: an empty set is serialized as an empty array `[]`.","example":[]},"created_at":{"type":"string","format":"date-time","example":"2026-01-15T10:00:00.000000Z"},"updated_at":{"type":"string","format":"date-time","example":"2026-01-15T10:00:00.000000Z"}}},"ContactNps":{"type":"object","properties":{"id":{"type":"integer","example":501},"contactId":{"type":"integer","example":700101},"externalId":{"type":"string","description":"Response ID in the source.","example":"nps-1"},"externalParentId":{"type":["string","null"],"description":"Survey ID in the source.","example":"survey-1"},"sourceType":{"type":"integer","description":"Source type ID.","example":1},"value":{"type":"string","description":"NPS score.","example":"9"},"comment":{"type":["string","null"],"example":"Great service"},"label":{"type":["string","null"],"example":"promoter"},"createdAt":{"type":"string","format":"date-time","example":"2026-01-15T10:00:00.000000Z"},"updatedAt":{"type":"string","format":"date-time","example":"2026-01-15T10:00:00.000000Z"}},"required":["id","contactId","externalId","externalParentId","sourceType","value","comment","label","createdAt","updatedAt"]},"ContactLocation":{"type":"object","properties":{"organization":{"type":["string","null"],"example":"Kyivstar"},"region":{"type":["string","null"],"example":"Kyiv City"},"asn":{"type":["string","null"],"example":"AS15895"},"ip":{"type":["string","null"],"example":"93.72.1.1"},"timezone":{"type":["string","null"],"example":"Europe\/Kyiv"},"longitude":{"type":["string","null"],"example":"30.5234"},"latitude":{"type":["string","null"],"example":"50.4501"},"postalCode":{"type":["string","null"],"example":"01001"},"continentCode":{"type":["string","null"],"example":"EU"},"country":{"type":["string","null"],"example":"Ukraine"},"regionCode":{"type":["string","null"],"example":"30"},"countryCode":{"type":["string","null"],"example":"UA"},"city":{"type":["string","null"],"example":"Kyiv"},"googleMapsUrl":{"type":["string","null"],"example":"https:\/\/maps.google.com\/?q=50.4501,30.5234"}}},"CompanyShortRef":{"type":"object","properties":{"id":{"type":"integer","description":"Company ID.","example":4401},"name":{"type":"string","description":"Company name.","example":"Acme Inc."}},"required":["id","name"]},"CreateContactRequest":{"type":"object","description":"`firstName` or `lastName` is required.","properties":{"firstName":{"type":["string","null"],"maxLength":128,"description":"First name.","example":"Anna"},"lastName":{"type":["string","null"],"maxLength":128,"description":"Last name.","example":"Smith"},"responsibleId":{"type":["integer","null"],"minimum":1,"description":"ID of the responsible team member. It can be obtained with the \"Get a list of team members\" method.","example":8001234},"externalContactId":{"type":["string","null"],"description":"Contact ID in your system.","example":"ext-1001"}}},"CreateContactWithDetailsRequest":{"type":"object","description":"`firstName` or `lastName` is required.","properties":{"firstName":{"type":["string","null"],"maxLength":128,"description":"First name.","example":"Anna"},"lastName":{"type":["string","null"],"maxLength":128,"description":"Last name.","example":"Smith"},"responsibleId":{"type":["integer","null"],"minimum":0,"description":"ID of the responsible team member; `0` or not passed \u2014 the default responsible user from the CRM settings.","example":8001234},"externalContactId":{"type":["string","null"],"description":"Contact ID in your system; must be unique in the account.","example":"ext-1001"},"phones":{"type":["array","null"],"description":"Phone numbers (1\u201350 digits); the first one becomes the main phone.","items":{"type":["string","integer"]},"example":["+380501234567"]},"emails":{"type":["array","null"],"description":"Email addresses; the first one becomes the main email.","items":{"type":"string","format":"email","maxLength":128},"example":["anna@example.com"]},"tags":{"type":["array","null"],"description":"Tag IDs.","items":{"type":"integer"},"example":[301]},"messengers":{"type":["array","null"],"description":"Messengers of the contact.","items":{"type":"object","properties":{"typeId":{"$ref":"#\/components\/schemas\/MessengerTypeProperty"},"login":{"type":["string","null"],"maxLength":255,"description":"Messenger login.","example":"anna_smith"},"botId":{"type":["string","null"],"maxLength":255,"description":"Chatbot ID in SendPulse.","example":"6123abc"},"contactId":{"type":["string","null"],"maxLength":255,"description":"Contact ID in the SendPulse chatbot.","example":"6456def"}},"required":["typeId"]}},"attributes":{"type":["array","null"],"description":"Attribute values. Pass `attributeId` of an existing contact attribute, or `name` and `type` to use the attribute with this name and type or create it.","items":{"type":"object","properties":{"attributeId":{"type":"integer","description":"Contact attribute ID.","example":3101},"name":{"type":"string","maxLength":255,"description":"Attribute name. Required if `attributeId` is not passed.","example":"Birthday"},"type":{"allOf":[{"$ref":"#\/components\/schemas\/EntityAttributeFieldType"}],"description":"Attribute field type. Required if `attributeId` is not passed."},"value":{"type":"string","maxLength":5500,"description":"Attribute value (see `SetAttributeValueRequest` for formats).","example":"1990-05-01 00:00:00"}},"required":["value"]}}}},"UpdateContactRequest":{"type":"object","description":"`firstName` or `lastName` is required.","properties":{"firstName":{"type":["string","null"],"maxLength":128,"description":"First name.","example":"Anna"},"lastName":{"type":["string","null"],"maxLength":128,"description":"Last name.","example":"Smith"},"responsibleId":{"type":["integer","null"],"minimum":0,"description":"ID of the responsible team member; `0` or not passed \u2014 keep the current one.","example":8001234}}},"SaveContactMessengerRequest":{"type":"object","properties":{"typeId":{"$ref":"#\/components\/schemas\/MessengerTypeProperty"},"login":{"type":"string","maxLength":255,"description":"Messenger login.","example":"anna_smith"},"botId":{"type":["string","null"],"maxLength":255,"description":"Chatbot ID in SendPulse.","example":"6123abc"},"contactId":{"type":["string","null"],"maxLength":255,"description":"Contact ID in the SendPulse chatbot.","example":"6456def"},"isMainChatbot":{"type":["boolean","null"],"description":"Whether this is the main chatbot of the contact. Default `false`.","example":false}},"required":["typeId","login"]},"CreateTagRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"description":"Tag name, unique among active tags of the account.","example":"VIP"},"colorBackground":{"type":["string","null"],"maxLength":8,"description":"Background color; default color if not passed.","example":"#FFE8CC"},"colorText":{"type":["string","null"],"maxLength":8,"description":"Text color; default color if not passed.","example":"#7A4100"}},"required":["name"]},"UpdateTagRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"description":"Tag name, unique among active tags of the account.","example":"VIP"},"colorBackground":{"type":["string","null"],"maxLength":8,"description":"Background color.","example":"#FFE8CC"},"colorText":{"type":["string","null"],"maxLength":8,"description":"Text color.","example":"#7A4100"}}},"EduPaymentList":{"type":"object","properties":{"list":{"type":"array","items":{"$ref":"#\/components\/schemas\/EduPayment"}},"total":{"type":"integer","description":"Number of payments.","example":3}},"required":["list","total"]},"EduPayment":{"type":"object","description":"Course payment in Education.","properties":{"courseId":{"type":"integer","description":"Course ID.","example":501},"courseTariffId":{"type":["integer","null"],"description":"Course tariff ID; `null` for older payments.","example":9001},"name":{"type":"string","description":"Course name.","example":"Marketing basics"},"price":{"type":"object","properties":{"currency":{"type":"string","example":"USD"},"amount":{"type":"string","description":"Decimal amount as a string.","example":"100.00"}},"required":["currency","amount"],"description":"Payment amount.","example":{"currency":"USD","amount":"100.00"}},"status":{"type":"string","enum":["new","succeed","failed"],"description":"Payment status group.","example":"succeed"},"paymentMethod":{"type":"string","enum":["YooMoney","PayPal","Fondy","YooKassa","ROBOKASSA","Stripe","MERCADOPAGO","LiqPay","Wayforpay","Flutterwave","Monobank","Cryptomus","Whitepay","TELEGRAM","Klarna","StripeConnect","RozetkaPay","Novapay"],"description":"Payment method.","example":"Stripe"},"merchantUuid":{"type":["string","null"],"format":"uuid","description":"Merchant ID.","example":"5b1f2c9e-0d4a-4e8f-9a1b-1c2d3e4f5a6b"},"merchantName":{"type":["string","null"],"description":"Merchant name.","example":"My School"},"orderId":{"type":"string","description":"Order ID.","example":"ord_8f2a1c"},"createdAt":{"type":"string","format":"date-time","description":"Payment date and time (UTC).","example":"2026-01-15T10:00:00.000000Z"},"promoCode":{"type":["string","null"],"description":"Applied promo code.","example":"SPRING10"},"promoCodeDiscount":{"type":["object","null"],"properties":{"value":{"type":["string","null"],"example":"10"},"type":{"type":"string","example":"percentage"},"currency":{"type":["string","null"],"example":null}},"description":"Discount details of the payment.","example":{"value":"10","type":"percentage","currency":null}}},"required":["courseId","courseTariffId","name","price","status","paymentMethod","merchantUuid","merchantName","orderId","createdAt","promoCode","promoCodeDiscount"]},"EduStatistics":{"type":"object","description":"Learning statistics of the students linked to a contact.","properties":{"schools":{"type":"array","description":"Schools of the students (one item per student and school).","items":{"$ref":"#\/components\/schemas\/EduStatisticsSchool"}},"groups":{"type":"array","description":"Course groups of the students.","items":{"$ref":"#\/components\/schemas\/EduStatisticsGroup"}},"responsible":{"type":"array","description":"Responsible team members of the students on courses.","items":{"$ref":"#\/components\/schemas\/EduStatisticsResponsible"}}},"required":["schools","groups","responsible"]},"EduStatisticsSchool":{"type":"object","properties":{"schoolName":{"type":["string","null"],"description":"School name.","example":"Digital School"},"isLms":{"type":"boolean","description":"Whether the school is an LMS school.","example":false},"schoolId":{"type":["integer","null"],"description":"School ID.","example":41},"externalContactId":{"type":"string","description":"Student UUID.","example":"0b2c5d8e-1f3a-4b6c-8d9e-0a1b2c3d4e5f"},"marketingOptIn":{"type":["boolean","null"],"description":"Marketing consent of the student; `null` if not given.","example":true},"courses":{"type":"array","items":{"$ref":"#\/components\/schemas\/EduStatisticsCourse"}}},"required":["schoolName","isLms","schoolId","externalContactId","marketingOptIn","courses"]},"EduFeedback":{"type":"object","description":"Feedback left by the student; all fields are `null` if there is no feedback.","properties":{"rate":{"type":["integer","null"],"example":5},"message":{"type":["string","null"],"example":"Great course"},"date":{"type":["string","null"],"format":"date-time","example":"2026-01-15T10:00:00.000000Z"}},"required":["rate","message","date"]},"EduStatisticsCourse":{"type":"object","properties":{"id":{"type":"integer","description":"Course ID.","example":501},"status":{"type":"string","enum":["inProgress","inactive","planned"],"description":"Course status.","example":"inProgress"},"name":{"type":"string","description":"Course name.","example":"Marketing basics"},"statusStudentOnCourse":{"type":"string","enum":["registered","inProgress","success","failed","certificated","deletedFromCourse"],"description":"Status of the student on the course.","example":"inProgress"},"studentDateRegistrationOnCourse":{"type":["string","null"],"format":"date-time","description":"Registration date on the course (UTC).","example":"2026-01-15T10:00:00.000000Z"},"studentEmail":{"type":"string","description":"Student email; masked if contact data is hidden for the user.","example":"anna@example.com"},"studentLastEntry":{"type":["string","null"],"format":"date-time","description":"Last visit date (UTC).","example":"2026-01-15T10:00:00.000000Z"},"courseAvailableDate":{"type":["string","null"],"format":"date-time","description":"Date from which the course is available (UTC).","example":"2026-01-15T10:00:00.000000Z"},"studentMetadata":{"type":["array","null"],"description":"Visit metadata of the student; `null` on the free tariff plan.","items":{"$ref":"#\/components\/schemas\/EduStudentMetadata"}},"landingUrl":{"type":"string","description":"Course landing URL.","example":"https:\/\/school.example.com\/marketing"},"feedback":{"$ref":"#\/components\/schemas\/EduFeedback"},"sections":{"type":"array","items":{"$ref":"#\/components\/schemas\/EduStatisticsSection"}},"tests":{"type":"array","items":{"$ref":"#\/components\/schemas\/EduStatisticsTest"}},"homeworks":{"type":"array","items":{"$ref":"#\/components\/schemas\/EduStatisticsHomework"}},"hideOrder":{"type":"boolean","description":"Whether the course content order is hidden.","example":false},"promoCode":{"type":["string","null"],"description":"Promo code used for the course payment.","example":"SPRING10"},"promoCodeDiscount":{"type":["object","null"],"properties":{"value":{"type":["string","null"],"example":"10"},"type":{"type":"string","example":"percentage"}},"description":"Discount of the course payment.","example":{"value":"10","type":"percentage"}},"studentTariff":{"oneOf":[{"$ref":"#\/components\/schemas\/EduStudentTariff"},{"type":"null"}]},"subscriptionStatus":{"type":["integer","null"],"enum":[1,2,null],"description":"Subscription status for subscription tariffs: `1` \u2014 active, `2` \u2014 stopped; `null` for other tariffs.","example":1},"gamificationData":{"type":["object","null"],"description":"Gamification data; `null` if gamification is disabled for the school.","properties":{"score":{"type":"integer","example":120},"rating":{"type":["integer","null"],"example":3},"ratingSize":{"type":"integer","example":40}}}},"required":["id","status","name","statusStudentOnCourse","studentDateRegistrationOnCourse","studentEmail","studentLastEntry","courseAvailableDate","studentMetadata","landingUrl","feedback","sections","tests","homeworks","hideOrder","promoCode","promoCodeDiscount","studentTariff","subscriptionStatus","gamificationData"]},"EduStudentMetadata":{"type":"object","properties":{"ip":{"type":"string","example":"93.72.1.1"},"countryCode":{"type":["string","null"],"example":"UA"},"country":{"type":["string","null"],"example":"Ukraine"},"platformFamily":{"type":["string","null"],"example":"windows"},"platformVersion":{"type":["string","null"],"example":"10"},"appVersion":{"type":["string","null"],"example":"124.0"},"browserFamily":{"type":["string","null"],"example":"Chrome"},"createdAt":{"type":["string","null"],"format":"date-time","example":"2026-01-15T10:00:00.000000Z"}},"required":["ip","countryCode","country","platformFamily","platformVersion","appVersion","browserFamily","createdAt"]},"EduStatisticsSection":{"type":"object","properties":{"id":{"type":"integer","example":601},"name":{"type":"string","example":"Introduction"},"order":{"type":"integer","example":1},"status":{"type":"string","enum":["closed","opened","planned","hidden"],"example":"opened"},"lessons":{"type":"array","items":{"$ref":"#\/components\/schemas\/EduStatisticsLesson"}},"certificateSections":{"type":"array","items":{"$ref":"#\/components\/schemas\/EduStatisticsCertificate"}},"forms":{"type":"array","items":{"$ref":"#\/components\/schemas\/EduStatisticsForm"}}},"required":["id","name","order","status","lessons","certificateSections","forms"]},"EduStatisticsLesson":{"type":"object","properties":{"id":{"type":"integer","example":701},"name":{"type":"string","example":"Lesson 1"},"order":{"type":"integer","example":1},"statusStudentOnLesson":{"type":"object","properties":{"status":{"type":["string","null"],"enum":["doNotStarted","started","completed",null],"example":"completed"},"updatedAt":{"type":["string","null"],"format":"date-time","example":"2026-01-15T10:00:00.000000Z"}}},"feedback":{"$ref":"#\/components\/schemas\/EduFeedback"},"status":{"type":"string","enum":["closed","opened","deleted","planned","hidden"],"example":"opened"}},"required":["id","name","order","statusStudentOnLesson","feedback","status"]},"EduStatisticsCertificate":{"type":"object","properties":{"id":{"type":"integer","example":801},"name":{"type":"string","example":"Certificate"},"sectionId":{"type":"integer","example":601},"order":{"type":"integer","example":2},"dateReceived":{"type":["string","null"],"format":"date-time","example":"2026-01-15T10:00:00.000000Z"},"status":{"type":"string","enum":["inactive","active","planned","hidden"],"example":"active"},"haveCertificate":{"type":"boolean","example":true},"isImported":{"type":"boolean","example":false},"certificateId":{"type":["integer","null"],"example":9901}},"required":["id","name","sectionId","order","dateReceived","status","haveCertificate","isImported","certificateId"]},"EduStatisticsForm":{"type":"object","properties":{"id":{"type":"integer","example":901},"name":{"type":"string","example":"Survey"},"order":{"type":"integer","example":3},"status":{"type":"string","enum":["inactive","active","planned","hidden"],"example":"active"},"sectionId":{"type":"integer","example":601},"questionsCount":{"type":"integer","example":5},"answeredQuestionsCount":{"type":"integer","example":5},"studentStatus":{"type":["string","null"],"enum":["started","completed",null],"example":"completed"}},"required":["id","name","order","status","sectionId","questionsCount","answeredQuestionsCount","studentStatus"]},"EduStatisticsTest":{"type":"object","properties":{"id":{"type":"integer","example":1001},"name":{"type":"string","example":"Final test"},"studentStatus":{"type":["string","null"],"enum":["blocked","running","finished","failed",null],"description":"`null` if the student has not started the test.","example":"finished"},"score":{"type":"object","properties":{"userScore":{"type":"integer","example":8},"minScore":{"type":"integer","example":6},"maxScore":{"type":"integer","example":10}},"required":["userScore","minScore","maxScore"],"example":{"userScore":8,"minScore":6,"maxScore":10}},"relatedEntityType":{"type":["string","null"],"enum":["course","section","lesson",null],"example":"course"},"relatedEntityId":{"type":["integer","null"],"example":501},"order":{"type":"integer","example":1},"feedback":{"$ref":"#\/components\/schemas\/EduFeedback"},"status":{"type":"string","enum":["active","inactive","planned","hidden"],"example":"active"}},"required":["id","name","studentStatus","score","relatedEntityType","relatedEntityId","order","feedback","status"]},"EduStatisticsHomework":{"type":"object","properties":{"lessonId":{"type":"integer","example":701},"name":{"type":"string","example":"Homework 1"},"status":{"type":["string","null"],"enum":["checking","accepted","declined","autoAccepted","rework","acceptedWithoutAnswer","messageFromStudent","acceptWithRate",null],"example":"accepted"},"rate":{"type":["integer","null"],"example":9},"maxRate":{"type":["integer","null"],"example":10}},"required":["lessonId","name","status","rate","maxRate"]},"EduStudentTariff":{"type":"object","properties":{"id":{"type":["integer","null"],"example":9001},"courseId":{"type":"integer","example":501},"name":{"type":"string","example":"Standard"},"isMain":{"type":"boolean","example":true},"isPaid":{"type":"boolean","description":"Whether the tariff has payment methods.","example":true},"pricingType":{"type":["integer","null"],"enum":[1,2,3,null],"description":"Pricing type: `1` \u2014 free, `2` \u2014 one-time, `3` \u2014 subscription.","example":2},"studentTariffStatus":{"type":"string","enum":["unPaid","paid"],"example":"paid"},"courseTariffSetting":{"type":["object","null"],"properties":{"courseTariffId":{"type":"integer","example":9001},"startDate":{"type":["string","null"],"format":"date-time","example":null},"endDate":{"type":["string","null"],"format":"date-time","example":null},"timezone":{"type":["string","null"],"example":"Europe\/Kyiv"},"contentShow":{"type":"boolean","example":true},"quota":{"type":["integer","null"],"example":null}}}},"required":["id","courseId","name","isMain","isPaid","pricingType","studentTariffStatus","courseTariffSetting"]},"EduStatisticsGroup":{"type":"object","properties":{"groupId":{"type":"integer","example":51},"courseId":{"type":"integer","example":501},"groupName":{"type":"string","example":"Group A"},"groupColor":{"type":["string","null"],"example":"#4C9AFF"},"responsibleUserId":{"type":["integer","null"],"example":8001234}},"required":["groupId","courseId","groupName","groupColor","responsibleUserId"]},"EduStatisticsResponsible":{"type":"object","properties":{"courseId":{"type":"integer","example":501},"responsibleUserId":{"type":"integer","example":8001234}},"required":["courseId","responsibleUserId"]},"ContactSearchRequest":{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":100,"default":100,"description":"Number of contacts to return.","example":20},"offset":{"type":["integer","null"],"minimum":0,"default":0,"description":"Number of contacts to skip.","example":0},"ids":{"type":"array","minItems":1,"description":"Contact IDs.","items":{"type":"integer"},"example":[700101,700102]},"firstName":{"type":["string","null"],"description":"Part of the first name.","example":"Anna"},"lastName":{"type":["string","null"],"description":"Part of the last name.","example":"Smith"},"email":{"type":["string","null"],"description":"Beginning of the email address: contacts whose email starts with this value are returned (case-insensitive). A full email address also finds an exact match.","example":"anna@"},"isEmailFullSearch":{"type":"boolean","deprecated":true,"description":"Deprecated and ignored: email is always searched by prefix (\"starts with\").","example":false},"phone":{"type":["string","integer","null"],"description":"Phone number (1\u201350 digits).","example":"38050"},"messengerLogin":{"type":["string","null"],"description":"Messenger login.","example":"anna_smith"},"messengerTypeIds":{"type":["array","null"],"description":"Contacts with a messenger of these types.","items":{"$ref":"#\/components\/schemas\/MessengerTypeProperty"}},"responsibleIds":{"type":["array","null"],"description":"IDs of responsible team members.","items":{"type":"integer"},"example":[8001234]},"tagIds":{"type":["array","null"],"description":"Tag IDs.","items":{"type":"integer"},"example":[301]},"tagMatch":{"type":["string","null"],"enum":["all","any",null],"default":"any","description":"`any` \u2014 a contact has at least one of `tagIds`; `all` \u2014 all of them.","example":"any"},"sourceTypes":{"type":["array","null"],"description":"Source IDs (see `SourceType`).","items":{"type":"integer","enum":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]},"example":[8]},"from":{"type":["string","null"],"format":"date","description":"Contacts created on or after this date.","example":"2026-01-01"},"to":{"type":["string","null"],"format":"date","description":"Contacts created on or before this date.","example":"2026-01-31"},"updateFrom":{"type":["string","null"],"format":"date","description":"Contacts updated on or after this date.","example":"2026-01-01"},"updateTo":{"type":["string","null"],"format":"date","description":"Contacts updated on or before this date.","example":"2026-01-31"},"contactMergeHistoryId":{"type":["integer","null"],"description":"ID of a contact merge operation; returns contacts affected by it.","example":55},"pipelineIds":{"type":["array","null"],"description":"Contacts that have deals in these pipelines.","items":{"type":"integer"},"example":[1201]},"withoutDeals":{"type":"boolean","description":"`true` \u2014 only contacts without deals.","example":false},"attributes":{"type":"array","maxItems":50,"description":"Conditions on contact attribute values; all conditions must match.","items":{"$ref":"#\/components\/schemas\/AttributeFilter"}},"attributeIds":{"type":"array","minItems":1,"maxItems":50,"description":"Return only these attributes in `attributes` of each contact (does not filter contacts).","items":{"type":"integer"},"example":[3101]},"fieldValueConditions":{"type":"array","description":"Conditions on presence of contact data; all conditions must match.","items":{"type":"object","properties":{"field":{"type":"string","enum":["attributes","lastName","phones","emails","messengers","contactSource","location","tags"],"description":"Contact data to check.","example":"phones"},"expression":{"type":"string","enum":["withoutData","anyData"],"description":"`withoutData` \u2014 the data is absent; `anyData` \u2014 the data is present.","example":"anyData"},"value":{"type":["integer","null"],"description":"Attribute ID for `field: attributes`.","example":null}},"required":["field","expression"]}},"contactPopupSettings":{"type":"object","description":"Popup data filters.","properties":{"widgetId":{"type":"string","example":"w-123"},"popupId":{"type":"string","example":"p-456"},"type":{"type":"integer","example":1},"clientId":{"type":"string","example":"c-789"},"city":{"type":"string","example":"Kyiv"},"gender":{"type":"integer","example":1}}},"location":{"type":"string","description":"Part of the contact location.","example":"Kyiv"},"nps":{"type":"object","description":"NPS response filters.","properties":{"externalId":{"type":"string","example":"nps-1"},"externalParentId":{"type":"string","example":"survey-1"},"value":{"type":"string","example":"9"},"label":{"type":"string","example":"promoter"}}},"products":{"type":"object","description":"Filters on products of the contact deals.","properties":{"name":{"type":"string","description":"Part of the product name.","example":"Logo"},"vendorCode":{"type":"string","description":"Part of the product vendor code.","example":"SKU-1"},"quantity":{"$ref":"#\/components\/schemas\/ProductQuantityFilter"},"price":{"$ref":"#\/components\/schemas\/DealProductPriceFilter"},"sumPrice":{"$ref":"#\/components\/schemas\/DealProductPriceFilter"}}},"sortBy":{"type":["object","null"],"description":"Sorting.","properties":{"fieldName":{"type":["string","null"],"enum":["id","firstName","lastName","responsibleId","createdAt","updatedAt",null],"description":"Contact field to sort by.","example":"createdAt"},"attributeId":{"type":["integer","null"],"description":"ID of a sortable contact attribute to sort by (instead of `fieldName`).","example":3101},"direction":{"type":"string","enum":["asc","desc"],"default":"asc","description":"Sort direction.","example":"desc"}}}}},"ContactHistoryEvent":{"type":"object","properties":{"id":{"type":"integer","description":"Event ID.","example":990001},"userId":{"type":["integer","null"],"description":"ID of the team member who made the change; `null` for system events.","example":8001234},"contactId":{"type":"integer","description":"Contact ID.","example":700101},"eventType":{"type":"string","description":"Event type, e.g. `contact_field_updated`, `contact_phone_field_added`, `contact_email_field_updated`, `contact_messenger_field_deleted`, `contact_tag_field_added`, `contact_attribute_field_updated`, `relation_created`, `relation_deleted`.","example":"contact_phone_field_added"},"eventData":{"type":"object","additionalProperties":true,"description":"Event details; the set of keys depends on `eventType`. Note: an empty set is serialized as an empty array `[]`.","example":{"updatingField":[{"phone":"380501234567","isMain":true}]}},"eventTime":{"type":"string","format":"date-time","description":"Event date and time (UTC).","example":"2026-01-15T10:00:00.000000Z"},"currentData":{"type":["object","null"],"description":"Current name of the related deal for events with a deal; `null` otherwise.","properties":{"dealName":{"type":["string","null"],"example":"Website redesign"}}}},"required":["id","userId","contactId","eventType","eventData","eventTime","currentData"]},"AttributeValueBatchItem":{"type":"object","properties":{"attributeId":{"type":"integer","description":"Attribute ID.","example":3101},"value":{"type":["string","null"],"description":"Saved value.","example":"1990-05-01 00:00:00"}},"required":["attributeId","value"]},"BatchSetAttributeValuesRequest":{"type":"object","properties":{"attributesValues":{"type":"array","description":"Attribute values to set.","items":{"type":"object","properties":{"attributeId":{"type":"integer","description":"Attribute ID.","example":3101},"value":{"type":"string","maxLength":5500,"description":"Attribute value (see `SetAttributeValueRequest` for formats).","example":"1990-05-01 00:00:00"}},"required":["attributeId","value"]}}},"required":["attributesValues"]},"EntityAttribute":{"type":"object","description":"Custom field (attribute) of deals, contacts or companies.","properties":{"id":{"type":"integer","description":"Attribute ID.","example":3101},"pipelineId":{"type":"integer","description":"Pipeline ID. Present for deal attributes.","example":1201},"name":{"type":"string","description":"Attribute name.","example":"Delivery address"},"status":{"$ref":"#\/components\/schemas\/EntityAttributeStatus"},"type":{"$ref":"#\/components\/schemas\/EntityAttributeFieldType"},"order":{"type":"integer","description":"Position of the attribute in the field list.","example":3},"options":{"type":["array","null"],"description":"Options of `select` and `multiSelect` attributes; `null` for other types.","items":{"type":["string","null"]},"example":["Kyiv","Lviv"]},"mandatory":{"type":"boolean","description":"Whether the field is mandatory.","example":false},"default":{"type":"boolean","description":"Whether this is a system (default) attribute.","example":false},"contactCardShow":{"type":"boolean","description":"Whether the field is shown on the contact card.","example":false}},"required":["id","name","status","type","order","options","mandatory","default","contactCardShow"]},"EntityAttributeStatus":{"type":"integer","description":"Attribute status:\n* 1 \u2014 active\n* 2 \u2014 hidden\n","enum":[1,2],"example":1},"EntityAttributeFieldType":{"type":"integer","description":"Attribute field type:\n* 0 \u2014 text\n* 1 \u2014 number\n* 2 \u2014 date\n* 3 \u2014 link\n* 4 \u2014 select\n* 5 \u2014 multiSelect\n* 6 \u2014 checkbox\n","enum":[0,1,2,3,4,5,6],"example":0},"CreateEntityAttributeRequest":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"Attribute name.","example":"Delivery address"},"type":{"$ref":"#\/components\/schemas\/EntityAttributeFieldType"},"status":{"type":["integer","null"],"enum":[1,2,null],"description":"Attribute status: `1` \u2014 active (default), `2` \u2014 hidden.","example":1},"options":{"type":["array","null"],"description":"Options of the list. Required for `select` (4) and `multiSelect` (5) attributes; at least one option must not be `null`.","items":{"type":["string","null"]},"example":["Kyiv","Lviv"]},"mandatory":{"type":"boolean","description":"Whether the field is mandatory. Default `false`.","example":false},"contactCardShow":{"type":"boolean","description":"Whether the field is shown on the contact card. Default `false`.","example":false}},"required":["name","type"]},"UpdateEntityAttributeRequest":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"Attribute name.","example":"Delivery address"},"type":{"allOf":[{"$ref":"#\/components\/schemas\/EntityAttributeFieldType"}],"description":"Current field type of the attribute. The type of an existing attribute cannot be changed; a different value returns 422."},"status":{"$ref":"#\/components\/schemas\/EntityAttributeStatus"},"order":{"type":"integer","description":"Position of the attribute in the field list.","example":3},"options":{"type":["array","null"],"description":"New options of the list (`null` items are dropped). Required for `select` (4) and `multiSelect` (5) attributes.","items":{"type":["string","null"]},"example":["Kyiv","Lviv","Odesa"]},"mandatory":{"type":"boolean","description":"Whether the field is mandatory. If omitted, the current value is kept.","example":false},"contactCardShow":{"type":"boolean","description":"Whether the field is shown on the contact card. If omitted, the current value is kept.","example":false}},"required":["name","type","status","order"]},"SetAttributeValueRequest":{"type":"object","properties":{"attributeId":{"type":"integer","description":"Attribute ID.","example":3101},"value":{"type":"string","maxLength":5500,"description":"Attribute value as a string:\n* date \u2014 `Y-m-d H:i:s`, `Y-m-d H:i`, `Y\/m\/d H:i:s`, `Y\/m\/d H:i`, `Y.m.d H:i:s`, `Y.m.d H:i` (account time zone) or `Y-m-d\\TH:i:s\\Z` (UTC);\n* checkbox \u2014 `0` or `1`;\n* multiSelect \u2014 JSON array of attribute options, e.g. `[\"Option A\",\"Option B\"]`;\n* other types \u2014 any text.\n","example":"Kyiv, Khreshchatyk 1"},"initCreation":{"type":["boolean","null"],"description":"Pass `true` when filling values of a newly created entity: the change is not reported as an attribute value update (no update event for automations and integrations). Default `false`.","example":false}},"required":["attributeId","value"]},"UpdateAttributeValueRequest":{"type":"object","properties":{"value":{"type":"string","maxLength":5500,"description":"Attribute value as a string, in the same formats as for setting a value (see `SetAttributeValueRequest`).","example":"Kyiv, Khreshchatyk 1"},"initCreation":{"type":["boolean","null"],"description":"Pass `true` to not report the change as an attribute value update. Default `false`.","example":false}},"required":["value"]},"Comment":{"type":"object","description":"Comment on a deal, contact, company or task.","properties":{"id":{"type":"integer","description":"Comment ID.","example":61001},"userId":{"type":"integer","description":"ID of the team member who wrote the comment.","example":8001234},"eventData":{"type":"object","properties":{"text":{"type":["string","null"],"description":"Comment text. `null` for a comment with attachments only.","example":"Sent the invoice"}},"required":["text"]},"eventTime":{"type":"string","format":"date-time","description":"Comment date and time (UTC); equals `createdAt`.","example":"2026-01-15T10:00:00.000000Z"},"createdAt":{"type":"string","format":"date-time","description":"Creation date and time (UTC).","example":"2026-01-15T10:00:00.000000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Last update date and time (UTC).","example":"2026-01-15T10:00:00.000000Z"},"attachments":{"type":"array","description":"Attached files.","items":{"$ref":"#\/components\/schemas\/Attachment"}},"parentId":{"type":["integer","null"],"description":"ID of the parent comment for a reply; `null` for a top-level comment.","example":null},"childCount":{"type":"integer","description":"Number of replies.","example":2},"childUsers":{"type":"array","description":"IDs of team members who replied.","items":{"type":"integer"},"example":[8001235]}},"required":["id","userId","eventData","eventTime","createdAt","updatedAt","attachments","parentId","childCount","childUsers"]},"CommentList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Comment"}},"meta":{"$ref":"#\/components\/schemas\/ListMeta"}},"required":["data","meta"]},"CreateCommentRequest":{"type":"object","description":"Either `message` (or its alias `text`) or `attachments` is required.","properties":{"message":{"type":["string","null"],"maxLength":5000,"description":"Comment text.","example":"Sent the invoice"},"text":{"type":"string","maxLength":5000,"description":"Alias of `message`; used when `message` is not passed.","example":"Sent the invoice"},"parentId":{"type":["integer","null"],"minimum":1,"description":"ID of the comment to reply to.","example":61000},"attachments":{"type":"array","description":"Paths of files uploaded to the file manager to attach to the comment.","items":{"type":"string","maxLength":255},"example":["\/personal\/deal\/invoice.pdf"]}}},"UpdateCommentRequest":{"type":"object","properties":{"message":{"type":["string","null"],"maxLength":5000,"description":"New comment text.","example":"Sent the corrected invoice"}}},"User":{"type":"object","properties":{"id":{"type":"integer","description":"User ID.","example":8001234},"firstname":{"type":"string","description":"First name. Empty string if not set.","example":"Anna"},"lastname":{"type":"string","description":"Last name. Empty string if not set.","example":"Smith"},"email":{"type":"string","description":"Email address.","example":"anna@example.com"},"phone":{"type":"string","description":"Phone number. Empty string if not set.","example":"380501234567"},"avatar":{"type":"string","description":"Profile picture URL. Empty string if not set.","example":"https:\/\/login.sendpulse.com\/files\/avatar.png"},"lang":{"type":"string","description":"Interface language locale.","example":"en_US"},"locale":{"type":["string","null"],"description":"Regional format locale.","example":"en-US"},"currency":{"type":["string","null"],"description":"Currency set in the user settings.","example":"USD"},"country":{"type":["string","null"],"description":"Country code.","example":"UA"},"status":{"type":"integer","description":"Account status (`1` \u2014 active).","example":1}},"required":["id","firstname","lastname","email","phone","avatar","lang","locale","currency","country","status"]},"Board":{"type":"object","properties":{"id":{"type":"integer","description":"Board ID.","example":2101},"name":{"type":"string","description":"Board name.","example":"Support"},"userId":{"type":"integer","description":"Account owner ID.","example":8001234},"order":{"type":"integer","description":"Position of the board in the board list.","example":0},"steps":{"type":"array","items":{"$ref":"#\/components\/schemas\/BoardStep"}},"attributes":{"type":"array","description":"Custom task fields of the board.","items":{"$ref":"#\/components\/schemas\/BoardAttribute"}},"settings":{"type":"array","items":{"$ref":"#\/components\/schemas\/BoardSetting"}}},"required":["id","name","userId","order","steps","attributes","settings"]},"BoardList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Board"}}},"required":["data"]},"BoardStep":{"type":"object","properties":{"id":{"type":"integer","description":"Step ID.","example":6101},"name":{"type":"string","description":"Step name.","example":"In progress"},"color":{"type":"string","description":"Step color.","example":"#4C9AFF"},"order":{"type":"integer","description":"Position of the step on the board.","example":2},"boardId":{"type":"integer","description":"Board ID.","example":2101},"addEndHours":{"type":["integer","null"],"description":"Time limit for a task in this step, in hours.","example":24},"notifyIn":{"type":["string","null"],"description":"When to notify before the step time limit ends.","example":"1h"},"description":{"type":["string","null"],"description":"Step description. Always `null` on the free tariff plan.","example":"Tasks being worked on"}},"required":["id","name","color","order","boardId","addEndHours","notifyIn","description"]},"BoardAttribute":{"type":"object","description":"Custom task field of a board.","properties":{"id":{"type":"integer","description":"Attribute ID.","example":3301},"name":{"type":"string","description":"Attribute name.","example":"Priority level"},"type":{"$ref":"#\/components\/schemas\/BoardAttributeType"},"mandatory":{"type":"boolean","description":"Whether the field is mandatory.","example":false},"options":{"type":["array","null"],"description":"Options of `list` and `multiList` fields.","items":{"type":["string","null"]},"example":["Low","High"]},"status":{"type":["integer","null"],"description":"Whether the field is shown in the task filter: `1` \u2014 shown, `0` \u2014 hidden.","example":1},"order":{"type":"integer","description":"Position of the field.","example":1}},"required":["id","name","type","mandatory","options","status","order"]},"BoardAttributeType":{"type":"integer","description":"Task field type:\n* 0 \u2014 string\n* 1 \u2014 number\n* 2 \u2014 date\n* 3 \u2014 link\n* 4 \u2014 list\n* 5 \u2014 multiList\n* 6 \u2014 checkbox\n","enum":[0,1,2,3,4,5,6],"example":0},"BoardSetting":{"type":"object","properties":{"id":{"type":"integer","description":"Setting ID.","example":501},"name":{"type":"string","enum":["responsibleUser","color"],"description":"Setting name.","example":"responsibleUser"},"value":{"type":["integer","string"],"description":"`responsibleUser` \u2014 team member ID (integer); `color` \u2014 HEX color (string).","example":8001234},"boardId":{"type":"integer","description":"Board ID.","example":2101}},"required":["id","name","value","boardId"]},"BoardSettingInput":{"type":"object","properties":{"name":{"type":"string","enum":["responsibleUser","color"],"description":"Setting name.","example":"color"},"value":{"type":["integer","string"],"description":"`responsibleUser` \u2014 ID of a team member; `color` \u2014 HEX color `#RRGGBB`.","example":"#4C9AFF"}},"required":["name","value"]},"CreateBoardRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":45,"description":"Board name, unique among active boards of the account.","example":"Support"},"settings":{"type":"array","description":"Board settings.","items":{"$ref":"#\/components\/schemas\/BoardSettingInput"}}},"required":["name"]},"UpdateBoardRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":45,"description":"Board name, unique among active boards of the account.","example":"Support"},"settings":{"type":"array","description":"Board settings.","items":{"$ref":"#\/components\/schemas\/BoardSettingInput"}}}},"CreateBoardAttributeRequest":{"type":"object","properties":{"name":{"type":"string","maxLength":250,"description":"Field name.","example":"Priority level"},"type":{"$ref":"#\/components\/schemas\/BoardAttributeType"},"mandatory":{"type":"boolean","description":"Whether the field is mandatory.","example":false},"options":{"type":"array","description":"Options; required for `list` (4) and `multiList` (5).","items":{"type":"string"},"example":["Low","High"]}},"required":["name","type","mandatory"]},"UpdateBoardAttributeRequest":{"type":"object","properties":{"name":{"type":"string","maxLength":250,"description":"Field name.","example":"Priority level"},"type":{"$ref":"#\/components\/schemas\/BoardAttributeType"},"mandatory":{"type":"boolean","description":"Whether the field is mandatory.","example":false},"options":{"type":"array","description":"Options of `list` and `multiList` fields.","items":{"type":"string"},"example":["Low","Medium","High"]},"order":{"type":"integer","minimum":0,"description":"Position of the field.","example":1},"status":{"type":"integer","enum":[0,1],"description":"Whether the field is shown in the task filter.","example":1}}},"SaveBoardStepRequest":{"type":"object","properties":{"name":{"type":"string","description":"Step name.","example":"In progress"},"color":{"type":"string","minLength":1,"maxLength":12,"description":"Step color.","example":"#4C9AFF"},"order":{"type":"integer","minimum":1,"description":"Position of the step on the board.","example":2},"addEndHours":{"type":["number","null"],"minimum":0,"maximum":9600,"description":"Time limit for a task in this step, in hours.","example":24},"description":{"type":["string","null"],"maxLength":500,"description":"Step description. Saved only on a paid tariff plan.","example":"Tasks being worked on"}},"required":["name","color"]},"UpdateBoardStepRequest":{"type":"object","properties":{"name":{"type":"string","description":"Step name.","example":"In progress"},"color":{"type":"string","minLength":1,"maxLength":12,"description":"Step color.","example":"#4C9AFF"},"order":{"type":"integer","minimum":1,"description":"Position of the step on the board.","example":2},"addEndHours":{"type":["number","null"],"minimum":0,"maximum":9600,"description":"Time limit for a task in this step, in hours.","example":24},"description":{"type":["string","null"],"maxLength":500,"description":"Step description. Saved only on a paid tariff plan.","example":"Tasks being worked on"}}},"CallFilter":{"type":"object","properties":{"from":{"type":["string","null"],"format":"date","description":"Calls created on or after this date (UTC). Default \u2014 10 years ago.","example":"2026-01-01"},"to":{"type":["string","null"],"format":"date","description":"Calls created on or before this date (UTC), not earlier than `from`. Default \u2014 today.","example":"2026-01-31"},"responsibleIds":{"type":"array","maxItems":100,"description":"IDs of responsible team members.","items":{"type":"integer"},"example":[8001234]},"callType":{"type":"integer","enum":[0,1],"description":"Call type: `0` \u2014 incoming, `1` \u2014 outgoing.","example":0},"state":{"type":"integer","enum":[1,2,3],"description":"Call state: `1` \u2014 pending, `2` \u2014 successful, `3` \u2014 failed.","example":2},"integrationGroupId":{"type":"integer","description":"Telephony integration group ID.","example":15},"contactFirstName":{"type":"string","maxLength":255,"description":"Part of the contact first name.","example":"Anna"},"contactLastName":{"type":"string","maxLength":255,"description":"Part of the contact last name.","example":"Smith"},"contactEmail":{"type":"string","maxLength":255,"description":"Part of a contact email.","example":"anna@"},"contactPhone":{"type":"string","maxLength":255,"description":"Part of a contact phone number.","example":"38050"}}},"CallSearchRequest":{"type":"object","properties":{"from":{"type":["string","null"],"format":"date","description":"Calls created on or after this date (UTC). Default \u2014 10 years ago.","example":"2026-01-01"},"to":{"type":["string","null"],"format":"date","description":"Calls created on or before this date (UTC), not earlier than `from`. Default \u2014 today.","example":"2026-01-31"},"responsibleIds":{"type":"array","maxItems":100,"description":"IDs of responsible team members.","items":{"type":"integer"},"example":[8001234]},"callType":{"type":"integer","enum":[0,1],"description":"Call type: `0` \u2014 incoming, `1` \u2014 outgoing.","example":0},"state":{"type":"integer","enum":[1,2,3],"description":"Call state: `1` \u2014 pending, `2` \u2014 successful, `3` \u2014 failed.","example":2},"integrationGroupId":{"type":"integer","description":"Telephony integration group ID.","example":15},"contactFirstName":{"type":"string","maxLength":255,"description":"Part of the contact first name.","example":"Anna"},"contactLastName":{"type":"string","maxLength":255,"description":"Part of the contact last name.","example":"Smith"},"contactEmail":{"type":"string","maxLength":255,"description":"Part of a contact email.","example":"anna@"},"contactPhone":{"type":"string","maxLength":255,"description":"Part of a contact phone number.","example":"38050"},"limit":{"type":"integer","minimum":1,"maximum":100,"default":10,"description":"Number of calls to return.","example":10},"offset":{"type":["integer","null"],"minimum":0,"default":0,"description":"Number of calls to skip.","example":0}}},"CallList":{"type":"object","properties":{"total":{"type":"integer","description":"Total number of calls that match the filters.","example":42},"list":{"type":"array","items":{"$ref":"#\/components\/schemas\/TelephonyCall"}}},"required":["total","list"]},"CallsByDate":{"type":"object","properties":{"date":{"type":"string","format":"date","description":"Date (UTC).","example":"2026-01-15"},"calls":{"type":"array","items":{"$ref":"#\/components\/schemas\/TelephonyCall"}}},"required":["date","calls"]},"TelephonyCall":{"type":"object","properties":{"id":{"type":"integer","description":"Call ID.","example":99001},"integrationId":{"type":"integer","description":"Telephony integration ID.","example":310},"integrationGroupId":{"type":"integer","description":"Telephony integration group ID.","example":15},"responsibleId":{"type":"integer","description":"ID of the responsible team member.","example":8001234},"externalCallId":{"type":["string","null"],"description":"Call ID in the telephony provider.","example":"abc-123"},"phone":{"type":"string","description":"Phone number of the other party; partially masked if contact data masking is enabled for the user.","example":"380501234567"},"callDuration":{"type":["integer","null"],"description":"Call duration in seconds.","example":125},"callType":{"type":"integer","enum":[0,1],"description":"Call type: `0` \u2014 incoming, `1` \u2014 outgoing.","example":0},"state":{"type":"integer","enum":[1,2,3],"description":"Call state: `1` \u2014 pending, `2` \u2014 successful, `3` \u2014 failed.","example":2},"callRecordLink":{"type":["string","null"],"description":"Call recording URL.","example":"https:\/\/records.example.com\/abc-123.mp3"},"createdAt":{"type":"string","format":"date-time","description":"Call date and time (UTC).","example":"2026-01-15T10:00:00.000000Z"},"contact":{"type":["object","null"],"description":"Contact of the call.","properties":{"id":{"type":"integer","example":700101},"firstName":{"type":"string","example":"Anna"},"lastName":{"type":"string","example":"Smith"}},"required":["id","firstName","lastName"]},"deal":{"type":["object","null"],"description":"Deal linked to the call.","properties":{"id":{"type":"integer","example":950001},"name":{"type":"string","example":"Website redesign"},"sourceType":{"$ref":"#\/components\/schemas\/SourceType"}},"required":["id","name","sourceType"]}},"required":["id","integrationId","integrationGroupId","responsibleId","externalCallId","phone","callDuration","callType","state","callRecordLink","createdAt","contact","deal"]},"CreateAttachmentRequest":{"type":"object","properties":{"link":{"type":"string","maxLength":255,"description":"File path in the file manager (see \"Upload files\").","example":"\/personal\/crm\/attachments\/contract.pdf"},"entityType":{"type":"string","enum":["task","deal","contact","company","comment"],"description":"Type of the entity to attach the file to.","example":"deal"},"entityId":{"type":"integer","description":"ID of the entity.","example":950001}},"required":["link","entityType","entityId"]},"AttachmentRecord":{"type":"object","description":"Created attachment (raw record).","properties":{"id":{"type":"integer","example":51001},"attachmentable_id":{"type":"integer","description":"ID of the entity.","example":950001},"attachmentable_type":{"type":"string","enum":["task","deal","contact","company","comment"],"description":"Type of the entity.","example":"deal"},"link":{"type":"string","example":"\/personal\/crm\/attachments\/contract.pdf"},"user_id":{"type":"integer","example":8001234},"created_at":{"type":"string","format":"date-time","example":"2026-01-15T10:00:00.000000Z"},"updated_at":{"type":"string","format":"date-time","example":"2026-01-15T10:00:00.000000Z"}},"required":["id","attachmentable_id","attachmentable_type","link","user_id","created_at","updated_at"]},"MessengerTypeProperty":{"type":"integer","description":"Messenger type:\n* 1 \u2014 telegram\n* 2 \u2014 facebook\n* 4 \u2014 instagram\n* 5 \u2014 whatsapp\n* 6 \u2014 viber\n* 7 \u2014 liveChat\n* 8 \u2014 TikTok\n* 1000 \u2014 BRIDGE_TEST_BOT\n* 1001 \u2014 BRIDGE_TELEGRAM_PERSONAL_PROFILE\n* 1002 \u2014 BRIDGE_SENDPULSE_SMS\n* 1003 \u2014 BRIDGE_VIBER_PERSONAL_PROFILE\n* 1004 \u2014 BRIDGE_CRM_MAILBOX\n* 1005 \u2014 BRIDGE_VIBER_CAMPAIGN_BOT\n* 1006 \u2014 BRIDGE_LINKEDIN_BOT\n* 1007 \u2014 BRIDGE_LINE_BOT\n* 5008 \u2014 linkedin\n","enum":[1,2,4,5,6,7,8,1000,1001,1002,1003,1004,1005,1006,1007,5008],"example":1},"ManagerSectionId":{"type":"integer","description":"CRM section:\n* 1 \u2014 mainSettings\n* 2 \u2014 contactImport\n* 3 \u2014 contactExport\n* 4 \u2014 contactDuplicates\n* 5 \u2014 dealExport\n* 6 \u2014 dealDuplicates\n* 7 \u2014 taskExport\n* 8 \u2014 paymentExport\n* 9 \u2014 productExport\n* 12 \u2014 contactSettings\n* 13 \u2014 boardSettings\n* 14 \u2014 companySettings\n* 15 \u2014 pipelineSettings\n* 16 \u2014 productSettings\n* 17 \u2014 subscriptionExport\n","enum":[1,2,3,4,5,6,7,8,9,12,13,14,15,16,17],"example":3},"ManagerSettingSections":{"type":"object","description":"Map of section names to section IDs.","properties":{"mainSettings":{"type":"integer","const":1,"example":1},"contactImport":{"type":"integer","const":2,"example":2},"contactExport":{"type":"integer","const":3,"example":3},"contactDuplicates":{"type":"integer","const":4,"example":4},"dealExport":{"type":"integer","const":5,"example":5},"dealDuplicates":{"type":"integer","const":6,"example":6},"taskExport":{"type":"integer","const":7,"example":7},"paymentExport":{"type":"integer","const":8,"example":8},"productExport":{"type":"integer","const":9,"example":9},"contactSettings":{"type":"integer","const":12,"example":12},"boardSettings":{"type":"integer","const":13,"example":13},"companySettings":{"type":"integer","const":14,"example":14},"pipelineSettings":{"type":"integer","const":15,"example":15},"productSettings":{"type":"integer","const":16,"example":16},"subscriptionExport":{"type":"integer","const":17,"example":17}},"required":["mainSettings","contactImport","contactExport","contactDuplicates","dealExport","dealDuplicates","taskExport","paymentExport","productExport","contactSettings","boardSettings","companySettings","pipelineSettings","productSettings","subscriptionExport"]},"ManagerSetting":{"type":"object","properties":{"id":{"type":"integer","description":"Setting ID.","example":71},"responsibleIds":{"type":"array","description":"IDs of team members managing the section.","items":{"type":"integer"},"example":[8001234]},"sectionId":{"$ref":"#\/components\/schemas\/ManagerSectionId"},"userId":{"type":"integer","description":"Account owner ID.","example":8001234}},"required":["id","responsibleIds","sectionId","userId"]},"CustomTabEntityType":{"type":"integer","description":"Entity type: `0` \u2014 contact, `1` \u2014 deal (pipeline), `2` \u2014 task (board), `3` \u2014 company.","enum":[0,1,2,3],"example":1},"CustomTab":{"type":"object","properties":{"id":{"type":"integer","example":801},"name":{"type":"string","example":"Delivery"},"userId":{"type":"integer","example":8001234},"order":{"type":["integer","null"],"example":2},"isVisible":{"type":"boolean","example":true},"isDefault":{"type":"boolean","description":"Whether this is a default (system) tab.","example":false},"isProtected":{"type":"boolean","description":"Whether the tab is a system tab that cannot be renamed, deleted or edited.","example":false},"type":{"type":"integer","enum":[0,1],"description":"`0` \u2014 attributes tab, `1` \u2014 integration tab.","example":0},"entityType":{"$ref":"#\/components\/schemas\/CustomTabEntityType"},"entityId":{"type":["integer","null"],"description":"Pipeline or board ID.","example":1201},"options":{"type":["object","null"],"additionalProperties":true,"description":"Tab options.","example":null},"attributes":{"type":"array","description":"Custom fields on the tab.","items":{"type":"object","properties":{"attributeId":{"type":"integer","example":3101},"attributeType":{"$ref":"#\/components\/schemas\/CustomTabEntityType"}},"required":["attributeId","attributeType"]}},"responsibleIds":{"type":"array","description":"IDs of team members who see the tab.","items":{"type":"integer"},"example":[]}},"required":["id","name","userId","order","isVisible","isDefault","isProtected","type","entityType","entityId","options","attributes","responsibleIds"]},"CustomTabShort":{"type":"object","properties":{"id":{"type":"integer","example":801},"userId":{"type":"integer","example":8001234},"name":{"type":"string","example":"Delivery"},"order":{"type":["integer","null"],"example":2},"isVisible":{"type":"boolean","example":true},"isDefault":{"type":"boolean","example":false},"type":{"type":"integer","enum":[0,1],"example":0},"entityType":{"$ref":"#\/components\/schemas\/CustomTabEntityType"},"entityId":{"type":["integer","null"],"example":1201},"options":{"type":["object","null"],"additionalProperties":true,"example":null},"responsibleIds":{"type":["array","null"],"items":{"type":"integer"},"example":[]}},"required":["id","userId","name","order","isVisible","isDefault","type","entityType","entityId"]},"CustomTabsByEntity":{"type":"object","properties":{"contact":{"type":"array","items":{"$ref":"#\/components\/schemas\/CustomTab"}},"pipeline":{"type":"array","items":{"$ref":"#\/components\/schemas\/CustomTab"}},"board":{"type":"array","items":{"$ref":"#\/components\/schemas\/CustomTab"}},"company":{"type":"array","items":{"$ref":"#\/components\/schemas\/CustomTab"}}},"required":["contact","pipeline","board","company"]},"CustomTabRelationRequest":{"type":"object","properties":{"entityType":{"$ref":"#\/components\/schemas\/CustomTabEntityType"},"entityId":{"type":["integer","null"],"description":"Pipeline ID (`entityType: 1`) or board ID (`entityType: 2`); required for them.","example":1201},"entityIds":{"type":"array","description":"IDs of custom fields of the entity.","items":{"type":"integer"},"example":[3101,3102]}},"required":["entityType","entityIds"]},"DealExpense":{"type":"object","properties":{"id":{"type":"integer","description":"Expense ID.","example":1501},"deal_id":{"type":"integer","description":"Deal ID.","example":950001},"dealExpenseTypeId":{"type":["integer","null"],"description":"Expense type ID.","example":12},"name":{"type":"string","description":"Expense name.","example":"Delivery"},"amount":{"type":"number","description":"Expense amount in major units of the deal currency.","example":25.5},"currency":{"type":"string","description":"Deal currency code (`USD` if the deal has no currency).","example":"USD"}},"required":["id","deal_id","dealExpenseTypeId","name","amount","currency"]},"CreateDealExpenseRequest":{"type":"object","properties":{"deal_id":{"type":"integer","description":"ID of an active deal.","example":950001},"dealExpenseTypeId":{"type":["integer","null"],"description":"ID of an active expense type of the deal pipeline.","example":12},"name":{"type":"string","maxLength":255,"description":"Expense name.","example":"Delivery"},"amount":{"type":"number","minimum":0,"maximum":999999999.99,"description":"Expense amount in major units of the deal currency.","example":25.5}},"required":["deal_id","name","amount"]},"UpdateDealExpenseRequest":{"type":"object","properties":{"dealExpenseTypeId":{"type":["integer","null"],"description":"ID of an active expense type of the deal pipeline.","example":12},"name":{"type":"string","maxLength":255,"description":"Expense name.","example":"Delivery"},"amount":{"type":"number","minimum":0,"maximum":999999999.99,"description":"Expense amount in major units of the deal currency.","example":30}}}},"parameters":{"PipelineId":{"name":"pipelineId","in":"path","required":true,"description":"Pipeline ID. It can be obtained with the \"Get a list of pipelines\" method.","schema":{"type":"integer"},"example":1201},"StepId":{"name":"stepId","in":"path","required":true,"description":"Pipeline step ID.","schema":{"type":"integer"},"example":5301},"ReasonId":{"name":"reasonId","in":"path","required":true,"description":"Fail reason ID.","schema":{"type":"integer"},"example":701},"AttributeId":{"name":"attributeId","in":"path","required":true,"description":"Attribute ID.","schema":{"type":"integer"},"example":3101},"DealId":{"name":"dealId","in":"path","required":true,"description":"Deal ID. It can be obtained with the \"Search deals\" method.","schema":{"type":"integer"},"example":950001},"ContactId":{"name":"contactId","in":"path","required":true,"description":"Contact ID. It can be obtained with the \"Search contacts\" method.","schema":{"type":"integer"},"example":700101},"TaskId":{"name":"taskId","in":"path","required":true,"description":"Task ID. It can be obtained with the \"Search tasks\" method.","schema":{"type":"integer"},"example":77001},"CompanyId":{"name":"companyId","in":"path","required":true,"description":"Company ID. It can be obtained with the \"Search companies\" method.","schema":{"type":"integer"},"example":4401},"CommentId":{"name":"commentId","in":"path","required":true,"description":"Comment ID.","schema":{"type":"integer"},"example":61001},"ExpenseId":{"name":"id","in":"path","required":true,"description":"Expense ID.","schema":{"type":"integer"},"example":1501},"PaymentId":{"name":"paymentId","in":"path","required":true,"description":"Payment ID.","schema":{"type":"integer"},"example":300501},"PhoneId":{"name":"phoneId","in":"path","required":true,"description":"Phone ID.","schema":{"type":"integer"},"example":81001},"EmailId":{"name":"emailId","in":"path","required":true,"description":"Email ID.","schema":{"type":"integer"},"example":82001},"MessengerId":{"name":"messengerId","in":"path","required":true,"description":"Messenger ID.","schema":{"type":"integer"},"example":83001},"TagId":{"name":"tagId","in":"path","required":true,"description":"Tag ID.","schema":{"type":"integer"},"example":301},"BoardId":{"name":"boardId","in":"path","required":true,"description":"Board ID. It can be obtained with the \"Get a list of boards\" method.","schema":{"type":"integer"},"example":2101},"ValueId":{"name":"valueId","in":"path","required":true,"description":"Attribute value ID.","schema":{"type":"integer"},"example":7701},"ChecklistId":{"name":"checklistId","in":"path","required":true,"description":"Checklist ID.","schema":{"type":"integer"},"example":1201},"ChecklistItemId":{"name":"itemId","in":"path","required":true,"description":"Checklist item ID.","schema":{"type":"integer"},"example":2301},"AttachmentId":{"name":"attachmentId","in":"path","required":true,"description":"Attachment ID.","schema":{"type":"integer"},"example":51001},"CategoryId":{"name":"categoryId","in":"path","required":true,"description":"Product category ID.","schema":{"type":"integer"},"example":1101},"ProductId":{"name":"productId","in":"path","required":true,"description":"Product ID.","schema":{"type":"integer"},"example":2201},"CustomTabId":{"name":"customTabId","in":"path","required":true,"description":"Custom tab ID.","schema":{"type":"integer"},"example":801}},"responses":{"Unauthorized":{"description":"The access token is expired or its signature is invalid, or the request is not authenticated.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"success":false,"error":{"code":401,"message":"Expired token"}}}}},"Forbidden":{"description":"Access denied. The body is `ErrorResponse` when the access token is missing or invalid, the user has no access to CRM (role permissions, no active pipelines) or the action is not allowed; it is `ErrorList` when the tariff plan does not include API access or has expired, when a tariff limit is reached, or when the request is not authorized for the resource.","content":{"application\/json":{"schema":{"oneOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"$ref":"#\/components\/schemas\/ErrorList"}]},"examples":{"missingToken":{"summary":"Missing access token","value":{"success":false,"error":{"code":403,"message":"Unauthorized action!"}}},"tariff":{"summary":"Tariff plan restriction","value":{"errors":[{"code":403,"message":"Your tariff plan was expired."}]}}}}}},"NotFound":{"description":"The resource does not exist or is not available to the user, or a path parameter has an invalid format.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"success":false,"error":{"code":404,"message":"Not found"}}}}},"ValidationFailed":{"description":"Request validation failed.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}},"UnprocessableEntity":{"description":"Request validation failed (`ValidationError`) or the action violates a business rule (`ErrorResponse`).","content":{"application\/json":{"schema":{"oneOf":[{"$ref":"#\/components\/schemas\/ValidationError"},{"$ref":"#\/components\/schemas\/ErrorResponse"}]}}}}},"securitySchemes":{"oauth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https:\/\/api.sendpulse.com\/oauth\/access_token","scopes":[]}}},"apiKey":{"type":"apiKey","in":"header","name":"Authorization"}}},"security":[{"oauth2":[]},{"apiKey":[]}]}