Skip to content

Hashtags and JSON-LD

The examples here are various variations of creating the Hashtag element in the tag list. These variations can be useful in understanding how strict an application sees JSON-LD.

Hashtags are a good illustration of JSON-LD parsing as Hashtag is not part of the ActivityStreams vocabulary.

All examples except the first are questionable, and probably should not be used when publishing to the Fediverse. The examples marked with ⚠️ are expected to fail with a JSON-LD parser. The examples using as:Hashtag are expected to fail with a JSON only parser.

Examples

Example 1

activity
{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    {
      "Hashtag": "as:Hashtag",
      "sensitive": "as:sensitive"
    }
  ],
  "type": "Create",
  "actor": "http://pasture-one-actor/actor",
  "to": [
    "http://mitra/users/admin",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/activity/V6nHYGWyHwk",
  "published": "2025-09-03T19:05:50Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://mitra/users/admin"
    ],
    "id": "http://pasture-one-actor/object/Un1HvZVl7WA",
    "published": "2025-09-03T19:05:50Z",
    "content": "text",
    "tag": {
      "type": "Hashtag",
      "name": "#test"
    }
  }
}
mitra
{
  "id": "019910f8-99de-0107-d453-f83521066bfd",
  "uri": "http://pasture-one-actor/object/Un1HvZVl7WA",
  "url": "http://pasture-one-actor/object/Un1HvZVl7WA",
  "created_at": "2025-09-03T19:05:50.000Z",
  "edited_at": null,
  "account": {
    "id": "019910f8-4b22-bdbf-44f0-554e4e40522f",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "actor_id": "http://pasture-one-actor/actor",
    "url": "http://pasture-one-actor/actor",
    "display_name": "Test Actor",
    "created_at": "2025-09-03T19:05:31.682Z",
    "note": "",
    "avatar": "http://mitra/api/v1/accounts/identicon?input=http://pasture-one-actor/actor",
    "header": "http://mitra/api/v1/accounts/identicon",
    "locked": false,
    "mention_policy": "none",
    "bot": false,
    "identity_proofs": [],
    "payment_options": [],
    "fields": [],
    "emojis": [],
    "followers_count": 0,
    "following_count": 0,
    "subscribers_count": 0,
    "statuses_count": 14,
    "source": null,
    "role": null,
    "authentication_methods": null,
    "client_config": null
  },
  "content": "text",
  "language": null,
  "in_reply_to_id": null,
  "in_reply_to_account_id": null,
  "reblog": null,
  "visibility": "public",
  "sensitive": false,
  "spoiler_text": "",
  "pinned": false,
  "replies_count": 0,
  "favourites_count": 0,
  "reblogs_count": 0,
  "poll": null,
  "media_attachments": [],
  "quote": null,
  "mentions": [
    {
      "id": "019910f7-1105-bb78-1dbb-d1b8d7b4498a",
      "username": "admin",
      "acct": "admin",
      "url": "http://mitra/users/admin"
    }
  ],
  "tags": [
    {
      "name": "test",
      "url": "http://mitra/collections/tags/test"
    }
  ],
  "emojis": [],
  "favourited": false,
  "reblogged": false,
  "bookmarked": false,
  "pleroma": {
    "emoji_reactions": [],
    "in_reply_to_account_acct": null,
    "parent_visible": true,
    "quote": null,
    "quote_visible": true
  },
  "hidden": false,
  "ipfs_cid": null,
  "links": []
}

Example 2

activity
{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    {
      "Hashtag": "as:Hashtag",
      "sensitive": "as:sensitive"
    }
  ],
  "type": "Create",
  "actor": "http://pasture-one-actor/actor",
  "to": [
    "http://mitra/users/admin",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/activity/_arbj79P_iA",
  "published": "2025-09-03T19:05:51Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://mitra/users/admin"
    ],
    "id": "http://pasture-one-actor/object/4ZZB8kvyhWM",
    "published": "2025-09-03T19:05:51Z",
    "content": "using as:Hashtag",
    "tag": {
      "type": "as:Hashtag",
      "name": "#test"
    }
  }
}
mitra
{
  "id": "019910f8-9fbb-edea-565c-217ad1bd2b66",
  "uri": "http://pasture-one-actor/object/4ZZB8kvyhWM",
  "url": "http://pasture-one-actor/object/4ZZB8kvyhWM",
  "created_at": "2025-09-03T19:05:51.000Z",
  "edited_at": null,
  "account": {
    "id": "019910f8-4b22-bdbf-44f0-554e4e40522f",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "actor_id": "http://pasture-one-actor/actor",
    "url": "http://pasture-one-actor/actor",
    "display_name": "Test Actor",
    "created_at": "2025-09-03T19:05:31.682Z",
    "note": "",
    "avatar": "http://mitra/api/v1/accounts/identicon?input=http://pasture-one-actor/actor",
    "header": "http://mitra/api/v1/accounts/identicon",
    "locked": false,
    "mention_policy": "none",
    "bot": false,
    "identity_proofs": [],
    "payment_options": [],
    "fields": [],
    "emojis": [],
    "followers_count": 0,
    "following_count": 0,
    "subscribers_count": 0,
    "statuses_count": 15,
    "source": null,
    "role": null,
    "authentication_methods": null,
    "client_config": null
  },
  "content": "using as:Hashtag",
  "language": null,
  "in_reply_to_id": null,
  "in_reply_to_account_id": null,
  "reblog": null,
  "visibility": "public",
  "sensitive": false,
  "spoiler_text": "",
  "pinned": false,
  "replies_count": 0,
  "favourites_count": 0,
  "reblogs_count": 0,
  "poll": null,
  "media_attachments": [],
  "quote": null,
  "mentions": [
    {
      "id": "019910f7-1105-bb78-1dbb-d1b8d7b4498a",
      "username": "admin",
      "acct": "admin",
      "url": "http://mitra/users/admin"
    }
  ],
  "tags": [],
  "emojis": [],
  "favourited": false,
  "reblogged": false,
  "bookmarked": false,
  "pleroma": {
    "emoji_reactions": [],
    "in_reply_to_account_acct": null,
    "parent_visible": true,
    "quote": null,
    "quote_visible": true
  },
  "hidden": false,
  "ipfs_cid": null,
  "links": []
}

