> ## Documentation Index
> Fetch the complete documentation index at: https://help.nextmatter.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrate with Nutshell

> Create a new contact in Nutshell CRM.

## Create a new contact

1. In Next Matter select the workflow that should integrate with Nutshell and add a new integration step.

2. Click **Settings** and enter the following details:

   * **Method**: POST

   * **URL**: [`https://app.nutshell.com/api/v1/json`](https://app.nutshell.com/api/v1/json)

   * **Headers**: Content-Type: application/json

   * **Headers**: Authorization: Base64-encoded`username:Nutshell_API_KEY`.
     For details on how to generate a Nutshell API key, see [Nutshell documentation](https://support.nutshell.com/hc/en-us/articles/115013717968-API-keys-Create-API-keys-to-integrate-3rd-party-apps).

   * **Body** might look like the following:

     <CodeGroup>
       ```json JSON theme={null}
       {
         {
         "method": "newContact",
         "params": {
           "contact": {
             "name": {
          "givenName": "FIRST_NAME", //Enter first name
          "familyName": "LAST_NAME" //Enter last name
             },
             "email": {
               "email": "EMAIL_ADDRESS" //Enter email address
             },
             "phone": {
               "number": "PHONE NUMBER" //Enter phone number
             },
             "tags": ["TAG_1", "TAG_2"] //Enter tags for this contact
           }
         },
         "id": "1"
       }
       }
       ```
     </CodeGroup>

3. If you want to use this contact's data further in the workflow, create a variable for the contact\_id with the value of: `$.result.id`.

4. Save your changes.

## Create a new account

1. In Next Matter select the workflow that should integrate with Nutshell and add a new integration step.

2. Click **Settings** and enter the following details:

   * **Method**: POST

   * **URL**: [`https://app.nutshell.com/api/v1/json`](https://app.nutshell.com/api/v1/json)

   * **Headers**: Content-Type: application/json

   * **Headers**: Authorization: Base64-encoded`username:Nutshell_API_KEY`. It might look like the following: service@\[company-domain].com:bhu123b12y312312njh123 For details on how to generate a Nutshell API key, see [Nutshell documentation](https://support.nutshell.com/hc/en-us/articles/115013717968-API-keys-Create-API-keys-to-integrate-3rd-party-apps).

   * **Body** might look like the following:

     <CodeGroup>
       ```json JSON theme={null}
       {
         "method": "newAccount",
         "params": {
           "account": {
             "name": "COMPANY_NAME", //Replace with company name
             "owner": {
               "entityType": "Users",
               "id": OWNER_ID //Replace with the Owner User ID in your Nutshell
             },
             "industryId": "INDUSTRY_ID", //Replace with industry ID
             "accountTypeId": "1",
             "url": ["COMPANY_WEBSITE"], //Replace with company website URL
             "phone": ["COMPANY_PHONE"], //Replace with company phone number
             "address": [
               {
                 "address_1": "ADDRESS",
                 "city": "CityName",
                 "state": "StateName",
                 "postalCode": "12345",
                 "country": "US"
               }
             ]
           }
         },
         "id": "10"
       }
       ```
     </CodeGroup>

3. If you want to use this account's data further in the workflow, create a variable for the account\_id with the value of: `$.result.id`.

4. Save your changes.

## Create a new lead

1. In Next Matter select the workflow that should integrate with Nutshell and add a new integration step.

2. Click **Settings** and enter the following details:

   * **Method**: POST

   * **URL**: [`https://app.nutshell.com/api/v1/json`](https://app.nutshell.com/api/v1/json)

   * **Headers**: Content-Type: application/json

   * **Headers**: Authorization: Base64-encoded`username:Nutshell_API_KEY`. It might look like the following: service@\[company-domain].com:bhu123b12y312312njh123 For details on how to generate a Nutshell API key, see [Nutshell documentation](https://support.nutshell.com/hc/en-us/articles/115013717968-API-keys-Create-API-keys-to-integrate-3rd-party-apps).

   * **Body** might look like the following:

     <CodeGroup>
       ```json JSON theme={null}

       {
         "method": "newLead",
         "params": {
           "lead": {
             "description": "LEAD_DESCRIPTION", //replace the placeholder
             "contacts": [
               {
                 "entityType": "Contacts",
                 "id": "CONTACT_ID" //Please replace with contact ID
               }
             ],
             "accounts": [
               {
                 "entityType": "Accounts",
                 "id": "ACCOUNT_ID" //Please replace with Account ID
               }
             ],
             "note": "Note about the lead"
           }
         },
         "id": "20"
       }
       ```
     </CodeGroup>

3. If you want to use this account's data further in the workflow, create a variable for the contact\_id with the value of: `$.result.id`.

4. Save your changes.
