Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

Type aliases

Action

Audience

Audience: { id: string }

Type declaration

  • id: string

    A user ID or IFA.

AudienceGroup

AudienceGroup: (UploadAudienceGroup | ImpAudienceGroup | ClickAudienceGroup) & { audienceCount: number } & ({ status: "IN_PROGRESS" | "READY" | "EXPIRED" } | { failedType: "AUDIENCE_GROUP_AUDIENCE_INSUFFICIENT" | "INTERNAL_ERROR"; status: "FAILED" })

AudienceGroupAuthorityLevel

AudienceGroupAuthorityLevel: { authorityLevel: "PUBLIC" | "PRIVATE" }

Type declaration

  • authorityLevel: "PUBLIC" | "PRIVATE"

    The authority level for all audiences linked to a channel

    • PUBLIC: The default authority level. Audiences will be available in channels other than the one where you created the audience. For example, it will be available in LINE Official Account Manager, LINE Ad Manager, and all channels the bot is linked to.
    • PRIVATE: Audiences will be available only in the channel where you created the audience.

AudienceGroupWithJob

AudienceGroupWithJob: AudienceGroup & { jobs: Job[] }

AudienceGroups

AudienceGroups: { audienceGroups: AudienceGroup[]; hasNextPage: boolean; page: number; readWriteAudienceGroupTotalCount: number; size: number; totalCount: number }

Type declaration

  • audienceGroups: AudienceGroup[]

    An array of audience data.

  • hasNextPage: boolean

    true when this is not the last page.

  • page: number

    The current page number.

  • readWriteAudienceGroupTotalCount: number

    Of the audiences you can get with the specified condition, the number of audiences with the update permission set to READ_WRITE.

  • size: number

    The number of audiences on the current page.

  • totalCount: number

    The total number of audiences that can be returned with the specified filter.

AudienceObject

AudienceObject: { audienceGroupId: number; type: "audience" }

Type declaration

  • audienceGroupId: number

    The audience ID. Create audiences with the manage audience API.

  • type: "audience"

AudioMessage

AudioMessage: { duration: number; originalContentUrl: string; type: "audio" }

Type declaration

  • duration: number

    Length of audio file (milliseconds)

  • originalContentUrl: string

    URL of audio file

    • Max character limit: 1000
    • HTTPS over TLS 1.2 or later
    • m4a
    • Max: 1 minute
    • Max: 10 MB
  • type: "audio"

BasicAudienceGroup

BasicAudienceGroup: { audienceGroupId: number; createRoute: "OA_MANAGER" | "MESSAGING_API"; created: number; description: string; isIfaAudience: string; permission: "READ" | "READ_WRITE" }

Type declaration

  • audienceGroupId: number

    The audience ID.

  • createRoute: "OA_MANAGER" | "MESSAGING_API"

    How the audience was created. If omitted, all audiences are included.

  • created: number

    When the audience was created (in UNIX time).

  • description: string

    The audience's name.

  • isIfaAudience: string

    The value specified when creating an audience for uploading user IDs to indicate the type of accounts that will be given as recipients. One of:

    • true: Accounts are specified with IFAs.
    • false (default): Accounts are specified with user IDs.
  • permission: "READ" | "READ_WRITE"

    Audience's update permission. Audiences linked to the same channel will be READ_WRITE.

    • READ: Can use only.
    • READ_WRITE: Can use and update.

BotInfoResponse

BotInfoResponse: { basicId: string; chatMode: "chat" | "bot"; displayName: string; markAsReadMode: "auto" | "manual"; pictureUrl: string; premiumId?: string; userId: string }

Response body of get bot info.

see

Get bot info

Type declaration

  • basicId: string

    Bot's basic ID

  • chatMode: "chat" | "bot"

    Bot's response mode set in the LINE Official Account Manager. One of:

    • chat: The response mode is set to "Chat".
    • bot: The response mode is set to "Bot".
  • displayName: string

    Bot's display name

  • markAsReadMode: "auto" | "manual"

    Automatic read setting for messages. If the bot's response mode is "Bot", auto is returned. If the response mode is "Chat", manual is returned.

    • auto: Auto read setting is enabled.
    • manual: Auto read setting is disabled.
  • pictureUrl: string

    Profile image URL. "https" image URL. Not included in the response if the bot doesn't have a profile image.

  • Optional premiumId?: string

    Bot's premium ID. Not included in the response if the premium ID isn't set.

  • userId: string

    Bot's user ID

ButtonsTemplate

ButtonsTemplate: { actions: Action[]; defaultAction?: Action; imageAspectRatio?: "rectangle" | "square"; imageBackgroundColor?: string; imageSize?: "cover" | "contain"; text: string; thumbnailImageUrl?: string; title?: string; type: "buttons" }

Buttons template

Template with an image, title, text, and multiple action buttons.

Because of the height limitation for buttons template messages, the lower part of the text display area will get cut off if the height limitation is exceeded. For this reason, depending on the character width, the message text may not be fully displayed even when it is within the character limits.

Type declaration

  • actions: Action[]

    Action when tapped

    • Max objects: 4
  • Optional defaultAction?: Action

    Action when image, title or text area is tapped.

  • Optional imageAspectRatio?: "rectangle" | "square"

    Aspect ratio of the image. One of:

    • rectangle: 1.51:1
    • square: 1:1

    Default: rectangle

  • Optional imageBackgroundColor?: string

    Background color of the image. Specify a RGB color value. Default: #FFFFFF (white)

  • Optional imageSize?: "cover" | "contain"

    Size of the image. One of:

    • cover: The image fills the entire image area. Parts of the image that do not fit in the area are not displayed.
    • contain: The entire image is displayed in the image area. A background is displayed in the unused areas to the left and right of vertical images and in the areas above and below horizontal images.

    Default: cover

  • text: string

    Message text

    • Max character limit: 160 (no image or title)
    • Max character limit: 60 (message with an image or title)
  • Optional thumbnailImageUrl?: string

    Image URL

    • Max character limit: 1,000
    • HTTPS over TLS 1.2 or later
    • JPEG or PNG
    • Max width: 1024px
    • Max file size: 1 MB
  • Optional title?: string

    Title

    • Max character limit: 40
  • type: "buttons"

