MeiroDocs

Attributes

Required feature (one of):

Section: Group Attributes. Base URL: https://instance_name.meiro.io/api/.

Attributes [/attributes{?limit,offset,order_by,order_dir,tag_ids,source_ids,name_filter,show_hidden,load_full_structure}]

List All Attributes [GET]

Required feature (one of):

  • settings/cdp_entities

  • settings/global

  • settings/insights

  • settings/sources_and_destinations

  • data/sources_and_destinations

  • foreign_segments/list

  • foreign_segments/view

  • foreign_segments/edit

  • segments/create

  • segments/export

  • segments/insights

  • data/insights

  • data/dashboard

  • data/attributes

  • customers/search

  • customers/detail

  • access to any segment

  • Parameters

    • limit (number, optional) - Limit of the number of records returned
    • offset (number, optional) - Offset for the number of records returned
    • order_by (string, optional) - Ordered column name
    • order_dir (string, optional) - Ordering direction
    • tag_ids (array, optional) - Attributes' tags filter
    • source_ids (array, optional) - Attributes' sources filter
    • name_filter (string, optional) - Attributes' name filter
    • show_hidden (integer, optional) - Result will include hidden attributes if set to 1
    • load_full_structure (number, optional) - Full data structure return flag
  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

{
    "attributes": [
        {
            "id": "100",
            "source_id": "200",
            "name": "Simple attribute example",
            "is_disabled": 0,
            "is_unique": 1,
            "is_hidden": 0,
            "is_system": 0,
            "is_pii_protected": 1,
            "data_type": "string",
            "order_index": 1000,
            "description": "example description",
            "definition": {
                "id": "100",
                "type": "last",
                "value": "payload -> 'foo' ->> 'bar'",
                "outer_value": "value",
                "weight": "1",
                "filter": "payload ->> 'url' != foo.bar",
                "outer_filter": "event_time < now()",
                "sources": ["me", "mk"],
                "types": ["page_view", "custom_event"],
                "versions": ["1-0-0", "1-1-0"]
            },
            "modified": "2017-01-02 15:35:00",
            "created":"2017-01-01 15:35:00",
            "tags": ["tag1", "tag2"],
            "examples": ["value1", "value2"]
        },
        {
            "id": "200",
            "source_id": "300",
            "name": "Compound attribute example",
            "is_dynamic": 0,
            "is_disabled": 0,
            "is_personal": 0,
            "is_unique": 1,
            "is_hidden": 0,
            "is_system": 0,
            "is_pii_protected": 0,
            "data_type": "compound([["1", "First sub-attr", "string"], ["2", "Second sub-attr", "string"]])",
            "order_index": 1000,
            "description": "example description",
            "definition": {
                "id": 100,
                "type": "custom",
                "query": "SELECT * FROM test_table"
            },
            "modified": "2017-01-02 15:35:00",
            "created":"2017-01-01 15:35:00",
            "tags": ["tag1", "tag2"],
            "examples": {
                "1": ["value1", "value2"],
                "2": ["value1", "value2"]
            }
        }
    ],
    "selection_settings": {
        "limit": 20,
        "offset": null,
        "order_by": "id",
        "order_dir": "ASC",
        "tag_ids": ["tag1"],
        "name_filter": "example",
        "source_ids": ["200"],
        "show_hidden": false
    }
}

Create an Attribute [POST]

Required feature: settings/cdp_entities

  • Attributes

    • id: attribute_id (string)
    • source_id: source_id (string)
    • name: attribute name (string)
    • data_type: int (string)
    • is_disabled: 0 (number, optional)
    • is_unique: 1 (number, optional)
    • is_hidden: 0 (number, optional)
    • order_index: 1000 (number, optional)
    • description: attribute description (string, optional)
    • definition: definition of attribute calculation (string, optional)
    • tag_ids (array, optional)
  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 201 (application/json)

{
    "attribute": {
        "id": "attribute_id",
        "source_id": "source_id",
        "name": "attribute name",
        "data_type": "int",
        "is_disabled": 0,
        "is_unique": 1,
        "is_hidden": 0,
        "is_system": 0,
        "is_pii_protected": 1,
        "order_index": 1000,
        "description": "attribute description",
        "definition": {
            "id": 100,
            "type": "custom",
            "query": "SELECT * FROM test_table"
        }
        "tags": ["tag1", "tag2"],
        "modified": "2017-01-02 15:35:00",
        "created":"2017-01-01 15:35:00"
    }
}

