{"info":{"title":"Agendor API","description":"# Introduction\n\nWelcome to our API docs! Agendor is a CRM system made to streamline the\nsales process of teams of inside and outside sales. With our API, you\ncan integrate your existing systems with Agendor and make your sales\nteam even more efficient. Check out some help articles our team has\nwritten about integrating with our API (in Portuguese):\n\n* [Do you have examples of how to use the Agendor API?](https://ajuda.agendor.com.br/integracoes/voces-tem-exemplos-de-como-utilizar-a-api-do-agendor)\n* [Can I integrate Agendor to my current system?](https://ajuda.agendor.com.br/integracoes/o-agendor-pode-ser-integrado-ao-meu-sistema-atual)\n\n## Structure\n\nOur API is a RESTful JSON API, which means:\n\n* The endpoints are structured around *resources*, identified by URIs;\n* HTTP *verbs* are used to act differently on the same resource\nand HTTP *status codes* are used to signal the result of an operation;\n* We expect body parameters in JSON and also respond in JSON.\n\nThe body of succesful responses will have up to three main root level\nproperties:\n\n* `data`: actual data of the resource you're working with, will always\nbe present;\n* `meta`: metadata about the resource, for instance total size of a\ncollection of results;\n* `links`: links to related resources, which can be used to navigate\nthrough the API.\n\nThe failure responses will be signaled by HTTP status codes and also\nhave error details under the `errors` property in the response body.\n\n## Authentication\n\n\u003c!-- ReDoc-Inject: \u003csecurity-definitions\u003e --\u003e\n\nTo authenticate your requests, you need an API token. You can find\nyour token by logging into Agendor, and going to\n[Menu \u003e Integrações](https://web.agendor.com.br/sistema/integracoes).\nThis token is like your password, so keep it secret!\n\nAdd this token to the `Authorization` header of your requests, using\nthe `Token` scheme, for example, in cURL:\n\n```bash\ncurl -H 'Authorization: Token your-token-here' https://api.agendor.com.br/v3/users/me\n```\n\nIn PHP, you might do:\n\n```php\n$curl = curl_init();\n\ncurl_setopt($curl, CURLOPT_HTTPHEADER, array(\"Authorization: Token your-token-here\"));\ncurl_setopt($curl, CURLOPT_URL, \"https://api.agendor.com.br/v3/users/me\");\n\n$response = curl_exec($curl);\n```\n\nIn case of failed authentication, the API will respond with a `401`\nstatus code and the following body:\n\n```json\n{\n  \"errors\": [\n    \"Token could not be authenticated\"\n  ]\n}\n```\n\nIf you're getting this error, you might be using an invalid token or\nyour headers are not set up properly. Check if your Agendor account and\nuser are active and if you have included your token in the `Authorization`\nheader, preceded by the word `Token`.\n\n## Pagination\n\nIn the endpoints where you might `GET` a collection of resources, they\nwill be paginated. By default, `10` items are returned per page, but\nyou can increase the page size up to `100`.\n\nTo navigate through the results, use the `page` parameter, starting\nfrom page `1`. The total count of results will be included in the\n`meta` property of the response and links for the following and\npreceding pages will be  included under `links`:\n\n```bash\nGET https://api.agendor.com.br/v3/organizations?page=2\n\n{\n  \"data\": [...\n  ],\n  \"meta\": {\n    \"totalCount\": 100\n  },\n  \"links\": {\n    \"self\": \"https://api.agendor.com.br/v3/organizations?page=2\",\n    \"prev\": \"https://api.agendor.com.br/v3/organizations?page=1\",\n    \"next\": \"https://api.agendor.com.br/v3/organizations?page=3\"\n  }\n}\n```\n","contact":{"name":"Contato","email":"contato@agendor.com.br","url":"https://www.agendor.com.br"},"version":"v3","x-logo":{"url":"logo.png"}},"swagger":"2.0","produces":["application/json"],"securityDefinitions":{"token":{"type":"apiKey","in":"header","name":"Authorization","scheme":"Token"}},"security":[{"token":[]}],"host":"api.agendor.com.br","basePath":"/v3","x-tagGroups":[{"name":"core","tags":["organizations","people","deals","tasks"]},{"name":"account","tags":["users"]},{"name":"settings","tags":["categories","states","funnels","deal_stages","deal_statuses","lead_origins","loss_reasons","metrics","products","sectors","product_categories"]}],"tags":[{"name":"voip_calls","description":"Operations about voip_calls"},{"name":"ping","description":"Operations about pings"},{"name":"organizations","description":"Organizations are other businesses that you sell to; in other\nwords, your B2B customers. If you sell B2C, you might want to use\n[people](#tag/people) instead.\n\nUse these endpoints to add new organizations, search for and update\nexisting organizations, or remove them.\n"},{"name":"custom_fields","description":"Custom fields are custom areas for including additional information on organizations, people and deals.\n\nUse this endpoint to verify all custom fields added to your records.\n"},{"name":"people","description":"People are your contacts, either with an [organization](#tag/organizations),\nif you sell B2B, or your actual customers if you sell B2C.\n\nUse these endpoints to add new people, search for and update existing\npeople, or remove them.\n"},{"name":"deals","description":"Deals are your business opportunities. You can create deals associated\nwith [organizations](#tag/organizations), if you sell B2B,\nor to [people](#tag/people), if you sell B2C.\n\nUse these endpoints to create new deals (always under a organization\nor person), update their info, [stage](#tag/deal_stages) and\n[status](#tag/deal_statuses), search for specific deals, or remove them.\n"},{"name":"tasks","description":"Tasks represent small units of work that you have to perform in\norder to find opportunities or advance them through your funnel.\nThey always have to be associated with a customer, either\n[organization](#tag/organizations) or [person](#tag/people), or a\n[deal](#tag/deals).\n\nUse these endpoints to create, update, find or delete tasks.\n"},{"name":"users","description":"Users are the members of your team that add more customers, perform\ntasks and win deals.\n\nUse these endpoints to list your users and update them.\n"},{"name":"categories","description":"Categories are a way to segment your customers to find and identify\nthem more easily.\n\nYou can configure your categories in\n[Menu \u003e Configurações](https://web.agendor.com.br/sistema/configuracoes).\n"},{"name":"sectors","description":"Sectors are a way to indicate what business segments your customers\nwork with.\n\nYou can configure the relevant sectors for your account in\n[Menu \u003e Configurações](https://web.agendor.com.br/sistema/configuracoes).\n"},{"name":"products","description":"Use products to discriminate *what* you're selling in each deal or for\neach customer.\n\nYou can configure your portfolio of products through these endpoints or in\n[Menu \u003e Configurações](https://web.agendor.com.br/sistema/configuracoes).\n"},{"name":"lead_origins","description":"Lead origins represent what channels your customers came from.\n\nYou can configure your available lead origins in\n[Menu \u003e Configurações](https://web.agendor.com.br/sistema/configuracoes).\n"},{"name":"loss_reasons","description":"Loss reasons are the causes that you have identified of why you might\nlose a deal.\n\nYou can configure your available loss reasons in\n[Menu \u003e Configurações](https://web.agendor.com.br/sistema/configuracoes).\n"},{"name":"metrics","description":"Metrics are tags that you can attach to tasks to be able to measure\nlater.\n\nYou can create and configure your metrics in\n[Menu \u003e Relatórios \u003e Métricas](https://web.agendor.com.br/sistema/relatorios/criar.php).\n"},{"name":"funnels","description":"Funnels are the different processes that your deals might go\nthrough.\n\nTo configure funnels in your account, please contact our Customer\nSupport team.\n"},{"name":"deal_stages","description":"Ongoing deals will be advancing through your sales funnel, each step\ncloser to being won. The deal stages represent these steps that your\ndeals go through in your funnel.\n\nYou can configure the stages of your own sales process in\n[Menu \u003e Configurações](https://web.agendor.com.br/sistema/configuracoes).\n"},{"name":"deal_statuses","description":"Deal statuses represent whether your deals are still being worked on,\nor have been finished. Your deals can be in one of three possible\nstatuses:\n\n1. `ongoing` (`Em andamento`): deal is still being worked on;\n2. `won` (`Ganho`): deal is finished and was won;\n3. `lost` (`Perdido`): deal is finished and was lost.\n"},{"name":"states","description":"These are endpoints about geographic states. We currently support\nonly Brazilian addresses.\n"},{"name":"product_categories","description":"Endpoints about product categories.\n"}],"paths":{"/people/{person_id}/tasks":{"get":{"description":"List and search tasks of a person.","produces":["application/json"],"parameters":[{"in":"query","name":"page","description":"Page of results to fetch.","type":"integer","format":"int32","default":1,"required":false},{"in":"query","name":"per_page","description":"Number of results to return per page.","type":"integer","format":"int32","default":10,"minimum":0,"maximum":100,"required":false},{"in":"query","name":"finishedDateGt","description":"Use to search for tasks that were **finished after** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"finishedDateLt","description":"Use to search for tasks that were **finished before** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"dueDateGt","description":"Use to search for tasks **due after** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"dueDateLt","description":"Use to search for tasks **due before** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"updatedDateGt","description":"Use to search for tasks that were **updated after** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"updatedDateLt","description":"Use to search for tasks that were **updated before** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"createdDateGt","description":"Use to search for tasks that were **created after** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"createdDateLt","description":"Use to search for tasks that were **created before** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"metricId","description":"Metric ID.","type":"integer","format":"int32","required":false},{"in":"query","name":"finishedEq","description":"Use to search for finished or unfinished tasks.","type":"string","enum":["true","false"],"required":false},{"in":"path","name":"person_id","type":"integer","format":"int32","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/TaskEntity"}}}}}},"tags":["tasks"],"operationId":"List tasks of person"},"post":{"description":"Create a new task related to this person.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"person_id","type":"integer","format":"int32","required":true},{"name":"PeoplePersonIdTasks","in":"body","required":true,"schema":{"$ref":"#/definitions/postPeoplePersonIdTasks"}}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/TaskEntity"}}}}},"tags":["tasks"],"operationId":"Create task for person"}},"/people/{person_id}/tasks/{id}":{"put":{"description":"Update an existing task of this person.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"person_id","type":"integer","format":"int32","required":true},{"in":"path","name":"id","type":"integer","format":"int32","required":true},{"name":"PeoplePersonIdTasks","in":"body","required":true,"schema":{"$ref":"#/definitions/putPeoplePersonIdTasks"}}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/TaskEntity"}}}}},"tags":["tasks"],"operationId":"Update task of person"}},"/people/{person_id}/deals":{"get":{"description":"List deals of this person.","produces":["application/json"],"parameters":[{"in":"path","name":"person_id","type":"integer","format":"int32","required":true},{"in":"query","name":"withCustomFields","description":"Return custom fields of deals.\n                 Use this param to include them in the response.\n                 Example: /people/{person_id}/deals?withCustomFields=true","type":"boolean","required":false}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/DealEntity"}}}}}},"tags":["deals"],"operationId":"List deals of person"},"post":{"description":"Create a new deal for person.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"person_id","type":"integer","format":"int32","required":true},{"name":"PeoplePersonIdDeals","in":"body","required":true,"schema":{"$ref":"#/definitions/postPeoplePersonIdDeals"}}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/FullDealEntity"}}}}},"tags":["deals"],"operationId":"Create deal for person"}},"/people":{"get":{"description":"List and search for people.","produces":["application/json"],"parameters":[{"in":"query","name":"page","description":"Page of results to fetch.","type":"integer","format":"int32","default":1,"required":false},{"in":"query","name":"per_page","description":"Number of results to return per page.","type":"integer","format":"int32","default":10,"minimum":0,"maximum":100,"required":false},{"in":"query","name":"name","description":"Name **prefix**.","type":"string","required":false},{"in":"query","name":"category","description":"Category ID.","type":"integer","format":"int32","required":false},{"in":"query","name":"leadOrigin","description":"Lead origin ID.","type":"integer","format":"int32","required":false},{"in":"query","name":"products","description":"Array of product IDS.","type":"array","items":{"type":"integer","format":"int32"},"required":false},{"in":"query","name":"author","description":"Author user ID.","type":"integer","format":"int32","required":false},{"in":"query","name":"userOwner","description":"Owner user ID.","type":"integer","format":"int32","required":false},{"in":"query","name":"role","description":"Role prefix.","type":"string","required":false},{"in":"query","name":"cpf","description":"Document number (CPF) **prefix**.","type":"string","required":false},{"in":"query","name":"organization","description":"Organization ID.","type":"integer","format":"int32","required":false},{"in":"query","name":"state","description":"Address state abbreviation.","type":"string","enum":["AC","AL","AP","AM","BA","CE","DF","ES","GO","MA","MT","MS","MG","PA","PB","PR","PE","PI","RJ","RN","RS","RO","RR","SC","SP","SE","TO"],"required":false},{"in":"query","name":"cityName","description":"City name **prefix**.","type":"string","required":false},{"in":"query","name":"district","description":"District name **prefix**.","type":"string","required":false},{"in":"query","name":"email","description":"Contact email **prefix**.","type":"string","required":false},{"in":"query","name":"work_phone","description":"Work phone number.","type":"string","required":false},{"in":"query","name":"mobile_phone","description":"Mobile phone number.","type":"string","required":false},{"in":"query","name":"fax_phone","description":"Fax number.","type":"string","required":false},{"in":"query","name":"whatsapp","description":"WhatsApp phone number.","type":"string","required":false},{"in":"query","name":"phone","description":"Use to search in any phone field (work, mobile, fax and WhatsApp).","type":"string","required":false},{"in":"query","name":"createdAtGt","description":"Use to search for people that were **created after** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"createdAtLt","description":"Use to search for people that were **created before** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"updatedAtGt","description":"Use to search for people that were **updated after** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"updatedAtLt","description":"Use to search for people that were **updated before** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"withCustomFields","description":"Return custom fields of people. Use this param to include them in the response.\n           Example: /people?withCustomFields=true","type":"boolean","required":false}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/PersonEntity"}}}}}},"tags":["people"],"operationId":"List people"},"post":{"description":"Create a new person.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"name":"People","in":"body","required":true,"schema":{"$ref":"#/definitions/postPeople"}}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/PersonEntity"}}}}},"tags":["people"],"operationId":"Create person","x-codeSamples":[{"lang":"PHP","source":"$curl = curl_init();\n\ncurl_setopt($curl, CURLOPT_HTTPHEADER, array(\n  \"Authorization: Token your-token-here\",\n  \"Content-Type: application/json\"\n));\n\ncurl_setopt($curl, CURLOPT_URL,\n  \"https://api.agendor.com.br/v3/people\"\n);\ncurl_setopt($curl, CURLOPT_POSTFIELDS, json_encode(array(\n  \"name\" =\u003e \"Name of the person\",\n  \"contact\" =\u003e array(\n    \"email\" =\u003e \"person@organization.com\"\n  )\n)));\n\n$response = curl_exec($curl);\n\n"}]}},"/people/{id}":{"get":{"description":"Get an specific person by ID.","produces":["application/json"],"parameters":[{"in":"query","name":"withCustomFields","description":"Return custom fields of people. Use this param to include them in the response.\n             Example: /people/{id}?withCustomFields=true","type":"boolean","required":false},{"in":"path","name":"id","type":"integer","format":"int32","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/PersonEntity"}}}}},"tags":["people"],"operationId":"Get person"},"delete":{"description":"Delete a person.","produces":["application/json"],"parameters":[{"in":"path","name":"id","type":"integer","format":"int32","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/PersonEntity"}}}}},"tags":["people"],"operationId":"Delete person"},"put":{"description":"Update a specific person by ID.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"id","type":"integer","format":"int32","required":true},{"name":"People","in":"body","required":true,"schema":{"$ref":"#/definitions/putPeople"}}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/PersonEntity"}}}}},"tags":["people"],"operationId":"Update person"}},"/people/upsert":{"post":{"description":"Search for a person by cpf or email.\n\nIf found, update it, otherwise, create a new one.\n\nThis endpoint is very useful if you want to avoid verifying for\nduplicates before creating a new person.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"name":"PeopleUpsert","in":"body","required":true,"schema":{"$ref":"#/definitions/postPeopleUpsert"}}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/PersonEntity"}}}}},"tags":["people"],"operationId":"Upsert person"}},"/organizations/{organization_id}/tasks":{"get":{"description":"List and search tasks of an organization.","produces":["application/json"],"parameters":[{"in":"query","name":"page","description":"Page of results to fetch.","type":"integer","format":"int32","default":1,"required":false},{"in":"query","name":"per_page","description":"Number of results to return per page.","type":"integer","format":"int32","default":10,"minimum":0,"maximum":100,"required":false},{"in":"query","name":"finishedDateGt","description":"Use to search for tasks that were **finished after** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"finishedDateLt","description":"Use to search for tasks that were **finished before** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"dueDateGt","description":"Use to search for tasks **due after** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"dueDateLt","description":"Use to search for tasks **due before** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"updatedDateGt","description":"Use to search for tasks that were **updated after** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"updatedDateLt","description":"Use to search for tasks that were **updated before** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"createdDateGt","description":"Use to search for tasks that were **created after** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"createdDateLt","description":"Use to search for tasks that were **created before** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"metricId","description":"Metric ID.","type":"integer","format":"int32","required":false},{"in":"query","name":"finishedEq","description":"Use to search for finished or unfinished tasks.","type":"string","enum":["true","false"],"required":false},{"in":"path","name":"organization_id","type":"integer","format":"int32","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/TaskEntity"}}}}}},"tags":["tasks"],"operationId":"List tasks of organization"},"post":{"description":"Create a new task related to this organization.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"organization_id","type":"integer","format":"int32","required":true},{"name":"OrganizationsOrganizationIdTasks","in":"body","required":true,"schema":{"$ref":"#/definitions/postOrganizationsOrganizationIdTasks"}}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/TaskEntity"}}}}},"tags":["tasks"],"operationId":"Create task for organization"}},"/organizations/{organization_id}/tasks/{id}":{"put":{"description":"Update an existing task of this organization.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"organization_id","type":"integer","format":"int32","required":true},{"in":"path","name":"id","type":"integer","format":"int32","required":true},{"name":"OrganizationsOrganizationIdTasks","in":"body","required":true,"schema":{"$ref":"#/definitions/putOrganizationsOrganizationIdTasks"}}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/TaskEntity"}}}}},"tags":["tasks"],"operationId":"Update task of organization"}},"/organizations/{organization_id}/deals":{"get":{"description":"List deals of this organization.","produces":["application/json"],"parameters":[{"in":"path","name":"organization_id","type":"integer","format":"int32","required":true},{"in":"query","name":"withCustomFields","description":"Return custom fields of deals.\n                 Use this param to include them in the response.\n                 Example: /organizations/{organization_id}/deals?withCustomFields=true","type":"boolean","required":false}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/DealEntity"}}}}}},"tags":["deals"],"operationId":"List deals of organization"},"post":{"description":"Create a new deal for organization.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"organization_id","type":"integer","format":"int32","required":true},{"name":"OrganizationsOrganizationIdDeals","in":"body","required":true,"schema":{"$ref":"#/definitions/postOrganizationsOrganizationIdDeals"}}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/FullDealEntity"}}}}},"tags":["deals"],"operationId":"Create deal for organization"}},"/organizations/{organization_id}/people":{"get":{"description":"List all people of an organization.","produces":["application/json"],"parameters":[{"in":"query","name":"page","description":"Page of results to fetch.","type":"integer","format":"int32","default":1,"required":false},{"in":"query","name":"per_page","description":"Number of results to return per page.","type":"integer","format":"int32","default":10,"minimum":0,"maximum":100,"required":false},{"in":"path","name":"organization_id","type":"integer","format":"int32","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/PersonEntity"}}}}}},"tags":["people"],"operationId":"List people of organization"}},"/organizations":{"get":{"description":"List and search for organizations.","produces":["application/json"],"parameters":[{"in":"query","name":"page","description":"Page of results to fetch.","type":"integer","format":"int32","default":1,"required":false},{"in":"query","name":"per_page","description":"Number of results to return per page.","type":"integer","format":"int32","default":10,"minimum":0,"maximum":100,"required":false},{"in":"query","name":"name","description":"Name **prefix**.","type":"string","required":false},{"in":"query","name":"nameExact","description":"Name (exactly equal).","type":"string","required":false},{"in":"query","name":"category","description":"Category ID.","type":"integer","format":"int32","required":false},{"in":"query","name":"sector","description":"Sector ID.","type":"integer","format":"int32","required":false},{"in":"query","name":"leadOrigin","description":"Lead origin ID.","type":"integer","format":"int32","required":false},{"in":"query","name":"products","description":"Array of product IDs.","type":"array","items":{"type":"integer","format":"int32"},"required":false},{"in":"query","name":"userOwner","description":"Owner user ID.","type":"integer","format":"int32","required":false},{"in":"query","name":"cnpj","description":"Document number (CNPJ) **prefix**.","type":"string","required":false},{"in":"query","name":"author","description":"Author user ID.","type":"integer","format":"int32","required":false},{"in":"query","name":"state","description":"Address state abbreviation.","type":"string","enum":["AC","AL","AP","AM","BA","CE","DF","ES","GO","MA","MT","MS","MG","PA","PB","PR","PE","PI","RJ","RN","RS","RO","RR","SC","SP","SE","TO"],"required":false},{"in":"query","name":"cityName","description":"City name **prefix**.","type":"string","required":false},{"in":"query","name":"district","description":"District name **prefix**.","type":"string","required":false},{"in":"query","name":"email","description":"Contact email **prefix**.","type":"string","required":false},{"in":"query","name":"work_phone","description":"Work phone number.","type":"string","required":false},{"in":"query","name":"mobile_phone","description":"Mobile phone number.","type":"string","required":false},{"in":"query","name":"fax_phone","description":"Fax number.","type":"string","required":false},{"in":"query","name":"whatsapp","description":"WhatsApp phone number.","type":"string","required":false},{"in":"query","name":"phone","description":"Use to search in any phone field (work, mobile, fax and WhatsApp).","type":"string","required":false},{"in":"query","name":"createdAtGt","description":"Use to search for organizations that were **created after** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"createdAtLt","description":"Use to search for organizations that were **created before** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"updatedAtGt","description":"Use to search for organizations that were **updated after** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"updatedAtLt","description":"Use to search for organizations that were **updated before** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"withCustomFields","description":"Return custom fields of organizations. Use this param to include them in the response.\n             Example: /organizations?withCustomFields=true","type":"boolean","required":false}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/OrganizationEntity"}}}}}},"tags":["organizations"],"operationId":"List organizations"},"post":{"description":"Create a new organization.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"name":"Organizations","in":"body","required":true,"schema":{"$ref":"#/definitions/postOrganizations"}}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/OrganizationEntity"}}}}},"tags":["organizations"],"operationId":"Create organization"}},"/organizations/{id}":{"get":{"description":"Get an specific organization by ID.","produces":["application/json"],"parameters":[{"in":"query","name":"withCustomFields","description":"Return custom fields of organizations. Use this param to include them in the response.\n             Example: /organizations/{id}?withCustomFields=true","type":"boolean","required":false},{"in":"path","name":"id","type":"integer","format":"int32","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/OrganizationEntity"}}}}},"tags":["organizations"],"operationId":"Get organization"},"delete":{"description":"Delete an organization.","produces":["application/json"],"parameters":[{"in":"path","name":"id","type":"integer","format":"int32","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/OrganizationEntity"}}}}},"tags":["organizations"],"operationId":"Delete organization"},"put":{"description":"Update a specific organization by ID.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"id","type":"integer","format":"int32","required":true},{"name":"Organizations","in":"body","required":true,"schema":{"$ref":"#/definitions/putOrganizations"}}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/OrganizationEntity"}}}}},"tags":["organizations"],"operationId":"Update organization"}},"/organizations/upsert":{"post":{"description":"Search for an organization by name or document number (CNPJ).\n\nIf found, update it, otherwise, create a new one.\n\nThis endpoint is very useful if you want to avoid verifying for\nduplicates before creating a new organization.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"name":"OrganizationsUpsert","in":"body","required":true,"schema":{"$ref":"#/definitions/postOrganizationsUpsert"}}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/OrganizationEntity"}}}}},"tags":["organizations"],"operationId":"Upsert organization"}},"/deals/{deal_id}/tasks":{"get":{"description":"List and search tasks of a deal.","produces":["application/json"],"parameters":[{"in":"query","name":"page","description":"Page of results to fetch.","type":"integer","format":"int32","default":1,"required":false},{"in":"query","name":"per_page","description":"Number of results to return per page.","type":"integer","format":"int32","default":10,"minimum":0,"maximum":100,"required":false},{"in":"query","name":"finishedDateGt","description":"Use to search for tasks that were **finished after** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"finishedDateLt","description":"Use to search for tasks that were **finished before** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"dueDateGt","description":"Use to search for tasks **due after** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"dueDateLt","description":"Use to search for tasks **due before** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"updatedDateGt","description":"Use to search for tasks that were **updated after** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"updatedDateLt","description":"Use to search for tasks that were **updated before** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"createdDateGt","description":"Use to search for tasks that were **created after** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"createdDateLt","description":"Use to search for tasks that were **created before** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"metricId","description":"Metric ID.","type":"integer","format":"int32","required":false},{"in":"query","name":"finishedEq","description":"Use to search for finished or unfinished tasks.","type":"string","enum":["true","false"],"required":false},{"in":"path","name":"deal_id","type":"integer","format":"int32","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/TaskEntity"}}}}}},"tags":["tasks"],"operationId":"List tasks of deal"},"post":{"description":"Create a new task related to this deal.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"deal_id","type":"integer","format":"int32","required":true},{"name":"DealsDealIdTasks","in":"body","required":true,"schema":{"$ref":"#/definitions/postDealsDealIdTasks"}}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/TaskEntity"}}}}},"tags":["tasks"],"operationId":"Create task for deal"}},"/deals/{deal_id}/tasks/{id}":{"put":{"description":"Update an existing task of this deal.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"deal_id","type":"integer","format":"int32","required":true},{"in":"path","name":"id","type":"integer","format":"int32","required":true},{"name":"DealsDealIdTasks","in":"body","required":true,"schema":{"$ref":"#/definitions/putDealsDealIdTasks"}}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/TaskEntity"}}}}},"tags":["tasks"],"operationId":"Update task of deal"}},"/deals/movements_history":{"get":{"description":"List deals stages changes in a time range.\n            This allows to track everytime a deal had a movement between stages\n            of a funnel or when it was won or lost.","produces":["application/json"],"parameters":[{"in":"query","name":"page","description":"Page of results to fetch.","type":"integer","format":"int32","default":1,"required":false},{"in":"query","name":"per_page","description":"Number of results to return per page.","type":"integer","format":"int32","default":10,"minimum":0,"maximum":100,"required":false},{"in":"query","name":"since","description":"Use to search for stages or status created and updated\n                 **since** the given date. Example: 2023-10-23T00:00:00Z.\n                 When not provided, default value is 7 days ago.","type":"string","format":"date-time","default":"2026-08-23T10:03:27.737Z","required":false},{"in":"query","name":"days_interval","description":"Amount of days **after since** to delimit the filter range.\n                 Default value is 7. Max value is 30.","type":"integer","format":"int32","default":7,"minimum":1,"maximum":30,"required":false},{"in":"formData","name":"event_type","description":"Filter by event type. Possible values are: stage_changed,\n                   status_changed, and deal_created. You can provide one or more values\n                   separating them by commas without spaces. Example: stage_changed,status_changed.\n                   When value is not provided, all events are returned.","type":"array","items":{"type":"string","enum":["stage_changed","status_changed","deal_created"],"default":["stage_changed","status_changed","deal_created"]},"required":false}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/MovementHistoryEntity"}}}}}},"tags":["deals"],"operationId":"List deal movements history"}},"/deals/{id}":{"put":{"description":"Update a deal.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"id","type":"integer","format":"int32","required":true},{"name":"Deals","in":"body","required":true,"schema":{"$ref":"#/definitions/putDeals"}}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/FullDealEntity"}}}}},"tags":["deals"],"operationId":"Update deal"},"get":{"description":"Get an specific deal by ID.","produces":["application/json"],"parameters":[{"in":"query","name":"withCustomFields","description":"Return custom fields of deals. Use this param to include them in the response.\n           Example: /deals/{id}?withCustomFields=true","type":"boolean","required":false},{"in":"path","name":"id","type":"integer","format":"int32","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/DealEntity"}}}}},"tags":["deals"],"operationId":"Get deal"}},"/deals/{id}/status":{"put":{"description":"Win, lose or reopen a deal.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"id","type":"integer","format":"int32","required":true},{"name":"DealsIdStatus","in":"body","required":true,"schema":{"$ref":"#/definitions/putDealsIdStatus"}}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/FullDealEntity"}}}}},"tags":["deals"],"operationId":"Update deal status"}},"/deals/{id}/stage":{"put":{"description":"Change a deal's funnel stage.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"id","type":"integer","format":"int32","required":true},{"name":"DealsIdStage","in":"body","required":true,"schema":{"$ref":"#/definitions/putDealsIdStage"}}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/FullDealEntity"}}}}},"tags":["deals"],"operationId":"Update deal stage"}},"/deals":{"get":{"description":"List and search for deals.","produces":["application/json"],"parameters":[{"in":"query","name":"page","description":"Page of results to fetch.","type":"integer","format":"int32","default":1,"required":false},{"in":"query","name":"per_page","description":"Number of results to return per page.","type":"integer","format":"int32","default":10,"minimum":0,"maximum":100,"required":false},{"in":"query","name":"title","description":"Title **prefix**.","type":"string","required":false},{"in":"query","name":"dealStatus","description":"Deal status ID.","type":"integer","format":"int32","enum":[1,2,3],"required":false},{"in":"query","name":"dealStage","description":"Deal stage ID.","type":"integer","format":"int32","required":false},{"in":"query","name":"dealStageOrder","description":"Deal stage sequence number.","type":"integer","format":"int32","required":false},{"in":"query","name":"userOwner","description":"Owner user ID.","type":"integer","format":"int32","required":false},{"in":"query","name":"author","description":"Author user ID.","type":"integer","format":"int32","required":false},{"in":"query","name":"organization","description":"Organization ID.","type":"integer","format":"int32","required":false},{"in":"query","name":"person","description":"Person ID.","type":"integer","format":"int32","required":false},{"in":"query","name":"lossReason","description":"Loss reason ID.","type":"integer","format":"int32","required":false},{"in":"query","name":"products","description":"Array of product IDS.","type":"array","items":{"type":"integer","format":"int32"},"required":false},{"in":"query","name":"startAtGt","description":"Use to search for deals that **started after** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"startAtLt","description":"Use to search for deals that **started before** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"endAtGt","description":"Use to search for deals that were **finished after** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"endAtLt","description":"Use to search for deals that were **finished before** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"createdAtGt","description":"Use to search for deals that were **created after** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"createdAtLt","description":"Use to search for deals that were **created before** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"updatedAtGt","description":"Use to search for deals that were **updated after** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"updatedAtLt","description":"Use to search for deals that were **updated before** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"withCustomFields","description":"Return custom fields of deals. Use this param to include them in the response.\n        Example: /deals?withCustomFields=true","type":"boolean","required":false}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/DealEntity"}}}}}},"tags":["deals"],"operationId":"List deals"}},"/tasks":{"get":{"description":"List and search tasks.","produces":["application/json"],"parameters":[{"in":"query","name":"page","description":"Page of results to fetch.","type":"integer","format":"int32","default":1,"required":false},{"in":"query","name":"per_page","description":"Number of results to return per page.","type":"integer","format":"int32","default":10,"minimum":0,"maximum":100,"required":false},{"in":"query","name":"finishedDateGt","description":"Use to search for tasks that were **finished after** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"finishedDateLt","description":"Use to search for tasks that were **finished before** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"dueDateGt","description":"Use to search for tasks **due after** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"dueDateLt","description":"Use to search for tasks **due before** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"updatedDateGt","description":"Use to search for tasks that were **updated after** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"updatedDateLt","description":"Use to search for tasks that were **updated before** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"createdDateGt","description":"Use to search for tasks that were **created after** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"createdDateLt","description":"Use to search for tasks that were **created before** this date.","type":"string","format":"date-time","required":false},{"in":"query","name":"metricId","description":"Metric ID.","type":"integer","format":"int32","required":false},{"in":"query","name":"finishedEq","description":"Use to search for finished or unfinished tasks.","type":"string","enum":["true","false"],"required":false}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/TaskEntity"}}}}}},"tags":["tasks"],"operationId":"List tasks"}},"/tasks/export":{"post":{"description":"Generate a .xlsx file with a list of tasks and return a link\n        to download it.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"formData","name":"since","description":"Use to search for tasks created or updated **since** the\n            given date. Example: 2023-10-23T00:00:00Z.\n            When not provided, default value is 7 days ago.","type":"string","format":"date-time","default":"2026-08-23T10:03:27.811Z","required":false},{"in":"formData","name":"days_interval","description":"Amount of days **after since** to delimit the filter range.\n             Default value is 7. Max value is 30.","type":"integer","format":"int32","default":7,"minimum":1,"maximum":30,"required":false}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"account_exportation_entities":{"type":"array","items":{"$ref":"#/definitions/AccountExportationEntity"}}}}}},"tags":["tasks"],"operationId":"Export list of task in .xlsx"}},"/categories":{"get":{"description":"List all categories in your account.","produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/CategoryEntity"}}}}}},"tags":["categories"],"operationId":"List categories"}},"/sectors":{"get":{"description":"List all sectors in your account.","produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/SectorEntity"}}}}}},"tags":["sectors"],"operationId":"List sectors"}},"/products":{"get":{"description":"List all products in your account.","produces":["application/json"],"parameters":[{"in":"query","name":"page","description":"Page of results to fetch.","type":"integer","format":"int32","default":1,"required":false},{"in":"query","name":"per_page","description":"Number of results to return per page.","type":"integer","format":"int32","default":10,"minimum":0,"maximum":100,"required":false},{"in":"query","name":"withCustomFields","description":"Return custom fields of products.\n                  Example: /products?withCustomFields=true","type":"boolean","required":false}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/ProductEntity"}}}}}},"tags":["products"],"operationId":"List products"},"post":{"description":"Create a new product.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"name":"Products","in":"body","required":true,"schema":{"$ref":"#/definitions/postProducts"}}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/ProductEntity"}}}}},"tags":["products"],"operationId":"Create product"}},"/products/{id}":{"get":{"description":"Get product by id","produces":["application/json"],"parameters":[{"in":"query","name":"withCustomFields","description":"Return custom fields of product.\n                  Example: /products/{id}?withCustomFields=true","type":"boolean","required":false},{"in":"path","name":"id","type":"integer","format":"int32","required":true}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"product_entity":{"$ref":"#/definitions/ProductEntity"}}}}},"tags":["products"],"operationId":"Get a product"},"put":{"description":"Update a product.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"id","type":"integer","format":"int32","required":true},{"name":"Products","in":"body","required":true,"schema":{"$ref":"#/definitions/putProducts"}}],"responses":{"201":{"description":"Updated","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/ProductEntity"}}}}},"tags":["products"],"operationId":"Update product"},"delete":{"description":"Delete a product.","produces":["application/json"],"parameters":[{"in":"path","name":"id","type":"integer","format":"int32","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/ProductEntity"}}}}},"tags":["products"],"operationId":"Delete product"}},"/states":{"get":{"description":"List all available address states.","produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/StateEntity"}}}}}},"tags":["states"],"operationId":"List states"}},"/states/{state}/cities":{"get":{"description":"List all cities in a state.","produces":["application/json"],"parameters":[{"in":"path","name":"state","type":"string","enum":["AC","AL","AP","AM","BA","CE","DF","ES","GO","MA","MT","MS","MG","PA","PB","PR","PE","PI","RJ","RN","RS","RO","RR","SC","SP","SE","TO"],"required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/CityEntity"}}}}}},"tags":["states"],"operationId":"List cities in state"}},"/users":{"get":{"description":"List and search users of your account.","produces":["application/json"],"parameters":[{"in":"query","name":"id","description":"User ID.","type":"integer","format":"int32","required":false},{"in":"query","name":"name","description":"Name **prefix**.","type":"string","required":false},{"in":"query","name":"email","description":"Email **prefix**.","type":"string","required":false},{"in":"query","name":"active","description":"Whether the user is active or not.","type":"boolean","required":false}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/UserEntity"}}}}}},"tags":["users"],"operationId":"List users"}},"/users/me":{"get":{"description":"Get information about the authenticated user.","produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/UserEntity"}}}}},"tags":["users"],"operationId":"Get current user"}},"/users/{id}":{"put":{"description":"Activate or inactivate a specific user.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"id","type":"integer","format":"int32","required":true},{"name":"Users","in":"body","required":true,"schema":{"$ref":"#/definitions/putUsers"}}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"$ref":"#/definitions/UserEntity"}}}}},"tags":["users"],"operationId":"Update user"}},"/lead_origins":{"get":{"description":"List all lead origins in your account.","produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/LeadOriginEntity"}}}}}},"tags":["lead_origins"],"operationId":"List lead origins"}},"/loss_reasons":{"get":{"description":"List all loss reasons in your account.","produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/LossReasonEntity"}}}}}},"tags":["loss_reasons"],"operationId":"List loss reasons"}},"/funnels":{"get":{"description":"List all funnels in your account.","produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/FunnelEntity"}}}}}},"tags":["funnels"],"operationId":"List funnels"}},"/metrics":{"get":{"description":"List all metrics in your account.","produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/MetricEntity"}}}}}},"tags":["metrics"],"operationId":"List metrics"}},"/deal_statuses":{"get":{"description":"List all deal statuses.","produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/DealStatusEntity"}}}}}},"tags":["deal_statuses"],"operationId":"List deal statuses"}},"/deal_stages":{"get":{"description":"List and search deal stages in your account.","produces":["application/json"],"parameters":[{"in":"query","name":"funnel","description":"Funnel ID.","type":"integer","format":"int32","required":false}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/DealStageEntity"}}}}}},"tags":["deal_stages"],"operationId":"List deal stages"}},"/custom_fields/organizations":{"get":{"produces":["application/json"],"responses":{"200":{"description":"get Organization(s)"}},"tags":["custom_fields"],"operationId":"getCustomFieldsOrganizations"}},"/custom_fields/people":{"get":{"produces":["application/json"],"responses":{"200":{"description":"get Person(s)"}},"tags":["custom_fields"],"operationId":"getCustomFieldsPeople"}},"/custom_fields/deals":{"get":{"produces":["application/json"],"responses":{"200":{"description":"get Deal(s)"}},"tags":["custom_fields"],"operationId":"getCustomFieldsDeals"}},"/custom_fields/products":{"get":{"produces":["application/json"],"responses":{"200":{"description":"get Product(s)"}},"tags":["custom_fields"],"operationId":"getCustomFieldsProducts"}},"/product_categories":{"get":{"description":"List all product categories in your account.","produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/ProductCategoryEntity"}}}}}},"tags":["product_categories"],"operationId":"List product categories"}},"/voip_calls":{"get":{"produces":["application/json"],"parameters":[{"in":"query","name":"phone_number","type":"string","required":true}],"responses":{"200":{"description":"get VoipCall(s)"}},"tags":["voip_calls"],"operationId":"getVoipCalls"}},"/ping/{id}":{"get":{"produces":["application/json"],"parameters":[{"in":"path","name":"id","type":"integer","format":"int32","required":true}],"responses":{"200":{"description":"get Ping(s)"}},"tags":["ping"],"operationId":"getPingId"}}},"definitions":{"TaskEntity":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Task ID."},"accountId":{"type":"integer","format":"int32","description":"Account ID."},"user":{"allOf":[{"$ref":"#/definitions/LeanUserEntity"},{"type":"object","description":"User that created this task."}],"description":"User that created this task."},"text":{"type":"string","description":"Text content."},"organization":{"allOf":[{"$ref":"#/definitions/LeanOrganizationEntity"},{"type":"object","description":"Related organization."}],"description":"Related organization."},"person":{"allOf":[{"$ref":"#/definitions/LeanPersonEntity"},{"type":"object","description":"Related person."}],"description":"Related person."},"deal":{"allOf":[{"$ref":"#/definitions/LeanDealEntity"},{"type":"object","description":"Related deal."}],"description":"Related deal."},"dueDate":{"type":"date-time","description":"When this task is due."},"finishedAt":{"type":"date-time","description":"When this task was finished."},"finishedBy":{"allOf":[{"$ref":"#/definitions/LeanUserEntity"},{"type":"object","description":"User who finished this task."}],"description":"User who finished this task."},"createdAt":{"type":"date-time","description":"Time of creation."},"updatedAt":{"type":"date-time","description":"Time of last update."},"assignedUsers":{"type":"array","items":{"$ref":"#/definitions/LeanUserEntity"},"description":"Users assigned to this task"},"metrics":{"type":"array","items":{"$ref":"#/definitions/ActivityMetricEntity"},"description":"Metrics associated with this task."},"type":{"type":"string","description":"Task type."},"_webUrl":{"type":"string","description":"Web platform URL."}},"description":null},"LeanUserEntity":{"type":"object","properties":{"accountId":{"type":"integer","format":"int32","description":"Account ID."},"id":{"type":"integer","format":"int32","description":"User ID."},"name":{"type":"string","description":"User name."}}},"LeanOrganizationEntity":{"type":"object","properties":{"id":{"type":"string","description":"Organization ID."},"name":{"type":"string","description":"Display name (Nome fantasia)."},"email":{"type":"string","description":"Contact email."}}},"LeanPersonEntity":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Person ID."},"name":{"type":"string","description":"Person name."},"email":{"type":"string","format":"email","description":"Email address."}}},"LeanDealEntity":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"}}},"ActivityMetricEntity":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Metric ID."},"name":{"type":"string","description":"Metric name."},"value":{"type":"number","description":"Metric value."}}},"postPeoplePersonIdTasks":{"type":"object","properties":{"text":{"type":"string","description":"Text content of this task."},"assigned_users":{"type":"array","description":"Array of IDs of users assigned to this task.","items":{"type":"integer","format":"int32"}},"due_date":{"type":"string","format":"date-time","description":"When this task is due."},"finished_date":{"type":"string","format":"date-time","description":"When this date was finished."},"finished_by":{"type":"integer","format":"int32","description":"ID of user who finished this task."},"type":{"type":"string","description":"Task type.","enum":["VISITA","REUNIAO","LIGACAO","EMAIL","PROPOSTA","WHATSAPP"]},"metrics":{"type":"array","description":"Array of metric IDs to associated with this task.","items":{"type":"integer","format":"int32"}}},"required":["text"],"description":"Create a new task related to this person."},"putPeoplePersonIdTasks":{"type":"object","properties":{"text":{"type":"string","description":"Text content of this task."},"assigned_users":{"type":"array","description":"Array of IDs of users assigned to this task.","items":{"type":"integer","format":"int32"}},"due_date":{"type":"string","format":"date-time","description":"When this task is due."},"finished_date":{"type":"string","format":"date-time","description":"When this date was finished."},"finished_by":{"type":"integer","format":"int32","description":"ID of user who finished this task."},"type":{"type":"string","description":"Task type.","enum":["VISITA","REUNIAO","LIGACAO","EMAIL","PROPOSTA","WHATSAPP"]},"metrics":{"type":"array","description":"Array of metric IDs to associated with this task.","items":{"type":"integer","format":"int32"}}},"required":["text"],"description":"Update an existing task of this person."},"DealEntity":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Deal ID."},"parentDealId":{"type":"integer","format":"int32","description":"Parent deal ID."},"accountId":{"type":"integer","format":"int32","description":"Account ID."},"organization":{"allOf":[{"$ref":"#/definitions/LeanOrganizationEntity"},{"type":"object","description":"Related organization info."}],"description":"Related organization info."},"person":{"allOf":[{"$ref":"#/definitions/LeanPersonEntity"},{"type":"object","description":"Related person info."}],"description":"Related person info."},"author":{"allOf":[{"$ref":"#/definitions/LeanUserEntity"},{"type":"object","description":"User that created this deal."}],"description":"User that created this deal."},"dealStage":{"allOf":[{"$ref":"#/definitions/DealStageEntity"},{"type":"object","description":"Stage that this deal is currently in."}],"description":"Stage that this deal is currently in."},"dealStatus":{"allOf":[{"$ref":"#/definitions/DealStatusEntity"},{"type":"object","description":"Status that this deal is in."}],"description":"Status that this deal is in."},"lossReason":{"allOf":[{"$ref":"#/definitions/DealLossReasonEntity"},{"type":"object","description":"Deal's loss reason information."}],"description":"Deal's loss reason information."},"owner":{"allOf":[{"$ref":"#/definitions/LeanUserEntity"},{"type":"object","description":"User that currently owns this deal."}],"description":"User that currently owns this deal."},"title":{"type":"string","description":"Deal title."},"description":{"type":"string","description":"Deal description."},"startTime":{"type":"date-time","description":"When this deal was started."},"endTime":{"type":"date-time","description":"When this deal was finished."},"wonAt":{"type":"date-time","description":"When this deal was marked as being won. This is different from endTime because endTime might be a forecast or the deal might have been registered as won retroactively."},"lostAt":{"type":"date-time","description":"When this deal was marked as being lost. This is different from endTime because endTime might be a forecast or the deal might have been registered as won retroactively."},"createdAt":{"type":"date-time","description":"Time of creation."},"updatedAt":{"type":"date-time","description":"Time of last update."},"ranking":{"type":"integer","format":"int32","enum":[0,1,2,3,4,5],"description":"Numeric ranking."},"value":{"type":"number","format":"float","description":"Monetary value."},"products":{"type":"array","items":{"$ref":"#/definitions/ProductEntity"},"description":"Associated products."},"products_entities":{"type":"array","items":{"$ref":"#/definitions/EntityProductEntity"},"description":"Associated products with deal-specific pricing details."},"allowedUsers":{"type":"array","items":{"$ref":"#/definitions/LeanUserEntity"},"description":"Users allowed to view this deal."},"_email":{"type":"string","description":"Email address to which you can send a copy of emails to register them\nas tasks in this deal.\n\nVisit [this article](\nhttps://ajuda.agendor.com.br/pt-BR/funcionalidades/como-gravar-e-mails-nos-historicos-do-agendor\n) for more information.\n"},"customFields":{"type":"object","description":"Custom fields."},"frozen":{"type":"boolean","description":"Whether this deal is currently frozen."},"freezing":{"allOf":[{"$ref":"#/definitions/DealFreezeEntity"},{"type":"object","description":"Freeze details, present only when the deal is frozen; null otherwise."}],"description":"Freeze details, present only when the deal is frozen; null otherwise."},"_webUrl":{"type":"string","description":"Web platform URL."}},"description":null},"DealStageEntity":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Deal stage ID."},"name":{"type":"string","description":"Deal stage name."},"sequence":{"type":"integer","format":"int32","description":"Sequence number."},"funnel":{"allOf":[{"$ref":"#/definitions/LeanFunnelEntity"},{"type":"object","description":"Related funnel info."}],"description":"Related funnel info."}},"description":null},"LeanFunnelEntity":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Funnel ID."},"name":{"type":"string","description":"Funnel name."}}},"DealStatusEntity":{"type":"object","properties":{"id":{"type":"integer","format":"int32","enum":[1,2,3],"description":"Deal status ID."},"name":{"type":"string","enum":["Em andamento","Ganho","Perdido"],"description":"Deal status name"}},"description":null},"DealLossReasonEntity":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Loss reason ID."},"name":{"type":"string","description":"Loss reason name."},"description":{"type":"string","description":"Specific description of this deal's loss reason."}}},"ProductEntity":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Product ID."},"name":{"type":"string","description":"Product name."},"code":{"type":"string","description":"Product code."},"categoryId":{"type":"integer","format":"int32","description":"Product category id."},"price":{"type":"number","format":"double","description":"Product price."},"unit":{"type":"string","description":"Product unit."},"active":{"type":"boolean","description":"Product active."},"imageUrl":{"type":"string","description":"Product image URL."},"imageThumbUrl":{"type":"string","description":"Product image thumbnail URL."},"createdAt":{"type":"s","format":"g","description":"Product creation date."},"customFields":{"type":"hash","description":"Product custom fields."},"description":{"type":"string","description":"Product description (HTML)."}},"description":null},"EntityProductEntity":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Product ID."},"createdAt":{"type":"s","format":"g","description":"Product creation date."},"unitValue":{"type":"number","format":"double","description":"Product creation date."},"quantity":{"type":"number","format":"double","description":"Product creation date."},"discount":{"type":"number","format":"double","description":"Product creation date."},"totalValue":{"type":"number","format":"double","description":"Product creation date."}}},"DealFreezeEntity":{"type":"object","properties":{"frozenAt":{"type":"date-time","description":"When this deal was frozen."},"unfreezeAt":{"type":"date-time","description":"Scheduled date to automatically unfreeze this deal."},"description":{"type":"string","description":"Reason description provided when freezing the deal."},"reason":{"type":"string","description":"Name of the freeze reason."}}},"postPeoplePersonIdDeals":{"type":"object","properties":{"title":{"type":"string","description":"Title to identify this deal.","maxLength":150},"dealStatusText":{"type":"string","description":"Deal status name.","enum":["ongoing","won","lost"]},"description":{"type":"string","description":"Your own description for this deal.","maxLength":2000},"endTime":{"type":"string","format":"date-time","description":"When this deal was finished."},"products_entities":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Product id."},"unitValue":{"type":"number","format":"float","description":"Product value."},"discount":{"type":"number","format":"float","description":"Product value."},"quantity":{"type":"number","format":"float","description":"Product value."}},"required":["id"]}},"products":{"type":"array","items":{"type":"string"}},"ranking":{"type":"integer","format":"int32","description":"Ranking displayed as stars in deal page.","enum":[0,1,2,3,4,5]},"startTime":{"type":"string","format":"date-time","description":"When this deal started."},"author":{"type":"integer","format":"int32","description":"User ID of the author of this deal."},"ownerUser":{"type":"integer","format":"int32","description":"Owner user ID or email."},"funnel":{"type":"integer","format":"int32","description":"Funnel ID."},"dealStage":{"type":"integer","format":"int32","description":"Deal stage sequence number."},"value":{"type":"number","format":"float","description":"Monetary value of this deal."},"allowedUsers":{"type":"array","description":"Array of IDs of users that should be able to see this deal.","items":{"type":"integer","format":"int32"}},"allowToAllUsers":{"type":"boolean","description":"Set true if this deal should be visible to all users.","enum":[true]},"customFields":{"type":"object","description":"Custom Fields information. A key-value map where each key is the identifier (name)\nof a custom field and the value is the desired content.\n\nExample:\n{\n  \"customFields\": {\n    \"custom_field_identifier_1\" : \"desired value\",\n    \"custom_field_identifier_2\" : \"desired value 2\"\n  }\n}\n"},"checkRequiredFields":{"type":"boolean","description":"Check if required fields are filled when changing the deal stage or status."}},"required":["title"],"description":"Create a new deal for person."},"FullDealEntity":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Deal ID."},"parentDealId":{"type":"integer","format":"int32","description":"Parent deal ID."},"title":{"type":"string","description":"Deal title."},"accountId":{"type":"integer","format":"int32","description":"Account ID."},"startTime":{"type":"date-time","description":"When this deal was started."},"endTime":{"type":"date-time","description":"When this deal was finished."},"wonAt":{"type":"date-time","description":"When this deal was marked as being won. This is different from endTime because endTime might be a forecast or the deal might have been registered as won retroactively."},"lostAt":{"type":"date-time","description":"When this deal was marked as being lost. This is different from endTime because endTime might be a forecast or the deal might have been registered as won retroactively."},"organization":{"allOf":[{"$ref":"#/definitions/OrganizationEntity"},{"type":"object","description":"Related organization info."}],"description":"Related organization info."},"person":{"allOf":[{"$ref":"#/definitions/PersonEntity"},{"type":"object","description":"Related person info."}],"description":"Related person info."},"author":{"allOf":[{"$ref":"#/definitions/LeanUserEntity"},{"type":"object","description":"User that created this deal."}],"description":"User that created this deal."},"dealStage":{"allOf":[{"$ref":"#/definitions/DealStageEntity"},{"type":"object","description":"Stage that this deal is currently in."}],"description":"Stage that this deal is currently in."},"dealStatus":{"allOf":[{"$ref":"#/definitions/DealStatusEntity"},{"type":"object","description":"Status that this deal is in."}],"description":"Status that this deal is in."},"lossReason":{"allOf":[{"$ref":"#/definitions/DealLossReasonEntity"},{"type":"object","description":"Deal's loss reason information."}],"description":"Deal's loss reason information."},"owner":{"allOf":[{"$ref":"#/definitions/LeanUserEntity"},{"type":"object","description":"User that currently owns this deal."}],"description":"User that currently owns this deal."},"description":{"type":"string","description":"Deal description."},"createdAt":{"type":"date-time","description":"Time of creation."},"updatedAt":{"type":"date-time","description":"Time of last update."},"ranking":{"type":"integer","format":"int32","enum":[0,1,2,3,4,5],"description":"Numeric ranking."},"value":{"type":"number","format":"float","description":"Monetary value."},"products_entities":{"type":"array","items":{"$ref":"#/definitions/EntityProductEntity"},"description":"Associated products."},"products":{"type":"array","items":{"type":"string"},"description":"Associated products ids."},"allowedUsers":{"type":"array","items":{"$ref":"#/definitions/LeanUserEntity"},"description":"Users allowed to view this deal."},"_email":{"type":"string","description":"Email address to which you can send a copy of emails to register them\nas tasks in this deal.\n\nVisit [this article](\nhttps://ajuda.agendor.com.br/pt-BR/funcionalidades/como-gravar-e-mails-nos-historicos-do-agendor\n) for more information.\n"},"customFields":{"type":"object","description":"Custom fields."},"frozen":{"type":"boolean","description":"Whether this deal is currently frozen."},"freezing":{"allOf":[{"$ref":"#/definitions/DealFreezeEntity"},{"type":"object","description":"Freeze details, present only when the deal is frozen; null otherwise."}],"description":"Freeze details, present only when the deal is frozen; null otherwise."},"_webUrl":{"type":"string","description":"Web platform URL."}},"description":null},"OrganizationEntity":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Organization ID."},"accountId":{"type":"integer","format":"int32","description":"Account ID."},"name":{"type":"string","description":"Display name (Nome fantasia)."},"legalName":{"type":"string","description":"Legal name (Razão social)."},"email":{"type":"string","format":"email","description":"Contact email."},"cnpj":{"type":"string","description":"Document number (CNPJ)."},"description":{"type":"string","description":"Organization description."},"logo":{"type":"object","properties":{"full":{"type":"string","format":"url","description":"Full sized logo image URL."},"thumb":{"type":"string","format":"url","description":"Thumb sized logo image URL."},"thumb_large":{"type":"string","format":"url","description":"Large thumb sized logo image URL."}},"description":"Logo image URLs."},"ranking":{"type":"integer","format":"int32","enum":[0,1,2,3,4,5],"description":"Numeric ranking."},"website":{"type":"string","format":"url","description":"Homepage URL."},"createdAt":{"type":"date-time","description":"Time of creation."},"updatedAt":{"type":"date-time","description":"Time of last update."},"products":{"type":"array","items":{"$ref":"#/definitions/ProductEntity"},"description":"Associated products."},"contact":{"allOf":[{"$ref":"#/definitions/ContactEntity"},{"type":"object","description":"Contact information."}],"description":"Contact information."},"address":{"allOf":[{"$ref":"#/definitions/AddressEntity"},{"type":"object","description":"Address information."}],"description":"Address information."},"category":{"allOf":[{"$ref":"#/definitions/CategoryEntity"},{"type":"object","description":"Associated category."}],"description":"Associated category."},"leadOrigin":{"allOf":[{"$ref":"#/definitions/LeadOriginEntity"},{"type":"object","description":"Associated lead origin."}],"description":"Associated lead origin."},"sector":{"allOf":[{"$ref":"#/definitions/SectorEntity"},{"type":"object","description":"Associated sector."}],"description":"Associated sector."},"people":{"type":"array","items":{"$ref":"#/definitions/LeanPersonEntity"},"description":"First page of people in this organization."},"author":{"allOf":[{"$ref":"#/definitions/LeanUserEntity"},{"type":"object","description":"User that created this organization."}],"description":"User that created this organization."},"ownerUser":{"allOf":[{"$ref":"#/definitions/LeanUserEntity"},{"type":"object","description":"User that currently owns this organization."}],"description":"User that currently owns this organization."},"allowedUsers":{"type":"array","items":{"$ref":"#/definitions/LeanUserEntity"},"description":"Users allowed to view this organization."},"customFields":{"type":"object","description":"Custom fields."},"_webUrl":{"type":"string","format":"url","description":"Web platform URL."}},"description":null},"ContactEntity":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"Email address."},"work":{"type":"string","example":"(99) 9999-9999","description":"Formatted work phone number."},"mobile":{"type":"string","example":"(99) 99999-9999","description":"Formatted mobile phone number."},"fax":{"type":"string","description":"Formatted fax number."},"ramal":{"type":"string","description":"Phone line branch number."},"radio":{"type":"string","description":"Radio phone number."},"whatsapp":{"type":"string","example":"+5511999999999","description":"WhatsApp phone number."},"facebook":{"type":"string","format":"url","description":"Facebook profile URL."},"twitter":{"type":"string","format":"url","description":"Twitter profile URL."},"linkedIn":{"type":"string","format":"url","description":"LinkedIn profile URL."},"skype":{"type":"string","description":"Skype username."},"instagram":{"type":"string","format":"url","description":"Instagram profile URL."}}},"AddressEntity":{"type":"object","properties":{"country":{"type":"string","description":"Country name."},"district":{"type":"string","description":"District (city subdivision) name."},"streetName":{"type":"string","description":"Street name."},"streetNumber":{"type":"integer","format":"int32","description":"Building number."},"additionalInfo":{"type":"string","description":"Additional address info."},"postalCode":{"type":"string","example":"99999-999","description":"Postal code (CEP)."},"state":{"type":"string","enum":["AC","AL","AP","AM","BA","CE","DF","ES","GO","MA","MT","MS","MG","PA","PB","PR","PE","PI","RJ","RN","RS","RO","RR","SC","SP","SE","TO"],"description":"State abbreviation."},"city":{"type":"string","description":"City name."}}},"CategoryEntity":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Category ID."},"name":{"type":"string","description":"Category name."}},"description":null},"LeadOriginEntity":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Lead origin ID."},"name":{"type":"string","description":"Lead origin name."}},"description":null},"SectorEntity":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Sector ID."},"name":{"type":"string","description":"Sector name."}},"description":null},"PersonEntity":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Person ID."},"accountId":{"type":"integer","format":"int32","description":"Account ID."},"name":{"type":"string","description":"Person's name."},"email":{"type":"string","description":"Contact email."},"organization":{"allOf":[{"$ref":"#/definitions/LeanOrganizationEntity"},{"type":"object","description":"Related organization info."}],"description":"Related organization info."},"cpf":{"type":"string","description":"Document number (CPF)."},"role":{"type":"string","description":"Person's role in organization."},"ranking":{"type":"integer","format":"int32","enum":[0,1,2,3,4,5],"description":"Numeric ranking."},"description":{"type":"string","description":"Person description."},"birthday":{"type":"string","description":"Person's birthdate."},"avatar":{"type":"string","format":"url","description":"Avatar image URL."},"createdAt":{"type":"date-time","description":"Time of creation."},"updatedAt":{"type":"date-time","description":"Time of last update."},"products":{"type":"array","items":{"$ref":"#/definitions/ProductEntity"},"description":"Associated products."},"contact":{"allOf":[{"$ref":"#/definitions/ContactEntity"},{"type":"object","description":"Contact information."}],"description":"Contact information."},"address":{"allOf":[{"$ref":"#/definitions/AddressEntity"},{"type":"object","description":"Address information."}],"description":"Address information."},"category":{"allOf":[{"$ref":"#/definitions/CategoryEntity"},{"type":"object","description":"Associated category."}],"description":"Associated category."},"leadOrigin":{"allOf":[{"$ref":"#/definitions/LeadOriginEntity"},{"type":"object","description":"Associated lead origin."}],"description":"Associated lead origin."},"author":{"allOf":[{"$ref":"#/definitions/LeanUserEntity"},{"type":"object","description":"User that created this organization."}],"description":"User that created this organization."},"ownerUser":{"allOf":[{"$ref":"#/definitions/LeanUserEntity"},{"type":"object","description":"User that currently owns this organization."}],"description":"User that currently owns this organization."},"allowedUsers":{"type":"array","items":{"$ref":"#/definitions/LeanUserEntity"},"description":"Users allowed to view this organization."},"customFields":{"type":"object","description":"Custom fields."},"_webUrl":{"type":"string","format":"url","description":"Web platform URL."}},"description":null},"postPeople":{"type":"object","properties":{"name":{"type":"string","description":"Name of this person.","maxLength":150},"cpf":{"type":"string","description":"Legal document number (CPF).","pattern":"/\\d{11}/"},"organization":{"type":"integer","format":"int32","description":"Organization ID."},"role":{"type":"string","description":"Person's role in their organization."},"ranking":{"type":"integer","format":"int32","description":"Ranking displayed as stars in the person's page.","enum":[0,1,2,3,4,5]},"description":{"type":"string","description":"Your description of this person.","maxLength":700},"birthday":{"type":"Birthdate","description":"Person's birthdate with or without year.","pattern":"YYYY-MM-DD or MM-DD"},"author":{"type":"integer","format":"int32","description":"User ID of the author of this person."},"ownerUser":{"type":"integer","format":"int32","description":"User ID or email of the owner of this person."},"contact":{"type":"object","description":"Contact information.","properties":{"email":{"type":"string","format":"email","description":"Contact email."},"work":{"type":"string","description":"Work phone number.","pattern":"/\\d{10, 11}/"},"mobile":{"type":"string","description":"Mobile phone number.","pattern":"/\\d{10, 11}/"},"fax":{"type":"string","description":"Fax number.","pattern":"/\\d{10, 11}/"},"whatsapp":{"type":"string","description":"WhatsApp phone number. Include country code (DDI) and area code (DDD).","pattern":"/+?\\d{13}/"},"facebook":{"type":"string","format":"url","description":"Facebook page URL."},"twitter":{"type":"string","format":"url","description":"Twitter profile URL."},"instagram":{"type":"string","format":"url","description":"Instagram profile URL."},"linked_in":{"type":"string","format":"url","description":"LinkedIn profile URL."},"skype":{"type":"string","description":"Skype username."}}},"address":{"type":"object","description":"Address information.","properties":{"postal_code":{"type":"string","description":"Postal code (CEP).","pattern":"/\\d{8}/"},"country":{"type":"string","description":"Country name."},"district":{"type":"string","description":"District name (city division)."},"state":{"type":"string","description":"State abbreviation. Only Brazilian states supported.","enum":["AC","AL","AP","AM","BA","CE","DF","ES","GO","MA","MT","MS","MG","PA","PB","PR","PE","PI","RJ","RN","RS","RO","RR","SC","SP","SE","TO"]},"street_name":{"type":"string","description":"Street name."},"street_number":{"type":"integer","format":"int32","description":"Building number."},"additional_info":{"type":"string","description":"Additional address info."},"city":{"type":"integer","format":"int32","description":"City ID or name."}}},"leadOrigin":{"type":"integer","format":"int32","description":"Lead origin ID or name."},"category":{"type":"integer","format":"int32","description":"Category ID or name."},"products":{"type":"array","description":"Array of product IDS.","items":{"type":"integer","format":"int32"}},"allowedUsers":{"type":"array","description":"Array of IDs of users that should be able to see this person.","items":{"type":"integer","format":"int32"}},"allowToAllUsers":{"type":"boolean","description":"Set true if this person should be visible to all users.","enum":[true]},"customFields":{"type":"object","description":"Custom Fields information. A key-value map where each key is the identifier (name)\nof a custom field and the value is the desired content.\n\nExample:\n{\n  \"customFields\": {\n    \"custom_field_identifier_1\" : \"desired value\",\n    \"custom_field_identifier_2\" : \"desired value 2\"\n  }\n}\n"}},"required":["name"],"description":"Create a new person."},"postPeopleUpsert":{"type":"object","properties":{"name":{"type":"string","description":"Name of this person.","maxLength":150},"cpf":{"type":"string","description":"Legal document number (CPF).","pattern":"/\\d{11}/"},"organization":{"type":"integer","format":"int32","description":"Organization ID."},"role":{"type":"string","description":"Person's role in their organization."},"ranking":{"type":"integer","format":"int32","description":"Ranking displayed as stars in the person's page.","enum":[0,1,2,3,4,5]},"description":{"type":"string","description":"Your description of this person.","maxLength":700},"birthday":{"type":"Birthdate","description":"Person's birthdate with or without year.","pattern":"YYYY-MM-DD or MM-DD"},"author":{"type":"integer","format":"int32","description":"User ID of the author of this person."},"ownerUser":{"type":"integer","format":"int32","description":"User ID or email of the owner of this person."},"contact":{"type":"object","description":"Contact information.","properties":{"email":{"type":"string","format":"email","description":"Email address that will be used to find (exact match) or create."},"work":{"type":"string","description":"Work phone number.","pattern":"/\\d{10, 11}/"},"mobile":{"type":"string","description":"Mobile phone number.","pattern":"/\\d{10, 11}/"},"fax":{"type":"string","description":"Fax number.","pattern":"/\\d{10, 11}/"},"whatsapp":{"type":"string","description":"WhatsApp phone number. Include country code (DDI) and area code (DDD).","pattern":"/+?\\d{13}/"},"facebook":{"type":"string","format":"url","description":"Facebook page URL."},"twitter":{"type":"string","format":"url","description":"Twitter profile URL."},"instagram":{"type":"string","format":"url","description":"Instagram profile URL."},"linked_in":{"type":"string","format":"url","description":"LinkedIn profile URL."},"skype":{"type":"string","description":"Skype username."}},"required":["email"]},"address":{"type":"object","description":"Address information.","properties":{"postal_code":{"type":"string","description":"Postal code (CEP).","pattern":"/\\d{8}/"},"country":{"type":"string","description":"Country name."},"district":{"type":"string","description":"District name (city division)."},"state":{"type":"string","description":"State abbreviation. Only Brazilian states supported.","enum":["AC","AL","AP","AM","BA","CE","DF","ES","GO","MA","MT","MS","MG","PA","PB","PR","PE","PI","RJ","RN","RS","RO","RR","SC","SP","SE","TO"]},"street_name":{"type":"string","description":"Street name."},"street_number":{"type":"integer","format":"int32","description":"Building number."},"additional_info":{"type":"string","description":"Additional address info."},"city":{"type":"integer","format":"int32","description":"City ID or name."}}},"leadOrigin":{"type":"integer","format":"int32","description":"Lead origin ID or name."},"category":{"type":"integer","format":"int32","description":"Category ID or name."},"products":{"type":"array","description":"Array of product IDS.","items":{"type":"integer","format":"int32"}},"allowedUsers":{"type":"array","description":"Array of IDs of users that should be able to see this person.","items":{"type":"integer","format":"int32"}},"allowToAllUsers":{"type":"boolean","description":"Set true if this person should be visible to all users.","enum":[true]},"customFields":{"type":"object","description":"Custom Fields information. A key-value map where each key is the identifier (name)\nof a custom field and the value is the desired content.\n\nExample:\n{\n  \"customFields\": {\n    \"custom_field_identifier_1\" : \"desired value\",\n    \"custom_field_identifier_2\" : \"desired value 2\"\n  }\n}\n"}},"description":"Search for a person by cpf or email.\n\nIf found, update it, otherwise, create a new one.\n\nThis endpoint is very useful if you want to avoid verifying for\nduplicates before creating a new person.\n"},"putPeople":{"type":"object","properties":{"name":{"type":"string","description":"Name of this person.","maxLength":150},"cpf":{"type":"string","description":"Legal document number (CPF).","pattern":"/\\d{11}/"},"organization":{"type":"integer","format":"int32","description":"Organization ID."},"role":{"type":"string","description":"Person's role in their organization."},"ranking":{"type":"integer","format":"int32","description":"Ranking displayed as stars in the person's page.","enum":[0,1,2,3,4,5]},"description":{"type":"string","description":"Your description of this person.","maxLength":700},"birthday":{"type":"Birthdate","description":"Person's birthdate with or without year.","pattern":"YYYY-MM-DD or MM-DD"},"author":{"type":"integer","format":"int32","description":"User ID of the author of this person."},"ownerUser":{"type":"integer","format":"int32","description":"User ID or email of the owner of this person."},"contact":{"type":"object","description":"Contact information.","properties":{"email":{"type":"string","format":"email","description":"Contact email."},"work":{"type":"string","description":"Work phone number.","pattern":"/\\d{10, 11}/"},"mobile":{"type":"string","description":"Mobile phone number.","pattern":"/\\d{10, 11}/"},"fax":{"type":"string","description":"Fax number.","pattern":"/\\d{10, 11}/"},"whatsapp":{"type":"string","description":"WhatsApp phone number. Include country code (DDI) and area code (DDD).","pattern":"/+?\\d{13}/"},"facebook":{"type":"string","format":"url","description":"Facebook page URL."},"twitter":{"type":"string","format":"url","description":"Twitter profile URL."},"instagram":{"type":"string","format":"url","description":"Instagram profile URL."},"linked_in":{"type":"string","format":"url","description":"LinkedIn profile URL."},"skype":{"type":"string","description":"Skype username."}}},"address":{"type":"object","description":"Address information.","properties":{"postal_code":{"type":"string","description":"Postal code (CEP).","pattern":"/\\d{8}/"},"country":{"type":"string","description":"Country name."},"district":{"type":"string","description":"District name (city division)."},"state":{"type":"string","description":"State abbreviation. Only Brazilian states supported.","enum":["AC","AL","AP","AM","BA","CE","DF","ES","GO","MA","MT","MS","MG","PA","PB","PR","PE","PI","RJ","RN","RS","RO","RR","SC","SP","SE","TO"]},"street_name":{"type":"string","description":"Street name."},"street_number":{"type":"integer","format":"int32","description":"Building number."},"additional_info":{"type":"string","description":"Additional address info."},"city":{"type":"integer","format":"int32","description":"City ID or name."}}},"leadOrigin":{"type":"integer","format":"int32","description":"Lead origin ID or name."},"category":{"type":"integer","format":"int32","description":"Category ID or name."},"products":{"type":"array","description":"Array of product IDS.","items":{"type":"integer","format":"int32"}},"allowedUsers":{"type":"array","description":"Array of IDs of users that should be able to see this person.","items":{"type":"integer","format":"int32"}},"allowToAllUsers":{"type":"boolean","description":"Set true if this person should be visible to all users.","enum":[true]},"customFields":{"type":"object","description":"Custom Fields information. A key-value map where each key is the identifier (name)\nof a custom field and the value is the desired content.\n\nExample:\n{\n  \"customFields\": {\n    \"custom_field_identifier_1\" : \"desired value\",\n    \"custom_field_identifier_2\" : \"desired value 2\"\n  }\n}\n"}},"description":"Update a specific person by ID."},"postOrganizationsOrganizationIdTasks":{"type":"object","properties":{"text":{"type":"string","description":"Text content of this task."},"assigned_users":{"type":"array","description":"Array of IDs of users assigned to this task.","items":{"type":"integer","format":"int32"}},"due_date":{"type":"string","format":"date-time","description":"When this task is due."},"finished_date":{"type":"string","format":"date-time","description":"When this date was finished."},"finished_by":{"type":"integer","format":"int32","description":"ID of user who finished this task."},"type":{"type":"string","description":"Task type.","enum":["VISITA","REUNIAO","LIGACAO","EMAIL","PROPOSTA","WHATSAPP"]},"metrics":{"type":"array","description":"Array of metric IDs to associated with this task.","items":{"type":"integer","format":"int32"}}},"required":["text"],"description":"Create a new task related to this organization."},"putOrganizationsOrganizationIdTasks":{"type":"object","properties":{"text":{"type":"string","description":"Text content of this task."},"assigned_users":{"type":"array","description":"Array of IDs of users assigned to this task.","items":{"type":"integer","format":"int32"}},"due_date":{"type":"string","format":"date-time","description":"When this task is due."},"finished_date":{"type":"string","format":"date-time","description":"When this date was finished."},"finished_by":{"type":"integer","format":"int32","description":"ID of user who finished this task."},"type":{"type":"string","description":"Task type.","enum":["VISITA","REUNIAO","LIGACAO","EMAIL","PROPOSTA","WHATSAPP"]},"metrics":{"type":"array","description":"Array of metric IDs to associated with this task.","items":{"type":"integer","format":"int32"}}},"required":["text"],"description":"Update an existing task of this organization."},"postOrganizationsOrganizationIdDeals":{"type":"object","properties":{"title":{"type":"string","description":"Title to identify this deal.","maxLength":150},"dealStatusText":{"type":"string","description":"Deal status name.","enum":["ongoing","won","lost"]},"description":{"type":"string","description":"Your own description for this deal.","maxLength":2000},"endTime":{"type":"string","format":"date-time","description":"When this deal was finished."},"products_entities":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Product id."},"unitValue":{"type":"number","format":"float","description":"Product value."},"discount":{"type":"number","format":"float","description":"Product value."},"quantity":{"type":"number","format":"float","description":"Product value."}},"required":["id"]}},"products":{"type":"array","items":{"type":"string"}},"ranking":{"type":"integer","format":"int32","description":"Ranking displayed as stars in deal page.","enum":[0,1,2,3,4,5]},"startTime":{"type":"string","format":"date-time","description":"When this deal started."},"author":{"type":"integer","format":"int32","description":"User ID of the author of this deal."},"ownerUser":{"type":"integer","format":"int32","description":"Owner user ID or email."},"funnel":{"type":"integer","format":"int32","description":"Funnel ID."},"dealStage":{"type":"integer","format":"int32","description":"Deal stage sequence number."},"value":{"type":"number","format":"float","description":"Monetary value of this deal."},"allowedUsers":{"type":"array","description":"Array of IDs of users that should be able to see this deal.","items":{"type":"integer","format":"int32"}},"allowToAllUsers":{"type":"boolean","description":"Set true if this deal should be visible to all users.","enum":[true]},"customFields":{"type":"object","description":"Custom Fields information. A key-value map where each key is the identifier (name)\nof a custom field and the value is the desired content.\n\nExample:\n{\n  \"customFields\": {\n    \"custom_field_identifier_1\" : \"desired value\",\n    \"custom_field_identifier_2\" : \"desired value 2\"\n  }\n}\n"},"checkRequiredFields":{"type":"boolean","description":"Check if required fields are filled when changing the deal stage or status."}},"required":["title"],"description":"Create a new deal for organization."},"postOrganizations":{"type":"object","properties":{"name":{"type":"string","description":"Display name (Nome fantasia).","maxLength":150},"legalName":{"type":"string","description":"Legal name (Razão social).","maxLength":255},"cnpj":{"type":"string","description":"Legal document number (CNPJ).","pattern":"/[A-Z0-9]{12}[0-9]{2}/"},"description":{"type":"string","description":"Your description of this organization.","maxLength":700},"logo":{"type":"string","format":"url","description":"Logo image URL."},"website":{"type":"string","format":"url","description":"Homepage URL."},"ranking":{"type":"integer","format":"int32","description":"Ranking displayed as stars in the organization page.","enum":[0,1,2,3,4,5]},"author":{"type":"integer","format":"int32","description":"User ID of the author of this organization."},"ownerUser":{"type":"integer","format":"int32","description":"User ID or email of the owner of this organization."},"contact":{"type":"object","description":"Contact information.","properties":{"email":{"type":"string","format":"email","description":"Contact email."},"work":{"type":"string","description":"Work phone number.","pattern":"/\\d{10, 11}/"},"mobile":{"type":"string","description":"Mobile phone number.","pattern":"/\\d{10, 11}/"},"fax":{"type":"string","description":"Fax number.","pattern":"/\\d{10, 11}/"},"whatsapp":{"type":"string","description":"WhatsApp phone number. Include country code (DDI) and area code (DDD).","pattern":"/+?\\d{13}/"},"facebook":{"type":"string","format":"url","description":"Facebook page URL."},"twitter":{"type":"string","format":"url","description":"Twitter profile URL."},"instagram":{"type":"string","format":"url","description":"Instagram profile URL."},"linked_in":{"type":"string","format":"url","description":"LinkedIn profile URL."},"skype":{"type":"string","description":"Skype username."}}},"address":{"type":"object","description":"Address information.","properties":{"postal_code":{"type":"string","description":"Postal code (CEP).","pattern":"/\\d{8}/"},"country":{"type":"string","description":"Country name."},"district":{"type":"string","description":"District name (city division)."},"state":{"type":"string","description":"State abbreviation. Only Brazilian states supported.","enum":["AC","AL","AP","AM","BA","CE","DF","ES","GO","MA","MT","MS","MG","PA","PB","PR","PE","PI","RJ","RN","RS","RO","RR","SC","SP","SE","TO"]},"street_name":{"type":"string","description":"Street name."},"street_number":{"type":"integer","format":"int32","description":"Building number."},"additional_info":{"type":"string","description":"Additional address info."},"city":{"type":"integer","format":"int32","description":"City ID or name."}}},"leadOrigin":{"type":"integer","format":"int32","description":"Lead origin ID or name."},"category":{"type":"integer","format":"int32","description":"Category ID or name."},"sector":{"type":"integer","format":"int32","description":"Sector ID or name."},"products":{"type":"array","description":"Array of product IDs.","items":{"type":"integer","format":"int32"}},"allowedUsers":{"type":"array","description":"Array of IDs of users that should be able to see this organization.","items":{"type":"integer","format":"int32"}},"allowToAllUsers":{"type":"boolean","description":"Set true if this organization should be visible to all users.","enum":[true]},"customFields":{"type":"object","description":"Custom Fields information. A key-value map where each key is the identifier (name)\nof a custom field and the value is the desired content.\n\nExample:\n{\n  \"customFields\": {\n    \"custom_field_identifier_1\" : \"desired value\",\n    \"custom_field_identifier_2\" : \"desired value 2\"\n  }\n}\n"}},"required":["name"],"description":"Create a new organization."},"postOrganizationsUpsert":{"type":"object","properties":{"name":{"type":"string","description":"Display name (Nome fantasia) that will be used to find (exact match) or create.","maxLength":150},"legalName":{"type":"string","description":"Legal name (Razão social).","maxLength":255},"cnpj":{"type":"string","description":"Legal document number (CNPJ).","pattern":"/[A-Z0-9]{12}[0-9]{2}/"},"description":{"type":"string","description":"Your description of this organization.","maxLength":700},"logo":{"type":"string","format":"url","description":"Logo image URL."},"website":{"type":"string","format":"url","description":"Homepage URL."},"ranking":{"type":"integer","format":"int32","description":"Ranking displayed as stars in the organization page.","enum":[0,1,2,3,4,5]},"author":{"type":"integer","format":"int32","description":"User ID of the author of this organization."},"ownerUser":{"type":"integer","format":"int32","description":"User ID or email of the owner of this organization."},"contact":{"type":"object","description":"Contact information.","properties":{"email":{"type":"string","format":"email","description":"Contact email."},"work":{"type":"string","description":"Work phone number.","pattern":"/\\d{10, 11}/"},"mobile":{"type":"string","description":"Mobile phone number.","pattern":"/\\d{10, 11}/"},"fax":{"type":"string","description":"Fax number.","pattern":"/\\d{10, 11}/"},"whatsapp":{"type":"string","description":"WhatsApp phone number. Include country code (DDI) and area code (DDD).","pattern":"/+?\\d{13}/"},"facebook":{"type":"string","format":"url","description":"Facebook page URL."},"twitter":{"type":"string","format":"url","description":"Twitter profile URL."},"instagram":{"type":"string","format":"url","description":"Instagram profile URL."},"linked_in":{"type":"string","format":"url","description":"LinkedIn profile URL."},"skype":{"type":"string","description":"Skype username."}}},"address":{"type":"object","description":"Address information.","properties":{"postal_code":{"type":"string","description":"Postal code (CEP).","pattern":"/\\d{8}/"},"country":{"type":"string","description":"Country name."},"district":{"type":"string","description":"District name (city division)."},"state":{"type":"string","description":"State abbreviation. Only Brazilian states supported.","enum":["AC","AL","AP","AM","BA","CE","DF","ES","GO","MA","MT","MS","MG","PA","PB","PR","PE","PI","RJ","RN","RS","RO","RR","SC","SP","SE","TO"]},"street_name":{"type":"string","description":"Street name."},"street_number":{"type":"integer","format":"int32","description":"Building number."},"additional_info":{"type":"string","description":"Additional address info."},"city":{"type":"integer","format":"int32","description":"City ID or name."}}},"leadOrigin":{"type":"integer","format":"int32","description":"Lead origin ID or name."},"category":{"type":"integer","format":"int32","description":"Category ID or name."},"sector":{"type":"integer","format":"int32","description":"Sector ID or name."},"products":{"type":"array","description":"Array of product IDs.","items":{"type":"integer","format":"int32"}},"allowedUsers":{"type":"array","description":"Array of IDs of users that should be able to see this organization.","items":{"type":"integer","format":"int32"}},"allowToAllUsers":{"type":"boolean","description":"Set true if this organization should be visible to all users.","enum":[true]},"customFields":{"type":"object","description":"Custom Fields information. A key-value map where each key is the identifier (name)\nof a custom field and the value is the desired content.\n\nExample:\n{\n  \"customFields\": {\n    \"custom_field_identifier_1\" : \"desired value\",\n    \"custom_field_identifier_2\" : \"desired value 2\"\n  }\n}\n"}},"required":["name"],"description":"Search for an organization by name or document number (CNPJ).\n\nIf found, update it, otherwise, create a new one.\n\nThis endpoint is very useful if you want to avoid verifying for\nduplicates before creating a new organization.\n"},"putOrganizations":{"type":"object","properties":{"name":{"type":"string","description":"Display name (Nome fantasia).","maxLength":150},"legalName":{"type":"string","description":"Legal name (Razão social).","maxLength":255},"cnpj":{"type":"string","description":"Legal document number (CNPJ).","pattern":"/[A-Z0-9]{12}[0-9]{2}/"},"description":{"type":"string","description":"Your description of this organization.","maxLength":700},"logo":{"type":"string","format":"url","description":"Logo image URL."},"website":{"type":"string","format":"url","description":"Homepage URL."},"ranking":{"type":"integer","format":"int32","description":"Ranking displayed as stars in the organization page.","enum":[0,1,2,3,4,5]},"author":{"type":"integer","format":"int32","description":"User ID of the author of this organization."},"ownerUser":{"type":"integer","format":"int32","description":"User ID or email of the owner of this organization."},"contact":{"type":"object","description":"Contact information.","properties":{"email":{"type":"string","format":"email","description":"Contact email."},"work":{"type":"string","description":"Work phone number.","pattern":"/\\d{10, 11}/"},"mobile":{"type":"string","description":"Mobile phone number.","pattern":"/\\d{10, 11}/"},"fax":{"type":"string","description":"Fax number.","pattern":"/\\d{10, 11}/"},"whatsapp":{"type":"string","description":"WhatsApp phone number. Include country code (DDI) and area code (DDD).","pattern":"/+?\\d{13}/"},"facebook":{"type":"string","format":"url","description":"Facebook page URL."},"twitter":{"type":"string","format":"url","description":"Twitter profile URL."},"instagram":{"type":"string","format":"url","description":"Instagram profile URL."},"linked_in":{"type":"string","format":"url","description":"LinkedIn profile URL."},"skype":{"type":"string","description":"Skype username."}}},"address":{"type":"object","description":"Address information.","properties":{"postal_code":{"type":"string","description":"Postal code (CEP).","pattern":"/\\d{8}/"},"country":{"type":"string","description":"Country name."},"district":{"type":"string","description":"District name (city division)."},"state":{"type":"string","description":"State abbreviation. Only Brazilian states supported.","enum":["AC","AL","AP","AM","BA","CE","DF","ES","GO","MA","MT","MS","MG","PA","PB","PR","PE","PI","RJ","RN","RS","RO","RR","SC","SP","SE","TO"]},"street_name":{"type":"string","description":"Street name."},"street_number":{"type":"integer","format":"int32","description":"Building number."},"additional_info":{"type":"string","description":"Additional address info."},"city":{"type":"integer","format":"int32","description":"City ID or name."}}},"leadOrigin":{"type":"integer","format":"int32","description":"Lead origin ID or name."},"category":{"type":"integer","format":"int32","description":"Category ID or name."},"sector":{"type":"integer","format":"int32","description":"Sector ID or name."},"products":{"type":"array","description":"Array of product IDs.","items":{"type":"integer","format":"int32"}},"allowedUsers":{"type":"array","description":"Array of IDs of users that should be able to see this organization.","items":{"type":"integer","format":"int32"}},"allowToAllUsers":{"type":"boolean","description":"Set true if this organization should be visible to all users.","enum":[true]},"customFields":{"type":"object","description":"Custom Fields information. A key-value map where each key is the identifier (name)\nof a custom field and the value is the desired content.\n\nExample:\n{\n  \"customFields\": {\n    \"custom_field_identifier_1\" : \"desired value\",\n    \"custom_field_identifier_2\" : \"desired value 2\"\n  }\n}\n"}},"description":"Update a specific organization by ID."},"postDealsDealIdTasks":{"type":"object","properties":{"text":{"type":"string","description":"Text content of this task."},"assigned_users":{"type":"array","description":"Array of IDs of users assigned to this task.","items":{"type":"integer","format":"int32"}},"due_date":{"type":"string","format":"date-time","description":"When this task is due."},"finished_date":{"type":"string","format":"date-time","description":"When this date was finished."},"finished_by":{"type":"integer","format":"int32","description":"ID of user who finished this task."},"type":{"type":"string","description":"Task type.","enum":["VISITA","REUNIAO","LIGACAO","EMAIL","PROPOSTA","WHATSAPP"]},"metrics":{"type":"array","description":"Array of metric IDs to associated with this task.","items":{"type":"integer","format":"int32"}}},"required":["text"],"description":"Create a new task related to this deal."},"putDealsDealIdTasks":{"type":"object","properties":{"text":{"type":"string","description":"Text content of this task."},"assigned_users":{"type":"array","description":"Array of IDs of users assigned to this task.","items":{"type":"integer","format":"int32"}},"due_date":{"type":"string","format":"date-time","description":"When this task is due."},"finished_date":{"type":"string","format":"date-time","description":"When this date was finished."},"finished_by":{"type":"integer","format":"int32","description":"ID of user who finished this task."},"type":{"type":"string","description":"Task type.","enum":["VISITA","REUNIAO","LIGACAO","EMAIL","PROPOSTA","WHATSAPP"]},"metrics":{"type":"array","description":"Array of metric IDs to associated with this task.","items":{"type":"integer","format":"int32"}}},"required":["text"],"description":"Update an existing task of this deal."},"MovementHistoryEntity":{"type":"object","properties":{"deal":{"allOf":[{"$ref":"#/definitions/LeanDealEntity"},{"type":"object","description":"Related deal."}],"description":"Related deal."},"owner_user":{"allOf":[{"$ref":"#/definitions/LeanUserEntity"},{"type":"object","description":"Owner user."}],"description":"Owner user."},"deal_stage":{"allOf":[{"$ref":"#/definitions/DealStageEntity"},{"type":"object","description":"Deal stage info including ID and name."}],"description":"Deal stage info including ID and name."},"deal_status":{"allOf":[{"$ref":"#/definitions/DealStatusEntity"},{"type":"object","description":"Deal status info including ID and name."}],"description":"Deal status info including ID and name."},"updated_at":{"type":"s","format":"g","description":"Date and time of the update."},"audit_deal_id":{"type":"integer","format":"int32","description":"Audit deal ID."},"event_type":{"type":"string","description":"Event type."}},"description":null},"putDeals":{"type":"object","properties":{"title":{"type":"string","description":"Title to identify this deal.","maxLength":150},"value":{"type":"number","format":"float","description":"Monetary value."},"description":{"type":"string","description":"Your own description of this deal.","maxLength":2000},"startTime":{"type":"string","format":"date-time","description":"When this deal was started."},"products_entities":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Product id."},"unitValue":{"type":"number","format":"float","description":"Product value."},"discount":{"type":"number","format":"float","description":"Product value."},"quantity":{"type":"number","format":"float","description":"Product value."}},"required":["id"]}},"products":{"type":"string"},"ownerUser":{"type":"integer","format":"int32","description":"Owner user ID or email"},"allowedUsers":{"type":"array","description":"Array of IDs of users that should be able to see this deal.","items":{"type":"integer","format":"int32"}},"allowToAllUsers":{"type":"boolean","description":"Set true if this deal should be visible to all users.","enum":[true]},"customFields":{"type":"object","description":"Custom Fields information. A key-value map where each key is the identifier (name)\nof a custom field and the value is the desired content.\n\nExample:\n{\n  \"customFields\": {\n    \"custom_field_identifier_1\" : \"desired value\",\n    \"custom_field_identifier_2\" : \"desired value 2\"\n  }\n}\n"},"checkRequiredFields":{"type":"boolean","description":"Check if required fields are filled when changing the deal stage or status."}},"description":"Update a deal."},"putDealsIdStatus":{"type":"object","properties":{"dealStatusText":{"type":"string","description":"Status that the deal should transition to.","enum":["ongoing","won","lost"]},"ownerUser":{"type":"integer","format":"int32","description":"Owner user ID or email."},"endTime":{"type":"string","format":"date-time","description":"When the deal was finished."},"checkRequiredFields":{"type":"boolean","description":"Check if required fields are filled when changing the deal stage or status."},"lossReason":{"type":"object","description":"Loss reason for the deal. Use when dealStatusText is 'lost'.\n\nExample: `{ \"id\": 1, \"description\": \"Customer chose a competitor\" }`\n\nFields:\n- `id` (integer): Loss reason ID (from GET /v3/loss_reasons).\n- `description` (string, optional): Specific description for this deal's loss.\n"}},"required":["dealStatusText"],"description":"Win, lose or reopen a deal."},"putDealsIdStage":{"type":"object","properties":{"dealStage":{"type":"integer","format":"int32","description":"Sequence number of new deal stage. (Starts at 1 for the first stage, this is not the deal Stage ID)"},"funnel":{"type":"integer","format":"int32","description":"Funnel ID. (Required if target funnel is not the default funnel)"},"checkRequiredFields":{"type":"boolean","description":"Check if required fields are filled when changing the deal stage or status."}},"required":["dealStage"],"description":"Change a deal's funnel stage."},"AccountExportationEntity":{"type":"object","properties":{"id":{"type":"string"},"updated_at":{"type":"string"},"status":{"type":"string"},"url":{"type":"string"},"resource":{"type":"string"}},"description":null},"postProducts":{"type":"object","properties":{"name":{"type":"string","description":"Product name.","maxLength":60},"code":{"type":"string","description":"Product code.","maxLength":60},"category":{"type":"integer","format":"int32","description":"Category name or id."},"price":{"type":"number","format":"float","description":"Product price."},"unit":{"type":"string","description":"Product unit.","maxLength":6},"active":{"type":"boolean","description":"Product is active?"},"customFields":{"type":"object","description":"Product custom fields."},"description":{"type":"string","description":"Product description (HTML). Will be sanitized before saving."}},"required":["name","active"],"description":"Create a new product."},"putProducts":{"type":"object","properties":{"name":{"type":"string","description":"Product name.","maxLength":60},"code":{"type":"string","description":"Product code.","maxLength":60},"category":{"type":"integer","format":"int32","description":"Category name or id."},"price":{"type":"number","format":"float","description":"Product price."},"unit":{"type":"string","description":"Product unit.","maxLength":6},"active":{"type":"boolean","description":"Product is active?"},"customFields":{"type":"object","description":"Product custom fields."},"description":{"type":"string","description":"Product description (HTML). Will be sanitized before saving."}},"required":["name","active"],"description":"Update a product."},"StateEntity":{"type":"object","properties":{"uf":{"type":"string","enum":["AC","AL","AP","AM","BA","CE","DF","ES","GO","MA","MT","MS","MG","PA","PB","PR","PE","PI","RJ","RN","RS","RO","RR","SC","SP","SE","TO"],"description":"State abbreviation. Only Brazilian states are supported."}},"description":null},"CityEntity":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"City ID."},"name":{"type":"integer","format":"int32","description":"City name."},"state":{"allOf":[{"$ref":"#/definitions/StateEntity"},{"type":"object","description":"City state."}],"description":"City state."}},"description":null},"UserEntity":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"User ID."},"account":{"allOf":[{"$ref":"#/definitions/AccountEntity"},{"type":"object","description":"Account information."}],"description":"Account information."},"accountId":{"type":"integer","format":"int32","description":"Account ID."},"name":{"type":"string","description":"User name."},"createdAt":{"type":"date-time","description":"Date when user was added to account."},"contact":{"allOf":[{"$ref":"#/definitions/ContactEntity"},{"type":"object","description":"Contact information."}],"description":"Contact information."},"teams":{"type":"array","items":{"$ref":"#/definitions/UserTeamEntity"},"description":"Teams that this user belongs to."},"isBlocked":{"type":"boolean","description":"Whether this user is blocked or not."}},"description":null},"AccountEntity":{"type":"object","properties":{"id":{"type":"string"},"features":{"type":"string"}}},"UserTeamEntity":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Team ID."},"leader":{"type":"boolean","description":"Whether this user is a leader of this team."}}},"putUsers":{"type":"object","properties":{"active":{"type":"boolean","description":"Whether the user should be active or not."}},"required":["active"],"description":"Activate or inactivate a specific user."},"LossReasonEntity":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Loss reason ID."},"name":{"type":"string","description":"Loss reason name."},"createdAt":{"type":"date-time","description":"Time of creation."},"updatedAt":{"type":"date-time","description":"Time of last update"}},"description":null},"FunnelEntity":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Funnel ID."},"name":{"type":"string","description":"Funnel name."},"initials":{"type":"string","description":"Funnel name initials."},"color":{"type":"string","description":"Funnel color."},"sequence":{"type":"integer","format":"int32","description":"Sequence number."},"default":{"type":"boolean","description":"Whether this funnel is the account's default funnel."},"dealStages":{"type":"array","items":{"$ref":"#/definitions/LeanDealStageEntity"},"description":"Funnel stages."}},"description":null},"LeanDealStageEntity":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Deal stage ID."},"name":{"type":"string","description":"Deal stage name."},"sequence":{"type":"integer","format":"int32","description":"Sequence number."}}},"MetricEntity":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Metric ID."},"name":{"type":"string","description":"Metric name."},"defaultValue":{"type":"number","description":"Default value."},"fix":{"type":"boolean","description":"Whether this is a fixed metric or not."}},"description":null},"ProductCategoryEntity":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"Product category ID."},"name":{"type":"string","description":"Product category name."}},"description":null}}}