Skip to main content

Citation element

This is a rich text element, compatible only with the rich_text block. It must be used within the rich_text_list, rich_text_quote, or rich_text_section block element within the rich_text block's elements array.

Fields

FieldTypeDescriptionRequired?
typeStringThe type of object; in this case, "citation".Required
urlStringThe URL of the cited source.Required
textStringThe display text for the citation.Required
indexNumberThe index of the citation.Required
detailsObjectDetails about the cited source. This can be a file, external, web, message, or memory object. See below for the schemas of each.Required
from_llmBooleanIndicates whether the citation was generated by the LLM itself.Optional
is_slack_urlBooleanIndicates whether the citation is a Slack URL.Optional

The following schemas are the options for the details object.

The file object:

{
"citation_type":
{
"type" : "string",
"enum": "file"
},
"descriptor":
{
"type": "string"
},
"file_id":
{
"type": "string"
}
}

The external object:

{
"citation_type":
{
"type": "string",
"enum": "external"
},
"app_name":
{
"type": "string"
},
"app_icon_url":
{
"type": "string"
}
}

The web object:

{
"citation_type":
{
"type": "string",
"enum": "web"
},
"display_name":
{
"type": "string"
},
"title":
{
"type": "string"
},
"snippet":
{
"type": "string"
}
}

The message object:

{
"citation_type":
{
"type": "string",
"enum": "message"
},
"channel":
{
"type": "string"
},
"message_ts":
{
"type": "string"
}
}

The memory object:

{
"citation_type":
{
"type": "string",
"enum": "memory"
},
"memory_id":
{
"type": "string"
}
}

Example

{
"blocks": [
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "citation",
"url": "https://example.com/source",
"text": "Source title",
"index": 1,
"details": {
"citation_type": "file",
"descriptor": "Team canvas",
"file_id": "F0ABCDEFG12"
}
}
]
}
]
}
]
}

View in Block Kit Builder