Attribute History [/attributes/{attribute_id}/history{?limit,offset,order_by,order_dir}]

List Attribute History [GET]

Returns a list of history records for an attribute, including the current state. The list includes:

  • Current state (id: null) - The latest version from the main attributes table
  • Historical snapshots - Previous versions saved before each modification

Each time an attribute is modified, a snapshot of its previous state is saved. When ordering by modified DESC (default), the current state appears first.

Required feature: settings/cdp_entities

  • Parameters

    • attribute_id (string, required) - The attribute ID
    • limit (number, optional) - Limit of the number of records returned
    • offset (number, optional) - Offset for the number of records returned
    • order_by (string, optional) - Ordered column name (id, modified, created)
    • order_dir (string, optional) - Ordering direction (ASC, DESC)
  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

{
    "history_list": [
        {
            "id": null,
            "attribute": {
                "id": "attribute_id",
                "source_id": "source_id",
                "name": "current attribute name",
                "data_type": "int",
                "is_disabled": 0,
                "is_unique": 1,
                "is_hidden": 0,
                "is_system": 0,
                "order_index": 1000,
                "description": "current description",
                "definition": null,
                "modified": "2017-01-03 15:35:00",
                "created": "2017-01-01 15:35:00"
            }
        },
        {
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "attribute": {
                "id": "attribute_id",
                "source_id": "source_id",
                "name": "attribute name before modification",
                "data_type": "int",
                "is_disabled": 0,
                "is_unique": 1,
                "is_hidden": 0,
                "is_system": 0,
                "order_index": 1000,
                "description": "attribute description",
                "definition": null,
                "modified": "2017-01-02 15:35:00",
                "created": "2017-01-01 15:35:00"
            }
        }
    ],
    "selection_settings": {
        "limit": 20,
        "offset": null,
        "order_by": "modified",
        "order_dir": "DESC"
    }
}
  • Response 404 (application/json)
{
    "message": "Attribute not found"
}

Attribute History Record [/attributes/{attribute_id}/history/{history_id}]

Get Attribute History Record [GET]

Returns a specific history record with its previous state for comparison. The response includes the snapshot at the requested history_id and, if available, the immediately preceding record.

Required feature: settings/cdp_entities

  • Parameters

    • attribute_id (string, required) - The attribute ID
    • history_id (string, required) - The history record UUID
  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

{
    "history_record": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "attribute": {
            "id": "attribute_id",
            "source_id": "source_id",
            "name": "attribute name before modification",
            "data_type": "int",
            "is_disabled": 0,
            "is_unique": 1,
            "is_hidden": 0,
            "is_system": 0,
            "order_index": 1000,
            "description": "attribute description",
            "definition": null,
            "modified": "2017-01-02 15:35:00",
            "created": "2017-01-01 15:35:00"
        },
        "previous_record": {
            "id": "660e8400-e29b-41d4-a716-446655440001",
            "attribute": {
                "id": "attribute_id",
                "source_id": "source_id",
                "name": "original attribute name",
                "data_type": "int",
                "is_disabled": 0,
                "is_unique": 1,
                "is_hidden": 0,
                "is_system": 0,
                "order_index": 1000,
                "description": "original description",
                "definition": null,
                "modified": "2017-01-01 15:35:00",
                "created": "2017-01-01 15:35:00"
            }
        }
    }
}
  • Response 404 (application/json)
{
    "message": "Attribute not found"
}
  • Response 404 (application/json)
{
    "message": "Attribute history record not found"
}
  • Response 400 (application/json)
{
    "message": "Invalid history ID format"
}

Attribute [/attributes/{attribute_id}{?load_full_structure}]

  • Parameters
    • load_full_structure (number, optional) - Full data structure return flag

Retrieve an Attribute [GET]

Required feature (one of):

  • settings/cdp_entities

  • settings/global

  • settings/insights

  • settings/sources_and_destinations

  • data/sources_and_destinations

  • foreign_segments/list

  • foreign_segments/view

  • foreign_segments/edit

  • segments/create

  • segments/export

  • segments/insights

  • data/insights

  • data/dashboard

  • data/attributes

  • customers/search

  • customers/detail

  • access to any segment

  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

