{ "openapi": "3.0.3", "info": { "title": "Agendor API", "version": "v3", "description": "Agendor CRM API for managing people, organizations, deals, tasks, and sales workflows. Brazilian-focused CRM platform with support for CPF, CNPJ, and Brazilian address formats.", "x-jentic-source-url": "https://api.agendor.com.br/docs/", "contact": {} }, "servers": [ { "url": "https://api.agendor.com.br/v3", "description": "Agendor API Server" } ], "paths": { "/people": { "get": { "summary": "List People", "description": "List and search for people", "operationId": "listPeople", "tags": [ "People" ], "parameters": [ { "name": "page", "in": "query", "schema": { "type": "integer", "default": 1 } }, { "name": "per_page", "in": "query", "schema": { "type": "integer", "default": 10, "maximum": 100 } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Person" } }, "meta": { "$ref": "#/components/schemas/Meta" } } } } } } } }, "post": { "summary": "Create Person", "description": "Create a new person", "operationId": "createPerson", "tags": [ "People" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PersonInput" } } } }, "responses": { "201": { "description": "Person created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/Person" } } } } } } } } }, "/people/{id}": { "get": { "summary": "Get Person", "description": "Get specific person by ID", "operationId": "getPerson", "tags": [ "People" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/Person" } } } } } } } }, "put": { "summary": "Update Person", "description": "Update a person", "operationId": "updatePerson", "tags": [ "People" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PersonInput" } } } }, "responses": { "200": { "description": "Person updated", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/Person" } } } } } } } }, "delete": { "summary": "Delete Person", "description": "Delete a person", "operationId": "deletePerson", "tags": [ "People" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "204": { "description": "Person deleted" } } } }, "/people/upsert": { "post": { "summary": "Upsert Person", "description": "Create or update person (search by CPF/email)", "operationId": "upsertPerson", "tags": [ "People" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PersonInput" } } } }, "responses": { "200": { "description": "Person upserted", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/Person" } } } } } } } } }, "/organizations": { "get": { "summary": "List Organizations", "description": "List and search organizations", "operationId": "listOrganizations", "tags": [ "Organizations" ], "parameters": [ { "name": "page", "in": "query", "schema": { "type": "integer" } }, { "name": "per_page", "in": "query", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Organization" } }, "meta": { "$ref": "#/components/schemas/Meta" } } } } } } } }, "post": { "summary": "Create Organization", "description": "Create new organization", "operationId": "createOrganization", "tags": [ "Organizations" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrganizationInput" } } } }, "responses": { "201": { "description": "Organization created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/Organization" } } } } } } } } }, "/organizations/{id}": { "get": { "summary": "Get Organization", "description": "Get specific organization", "operationId": "getOrganization", "tags": [ "Organizations" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/Organization" } } } } } } } }, "put": { "summary": "Update Organization", "description": "Update organization", "operationId": "updateOrganization", "tags": [ "Organizations" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrganizationInput" } } } }, "responses": { "200": { "description": "Organization updated", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/Organization" } } } } } } } }, "delete": { "summary": "Delete Organization", "description": "Delete organization", "operationId": "deleteOrganization", "tags": [ "Organizations" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "204": { "description": "Organization deleted" } } } }, "/organizations/upsert": { "post": { "summary": "Upsert Organization", "description": "Create or update (search by name/CNPJ)", "operationId": "upsertOrganization", "tags": [ "Organizations" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrganizationInput" } } } }, "responses": { "200": { "description": "Organization upserted", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/Organization" } } } } } } } } }, "/deals": { "get": { "summary": "List Deals", "description": "List and search deals", "operationId": "listDeals", "tags": [ "Deals" ], "parameters": [ { "name": "page", "in": "query", "schema": { "type": "integer" } }, { "name": "per_page", "in": "query", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Deal" } }, "meta": { "$ref": "#/components/schemas/Meta" } } } } } } } } }, "/deals/{id}": { "get": { "summary": "Get Deal", "description": "Get specific deal", "operationId": "getDeal", "tags": [ "Deals" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/Deal" } } } } } } } }, "put": { "summary": "Update Deal", "description": "Update deal", "operationId": "updateDeal", "tags": [ "Deals" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DealInput" } } } }, "responses": { "200": { "description": "Deal updated", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/Deal" } } } } } } } } }, "/deals/{id}/status": { "put": { "summary": "Change Deal Status", "description": "Change deal status (win/lose/reopen)", "operationId": "changeDealStatus", "tags": [ "Deals" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "won", "lost", "reopen" ] } } } } } }, "responses": { "200": { "description": "Status changed", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/Deal" } } } } } } } } }, "/deals/{id}/stage": { "put": { "summary": "Change Deal Stage", "description": "Change deal stage in funnel", "operationId": "changeDealStage", "tags": [ "Deals" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "stage_id": { "type": "integer" } } } } } }, "responses": { "200": { "description": "Stage changed", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/Deal" } } } } } } } } }, "/deals/movements_history": { "get": { "summary": "Deal Movements History", "description": "Track deal stage/status changes", "operationId": "getDealMovementsHistory", "tags": [ "Deals" ], "parameters": [ { "name": "page", "in": "query", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object" } } } } } } } } } }, "/tasks": { "get": { "summary": "List Tasks", "description": "List and search all tasks", "operationId": "listTasks", "tags": [ "Tasks" ], "parameters": [ { "name": "page", "in": "query", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Task" } } } } } } } } } }, "/tasks/export": { "post": { "summary": "Export Tasks", "description": "Export tasks to .xlsx file", "operationId": "exportTasks", "tags": [ "Tasks" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "filters": { "type": "object" } } } } } }, "responses": { "200": { "description": "Export file created", "content": { "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { "schema": { "type": "string", "format": "binary" } } } } } } }, "/products": { "get": { "summary": "List Products", "description": "List all products", "operationId": "listProducts", "tags": [ "Products" ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Product" } } } } } } } } }, "post": { "summary": "Create Product", "description": "Create product", "operationId": "createProduct", "tags": [ "Products" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProductInput" } } } }, "responses": { "201": { "description": "Product created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/Product" } } } } } } } } }, "/products/{id}": { "get": { "summary": "Get Product", "description": "Get product by ID", "operationId": "getProduct", "tags": [ "Products" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/Product" } } } } } } } }, "put": { "summary": "Update Product", "description": "Update product", "operationId": "updateProduct", "tags": [ "Products" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProductInput" } } } }, "responses": { "200": { "description": "Product updated", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/Product" } } } } } } } }, "delete": { "summary": "Delete Product", "description": "Delete product", "operationId": "deleteProduct", "tags": [ "Products" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "204": { "description": "Product deleted" } } } }, "/users": { "get": { "summary": "List Users", "description": "List and search users", "operationId": "listUsers", "tags": [ "Users" ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/User" } } } } } } } } } }, "/users/me": { "get": { "summary": "Get Current User", "description": "Get current authenticated user", "operationId": "getCurrentUser", "tags": [ "Users" ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/User" } } } } } } } } }, "/categories": { "get": { "summary": "List Categories", "description": "List all categories", "operationId": "listCategories", "tags": [ "Configuration" ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object" } } } } } } } } } }, "/funnels": { "get": { "summary": "List Funnels", "description": "List all funnels", "operationId": "listFunnels", "tags": [ "Configuration" ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object" } } } } } } } } } }, "/deal_stages": { "get": { "summary": "List Deal Stages", "description": "List deal stages", "operationId": "listDealStages", "tags": [ "Configuration" ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object" } } } } } } } } } } }, "components": { "securitySchemes": { "tokenAuth": { "type": "apiKey", "in": "header", "name": "Authorization", "description": "Token authentication. Format: 'Token YOUR_API_TOKEN'" } }, "schemas": { "Person": { "type": "object", "properties": { "id": { "type": "integer" }, "name": { "type": "string" }, "cpf": { "type": "string", "description": "Brazilian CPF" }, "email": { "type": "string" }, "phone": { "type": "string" }, "organization": { "type": "object" } } }, "PersonInput": { "type": "object", "properties": { "name": { "type": "string" }, "cpf": { "type": "string" }, "email": { "type": "string" }, "phone": { "type": "string" } } }, "Organization": { "type": "object", "properties": { "id": { "type": "integer" }, "name": { "type": "string" }, "cnpj": { "type": "string", "description": "Brazilian CNPJ" }, "email": { "type": "string" }, "phone": { "type": "string" } } }, "OrganizationInput": { "type": "object", "properties": { "name": { "type": "string" }, "cnpj": { "type": "string" }, "email": { "type": "string" } } }, "Deal": { "type": "object", "properties": { "id": { "type": "integer" }, "title": { "type": "string" }, "value": { "type": "number" }, "status": { "type": "string" } } }, "DealInput": { "type": "object", "properties": { "title": { "type": "string" }, "value": { "type": "number" } } }, "Task": { "type": "object", "properties": { "id": { "type": "integer" }, "type": { "type": "string" }, "text": { "type": "string" }, "done": { "type": "boolean" } } }, "Product": { "type": "object", "properties": { "id": { "type": "integer" }, "name": { "type": "string" }, "price": { "type": "number" } } }, "ProductInput": { "type": "object", "properties": { "name": { "type": "string" }, "price": { "type": "number" } } }, "User": { "type": "object", "properties": { "id": { "type": "integer" }, "name": { "type": "string" }, "email": { "type": "string" } } }, "Meta": { "type": "object", "properties": { "page": { "type": "integer" }, "count": { "type": "integer" }, "total": { "type": "integer" } } } } }, "security": [ { "tokenAuth": [] } ], "tags": [ { "name": "People", "description": "Operations for managing people/contacts" }, { "name": "Organizations", "description": "Operations for managing organizations/companies" }, { "name": "Deals", "description": "Operations for managing deals and opportunities" }, { "name": "Tasks", "description": "Operations for managing tasks" }, { "name": "Products", "description": "Operations for managing products" }, { "name": "Users", "description": "Operations for managing users" }, { "name": "Configuration", "description": "Configuration and settings endpoints" } ] }