Example 3

activity
{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    {
      "Hashtag": "as:Hashtag",
      "sensitive": "as:sensitive"
    }
  ],
  "type": "Create",
  "actor": "http://pasture-one-actor/actor",
  "to": [
    "http://mitra/users/admin",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/activity/Wqpazl9INSg",
  "published": "2025-09-03T19:05:53Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://mitra/users/admin"
    ],
    "id": "http://pasture-one-actor/object/ZWmgLsoiDHs",
    "published": "2025-09-03T19:05:53Z",
    "content": "no type \u26a0\ufe0f ",
    "tag": {
      "name": "#test"
    }
  }
}
mitra
{
  "id": "019910f8-a59d-a07e-d8ed-3b8c4e90d3bc",
  "uri": "http://pasture-one-actor/object/ZWmgLsoiDHs",
  "url": "http://pasture-one-actor/object/ZWmgLsoiDHs",
  "created_at": "2025-09-03T19:05:53.000Z",
  "edited_at": null,
  "account": {
    "id": "019910f8-4b22-bdbf-44f0-554e4e40522f",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "actor_id": "http://pasture-one-actor/actor",
    "url": "http://pasture-one-actor/actor",
    "display_name": "Test Actor",
    "created_at": "2025-09-03T19:05:31.682Z",
    "note": "",
    "avatar": "http://mitra/api/v1/accounts/identicon?input=http://pasture-one-actor/actor",
    "header": "http://mitra/api/v1/accounts/identicon",
    "locked": false,
    "mention_policy": "none",
    "bot": false,
    "identity_proofs": [],
    "payment_options": [],
    "fields": [],
    "emojis": [],
    "followers_count": 0,
    "following_count": 0,
    "subscribers_count": 0,
    "statuses_count": 16,
    "source": null,
    "role": null,
    "authentication_methods": null,
    "client_config": null
  },
  "content": "no type \u26a0\ufe0f ",
  "language": null,
  "in_reply_to_id": null,
  "in_reply_to_account_id": null,
  "reblog": null,
  "visibility": "public",
  "sensitive": false,
  "spoiler_text": "",
  "pinned": false,
  "replies_count": 0,
  "favourites_count": 0,
  "reblogs_count": 0,
  "poll": null,
  "media_attachments": [],
  "quote": null,
  "mentions": [
    {
      "id": "019910f7-1105-bb78-1dbb-d1b8d7b4498a",
      "username": "admin",
      "acct": "admin",
      "url": "http://mitra/users/admin"
    }
  ],
  "tags": [
    {
      "name": "test",
      "url": "http://mitra/collections/tags/test"
    }
  ],
  "emojis": [],
  "favourited": false,
  "reblogged": false,
  "bookmarked": false,
  "pleroma": {
    "emoji_reactions": [],
    "in_reply_to_account_acct": null,
    "parent_visible": true,
    "quote": null,
    "quote_visible": true
  },
  "hidden": false,
  "ipfs_cid": null,
  "links": []
}

Example 4