{
    "attribute": {
        "id": 100,
        "source_id": 200,
        "name": "example attribute",
        "is_dynamic": 0,
        "is_disabled": 0,
        "is_personal": 0,
        "is_unique": 1,
        "is_hidden": 0,
        "is_system": 0,
        "is_pii_protected": 1,
        "data_type": "string",
        "order_index": 1000,
        "description": "example description",
        "definition": {
            "id": 100,
            "type": "custom",
            "query": "SELECT * FROM test_table"
        },
        "modified": "2017-01-02 15:35:00",
        "created":"2017-01-01 15:35:00",
        "tags": ["tag1", "tag2"],
        "examples": ["value1", "value2"]
    }
}

Modify an Attribute [PATCH]

Required feature: settings/cdp_entities

  • Attributes

    • name: attribute name (string, optional)
    • description: attribute description (string, optional)
    • data_type: int (string, optional)
    • definition: definition of attribute calculation (string, optional)
    • tag_ids (array, optional)
  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

{
    "attribute": {
        "id": "100",
        "source_id": "200",
        "name": "attribute name",
        "is_disabled": 0,
        "is_unique": 1,
        "is_hidden": 0,
        "is_system": 0,
        "is_pii_protected": 1,
        "data_type": "int",
        "order_index": 1000,
        "description": "attribute description",
        "definition": {
            "id": "100",
            "type": "last",
            "value": "payload -> 'foo' ->> 'bar'",
            "outer_value": "value",
            "weight": "1",
            "filter": "payload ->> 'url' != foo.bar",
            "outer_filter": "event_time < now()",
            "sources": ["me", "mk"],
            "types": ["page_view", "custom_event"],
            "versions": ["1-0-0", "1-1-0"]
        },
        "tags": ["tag1", "tag2"],
        "modified": "2017-01-02 15:35:00",
        "created":"2017-01-01 15:35:00"
    }
}

Attributes' Tags [/attributes/tags{?limit,offset,order_by,order_dir,name_filter}]

List All Attributes' Tags [GET]

Required feature (one of):

  • settings/cdp_entities

  • settings/global

  • settings/insights

  • data/sources_and_destinations

  • foreign_segments/list

  • foreign_segments/view

  • foreign_segments/edit

  • segments/create

  • segments/export

  • segments/insights

  • data/insights

  • data/dashboard

  • data/attributes

  • customers/search

  • Parameters

    • limit (number, optional) - Limit of the number of records returned
    • offset (number, optional) - Offset for the number of records returned
    • order_by (string, optional) - Ordered column name
    • order_dir (string, optional) - Ordering direction
    • name_filter (string, optional) - Tags' name filter
  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

{
    "tags": [
        {
            "id": 100,
            "name": "example tag",
            "modified": "2017-01-02 15:35:00",
            "created":"2017-01-01 15:35:00",
        }
    ],
    "selection_settings": {
        "limit": 20,
        "offset": null,
        "order_by": "id",
        "order_dir": "ASC",
        "name_filter": "example"
    }
}

Attributes' Sources [/attributes/sources{?limit,offset,order_by,order_dir,name_filter,show_hidden}]

List All Attributes' Sources [GET]

Required feature: data/sources_and_destinations

  • Parameters

    • limit (number, optional) - Limit of the number of records returned
    • offset (number, optional) - Offset for the number of records returned
    • order_by (string, optional) - Ordered column name
    • order_dir (string, optional) - Ordering direction
    • name_filter (string, optional) - Tags' name filter
    • show_hidden (integer, optional) - Result will include hidden sources if set to 1
  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

{
    "sources": [
        {
            "id": "1",
            "name": "example source",
            "description": null,
            "type": "example type",
            "is_hidden": 0,
            "modified": "2018-09-07T22:49:29Z",
            "created": "2018-09-07T22:49:29Z"
        }
    ],
    "selection_settings": {
        "limit": 20,
        "offset": null,
        "order_by": "id",
        "order_dir": "ASC",
        "name_filter": "example",
        "show_hidden": false
    }
}

Attributes Count [/attributes_count]

Get Total Number of Attributes [GET]

Required feature: data/dashboard

  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

{
    "attributes_count": 4
}

On this page