# Dynamics 365

Dynamics 365 from Microsoft combines CRM, ERP, and productivity apps to streamline sales, marketing, customer service, and operations in one integrated platform

- **Category:** crm
- **Auth:** OAUTH2
- **Composio Managed App Available?** Yes
- **Tools:** 16
- **Triggers:** 0
- **Slug:** `DYNAMICS365`
- **Version:** 20260316_00

## Tools

### Create Account

**Slug:** `DYNAMICS365_DYNAMICSCRM_CREATE_ACCOUNT`

Creates a new account entity record in Dynamics CRM using the Web API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | No | The name of the new account to be created. |
| `revenue` | number | No | The revenue associated with the account. |
| `user_id` | string | No | The user's ID or 'me' for the authenticated user. |
| `description` | string | No | A description of the account. |
| `creditonhold` | boolean | No | Indicates whether the account is on credit hold. |
| `accountcategorycode` | integer | No | The category code of the account. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Case

**Slug:** `DYNAMICS365_DYNAMICSCRM_CREATE_CASE`

Creates a new case (incident) entity record in Dynamics CRM using the Web API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `title` | string | No | The subject or title of the case. |
| `user_id` | string | No | The user's ID or 'me' for the authenticated user. |
| `account_id` | string | No | A reference to the related account. Format: '/accounts(GUID)' |
| `contact_id` | string | No | A reference to the related contact. Format: '/contacts(GUID)' |
| `description` | string | No | A detailed description of the issue or inquiry. |
| `prioritycode` | integer | No | The priority level of the case (e.g., 1 for Low, 2 for Normal, 3 for High). |
| `caseorigincode` | integer | No | The source of the case. Valid values: 1 (Phone), 2 (Email), 3 (Web). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Contact

**Slug:** `DYNAMICS365_DYNAMICSCRM_CREATE_CONTACT`

Creates a new contact entity record in Dynamics CRM using the Web API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `user_id` | string | No | The user's ID or 'me' for the authenticated user. |
| `jobtitle` | string | No | The job title of the contact. |
| `lastname` | string | No | The last name of the contact. |
| `firstname` | string | No | The first name of the contact. |
| `telephone1` | string | No | The primary telephone number of the contact. |
| `mobilephone` | string | No | The mobile phone number of the contact. |
| `address1_city` | string | No | The city of the contact's address. |
| `emailaddress1` | string | No | The primary email address of the contact. |
| `address1_country` | string | No | The country of the contact's address. |
| `address1_postalcode` | string | No | The postal code of the contact's address. |
| `address1_stateorprovince` | string | No | The state or province of the contact's address. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Invoice

**Slug:** `DYNAMICS365_DYNAMICSCRM_CREATE_INVOICE`

Creates a new invoice entity record in Dynamics CRM using the Web API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | No | The name or number of the invoice. |
| `user_id` | string | No | The user's ID or 'me' for the authenticated user. |
| `account_id` | string | No | A reference to the related account. Format: '/accounts(GUID)' |
| `currency_id` | string | No | A reference to the currency for the transaction. Format: '/transactioncurrencies(GUID)' |
| `description` | string | No | A description of the invoice. |
| `price_level_id` | string | No | A reference to the price list. Format: '/pricelevels(GUID)' |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Lead

**Slug:** `DYNAMICS365_DYNAMICSCRM_CREATE_LEAD`

Creates a new lead entity record in Dynamics CRM using the Web API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `subject` | string | No | A brief description or title for the lead. |
| `user_id` | string | No | The user's ID or 'me' for the authenticated user. Set explicitly when creating leads on behalf of other users in multi-user or automated workflows. |
| `lastname` | string | No | The last name of the lead. |
| `firstname` | string | No | The first name of the lead. |
| `telephone1` | string | No | The primary telephone number of the lead. |
| `companyname` | string | No | The company name associated with the lead. May be enforced as required by some CRM configurations; omitting it can cause the request to be rejected. |
| `emailaddress1` | string | No | The primary email address of the lead. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Opportunity

**Slug:** `DYNAMICS365_DYNAMICSCRM_CREATE_OPPORTUNITY`

Creates a new opportunity entity record in Dynamics CRM using the Web API. Some CRM configurations enforce `estimatedclosedate` and a transaction currency at the server level even though they are schema-optional; omitting them may cause the request to be rejected.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | The name or title of the opportunity. This is a required field. |
| `description` | string | No | A brief description of the opportunity. |
| `estimatedvalue` | number | No | The anticipated revenue from the opportunity. |
| `estimatedclosedate` | string | No | The expected close date of the opportunity in 'YYYY-MM-DD' format. |
| `customer_account_id` | string | No | The GUID of the related account (without curly braces). Optional. |
| `customer_contact_id` | string | No | The GUID of the related contact (without curly braces). Optional. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Sales Order

**Slug:** `DYNAMICS365_DYNAMICSCRM_CREATE_SALES_ORDER`

Creates a new sales order entity record in Dynamics CRM using the Web API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | No | The name of the sales order. |
| `user_id` | string | No | The user's ID or 'me' for the authenticated user. |
| `account_id` | string | No | A reference to the related account. Format: '/accounts(GUID)' |
| `currency_id` | string | No | A reference to the currency for the transaction. Format: '/transactioncurrencies(GUID)' |
| `description` | string | No | A description of the sales order. |
| `price_level_id` | string | No | A reference to the price list. Format: '/pricelevels(GUID)' |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Dynamicscrm get a invoice