CameraAction

CameraAction: { label: string; type: "camera" }

This action can be configured only with quick reply buttons. When a button associated with this action is tapped, the camera screen in LINE is opened.

Type declaration

  • label: string

    Label for the action

    • Max character limit: 20
  • type: "camera"

CameraRollAction

CameraRollAction: { label: string; type: "cameraRoll" }

This action can be configured only with quick reply buttons. When a button associated with this action is tapped, the camera roll screen in LINE is opened.

Type declaration

  • label: string

    Label for the action

    • Max character limit: 20
  • type: "cameraRoll"

CarouselTemplate

CarouselTemplate: { columns: ColumnObject[]; imageAspectRatio?: "rectangle" | "square"; imageSize?: "cover" | "contain"; type: "carousel" }

Carousel template

Template with multiple columns which can be cycled like a carousel. The columns are shown in order when scrolling horizontally.

Because of the height limitation for carousel template messages, the lower part of the text display area will get cut off if the height limitation is exceeded. For this reason, depending on the character width, the message text may not be fully displayed even when it is within the character limits.

Keep the number of actions consistent for all columns. If you use an image or title for a column, make sure to do the same for all other columns.

Type declaration

  • columns: ColumnObject[]

    Array of columns

    • Max columns: 10
  • Optional imageAspectRatio?: "rectangle" | "square"

    Aspect ratio of the image. One of:

    • rectangle: 1.51:1
    • square: 1:1

    Applies to all columns. Default: rectangle

  • Optional imageSize?: "cover" | "contain"

    Size of the image. One of:

    • cover: The image fills the entire image area. Parts of the image that do not fit in the area are not displayed.
    • contain: The entire image is displayed in the image area. A background is displayed in the unused areas to the left and right of vertical images and in the areas above and below horizontal images.

    Applies to all columns. Default: cover.

  • type: "carousel"

CarouselTemplateOptions

CarouselTemplateOptions: MessageOptions & { imageAspectRatio?: "rectangle" | "square"; imageSize?: "cover" | "contain" }

ClickAudienceGroup

ClickAudienceGroup: BasicAudienceGroup & { clickUrl?: string; requestId: string; type: "CLICK" }

ClientConfig

ClientConfig: { accessToken: string; channelSecret?: string; dataOrigin?: string; onRequest?: OnRequestFunction; origin?: string }

Type declaration

  • accessToken: string
  • Optional channelSecret?: string
  • Optional dataOrigin?: string
  • Optional onRequest?: OnRequestFunction
  • Optional origin?: string

ColumnObject

ColumnObject: { actions: Action[]; defaultAction?: Action; imageBackgroundColor?: string; text: string; thumbnailImageUrl?: string; title?: string }

Type declaration

  • actions: Action[]

    Action when tapped

    • Max objects: 3
  • Optional defaultAction?: Action

    Action when image, title or text area is tapped.

  • Optional imageBackgroundColor?: string

    Background color of the image. Specify a RGB color value. The default value is #FFFFFF (white).

  • text: string

    Message text

    • Max character limit: 120 (no image or title)
    • Max character limit: 60 (message with an image or title)
  • Optional thumbnailImageUrl?: string

    Image URL

    • Max character limit: 1,000
    • HTTPS over TLS 1.2 or later
    • JPEG or PNG
    • Aspect ratio: 1:1.51
    • Max width: 1024px
    • Max file size: 1 MB
  • Optional title?: string

    Title

    • Max character limit: 40

ConfirmTemplate

ConfirmTemplate: { actions: Action[]; text: string; type: "confirm" }

Confirm template

Template with two action buttons.

Because of the height limitation for confirm template messages, the lower part of the text display area will get cut off if the height limitation is exceeded. For this reason, depending on the character width, the message text may not be fully displayed even when it is within the character limits.

Type declaration

  • actions: Action[]

    Array of action objects

    • Action when tapped
    • Set 2 actions for the 2 buttons
  • text: string

    Message text

    • Max character limit: 240
  • type: "confirm"

CreateClickAudienceGroupOptions

CreateClickAudienceGroupOptions: { clickUrl?: string }

Type declaration

  • Optional clickUrl?: string

    The URL clicked by the user. If empty, users who clicked any URL in the message are added to the list of recipients.

    • Max character limit: 2,000

CreateUploadAudienceGroupOptions

CreateUploadAudienceGroupOptions: { uploadDescription?: string }

Type declaration

  • Optional uploadDescription?: string

    The description to register for the job (in jobs[].description).

DatetimePickerAction

DatetimePickerAction: { data: "string"; initial?: string; label?: string; max?: string; min?: string; mode: "date" | "time" | "datetime"; type: "datetimepicker" }

When a control associated with this action is tapped, a postback event is returned via webhook with the date and time selected by the user from the date and time selection dialog. The datetime picker action does not support time zones.

Type declaration

  • data: "string"

    String returned via webhook in the postback.data property of the postback event

    • Max character limit: 300
  • Optional initial?: string

    Initial value of date or time.

  • Optional label?: string

    Label for the action

    • Required for templates other than image carousel. Max character limit: 20
    • Optional for image carousel templates. Max character limit: 12
    • Optional for rich menus. Spoken when the accessibility feature is enabled on the client device. Max character limit: 20. Supported on LINE 8.2.0 and later for iOS.
    • Required for quick reply buttons. Max character limit: 20. Supported on LINE 8.11.0 and later for iOS and Android.
    • Required for the button of Flex Message. This property can be specified for the box, image, and text but its value is not displayed. Max character limit: 20
  • Optional max?: string

    Largest date or time value that can be selected. Must be greater than the min value.

  • Optional min?: string

    Smallest date or time value that can be selected. Must be less than the max value.

  • mode: "date" | "time" | "datetime"

    Action mode

    • date: Pick date
    • time: Pick time
    • datetime: Pick date and time
  • type: "datetimepicker"

DemographicAge

DemographicAge: "age_15" | "age_20" | "age_25" | "age_30" | "age_35" | "age_40" | "age_45" | "age_50"

DemographicArea

