Skip to content

Variable: directMessageSchema ​

ts
const directMessageSchema: ZodObject<{
  item_id: ZodOptional<ZodString>;
  item_type: ZodOptional<ZodString>;
  text: ZodOptional<ZodString>;
  timestamp: ZodOptional<ZodCoercedString<unknown>>;
  user_id: ZodOptional<ZodCoercedString<unknown>>;
}, $loose>;

One item in a direct thread. Lean and lenient: item_type distinguishes the payload (text, media, like, link, ...), so most fields are optional. Timestamps arrive as microsecond strings and are kept as strings.

MIT License. Not affiliated with, endorsed or sponsored by Meta or Instagram.