> For the complete documentation index, see [llms.txt](https://docs.fieldmotion.com/fieldmotion-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fieldmotion.com/fieldmotion-api-docs/customertype/_save.md).

# \_save

Saves changes made to a Customer Type

### Parameters

#### id

The ID of the Customer type

#### name

The name of the modified Customer type

#### colour\_hex

The set background color of the Customer type

#### allowed\_next

If a customer is assigned to a specific customer type (for example "quoted"), then you may want to limit which customer types the customer can be changed to afterwards (for example, "invoiced" or "cancelled"). This parameter is a comma-delimited list of customer type IDs.

#### triggers

```
[{
    "template":"32017",
    "target":"customer",
    "replyto":"sender-test99999999@gmail.com",
    "subject":"Purchase"
}]
```

Contains an array of entries relating to emails which are sent using an Email Template:\
The ID of the template, the target of the email, a reply-to (who the email will claim to be from), and a subject for the email

### Example

```
FM_api('CustomerType_save',[
  'id'=>'60022',
  'name'=>'Residential',
  'colour_hex'=>'#ffffff',
  'allowed_next'=>'60021'
  ]
);
```

### Results

#### On Success

```
{"ok":1}
```

#### On Failure

If there's no 'id' parameter provided

```
{"error":"no id supplied"}
```

If there's no 'name' parameter provided

```
{"error":"no name supplied"}
```

If non-numeric characters are included in the 'allowed\_next' parameter, e.g letters

```
{"error":"values in allowed_next must be numeric"}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.fieldmotion.com/fieldmotion-api-docs/customertype/_save.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