DemographicArea: "jp_01" | "jp_02" | "jp_03" | "jp_04" | "jp_05" | "jp_06" | "jp_07" | "jp_08" | "jp_09" | "jp_10" | "jp_11" | "jp_12" | "jp_13" | "jp_14" | "jp_15" | "jp_16" | "jp_17" | "jp_18" | "jp_19" | "jp_20" | "jp_21" | "jp_22" | "jp_23" | "jp_24" | "jp_25" | "jp_26" | "jp_27" | "jp_28" | "jp_29" | "jp_30" | "jp_31" | "jp_32" | "jp_33" | "jp_34" | "jp_35" | "jp_36" | "jp_37" | "jp_38" | "jp_39" | "jp_40" | "jp_41" | "jp_42" | "jp_43" | "jp_44" | "jp_45" | "jp_46" | "jp_47" | "tw_01" | "tw_02" | "tw_03" | "tw_04" | "tw_05" | "tw_06" | "tw_07" | "tw_08" | "tw_09" | "tw_10" | "tw_11" | "tw_12" | "tw_13" | "tw_14" | "tw_15" | "tw_16" | "tw_17" | "tw_18" | "tw_19" | "tw_20" | "tw_21" | "tw_22" | "th_01" | "th_02" | "th_03" | "th_04" | "th_05" | "th_06" | "th_07" | "th_08" | "id_01" | "id_02" | "id_03" | "id_04" | "id_06" | "id_07" | "id_08" | "id_09" | "id_10" | "id_11" | "id_12" | "id_05"

DemographicFilterObject

DemographicObject

DemographicObject: { oneOf: ("male" | "female")[]; type: "gender" } | ({ type: "age" } & ({ gte: DemographicAge } | { lt: DemographicAge })) | { oneOf: ("ios" | "android")[]; type: "appType" } | { oneOf: DemographicArea[]; type: "area" } | ({ type: "subscriptionPeriod" } & ({ gte: DemographicSubscriptionPeriod } | { lt: DemographicSubscriptionPeriod }))

Demographic filter objects

Demographic filter objects represent criteria (e.g. age, gender, OS, region, and friendship duration) on which to filter the list of recipients. You can filter recipients based on a combination of different criteria using logical operator objects.

DemographicSubscriptionPeriod

DemographicSubscriptionPeriod: "day_7" | "day_30" | "day_90" | "day_180" | "day_365"

Emoji

Emoji: { emojiId: string; index: number; productId: string }

Type declaration

  • emojiId: string

    ID for a LINE emoji inside a set. See LINE Available Emoji List: https://d.line-scdn.net/r/devcenter/sendable_line_emoji_list.pdf.

  • index: number

    Index position for a character in text, with the first character being at position 0. The specified position must correspond to a $ character, which serves as a placeholder for the LINE emoji. If you specify a position that doesn't contain a $ character, the API returns HTTP 400 Bad request. See the text message example for details.

  • productId: string

    Product ID for a set of LINE emoji. See LINE Available Emoji List: https://d.line-scdn.net/r/devcenter/sendable_line_emoji_list.pdf.

FilterOperatorObject

FilterOperatorObject<T>: { type: "operator" } & ({ and: T | (T | FilterOperatorObject<T>)[] } | { or: T | (T | FilterOperatorObject<T>)[] } | { not: T | (T | FilterOperatorObject<T>)[] })

Logical operator objects

Use logical AND, OR, and NOT operators to combine multiple recipient objects together.

  • Be sure to specify only one of these three properties (and, or, not). You cannot specify an empty array.

Type parameters

  • T

FlexBlockStyle

FlexBlockStyle: { backgroundColor?: string; separator?: boolean; separatorColor?: string }

Objects for the block style

Type declaration

  • Optional backgroundColor?: string

    Background color of the block. Use a hexadecimal color code.

  • Optional separator?: boolean
    • true to place a separator above the block.
    • true will be ignored for the first block in a container because you cannot place a separator above the first block.
    • The default value is false.
  • Optional separatorColor?: string

    Color of the separator. Use a hexadecimal color code.

FlexBox

FlexBox<L>: { action?: Action; backgroundColor?: string; borderColor?: string; borderWidth?: string | "none" | "light" | "normal" | "medium" | "semi-bold" | "bold"; contents: L extends "baseline" ? (FlexIcon | FlexText | FlexFiller | FlexSpacer)[] : (FlexBox<FlexBoxLayout> | FlexButton | FlexImage | FlexText | FlexSeparator | FlexFiller | FlexSpacer)[]; cornerRadius?: string | "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl"; flex?: number; height?: string; layout: L; margin?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl"; paddingAll?: string; paddingBottom?: string; paddingEnd?: string; paddingStart?: string; paddingTop?: string; spacing?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl"; type: "box"; width?: string } & Offset

This is a component that defines the layout of child components. You can also include a box in a box.

Type parameters

FlexBoxLayout

FlexBoxLayout: "horizontal" | "vertical" | "baseline"

FlexBubble

FlexBubble: { action?: Action; body?: FlexBox<FlexBoxLayout>; direction?: "ltr" | "rtl"; footer?: FlexBox<FlexBoxLayout>; header?: FlexBox<FlexBoxLayout>; hero?: FlexBox<FlexBoxLayout> | FlexImage; size?: "nano" | "micro" | "kilo" | "mega" | "giga"; styles?: FlexBubbleStyle; type: "bubble" }

This is a container that contains one message bubble. It can contain four blocks: header, hero, body, and footer.

The maximum size of JSON data that defines a bubble is 10 KB.

For more information about using each block, see Block.

Type declaration

  • Optional action?: Action

    Action performed when this image is tapped. Specify an action object. This property is supported on the following versions of LINE.

    LINE for iOS and Android: 8.11.0 and later

  • Optional body?: FlexBox<FlexBoxLayout>

    Body block. Specify a Box.

  • Optional direction?: "ltr" | "rtl"

    Text directionality and the order of components in horizontal boxes in the container. Specify one of the following values:

    • ltr: Left to right
    • rtl: Right to left

    The default value is ltr.

  • Optional footer?: FlexBox<FlexBoxLayout>

    Footer block. Specify a Box.

  • Optional header?: FlexBox<FlexBoxLayout>

    Header block. Specify a Box.

  • Optional hero?: FlexBox<FlexBoxLayout> | FlexImage

    Hero block. Specify a box or an image.

  • Optional size?: "nano" | "micro" | "kilo" | "mega" | "giga"

    The size of the bubble. You can specify one of the following values: nano, micro, kilo, mega, or giga. The default value is mega.

  • Optional styles?: FlexBubbleStyle

    Style of each block. Specify a bubble style.

  • type: "bubble"

