# Additional Schemas

Schemas that are not grouped by a specific tag. These include core data objects and shared schemas used across multiple operations.


## Custom Event object {#customeventobject}

Defines a Custom Event.

[Jump to examples ↓](#customeventobject-examples)

- **`body`** `object` **REQUIRED**

  Contains information about your Custom Event. While only the event `name` is required, it is recommended that you provide as much information in this object as possible, so that your event is relevant and informative.

  **OBJECT PROPERTIES**

  - **`interaction_id`** `string`

    The identifier defining where the event occurred. In a traditional website, this would be the path and query string from the URL. In a single page app that uses hash routing, it would be the path, query string, and fragment identifier.

    Example: `your.store/us/en_us/pd/shoe/pid-11046546/pgid-10978234`

  - **`interaction_type`** `string`

    Describes the type of interaction that triggered the event, e.g., `url`, `social`, `email`. This should almost always be 'url' for web events. Airship can separate events with the same `name` by `interaction_type`, providing greater insight into Custom Events.

    Example: `url`

  - **`name`** `string` **REQUIRED**

    A plain-text name for the event. Airship’s analytics systems will roll up events with the same `name`, providing counts and total value associated with the event.
This value cannot contain upper-case characters. If the `name` contains upper-case characters, you will receive a 400 response.


    Example: `purchased`

  - **`properties`** `object`

    An object containing Custom Event properties. You can use handlebars to access Custom Event properties in templates or messages triggered by the Custom Event. Items in the `properties` object are limited to a 255 character maximum string length.

    Example: `[object Object]`

  - **`session_id`** `string`

    The user session during which the event occurred. You must supply and maintain session identifiers.

    Example: `22404b07-3f8f-4e42-a4ff-a996c18fa9f1`

  - **`transaction`** `string`

    If the event is one in a series representing a single transaction, use the transaction field to tie events together.

    Example: `886f53d4-3e0f-46d7-930e-c2792dac6e0a`

  - **`unique_id`** `string`

    If properties for the Custom Event are being used for triggering and personalizing a Sequence, use a unique ID to introduce uniqueness in order to differentiate messages and prevent dropping sends as duplicates.

    Example: `4c2c380a-0400-4d34-ab04-aaf31f0967c7`

  - **`value`** `number`

    If the event is associated with a count or amount, the 'value' field carries that information. Airship will treats this field as a representation of money; mathematical operations will use fixed precision representations of this field. The `value` field respects six digits of precision to the right of the decimal point. This field is optional; if empty, its value will default to zero.

    Default: `0`

    Example: `120.49`

- **`occurred`** `string`

  The [date-time](/docs/developer/rest-api/ua/introduction/#date-time-format) when the event occurred. Events must have occurred within the past 90 days. You cannot provide a future date-time. If omitted, the current date-time is used.

  Format: `date-time`

- **`user`** `object` **REQUIRED**

  Contains the Airship channel identifier for the user who triggered the event.

  **One of:**

  - **Named User** `object`
    - **`named_user_id`** `string`

      The Named User associated with the event.

      Example: `tommy_tutone`

  - **Fire OS Channel** `object`
    - **`amazon_channel`** `string`

      The unique channel identifier for a Fire OS device.

      Format: `uuid`

      Example: `3c070fc0-e976-4563-b088-ec8946176a01`

  - **Android Channel** `object`
    - **`android_channel`** `string`

      The unique channel identifier for an Android device.

      Format: `uuid`

      Example: `8bb5df16-bcca-4a55-ba71-8417525732f5`

  - **iOS Channel** `object`
    - **`ios_channel`** `string`

      The unique channel identifier for an iOS device.

      Format: `uuid`

      Example: `f59970d3-3d42-4584-907e-f5c57f5d46a1`

  - **Web Channel** `object`
    - **`web_channel`** `string`

      The unique channel identifier for a web device.

      Format: `uuid`

      Example: `9c36e8c7-5a73-47c0-9716-99fd3d4197d5`

  - **Generic Channel** `object`
    - **`channel`** `string`

      Airship canonical identifier for a user. Airship will determine the device.

      Format: `uuid`

      Example: `000ecc30-1e5d-47ed-b12e-11e2eb960db0`



**Used in:**

- [Add Custom Events]({{< ref "/developer/rest-api/ua/operations/custom-events/" >}}#addcustomevents)

**Examples**

*Example Custom Event*

```json
{
   "occurred": "2020-05-02T02:31:22",
   "user": {
       "named_user_id": "cool.person"
   },
   "body": {
       "name": "purchased",
       "value": 239.85,
       "transaction": "686f53d4-7e0s-36d7-234e-c9792dac6e7b",
       "interaction_id": "your.store/us/en_us/pd/shoe/pid-123456/pgid-123456",
       "interaction_type": "email",
       "unique_id": "4c2c380a-0400-4d34-ab04-aaf31f0967c7",
       "properties": {
          "description": "sky high",
          "brand": "victory",
          "colors": [
          "red",
          "blue"
          ],
          "items": [
          {
             "text": "New Line Sneakers",
             "price": "$ 79.95"
          },
          {
             "text": "Old Line Sneakers",
             "price": "$ 79.95"
          },
          {
             "text": "Blue Line Sneakers",
             "price": "$ 79.95"
          }
          ],
          "name": "Cool Person",
          "userLocation": {
          "state": "CO",
          "zip": "80202"
          }
       },
      "session_id": "22404b07-3f8f-4e42-a4ff-a996c18fa9f1"
   }
}

```

---

## Experiment object {#experimentobject}

An experiment object describes an A/B test, including the audience and variant portions.

[Jump to examples ↓](#experimentobject-examples)

- **`audience`** `object` <[Audience selector (max 1000)]({{< ref "/developer/rest-api/ua/schemas/audience-selection/" >}}#audienceselector1000)> **REQUIRED**

  The audience for the experiment.

  An audience selector forms the expression that determines the set of channels to target.

- **`campaigns`** `object` <[Campaigns object]({{< ref "/developer/rest-api/ua/schemas/push/" >}}#campaignsobject)>

  Campaigns object that will be applied to resulting pushes.

  An object specifying custom campaign categories related to the notification.

- **`control`** `number`

  The proportional subset of the audience that will not receive a push. The remaining audience will be split between the variants. It may help to think of this value as a percentage. See [Audience groups in the API](/docs/guides/experimentation/a-b-tests/messages/#audience-groups-in-the-api) in *Message A/B tests*.

  Format: `float`

- **`created_at`** `string`

  The [date-time](/docs/developer/rest-api/ua/introduction/#date-time-format) when the experiment was created. This value is created and assigned automatically by Airship and appears in responses only.

  Format: `date-time`

  Read only: true

- **`description`** `string`

  A description of the experiment.

- **`device_types`** `array[string]` **REQUIRED**

  An array containing one or more strings identifying targeted platforms.

  Min items: 1

  Possible values: `android`, `amazon`, `ios`, `web`, `sms`, `mms`, `email`, `open::open_platform_name`

- **`id`** `string`

  The unique ID assigned to this experiment. This value is created and assigned automatically by Airship and appears in responses only.

  Format: `uuid`

  Read only: true

- **`name`** `string`

  A name for the experiment.

- **`push_id`** `string`

  The push ID associated with this experiment. This value is created and assigned automatically by Airship and appears in responses only.

  Format: `uuid`

  Read only: true

- **`variants`** `array[object]` **REQUIRED**

  The variants for the experiment. An experiment must have at least 1 variant and no more than 26.

  Min: 1, Max: 26


**Used in:**

- [Create experiment (A/B Test)]({{< ref "/developer/rest-api/ua/operations/a-b-tests/" >}}#createexperiment)
- [Experiment listing]({{< ref "/developer/rest-api/ua/operations/a-b-tests/" >}}#getexperiments)
- [Experiment lookup]({{< ref "/developer/rest-api/ua/operations/a-b-tests/" >}}#getexperiment)
- [Scheduled experiment listing]({{< ref "/developer/rest-api/ua/operations/a-b-tests/" >}}#getscheduledexperiments)
- [Validate experiment]({{< ref "/developer/rest-api/ua/operations/a-b-tests/" >}}#validateexperiment)

**Examples**

*Example*

```json
{
   "name": "<experiment name>",
   "description": "<experiment description>",
   "control": "<control group>",
   "audience": "<audience-selection>",
   "device_types": "<device-types>",
   "campaigns": "<campaigns>",
   "variants": "[<variant specifications>]",
   "id": "<id>",
   "created_at": "timestamp",
   "push_id": "<push_id>"
}

```

---

## List response object {#listobject}

Contains all user-specified data about a static list or attributes list (metadata), but does not contain CSV list contents. Use the `/api/lists/{name}/csv` endpoints to [upload](/docs/developer/rest-api/ua/operations/static-lists/#updatestaticlist) or [download](/docs/developer/rest-api/ua/operations/static-lists/#getstaticlist) list contents.

[Jump to examples ↓](#listobject-examples)

- **`channel_count`** `integer`

  A count of resolved channel identifiers for the last uploaded and successfully processed identifier list. This will always be 0 for attribute lists.

  Read only: true

- **`created`** `string`

  The [date-time](/docs/developer/rest-api/ua/introduction/#date-time-format) when the list was initially created.

  Format: `date-time`

  Read only: true

- **`description`** `string`

  An optional description for the list.

  Max length: 10000

- **`error_path`** `string`

  If non-empty, indicates that there were errors in the processed CSV file. The value is either an empty string or a URL to download a file describing the errors.

- **`extra`** `object`

  An optional JSON map of up to 100 key-value (string-to-string) pairs associated with the list. Keys in this object have a 64-character maximum; values can be up to 1,024 characters.

- **`last_updated`** `string`

  The [date-time](/docs/developer/rest-api/ua/introduction/#date-time-format) when the identifiers of the list were last updated successfully.

  Format: `date-time`

  Read only: true

- **`name`** `string` **REQUIRED**

  The name of the list, consists of up to 64 URL-safe characters. The name is how the list is identified, so it should be unique and memorable.

  Min length: 1, Max length: 64

- **`status`** `string`

  A string value representing the state of the list.

* `ready` — The list was processed successfully and is ready for sending.
* `processing` — The list is being processed.
* `failure` — There was an error processing the last uploaded list.


  Possible values: `ready`, `processing`, `failure`

  Read only: true


**Used in:**

- [Download list errors]({{< ref "/developer/rest-api/ua/operations/attribute-lists/" >}}#getattributelisterrors)
- [Retrieve lists]({{< ref "/developer/rest-api/ua/operations/attribute-lists/" >}}#getattributelistmetadata)
- [Retrieve lists]({{< ref "/developer/rest-api/ua/operations/static-lists/" >}}#getstaticlistsmetadata)

**Examples**

*List response object*

```json
{
  "ok": true,
  "lists": [
      {
        "name": "ua_attributes_my_list",
        "description": "My first list",
        "extra": {
            "filename": "list.csv",
            "source": "crm"
        },
        "created": "2020-05-13T21:41:25",
        "last_updated": "2020-05-13T21:45:17",
        "channel_count": 0,
        "error_path": "https://go.urbanairship.com/api/attribute-lists/ua_attributes_my_list/errors",
        "status": "ready"
      },
      {
        "name": "ua_attributes_another_list",
        "description": "My second list",
        "extra": {
            "filename": "list2.csv",
            "source": "api"
        },
        "created": "2020-05-14T21:41:25",
        "last_updated": "2020-05-14T21:45:17",
        "channel_count": 0,
        "error_path": "https://go.urbanairship.com/api/attribute-lists/ua_attributes_another_list/errors",
        "status": "ready"
      }
  ]
}

```

---

## Sender ID {#sender-id}

A `sender_id` describes the sender target to apply the keyword action event to. This must be a number the app is already configured to send from. If a sender exists in multiple countries, a country can be specified by prefixing the country code with a colon, e.g., `US:12345`.

The `sender_id` is composed of two parts:
* A `sender` stem - Required numeric string.
* A `country_code` - Optional 2-letter ISO 3166 country code.

**Used in:**

- [Manually trigger a keyword interaction]({{< ref "/developer/rest-api/ua/operations/sms/" >}}#triggersmskeywordinteraction)

---

