autotask_update_company
Update a company record in Autotask, including billing and shipping addresses. Set payment terms by selecting an invoice template (e.g., 103 for Due on Receipt).
Instructions
Update company record. invoiceTemplateID sets payment terms (103=Due on Receipt, 104=NET 30). Billing address fields separate from regular address.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| companyName | No | ||
| phone | No | ||
| address1 | No | Regular address (distinct from billingAddress1) | |
| address2 | No | ||
| city | No | ||
| state | No | ||
| postalCode | No | ||
| countryID | No | e.g. 237 for United States | |
| isActive | No | ||
| webAddress | No | Website URL (field name is webAddress) | |
| billingAddress1 | No | For invoices (separate from address1) | |
| billingAddress2 | No | Billing address line 2 | |
| billToAttention | No | Bill-to attention name | |
| billToAddressToUse | No | 1 = use bill-to fields explicitly | |
| billToCity | No | Bill-to city | |
| billToState | No | Bill-to state/province | |
| billToZipCode | No | Bill-to ZIP/postal code | |
| billToCountryID | No | Bill-to country ID | |
| billToCompanyLocationID | No | Bill-to company location ID | |
| taxRegionID | No | Tax region ID (capital ID suffix per Autotask convention) | |
| invoiceTemplateID | No | Invoice template ID applied to this company. Acts as the payment-terms selector (e.g. 103=Due on Receipt, 104=NET 30). | |
| invoiceMethod | No | Invoice delivery method picklist ID (e.g. 2=Email) | |
| invoiceEmailMessageID | No | Default email-message template ID used when invoicing this company | |
| taxID | No | Tax registration / FEIN / VAT identifier string | |
| isTaxExempt | No | Whether the company is tax-exempt. Note: Autotask field name is `isTaxExempt` — not `taxExempt`. | |
| quoteEmailMessageID | No | Default email-message template ID used when sending quotes | |
| quoteTemplateID | No | Default quote template ID for this company | |
| purchaseOrderTemplateID | No | Default purchase-order template ID for this company | |
| ownerResourceID | No | Resource ID of the account owner | |
| classification | No | Company classification picklist ID | |
| companyType | No | Company type picklist ID (e.g. Customer, Prospect, Vendor) |
Implementation Reference
- src/handlers/tool.handler.ts:781-784 (registration)Dispatch table entry in AutotaskToolHandler that routes the 'autotask_update_company' tool name to its handler, which calls s.updateCompany(a.id, a).
['autotask_update_company', async (a) => { await s.updateCompany(a.id, a); return { result: undefined, message: `Successfully updated company ID: ${a.id}` }; }], ['autotask_get_company_site_configuration', async (a) => { - src/services/autotask.service.ts:168-178 (handler)Service-layer implementation of updateCompany: makes a PATCH request to 'Companies' entity via AutotaskHttpClient.update().
async updateCompany(id: number, updates: Partial<AutotaskCompany>): Promise<void> { const http = await this.ensureClient(); try { this.logger.debug(`Updating company ${id}:`, updates); await http.update('Companies', id, updates as Record<string, any>); this.logger.info(`Company ${id} updated successfully`); } catch (error) { this.logger.error(`Failed to update company ${id}:`, error); throw error; } } - Low-level HTTP helper that PATCHes the entity with an { id, ...fields } body — Autotask's update pattern (no PATCH /{Entity}/{id} route).
async update(entity: string, id: number, body: Record<string, any>): Promise<void> { await this.request<void>('PATCH', `/${entity}`, { id, ...body }); } - Schema definition for autotask_update_company: input schema with all updatable fields (address, billing, tax, invoice settings, ownership). Only 'id' is required.
{ name: 'autotask_update_company', description: 'Update company record. invoiceTemplateID sets payment terms (103=Due on Receipt, 104=NET 30). Billing address fields separate from regular address.', inputSchema: { type: 'object', properties: { id: { type: 'number', }, companyName: { type: 'string', }, phone: { type: 'string', }, address1: { type: 'string', description: 'Regular address (distinct from billingAddress1)' }, address2: { type: 'string', }, city: { type: 'string', }, state: { type: 'string', }, postalCode: { type: 'string', }, countryID: { type: 'number', description: 'e.g. 237 for United States' }, isActive: { type: 'boolean', }, webAddress: { type: 'string', description: 'Website URL (field name is webAddress)' }, // ---- Billing-to fields (used for Invoice Settings; SEPARATE from regular address) ---- billingAddress1: { type: 'string', description: 'For invoices (separate from address1)' }, billingAddress2: { type: 'string', description: 'Billing address line 2' }, billToAttention: { type: 'string', description: 'Bill-to attention name' }, billToAddressToUse: { type: 'number', description: '1 = use bill-to fields explicitly' }, billToCity: { type: 'string', description: 'Bill-to city' }, billToState: { type: 'string', description: 'Bill-to state/province' }, billToZipCode: { type: 'string', description: 'Bill-to ZIP/postal code' }, billToCountryID: { type: 'number', description: 'Bill-to country ID' }, billToCompanyLocationID: { type: 'number', description: 'Bill-to company location ID' }, // ---- Tax / invoice settings ---- taxRegionID: { type: 'number', description: 'Tax region ID (capital ID suffix per Autotask convention)' }, invoiceTemplateID: { type: 'number', description: 'Invoice template ID applied to this company. Acts as the payment-terms selector (e.g. 103=Due on Receipt, 104=NET 30).' }, invoiceMethod: { type: 'number', description: 'Invoice delivery method picklist ID (e.g. 2=Email)' }, invoiceEmailMessageID: { type: 'number', description: 'Default email-message template ID used when invoicing this company' }, taxID: { type: 'string', description: 'Tax registration / FEIN / VAT identifier string' }, isTaxExempt: { type: 'boolean', description: 'Whether the company is tax-exempt. Note: Autotask field name is `isTaxExempt` — not `taxExempt`.' }, // ---- Quote / PO templates ---- quoteEmailMessageID: { type: 'number', description: 'Default email-message template ID used when sending quotes' }, quoteTemplateID: { type: 'number', description: 'Default quote template ID for this company' }, purchaseOrderTemplateID: { type: 'number', description: 'Default purchase-order template ID for this company' }, // ---- Ownership / classification ---- ownerResourceID: { type: 'number', description: 'Resource ID of the account owner' }, classification: { type: 'number', description: 'Company classification picklist ID' }, companyType: { type: 'number', description: 'Company type picklist ID (e.g. Customer, Prospect, Vendor)' } }, required: ['id'] } }, - src/handlers/tool.handler.ts:516-524 (registration)Intent router that maps natural language queries about updating/editing/modifying a company to the autotask_update_company tool.
if (/\b(?:update|edit|modify)\b/.test(intent)) { const params: Record<string, any> = {}; if (numbers[0]) params.id = numbers[0]; return { suggestedTool: 'autotask_update_company', suggestedParams: params, description: 'Update company details', requiredParams: !params.id ? ['id'] : [], };