FlexBubbleStyle

FlexBubbleStyle: { body?: FlexBlockStyle; footer?: FlexBlockStyle; header?: FlexBlockStyle; hero?: FlexBlockStyle }

Type declaration

FlexButton

FlexButton: { action: Action; color?: string; flex?: number; gravity?: string; height?: "sm" | "md"; margin?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl"; style?: "link" | "primary" | "secondary"; type: "button" } & Offset

This component draws a button.

When the user taps a button, a specified action is performed.

FlexCarousel

FlexCarousel: { contents: FlexBubble[]; type: "carousel" }

Carousel

A carousel is a container that contains multiple bubbles as child elements. Users can scroll horizontally through the bubbles.

The maximum size of JSON data that defines a carousel is 50 KB.

【Bubble width】

A carousel cannot contain bubbles of different widths (size property). Each bubble in a carousel should have the same width.

【Bubble height】

The body of each bubble will stretch to match the bubble with the greatest height in the carousel. However, bubbles with no body will not change height.

Type declaration

  • contents: FlexBubble[]

    Bubbles in the carousel.

    • Max: 10 bubbles
  • type: "carousel"

FlexComponent

Components are objects that compose a Flex Message container. Here are the types of components available:

See the followings for the components' JSON data samples and usage.

FlexContainer

FlexContainer: FlexBubble | FlexCarousel

A container is the top-level structure of a Flex Message. Here are the types of containers available.

See Flex Message elements for the containers' JSON data samples and usage.

FlexFiller

FlexFiller: { flex?: number; type: "filler" }

This is an invisible component to fill extra space between components.

  • The filler's flex property is fixed to 1.
  • The spacing property of the parent box will be ignored for fillers.

Type declaration

  • Optional flex?: number

    The ratio of the width or height of this component within the parent box. For more information, see Width and height of components.

  • type: "filler"

FlexIcon

FlexIcon: { aspectRatio?: string; margin?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl"; size?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "3xl" | "4xl" | "5xl"; type: "icon"; url: string } & Offset

This component draws an icon.

FlexImage

FlexImage: { action?: Action; align?: "start" | "end" | "center"; aspectMode?: "cover" | "fit"; aspectRatio?: string; backgroundColor?: string; flex?: number; gravity?: "top" | "bottom" | "center"; margin?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl"; size?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "3xl" | "4xl" | "5xl" | "full"; type: "image"; url: string } & Offset

This component draws an image.

FlexMessage

FlexMessage: { altText: string; contents: FlexContainer; type: "flex" }

Flex Message

Flex Messages are messages with a customizable layout. You can customize the layout freely based on the specification for CSS Flexible Box (CSS Flexbox). For more information, see Sending Flex Messages in the API documentation.

Type declaration

  • altText: string

    Alternative text

    • Max character limit: 400
  • contents: FlexContainer

    Flex Message container

  • type: "flex"

FlexSeparator

FlexSeparator: { color?: string; margin?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl"; type: "separator" }

This component draws a separator between components in the parent box.

Type declaration

  • Optional color?: string

    Color of the separator. Use a hexadecimal color code.

  • Optional margin?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl"

    Minimum space between this box and the previous component in the parent box.

    • none does not set a space while the other values set a space whose size increases in the order of listing.
    • The default value is the value of the spacing property of the parent box.
    • If this box is the first component in the parent box, the margin property will be ignored.
  • type: "separator"

FlexSpacer

FlexSpacer: { size?: "xs" | "sm" | "md" | "lg" | "xl" | "xxl"; type: "spacer" }

This is an invisible component that places a fixed-size space at the beginning or end of the box.

Type declaration

  • Optional size?: "xs" | "sm" | "md" | "lg" | "xl" | "xxl"

    Size of the space. The size increases in the order of listing. The default value is md.

  • type: "spacer"

FlexSpan

FlexSpan: { color?: string; decoration?: string; size?: string; style?: string; text: string; type: "span"; weight?: string }

This component renders multiple text strings with different designs in one row. You can specify the color, size, weight, and decoration for the font. Span is set to contents property in Text.

Type declaration

  • Optional color?: string

    Font color. Use a hexadecimal color code.

  • Optional decoration?: string

    Decoration of the text. Specify one of the following values: none: No decoration underline: Underline line-through: Strikethrough

    The default value is none.

    Note: The decoration set in the decoration property of the text cannot be overwritten by the decoration property of the span.

  • Optional size?: string

    Font size. You can specify one of the following values: xxs, xs, sm, md, lg, xl, xxl, 3xl, 4xl, or 5xl. The size increases in the order of listing. The default value is md.

  • Optional style?: string

    Style of the text. Specify one of the following values:

    • normal: Normal
    • italic: Italic

    The default value is normal.

  • text: string

    Text. If the wrap property of the parent text is set to true, you can use a new line character (\n) to begin on a new line.

  • type: "span"
  • Optional weight?: string

    Font weight. You can specify one of the following values: regular or bold. Specifying bold makes the font bold. The default value is regular.

FlexText

FlexText: { action?: Action; align?: "start" | "end" | "center"; color?: string; contents?: FlexSpan[]; decoration?: string; flex?: number; gravity?: "top" | "bottom" | "center"; margin?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl"; maxLines?: number; size?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "3xl" | "4xl" | "5xl"; style?: string; text: string; type: "text"; weight?: "regular" | "bold"; wrap?: boolean } & Offset

FriendDemographics

FriendDemographics: { ages?: ({ age: string } & PercentageAble)[]; appTypes?: ({ appType: "ios" | "android" | "others" } & PercentageAble)[]; areas?: ({ area: string } & PercentageAble)[]; available: boolean; genders?: ({ gender: "unknown" | "male" | "female" } & PercentageAble)[]; subscriptionPeriods?: ({ subscriptionPeriod: "over365days" | "within365days" | "within180days" | "within90days" | "within30days" | "within7days" | "unknown" } & PercentageAble)[] }

Type declaration

  • Optional ages?: ({ age: string } & PercentageAble)[]

    Percentage per age group

  • Optional appTypes?: ({ appType: "ios" | "android" | "others" } & PercentageAble)[]

    Percentage by OS

  • Optional areas?: ({ area: string } & PercentageAble)[]

    Percentage per area

  • available: boolean

    true if friend demographic information is available.

  • Optional genders?: ({ gender: "unknown" | "male" | "female" } & PercentageAble)[]

    Percentage per gender

  • Optional subscriptionPeriods?: ({ subscriptionPeriod: "over365days" | "within365days" | "within180days" | "within90days" | "within30days" | "within7days" | "unknown" } & PercentageAble)[]

    Percentage per friendship duration

GetAudienceGroupsOptions

GetAudienceGroupsOptions: { createRoute?: string; description?: string; includesExternalPublicGroups?: boolean; page?: number; size?: number; status?: "IN_PROGRESS" | "READY" | "FAILED" | "EXPIRED" }

Type declaration

  • Optional createRoute?: string

    How the audience was created. If omitted, all audiences are included.

  • Optional description?: string

    The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical.

  • Optional includesExternalPublicGroups?: boolean
    • true: Get public audiences created in all channels linked to the same bot.
    • false: Get audiences created in the same channel.
  • Optional page?: number

    The page to return when getting (paginated) results. Must be 1 or higher.

  • Optional size?: number

    The number of audiences per page. Default: 20

    • Max: 40
  • Optional status?: "IN_PROGRESS" | "READY" | "FAILED" | "EXPIRED"

    The status of the audience(s) to return. One of:

    • IN_PROGRESS: Pending. It may take several hours for the status to change to READY.
    • READY: Ready to accept messages.
    • FAILED: An error occurred while creating the audience.
    • EXPIRED: Expired. Audiences are automatically deleted a month after they expire.

Group

Group: { groupId: string; groupName: string; pictureUrl: string }

Group Summary

Type declaration

  • groupId: string

    Group ID

  • groupName: string

    Group Name

  • pictureUrl: string

    Group icon URL

ImageCarouselColumnObject

ImageCarouselColumnObject: { action: Action; imageUrl: string }

Type declaration

  • action: Action

    Action when image is tapped

  • imageUrl: string

    Image URL

    • Max character limit: 1,000
    • HTTPS over TLS 1.2 or later
    • JPEG or PNG
    • Aspect ratio: 1:1
    • Max width: 1024px
    • Max file size: 1 MB

ImageCarouselTemplate

ImageCarouselTemplate: { columns: ImageCarouselColumnObject[]; type: "image_carousel" }

Image carousel template

Template with multiple images which can be cycled like a carousel. The images are shown in order when scrolling horizontally.

Type declaration

ImageMapArea

ImageMapArea: { height: number; width: number; x: number; y: number }

Defines the size of a tappable area. The top left is used as the origin of the area. Set these properties based on the baseSize.width property and the baseSize.height property.

Type declaration

  • height: number

    Height of the tappable area

  • width: number

    Width of the tappable area

  • x: number

    Horizontal position relative to the left edge of the area. Value must be 0 or higher.

  • y: number

    Vertical position relative to the top of the area. Value must be 0 or higher.

ImageMapMessageAction

ImageMapMessageAction: { area: ImageMapArea; label?: string; text: string; type: "message" }

Type declaration

  • area: ImageMapArea

    Defined tappable area

  • Optional label?: string

    Label for the action. Spoken when the accessibility feature is enabled on the client device.

    • Max character limit: 50
    • Supported on LINE 8.2.0 and later for iOS.
  • text: string

    Message to send

    • Max character limit: 400
    • Supported on LINE for iOS and Android only.
  • type: "message"

ImageMapUriAction

ImageMapUriAction: { area: ImageMapArea; label?: string; linkUri: string; type: "uri" }

Type declaration

  • area: ImageMapArea

    Defined tappable area

  • Optional label?: string

    Label for the action. Spoken when the accessibility feature is enabled on the client device.

    • Max character limit: 50
    • Supported on LINE 8.2.0 and later for iOS.
  • linkUri: string
    • Webpage URL
    • Max character limit: 1000

    The available schemes are http, https, line, and tel. For more information about the LINE URL scheme, see Using the LINE URL scheme.

  • type: "uri"

ImageMapVideo

ImageMapVideo: { area: { height: number; width: number; x: number; y: number }; externalLink: { label: string; linkUri: string }; originalContentUrl: string; previewImageUrl: string }

Type declaration

  • area: { height: number; width: number; x: number; y: number }
    • height: number

      Height of the video area

    • width: number

      Width of the video area

    • x: number

      Horizontal position of the video area relative to the left edge of the imagemap area. Value must be 0 or higher.

    • y: number

      Vertical position of the video area relative to the top of the imagemap area. Value must be 0 or higher.

  • externalLink: { label: string; linkUri: string }
    • label: string

      Label. Displayed after the video is finished. Max character limit: 30

    • linkUri: string

      Webpage URL. Called when the label displayed after the video is tapped. Max character limit: 1000 The available schemes are http, https, line, and tel. For more information about the LINE URL scheme, see Using the LINE URL scheme.

  • originalContentUrl: string

    URL of the video file

    • Max character limit: 1000
    • HTTPS over TLS 1.2 or later
    • mp4
    • Max: 1 minute
    • Max: 10 MB

    Note: A very wide or tall video may be cropped when played in some environments.

  • previewImageUrl: string

    URL of the preview image

    • Max character limit: 1000
    • HTTPS over TLS 1.2 or later
    • JPEG
    • Max: 240 x 240 pixels
    • Max: 1 MB

ImageMessage

ImageMessage: { originalContentUrl: string; previewImageUrl: string; type: "image" }

Type declaration

  • originalContentUrl: string

    Image URL (Max character limit: 1000)

    • HTTPS over TLS 1.2 or later
    • JPEG
    • Max: 4096 x 4096
    • Max: 1 MB
  • previewImageUrl: string

    Preview image URL (Max character limit: 1000)

    • HTTPS over TLS 1.2 or later
    • JPEG
    • Max: 240 x 240
    • Max: 1 MB
  • type: "image"

ImagemapMessage

ImagemapMessage: { actions: (ImageMapUriAction | ImageMapMessageAction)[]; altText: string; baseSize: { height: number; width: number }; baseUrl: string; type: "imagemap"; video?: ImageMapVideo }

Imagemap message

Imagemap messages are messages configured with an image that has multiple tappable areas. You can assign one tappable area for the entire image or different tappable areas on divided areas of the image.

You can also play a video on the image and display a label with a hyperlink after the video is finished.

Official document - imagemap message

Type declaration

  • actions: (ImageMapUriAction | ImageMapMessageAction)[]

    Imagemap action objects

    Object which specifies the actions and tappable areas of an imagemap.

    When an area is tapped, the user is redirected to the URI specified in uri and the message specified in message is sent.

    • Action when tapped
    • Max: 50
  • altText: string

    Alternative text

    • Max character limit: 400
  • baseSize: { height: number; width: number }
    • height: number

      Height of base image. Set to the height that corresponds to a width of 1040 pixels.

    • width: number

      Width of base image in pixels. Set to 1040.

  • baseUrl: string

    Base URL of the image

    • Max character limit: 1000
    • HTTPS over TLS 1.2 or later
    • For more information about supported images in imagemap messages, see How to configure an image.
  • type: "imagemap"
  • Optional video?: ImageMapVideo

ImpAudienceGroup

ImpAudienceGroup: BasicAudienceGroup & { requestId: string; type: "IMP" }

InsightStatisticsResponse

InsightStatisticsResponse: { status: "ready" | "unready" | "out_of_service" }

Type declaration

  • status: "ready" | "unready" | "out_of_service"

    Calculation status. One of:

    • ready: Calculation has finished; the numbers are up-to-date.
    • unready: We haven't finished calculating the number of sent messages for the specified date. Calculation usually takes about a day. Please try again later.
    • out_of_service: The specified date is earlier than the date on which we first started calculating sent messages. Different APIs have different date. Check them at the document.

Job

Job: { audienceCount: number; audienceGroupId: number; audienceGroupJobId: number; created: number; description: string; type: "DIFF_ADD" } & ({ jobStatus: "QUEUED" | "WORKING" | "FINISHED" } | { failedType: "INTERNAL_ERROR"; jobStatus: "FAILED" })

LiffApp

LiffApp: { description: string; features: LiffFeatures; liffId: string; view: LiffView }

Type declaration

  • description: string

    Name of the LIFF app

  • features: LiffFeatures
  • liffId: string

    LIFF app ID

  • view: LiffView

LiffFeatures

LiffFeatures: { ble: boolean }

Type declaration

  • ble: boolean

    true if the LIFF app supports Bluetooth® Low Energy for LINE Things. false otherwise.

LiffView

LiffView: { type: "compact" | "tall" | "full"; url: string }

Type declaration

  • type: "compact" | "tall" | "full"

    Size of the LIFF app view. Specify one of the following values:

    • compact: 50% of device screen height.
    • tall: 80% of device screen height.
    • full: 100% of device screen height.
  • url: string

    URL of the server on which the LIFF app is deployed (endpoint URL). The URL scheme must be https. Specify only the domain in this URL, without paths or query parameters.

LineNotifyConfig

LineNotifyConfig: { apiOrigin?: string; clientId: string; clientSecret: string; origin?: string; redirectUri: string }

LINE Notify Config

Type declaration

  • Optional apiOrigin?: string

    LINE Notify Notification URL origin

  • clientId: string

    LINE Notify Service Client ID

  • clientSecret: string

    LINE Notify Service Client Secret

  • Optional origin?: string

    LINE Notify Authentication URL origin

  • redirectUri: string

    LINE Notify Service Callback URL

LineNotifyOptions

LineNotifyOptions: { imageFullsize?: string; imageThumbnail?: string; notificationDisabled?: boolean; stickerId?: number; stickerPackageId?: number }

Type declaration

  • Optional imageFullsize?: string

    Maximum size of 2048×2048px JPEG

  • Optional imageThumbnail?: string

    Maximum size of 240×240px JPEG

  • Optional notificationDisabled?: boolean
    • true: The user doesn't receive a push notification when the message is sent.
    • false: The user receives a push notification when the message is sent (unless they have disabled push notification in LINE and/or their device).

    If omitted, the value defaults to false.

  • Optional stickerId?: number
    Sticker ID.
    
  • Optional stickerPackageId?: number

    Package ID.

LinePayConfig

LinePayConfig: { channelId: string; channelSecret: string; origin?: string; sandbox?: boolean }

Type declaration

  • channelId: string
  • channelSecret: string
  • Optional origin?: string
  • Optional sandbox?: boolean

LinePayCurrency

LinePayCurrency: "USD" | "JPY" | "TWD" | "THB"

Location

Location: { address: string; latitude: number; longitude: number; title: string }

Type declaration

  • address: string

    Address

    • Max character limit: 100
  • latitude: number

    Latitude

  • longitude: number

    Longitude

  • title: string

    Title

    • Max character limit: 100

LocationAction

LocationAction: { label: string; type: "location" }

This action can be configured only with quick reply buttons. When a button associated with this action is tapped, the location screen in LINE is opened.

Type declaration

  • label: string

    Label for the action

    • Max character limit: 20
  • type: "location"

LocationMessage

LocationMessage: { address: string; latitude: number; longitude: number; title: string; type: "location" }

Type declaration

  • address: string

    Address

    • Max character limit: 100
  • latitude: number

    Latitude

  • longitude: number

    Longitude

  • title: string

    Title

    • Max character limit: 100
  • type: "location"

Message

Message objects

JSON object which contains the contents of the message you send.

MessageAction

MessageAction: { label?: string; text: string; type: "message" }

When a control associated with this action is tapped, the string in the text property is sent as a message from the user.

Type declaration

  • Optional label?: string

    Label for the action

    • Required for templates other than image carousel. Max character limit: 20
    • Optional for image carousel templates. Max character limit: 12
    • Optional for rich menus. Spoken when the accessibility feature is enabled on the client device. Max character limit: 20. Supported on LINE 8.2.0 and later for iOS.
    • Required for quick reply buttons. Max character limit: 20. Supported on LINE 8.11.0 and later for iOS and Android.
    • Required for the button of Flex Message. This property can be specified for the box, image, and text but its value is not displayed. Max charater limit: 20
  • text: string

    Text sent when the action is performed

    • Max character limit: 300
  • type: "message"

MessageOptions

MessageOptions: { quickReply?: QuickReply; sender?: Sender }

Common properties for messages

The following properties can be specified in all the message objects.

  • Quick reply
  • sender

Type declaration

  • Optional quickReply?: QuickReply

    These properties are used for the quick reply feature. Supported on LINE 8.11.0 and later for iOS and Android. For more information, see Using quick replies.

  • Optional sender?: Sender

MutationSuccessResponse

MutationSuccessResponse: Record<string, never>

NarrowcastOptions

NarrowcastOptions: { demographic?: DemographicFilterObject; max?: number; recipient?: RecipientObject }

Type declaration

  • Optional demographic?: DemographicFilterObject

    Demographic filter object. You can use friends' attributes to filter the list of recipients.

    If this is omitted, messages are sent to everyone—including users with attribute values of "unknown".

  • Optional max?: number

    The maximum number of narrowcast messages to send. Use this parameter to limit the number of narrowcast messages sent. The recipients will be chosen at random.

  • Optional recipient?: RecipientObject

    Recipient object. You can specify recipients of the message using up to 10 audiences.

    If this is omitted, messages will be sent to all users who have added your LINE Official Account as a friend.

NarrowcastProgressResponse

NarrowcastProgressResponse: ({ phase: "waiting" } | (({ phase: "sending" | "succeeded" } | { failedDescription: string; phase: "failed" }) & { failureCount: number; successCount: number; targetCount: string })) & { errorCode?: 1 | 2 }

NumberOfFollowers

NumberOfFollowers: InsightStatisticsResponse & { blocks: number; followers: number; targetedReaches: number }

NumberOfFollowersResponse

NumberOfFollowersResponse: InsightStatisticsResponse | NumberOfFollowers

NumberOfMessageDeliveries

NumberOfMessageDeliveries: InsightStatisticsResponse & { apiBroadcast: number; apiMulticast: number; apiPush: number; apiReply: number; autoResponse: number; broadcast: number; chat: number; targeting: number; welcomeResponse: number }

NumberOfMessageDeliveriesResponse

NumberOfMessageDeliveriesResponse: InsightStatisticsResponse | NumberOfMessageDeliveries

NumberOfMessagesSentResponse

NumberOfMessagesSentResponse: InsightStatisticsResponse & { success?: number }

NumberOfMessagesSentThisMonth

NumberOfMessagesSentThisMonth: { totalUsage: number }

Type declaration

  • totalUsage: number

    The number of sent messages in the current month

Offset

Offset: { offsetBottom?: string; offsetEnd?: string; offsetStart?: string; offsetTop?: string; position?: "relative" | "absolute" }

Type declaration

  • Optional offsetBottom?: string

    The bottom offset. For more information, see Offset in the API documentation.

  • Optional offsetEnd?: string

    The right offset. For more information, see Offset in the API documentation.

  • Optional offsetStart?: string

    The left offset. For more information, see Offset in the API documentation.

  • Optional offsetTop?: string

    The top offset. For more information, see Offset in the API documentation.

  • Optional position?: "relative" | "absolute"

    Reference position for placing this box. Specify one of the following values:

    • relative: Use the previous box as reference.
    • absolute: Use the top left of parent element as reference.

    The default value is relative. For more information, see Offset in the API documentation.

PartialLiffApp

PartialLiffApp: { description?: string; features?: Partial<LiffFeatures>; liffId?: string; view?: Partial<LiffView> }

Type declaration

  • Optional description?: string

    Name of the LIFF app

  • Optional features?: Partial<LiffFeatures>
  • Optional liffId?: string

    LIFF app ID

  • Optional view?: Partial<LiffView>

PostbackAction

PostbackAction: { data: string; displayText?: string; label?: string; text?: string; type: "postback" }

When a control associated with this action is tapped, a postback event is returned via webhook with the specified string in the data property.

Type declaration

  • data: string

    String returned via webhook in the postback.data property of the postback event

    • Max character limit: 300
  • Optional displayText?: string

    Text displayed in the chat as a message sent by the user when the action is performed. Required for quick reply buttons. Optional for the other message types.

    • Max character limit: 300
    • The displayText and text properties cannot both be used at the same time.
  • Optional label?: string

    Label for the action

    • Required for templates other than image carousel. Max character limit: 20
    • Optional for image carousel templates. Max character limit: 12
    • Optional for rich menus. Spoken when the accessibility feature is enabled on the client device. Max character limit: 20. Supported on LINE 8.2.0 and later for iOS.
    • Required for quick reply buttons. Max character limit: 20. Supported on LINE 8.11.0 and later for iOS and Android.
    • Required for the button of Flex Message. This property can be specified for the box, image, and text but its value is not displayed. Max character limit: 20
  • Optional text?: string

    【Deprecated】 Text displayed in the chat as a message sent by the user when the action is performed. Returned from the server through a webhook. This property shouldn't be used with quick reply buttons.

    • Max character limit: 300
    • The displayText and text properties cannot both be used at the same time.
  • type: "postback"

QuickReply

QuickReply: { items: { action: QuickReplyAction; imageUrl?: string; type: "action" }[] }

This is a container that contains quick reply buttons.

If a version of LINE that doesn't support the quick reply feature receives a message that contains quick reply buttons, only the message is displayed.

Type declaration

  • items: { action: QuickReplyAction; imageUrl?: string; type: "action" }[]

    This is a quick reply option that is displayed as a button.

    • Max: 13 objects

QuickReplyAction

RecipientObject

Recipient objects

Recipient objects represent audiences. You can specify recipients based on a combination of criteria using logical operator objects. You can specify up to 10 recipient objects per request.

RichMenu

RichMenu: { areas: Area[]; chatBarText: string; name: string; selected: boolean; size: { height: 1686 | 843 | 810 | 405 | 270; width: 2500 | 1200 | 800 } }

Type declaration

  • areas: Area[]

    Array of area objects which define the coordinates and size of tappable areas

    • Max: 20 area objects
  • chatBarText: string

    Text displayed in the chat bar

    • Max character limit: 14
  • name: string

    Name of the rich menu. This value can be used to help manage your rich menus and is not displayed to users.

    • Max character limit: 300
  • selected: boolean

    true to display the rich menu by default. Otherwise, false.

  • size: { height: 1686 | 843 | 810 | 405 | 270; width: 2500 | 1200 | 800 }

    size object which contains the width and height of the rich menu displayed in the chat. Rich menu images must be one of the following sizes (pixels): 2500x1686, 2500x843, 1200x810, 1200x405, 800x540, 800x270

    • height: 1686 | 843 | 810 | 405 | 270
    • width: 2500 | 1200 | 800

Sender

Sender: { iconUrl?: string; name?: string }

When sending a message from the LINE Official Account, you can specify the sender.name and the sender.iconUrl properties in Message objects.

Type declaration

  • Optional iconUrl?: string

    URL of the image to display as an icon when sending a message

    • Max character limit: 1000
    • URL scheme: https
  • Optional name?: string

    Display name. Certain words such as LINE may not be used.

    • Max character limit: 20

StickerMessage

StickerMessage: { packageId: string; stickerId: string; type: "sticker" }

Type declaration

  • packageId: string

    Package ID for a set of stickers. For information on package IDs, see the Sticker list.

  • stickerId: string

    Sticker ID. For a list of sticker IDs for stickers that can be sent with the Messaging API, see the Sticker list.

  • type: "sticker"

TargetLimitForAdditionalMessages

TargetLimitForAdditionalMessages: { type: "none" | "limited"; value?: number }

Type declaration

  • type: "none" | "limited"

    One of the following values to indicate whether a target limit is set or not.

    • none: This indicates that a target limit is not set.
    • limited: This indicates that a target limit is set.
  • Optional value?: number

    The target limit for additional messages in the current month. This property is returned when the type property has a value of limited.

Template

TemplateMessage

TemplateMessage<Template>: { altText: string; template: Template; type: "template" }

Template messages are messages with predefined layouts which you can customize. For more information, see Template messages.

The following template types are available:

  • Buttons
  • Confirm
  • Carousel
  • Image carousel

Type parameters

  • Template

Type declaration

  • altText: string

    Alternative text

    • Max character limit: 400
  • template: Template

    A Buttons, Confirm, Carousel, or Image Carousel object.

  • type: "template"

TestWebhookEndpointResponse

TestWebhookEndpointResponse: { detail: string; reason: string; statusCode: number; success: boolean; timestamp: string }

Response body of test webhook endpoint.

see

Test webhook endpoint

Type declaration

  • detail: string

    Details of the response.

  • reason: string

    Reason for the response.

  • statusCode: number

    The HTTP status code. If the webhook response isn't received, the status code is set to zero or a negative number.

  • success: boolean

    Result of the communication from the LINE platform to the webhook URL.

    • true: Success
    • false: Failure
  • timestamp: string

    Time of the event in milliseconds

TextMessage

TextMessage: { emojis?: Emoji[]; text: string; type: "text" }

Type declaration

  • Optional emojis?: Emoji[]

    One or more LINE emoji. Max: 20 LINE emoji

  • text: string

    Message text. You can include the following emoji:

    Unicode emoji LINE emoji (Use a $ character as a placeholder and specify details in the emojis property) (Deprecated) LINE original emoji (Unicode code point table for LINE original emoji)

    Max character limit: 5000

  • type: "text"

URIAction

URIAction: { label?: string; type: "uri"; uri: string }

When a control associated with this action is tapped, the URI specified in the uri property is opened.

Type declaration

  • Optional label?: string

    Label for the action

    • Required for templates other than image carousel. Max character limit: 20
    • Optional for image carousel templates. Max character limit: 12
    • Optional for rich menus. Spoken when the accessibility feature is enabled on the client device. Max character limit: 20. Supported on LINE 8.2.0 and later for iOS.
    • Required for the button of Flex Message. This property can be specified for the box, image, and text but its value is not displayed. Max character limit: 20
  • type: "uri"
  • uri: string

    URI opened when the action is performed (Max character limit: 1000)

    The available schemes are http, https, line, and tel. For more information about the LINE URL scheme, see Using the LINE URL scheme.

UpdateUploadAudienceGroupOptions

UpdateUploadAudienceGroupOptions: CreateUploadAudienceGroupOptions & { description?: string }

UploadAudienceGroup

UploadAudienceGroup: BasicAudienceGroup & { type: "UPLOAD" }

User

User: { displayName: string; language?: string; pictureUrl: string; statusMessage: string; userId: string }

User Profile

Type declaration

  • displayName: string

    User's display name

  • Optional language?: string
  • pictureUrl: string

    Profile image URL. "https" image URL. Not included in the response if the user doesn't have a profile image.

  • statusMessage: string

    User's status message. Not included in the response if the user doesn't have a status message.

  • userId: string

    User ID

VideoMessage

VideoMessage: { originalContentUrl: string; previewImageUrl: string; type: "video" }

Type declaration

  • originalContentUrl: string

    URL of video file

    • Max character limit: 1000
    • HTTPS over TLS 1.2 or later
    • mp4
    • Max: 1 minute
    • Max: 10 MB

    A very wide or tall video may be cropped when played in some environments.

  • previewImageUrl: string

    URL of preview image

    • Max character limit: 1000
    • HTTPS over TLS 1.2 or later
    • JPEG
    • Max: 240 x 240
    • Max: 1 MB
  • type: "video"

WebhookEndpointInfoResponse

WebhookEndpointInfoResponse: { active: boolean; endpoint: string }

Response body of get webhook endpoint info.

see

Get get webhook endpoint info

Type declaration

  • active: boolean

    Webhook usage status. Send a webhook event from the LINE platform to the webhook URL only if enabled.

    • true: Webhook usage is enabled.
    • false: Webhook usage is disabled.
  • endpoint: string

    Webhook URL

Generated using TypeDoc