# Customer

![](/files/-LruD-Qxfb6CHfkqDnrA)

### Customer Properties

| Field          | Description                                           |
| -------------- | ----------------------------------------------------- |
| `created_at`   | When a `Customer` was created on the Malomo Platform. |
| `email`        | Customer's email address.                             |
| `first_name`   | Customer's first name.                                |
| `id`           | Unique identifier for a `Customer`.                   |
| `last_name`    | Customer's last name.                                 |
| `phone_number` | Customer's phone number.                              |
| `updated_at`   | When a `Customer` was last updated.                   |

## Create a Customer

<mark style="color:green;">`POST`</mark> `https://api.gomalomo.com/customers`

#### Request Body

| Name          | Type   | Description              |
| ------------- | ------ | ------------------------ |
| email         | string | Customer's email address |
| first\_name   | string | Customer's first name    |
| last\_name    | string | Customer's last name     |
| phone\_number | string | Customer's phone number  |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "created_at": "2019-01-30T13:30:00Z",
  "email": "johnny@rosevideo.com",
  "first_name": "Johnny",
  "id": "a0a877c6-4164-4e8a-8179-48f8d4752b4e",
  "last_name": "Rose",
  "phone_number": "555-555-5555",
  "updated_at": "2019-01-30T13:30:00Z"
}
```

{% endtab %}
{% endtabs %}

## Retrieve a Customer

<mark style="color:blue;">`GET`</mark> `https://api.gomalomo.com/customers/:id`

#### Path Parameters

| Name | Type   | Description                               |
| ---- | ------ | ----------------------------------------- |
| id   | string | Unique identifier of the desired customer |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "created_at": "2019-01-30T13:30:00Z",
  "email": "johnny@rosevideo.com",
  "first_name": "Johnny",
  "id": "a0a877c6-4164-4e8a-8179-48f8d4752b4e",
  "last_name": "Rose",
  "phone_number": "555-555-5555",
  "updated_at": "2019-01-30T13:30:00Z"
}
```

{% endtab %}
{% endtabs %}

## Retrieve a List of Customers

<mark style="color:blue;">`GET`</mark> `https://api.gomalomo.com/customers`

#### Query Parameters

| Name | Type   | Description                               |
| ---- | ------ | ----------------------------------------- |
| prev | string | Retrieve customers after a given cursor.  |
| next | string | Retrieve customers before a given cursor. |

{% tabs %}
{% tab title="200 " %}

```javascript
[
  {
    "created_at": "2019-01-30T13:30:00Z",
    "email": "johnny@rosevideo.com",
    "first_name": "Johnny",
    "id": "a0a877c6-4164-4e8a-8179-48f8d4752b4e"
    "last_name": "Rose",
    "phone_number": "555-555-5555",
    "updated_at": "2019-01-30T13:30:00Z"
  }
]
```

{% endtab %}
{% endtabs %}

## Update a Customer

<mark style="color:orange;">`PUT`</mark> `https://api.gomalomo.com/customers/:id`

#### Path Parameters

| Name | Type   | Description                                 |
| ---- | ------ | ------------------------------------------- |
| id   | string | Unique identifier of the customer to update |

#### Request Body

| Name          | Type   | Description              |
| ------------- | ------ | ------------------------ |
| email         | string | Customer's email address |
| first\_name   | string | Customer's first name    |
| last\_name    | string | Customer's last name     |
| phone\_number | string | Customer's phone number  |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "created_at": "2019-01-30T13:30:00Z",
  "email": "johnny@rosevideo.com",
  "first_name": "Johnny",
  "id": "a0a877c6-4164-4e8a-8179-48f8d4752b4e",
  "last_name": "Rose",
  "phone_number": "555-555-5555",
  "updated_at": "2019-01-30T13:30:00Z"
}
```

{% endtab %}
{% endtabs %}

## Delete a Customer

<mark style="color:red;">`DELETE`</mark> `https://api.gomalomo.com/customers/:id`

#### Path Parameters

| Name | Type   | Description                                 |
| ---- | ------ | ------------------------------------------- |
| id   | string | Unique identifier of the customer to delete |

{% tabs %}
{% tab title="204 " %}

{% endtab %}
{% endtabs %}

## Retrieve a List of Customer Events

<mark style="color:blue;">`GET`</mark> `https://api.gomalomo.com/customers/:customer_id/events`

#### Path Parameters

| Name         | Type   | Description                                       |
| ------------ | ------ | ------------------------------------------------- |
| customer\_id | string | Unique id of the Customer to retrieve events for. |

#### Query Parameters

| Name | Type   | Description                            |
| ---- | ------ | -------------------------------------- |
| prev | string | Retrieve events before a given cursor. |
| next | string | Retrieve events after a given cursor.  |

{% tabs %}
{% tab title="200 " %}

```javascript
[
  {
    "created_at": "2019-01-30T13:30:00Z",
    "id": "1a3c1090-efd1-11eb-9a03-0242ac130003",
    "label": "Order #1000 fulfilled",
    "link_back_url": "https://goodest-boi.myshopify.com/admin/orders/5555555555555",
    "properties": {
      "shopify_order": {
        "id": "5555555555555"
      }
    },
    "timestamp": 1548855000
    "type": "ShopifyOrderFulfilled",
    "updated_at": "2019-01-30T13:30:00Z",
  }
]
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gomalomo.com/resources/customer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
