---
title: Set Custom Data
slug: set-custom-data
createdAt: 2026-02-05T09:33:58.280Z
---

### Purpose

Assigns values to the customer field and custom fields used in the Insight Portal to collate and categorise SIM cards.

The target device is specified using the `<iccid>` element.

Each field setting is optional:

- `<customer>`
  If included, must **exactly match** a customer entry that has already been configured in the Insight Portal.
  If an incorrect customer value is supplied, it will be ignored, any existing value will remain unchanged, and the API will still return **Success**.
- `<field-x>`
  Sets the value of Custom Field *x* (where *x* = 1, 2, 3, or 4).
  Any existing data in the field will be **completely overwritten**.

Field length limits apply:

- Fields **1** and **2**: maximum **20 characters**
- Fields **3** and **4**: maximum **50 characters**

Data longer than the allowed field length will be truncated.
Empty fields will be ignored.

Data must be entered as **plain text**. Reserved XML characters must be escaped as described in the XML format section.

:::hint{type="warning"}
**Operational Impact**

API commands perform live configuration changes.

- Changes take effect immediately.&#x20;
- Commands may affect SIM status, service availability, charging, or usage limits.&#x20;
- Requests cannot be undone automatically.&#x20;

Ensure all parameters are validated before submitting requests to the production environment.
:::

### Endpoint

```http
POST https://api.m2miportal.com
Content-Type: application/xml
Accept: application/xml
```

### Request (XML)

```xml
<set-custom-data version="1" api-id="123456">
  <authentication>
    <username>username</username>
    <password>password</password>
  </authentication>
  <iccid>1234567890123456789</iccid>
  <customer>ACME Tracking</customer>
  <field-1>HP16 BVV</field-1>
  <field-2>Telit CV590</field-2>
  <field-3>VIN-1278649998</field-3>
  <field-4>26 The Gables, Whitmarsh, Lancs</field-4>
</set-custom-data>
```

### Response (Success)

```xml
<set-custom-data-response api-id="123456">
  <api-outcome>Success</api-outcome>
</set-custom-data-response>
```

:::hint{type="info"}
## Response (Failure)

If a request cannot be processed, the response will include:

- api-outcome indicating failure&#x20;
- An error description explaining the reason&#x20;

Failure responses may occur due to:

- Invalid authentication credentials&#x20;
- Invalid or unknown identifiers (for example ICCID or MSISDN)&#x20;
- Invalid or missing parameters&#x20;
- Values not permitted for the specified SIM type or account configuration&#x20;
- Insufficient permissions&#x20;

Integrating systems should validate input data before submission and implement appropriate error handling and logging.
:::

