# Assign Custom Subscriber Attributes

Custom Subscriber Attributes are used to store data of any type that you define for your subscribers. These attributes can be added and updated manually through [the platform](#manage-custom-subscriber-attributes-in-the-platform), automatically from your subscribers via [SMS with a workflow](#use-a-workflow-to-collect-subscriber-attributes), and with the [Mobile Text Alerts API](#manage-subscriber-attributes-with-the-mobile-text-alerts-api).

{% hint style="info" %}
This page describes how to assign Custom Subscriber Attributes, see [custom-subscriber-attributes](https://developers.mobile-text-alerts.com/tutorials/custom-subscriber-attributes "mention") to learn how to create these fields with the API.
{% endhint %}

## Manage Custom Subscriber Attributes in the Dashboard

Visit the [Manage Custom Attributes](https://platform.mobile-text-alerts.com/subscribers/attributes) tab in the platform dashboard by selecting **Subscribers** > **Attributes**. Here you can view and search all attributes currently available for your subscribers.

### Edit or Delete Attributes

Click on a specific attribute to edit it, or click the "trash bin" icon <img src="https://879775583-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM0P3gHFFZE4c6PMaPvHm%2Fuploads%2FfdNY02Zp05hvgjOdyM9k%2FScreen%20Shot%202025-05-09%20at%2012.11.09%20PM.png?alt=media&#x26;token=3cc948a2-bf63-4430-8e96-b3ce690f7684" alt="" data-size="line"> to delete an attribute.

### Add Attributes

1. Click the **Add Attribute** button.
2. Enter the **Name** of the new attribute.
3. Select from the following data types under **Attribute Type**:
   * `Text` (plain text)
   * `Number` (digits only)
   * `Date` (you will need to specify the date format)
   * `Checkbox` (a flag option that allows either checked or unchecked)
   * `Option`/`Multi Options` (this will allow you to create an `enum` of possible options)
   * `Address` (text for storing subscriber addresses)

***Example:*** To create a field to store subscribers' birthdays, you could create the following attribute:

* **Name:** "Birthday" with the **Attribute Type:** `Date`.

### Assign Attributes to Subscribers

After your attributes are created, you can assign the data for those attributes to your subscribers manually on the [Manage Subscribers](https://platform.mobile-text-alerts.com/subscribers/manage) page, or by importing a spreadsheet.

You can also configure your account's [sign-up page](https://platform.mobile-text-alerts.com/optins/sign-up-page) to collect subscriber data as part of the enrollment process.

## Use a Workflow to Collect Subscriber Attributes

Workflow Builder allows you to automatically collect data from your subscribers via SMS.

{% embed url="<https://youtu.be/sitvk0UqIiM>" %}

[Click here to learn more](https://mobile-text-alerts.deskpro.com/kb/articles/new-how-to-use-the-workflow-builder).

## Manage Subscriber Attributes with the Mobile Text Alerts API

### Add/update a subscriber's attributes

{% hint style="info" %}
This section explains how to add/update attributes for individual subscribers on your account. To learn how to manage the attributes that are configured for your account, visit [custom-subscriber-attributes](https://developers.mobile-text-alerts.com/tutorials/custom-subscriber-attributes "mention").
{% endhint %}

Subscriber attributes can be added or updated by including key/value pairs in `subscriberFields` as part of the request body to one of the [/subscribers](https://developers.mobile-text-alerts.com/tutorials/manage-subscribers) endpoints.

The data type of the Custom Subscriber Attribute must match what is configured for that field. For example, the request below uses the following Custom Subscriber Attribute: `"name":"Birthday","type":"date","format":"MM/DD/YYYY"`.

#### **Example Request to Create a Subscriber** [`POST` <mark style="color:blue;">`/subscribers`</mark>](https://developers.mobile-text-alerts.com/tutorials/manage-subscribers/..#post-subscribers)

<pre class="language-bash"><code class="lang-bash">curl -XPOST --location 'https://api.mobile-text-alerts.com/v3/subscribers' \
  --header 'Authorization: Bearer &#x3C;APIKey>' \
  --header 'Content-Type: application/json' \
  --data-raw '{  
    "firstName": "FirstName", 
    "lastName": "LastName", 
    "number": 8002223333, 
    "email": "example@mobile-text-alerts.com",
    "subscriberFields": {
      "<a data-footnote-ref href="#user-content-fn-1">Birthday</a>": "01/01/2000"
    } 
}'
</code></pre>

Mobile Text Alerts will assign each custom attribute a `SubscriberFieldId`. Each subscriber attribute will have a unique `id` assigned for that instance. You can retrieve this data by viewing the subscriber record via the API.

### View Subscriber Attributes

Custom subscriber attributes are returned by the Mobile Text Alerts API in the `subscriberFieldData` field, which contains:

* `id` - Refers to the specific *instance* of that field for the specified subscriber
* `subscriberFieldId` - Identifies the `CustomFieldId` of the Custom Subscriber Attribute. This can be used to [retrieve or update the Custom Subscriber Attribute](https://developers.mobile-text-alerts.com/custom-subscriber-attributes#update-a-custom-subscriber-attribute).
* `data` - The data for this field for the specified subscriber

For example, when retrieving a subscriber's data from [`GET` `/subscribers`](https://developers.mobile-text-alerts.com/tutorials/manage-subscribers/..#get-subscribers):

#### Example Response:

<pre class="language-json"><code class="lang-json">{"id":109021626,
    "firstName":"Test",
    "lastName":"Example",
    "email":"example@mobile-text-alerts.com",
    "number":0,
    "date":"2025-03-20T19:09:38.000Z",
    "countryId":null,
    "groups":[],
    "<a data-footnote-ref href="#user-content-fn-2">subscriberFieldData</a>":
        [{"id":21323389,"subscriberFieldId":7506,"data":"01/01/2000"},
        {"id":21323390,"subscriberFieldId":7507,"data":"ExampleAttribute"}],
    "signupMethod":11,
    "longNumber":0,
    "carrierId":41
}
</code></pre>

[^1]: fieldName

[^2]: Custom subscriber attributes


---

# 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://developers.mobile-text-alerts.com/tutorials/manage-subscribers/assign-custom-subscriber-attributes.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.