activity
{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Create",
  "actor": "http://pasture-one-actor/actor",
  "to": [
    "http://mitra/users/admin",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/activity/euWIhrHLVDU",
  "published": "2025-09-03T19:05:55Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://mitra/users/admin"
    ],
    "id": "http://pasture-one-actor/object/q-TPEk_Y7Ww",
    "published": "2025-09-03T19:05:55Z",
    "@context": "https://www.w3.org/ns/activitystreams",
    "content": "Hashtag not in @context \u26a0\ufe0f ",
    "tag": {
      "type": "Hashtag",
      "name": "#test"
    }
  }
}
mitra
{
  "id": "019910f8-ab78-287d-9dae-a7f7f17a480c",
  "uri": "http://pasture-one-actor/object/q-TPEk_Y7Ww",
  "url": "http://pasture-one-actor/object/q-TPEk_Y7Ww",
  "created_at": "2025-09-03T19:05:55.000Z",
  "edited_at": null,
  "account": {
    "id": "019910f8-4b22-bdbf-44f0-554e4e40522f",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "actor_id": "http://pasture-one-actor/actor",
    "url": "http://pasture-one-actor/actor",
    "display_name": "Test Actor",
    "created_at": "2025-09-03T19:05:31.682Z",
    "note": "",
    "avatar": "http://mitra/api/v1/accounts/identicon?input=http://pasture-one-actor/actor",
    "header": "http://mitra/api/v1/accounts/identicon",
    "locked": false,
    "mention_policy": "none",
    "bot": false,
    "identity_proofs": [],
    "payment_options": [],
    "fields": [],
    "emojis": [],
    "followers_count": 0,
    "following_count": 0,
    "subscribers_count": 0,
    "statuses_count": 17,
    "source": null,
    "role": null,
    "authentication_methods": null,
    "client_config": null
  },
  "content": "Hashtag not in @context \u26a0\ufe0f ",
  "language": null,
  "in_reply_to_id": null,
  "in_reply_to_account_id": null,
  "reblog": null,
  "visibility": "public",
  "sensitive": false,
  "spoiler_text": "",
  "pinned": false,
  "replies_count": 0,
  "favourites_count": 0,
  "reblogs_count": 0,
  "poll": null,
  "media_attachments": [],
  "quote": null,
  "mentions": [
    {
      "id": "019910f7-1105-bb78-1dbb-d1b8d7b4498a",
      "username": "admin",
      "acct": "admin",
      "url": "http://mitra/users/admin"
    }
  ],
  "tags": [
    {
      "name": "test",
      "url": "http://mitra/collections/tags/test"
    }
  ],
  "emojis": [],
  "favourited": false,
  "reblogged": false,
  "bookmarked": false,
  "pleroma": {
    "emoji_reactions": [],
    "in_reply_to_account_acct": null,
    "parent_visible": true,
    "quote": null,
    "quote_visible": true
  },
  "hidden": false,
  "ipfs_cid": null,
  "links": []
}

Example 5

activity
{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Create",
  "actor": "http://pasture-one-actor/actor",
  "to": [
    "http://mitra/users/admin",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/activity/T-FuDYNPgIs",
  "published": "2025-09-03T19:05:56Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://mitra/users/admin"
    ],
    "id": "http://pasture-one-actor/object/ohlUyeUpvog",
    "published": "2025-09-03T19:05:56Z",
    "@context": "https://www.w3.org/ns/activitystreams",
    "content": "Hashtag not in @context; as:Hashtag",
    "tag": {
      "type": "as:Hashtag",
      "name": "#test"
    }
  }
}
mitra
{
  "id": "019910f8-b144-9d06-ba90-dc68079dcf87",
  "uri": "http://pasture-one-actor/object/ohlUyeUpvog",
  "url": "http://pasture-one-actor/object/ohlUyeUpvog",
  "created_at": "2025-09-03T19:05:56.000Z",
  "edited_at": null,
  "account": {
    "id": "019910f8-4b22-bdbf-44f0-554e4e40522f",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "actor_id": "http://pasture-one-actor/actor",
    "url": "http://pasture-one-actor/actor",
    "display_name": "Test Actor",
    "created_at": "2025-09-03T19:05:31.682Z",
    "note": "",
    "avatar": "http://mitra/api/v1/accounts/identicon?input=http://pasture-one-actor/actor",
    "header": "http://mitra/api/v1/accounts/identicon",
    "locked": false,
    "mention_policy": "none",
    "bot": false,
    "identity_proofs": [],
    "payment_options": [],
    "fields": [],
    "emojis": [],
    "followers_count": 0,
    "following_count": 0,
    "subscribers_count": 0,
    "statuses_count": 18,
    "source": null,
    "role": null,
    "authentication_methods": null,
    "client_config": null
  },
  "content": "Hashtag not in @context; as:Hashtag",
  "language": null,
  "in_reply_to_id": null,
  "in_reply_to_account_id": null,
  "reblog": null,
  "visibility": "public",
  "sensitive": false,
  "spoiler_text": "",
  "pinned": false,
  "replies_count": 0,
  "favourites_count": 0,
  "reblogs_count": 0,
  "poll": null,
  "media_attachments": [],
  "quote": null,
  "mentions": [
    {
      "id": "019910f7-1105-bb78-1dbb-d1b8d7b4498a",
      "username": "admin",
      "acct": "admin",
      "url": "http://mitra/users/admin"
    }
  ],
  "tags": [],
  "emojis": [],
  "favourited": false,
  "reblogged": false,
  "bookmarked": false,
  "pleroma": {
    "emoji_reactions": [],
    "in_reply_to_account_acct": null,
    "parent_visible": true,
    "quote": null,
    "quote_visible": true
  },
  "hidden": false,
  "ipfs_cid": null,
  "links": []
}