**Slug:** `DYNAMICS365_DYNAMICSCRM_GET_A_INVOICE`

Dynamicscrm get a invoice

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `invoice_id` | string | Yes | The ID of the invoice to retrieve |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Dynamicscrm get a lead

**Slug:** `DYNAMICS365_DYNAMICSCRM_GET_A_LEAD`

Dynamicscrm get a lead

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `lead_id` | string | Yes | The ID of the lead to retrieve (GUID format) Use the value exactly as returned by Dynamics CRM tools — do not reformat or truncate. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Dynamicscrm get all leads

**Slug:** `DYNAMICS365_DYNAMICSCRM_GET_ALL_LEADS`

Dynamicscrm get all leads

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `top` | integer | No | Maximum number of leads to return |
| `filter` | string | No | OData filter criteria for leads (e.g., contains(fullname,'John')) Date filters require ISO 8601 format (e.g., createdon gt 2024-01-01T00:00:00Z). |
| `select` | string | No | Comma-separated list of fields to return (e.g., fullname,emailaddress1) |
| `orderby` | string | No | Field to order by (e.g., createdon desc) |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Case

**Slug:** `DYNAMICS365_DYNAMICSCRM_UPDATE_CASE`

Updates an existing case (incident) entity record in Dynamics CRM using the Web API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `title` | string | No | The subject or title of the case. |
| `case_id` | string | Yes | The unique identifier (GUID) of the case to update. |
| `user_id` | string | No | The user's ID or 'me' for the authenticated user. |
| `statuscode` | integer | No | The current status of the case (e.g., 1 for Active, 2 for In Progress, 3 for Resolved). |
| `description` | string | No | A detailed description of the issue or inquiry. |
| `prioritycode` | integer | No | The priority level of the case (e.g., 1 for High, 2 for Normal, 3 for Low). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Invoice

**Slug:** `DYNAMICS365_DYNAMICSCRM_UPDATE_INVOICE`

Updates an existing invoice entity record in Dynamics CRM using the Web API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | No | The updated name or number of the invoice. |
| `duedate` | string | No | The updated due date for the invoice in YYYY-MM-DD format. |
| `user_id` | string | No | The user's ID or 'me' for the authenticated user. |
| `invoice_id` | string | Yes | The unique identifier (GUID) of the invoice to update. |
| `description` | string | No | The updated description of the invoice. |
| `totalamount` | number | No | The updated total amount for the invoice. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Lead

**Slug:** `DYNAMICS365_DYNAMICSCRM_UPDATE_LEAD`

Updates an existing lead entity record in Dynamics CRM using the Web API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `lead_id` | string | Yes | The unique identifier (GUID) of the lead to update. Must be passed exactly as returned by Dynamics CRM lookup tools — no added braces or modified dash formatting. |
| `subject` | string | No | A brief description or title for the lead. |
| `user_id` | string | No | The user's ID or 'me' for the authenticated user. |
| `lastname` | string | No | Last name of the lead. |
| `firstname` | string | No | First name of the lead. |
| `telephone1` | string | No | Primary phone number of the lead. |
| `companyname` | string | No | Name of the company associated with the lead. |
| `emailaddress1` | string | No | Primary email address of the lead. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Opportunity

**Slug:** `DYNAMICS365_DYNAMICSCRM_UPDATE_OPPORTUNITY`

Updates an existing opportunity entity record in Dynamics CRM using the Web API. Some updates may be rejected if required relational fields (e.g., transactioncurrency) are absent from the record, even though they are not exposed as explicit parameters.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | No | The name or title of the opportunity. |
| `user_id` | string | No | The user's ID or 'me' for the authenticated user. |
| `description` | string | No | A brief description of the opportunity. |
| `estimatedvalue` | number | No | The anticipated revenue from the opportunity. |
| `opportunity_id` | string | Yes | The unique identifier (GUID) of the opportunity to update. Use the GUID exactly as returned by CRM lookup or list tools — reformatting the value will cause the update to fail. |
| `salesstagecode` | integer | No | The current sales stage (e.g., 1 for Qualify, 2 for Develop, 3 for Propose). |
| `estimatedclosedate` | string | No | The expected close date of the opportunity in 'YYYY-MM-DD' format. |
| `opportunityratingcode` | integer | No | The rating of the opportunity (e.g., 1 for Cold, 2 for Warm, 3 for Hot). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Sales Order

**Slug:** `DYNAMICS365_DYNAMICSCRM_UPDATE_SALES_ORDER`

Updates an existing sales order entity record in Dynamics CRM using the Web API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | No | The updated name of the sales order. |
| `user_id` | string | No | The user's ID or 'me' for the authenticated user. |
| `description` | string | No | The updated description of the sales order. |
| `freightamount` | number | No | The updated freight or shipping cost for the order. |
| `salesorder_id` | string | Yes | The unique identifier (GUID) of the sales order to update. |
| `discountamount` | number | No | The updated discount amount for the order. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get all invoices action

**Slug:** `DYNAMICS365_GET_ALL_INVOICES_ACTION`

Get all invoices action

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `filter` | string | No | Filter criteria for invoices |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
