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

# Contacts API

> This endpoint requires an Oauth-Token obtained from /oauth2

## How to Use

1. **Copy** any of the JSON examples below.
2. **Go to the API playground** by clicking on the **"Try it"** button.
3. **Paste** the JSON into the request body field.
4. **Click "Send"** button to execute the request.

## Examples

### Count Contact Records

```json theme={null}
{
  "module": "contact",
  "count_only": "1"
}
```

### List All Contacts

```json theme={null}
{
  "module": "contact"
}
```

### List Contacts with Specific Fields

```json theme={null}
{
  "module": "contact",
  "filters": {
    "fields": ["firstname", "createddate", "contact_type__c", "metro_area__c"],
    "order_by": "firstname:DESC",
    "max_num": "10"
  }
}
```

### Filter By Contact ID

```json theme={null}
{
  "module": "contact",
  "filters": {
    "filter": [
      {
        "sfid": {
          "$equals": "0017600000cmqHcAAI"
        }
      }
    ]
  }
}
```

### Filter By Contact Type (Administrator)

```json theme={null}
{
  "module": "contact",
  "filters": {
    "filter": [
      {
        "contact_type__c": {
          "$equals": "Administrator"
        }
      }
    ]
  }
}
```

### Filter By Contact Type (Not Assistant)

```json theme={null}
{
  "module": "contact",
  "filters": {
    "filter": [
      {
        "contact_type__c": {
          "$not_equals": "Assistant"
        }
      }
    ]
  }
}
```

### Filter By Contact Name (OR Example)

```json theme={null}
{
  "module": "contact",
  "filters": {
    "filter": [
      {
        "$or": [
          {
            "firstname": {
              "$contains": "Test"
            }
          },
          {
            "firstname": {
              "$equals": "Test2"
            }
          }
        ]
      }
    ]
  }
}
```

### Filter By Contact Name and Type (AND Example)

```json theme={null}
{
  "module": "contact",
  "filters": {
    "filter": [
      {
        "$and": [
          {
            "firstname": {
              "$equals": "Dakota QA 2"
            }
          },
          {
            "firstname": {
              "$equals": "Endowment"
            }
          }
        ]
      }
    ]
  }
}
```

### Filter By Last Modified Date Range

```json theme={null}
{
  "module": "contact",
  "filters": {
    "order_by": "firstname:DESC",
    "max_num": 50,
    "offset": 0,
    "filter": [
      {
        "lastmodifieddate": {
          "$between": ["2025-01-01", "2025-01-20"]
        }
      }
    ],
    "fields": ["sfid", "firstname", "lastmodifieddate", "contact_type__c"]
  }
}
```


## OpenAPI

````yaml POST /index.php/api/dakota
openapi: 3.1.0
info:
  title: OpenAPI Plant Store
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://marketplace-as-a-service.herokuapp.com
security: []
paths:
  /index.php/api/dakota:
    post:
      description: This endpoint requires an Oauth-Token obtained from /oauth2
      requestBody:
        required: true
        content:
          text/plain:
            schema:
              type: string
              description: >-
                Copy any of the JSON examples and paste it into the request body
                field.
            example: <JSON example>
      security:
        - authToken: []
components:
  securitySchemes:
    authToken:
      type: apiKey
      in: header
      name: Oauth-Token
      description: >-
        Get the OAuth token by calling the /oauth2 authentication API. Use the
        access_token from the response to authorize your API requests.

````