Skip to content

Event metadata validation is too strict #286

@jpvanhal

Description

@jpvanhal

CreateDataEventRequest models (CreateDataEventRequestWithId, CreateDataEventRequestWithUserId, CreateDataEventRequestWithEmail) only accept string metadata, conflicting with Intercom’s documented metadata types (strings, numbers, Unix timestamps, rich links, monetary amounts).

Steps to reproduce

  1. Instantiate any variant with non-string metadata:
from intercom.types import CreateDataEventRequestWithUserId

CreateDataEventRequestWithUserId(
    user_id="123",
    event_name="test-event",
    created_at=1671028894,
    metadata={"load": 3.67},
)
  1. Observe ValidationError because metadata.load is not a string.

Expected behaviour

Allow every metadata type listed at https://developers.intercom.com/docs/references/rest-api/api.intercom.io/data-events/createdataevent.

Actual behaviour

Validation forces all metadata values to be plain strings.

Suggested Fix

Relax the metadata value type in all CreateDataEventRequest* models (e.g., use typing.Any or a union covering the documented types) so the SDK aligns with Intercom’s API specification.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions