{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/orbit/main/json-schema/orbit-custom-or-post-activity-schema.json",
  "title": "custom_or_post_activity",
  "x-generated": "2026-10-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/orbit-activities-api-openapi.yml#/components/schemas/custom_or_post_activity",
  "oneOf": [
    {
      "$ref": "#/$defs/activity"
    },
    {
      "$ref": "#/$defs/post_activity"
    }
  ],
  "$defs": {
    "activity": {
      "title": "Custom Activity",
      "type": "object",
      "properties": {
        "description": {
          "type": "string",
          "description": "A description of the activity; displayed in the timeline"
        },
        "link": {
          "type": "string",
          "description": "A URL for the activity; displayed in the timeline"
        },
        "link_text": {
          "type": "string",
          "description": "The text for the timeline link"
        },
        "title": {
          "type": "string",
          "description": "A title for the activity; displayed in the timeline"
        },
        "weight": {
          "type": "string",
          "description": "A custom weight to be used in filters and reports; defaults to 1."
        },
        "activity_type": {
          "type": "string",
          "description": "The type of activity - what action was done by the member. This is a legacy field, use activity_type_key instead."
        },
        "activity_type_key": {
          "type": "string",
          "description": "The key for a custom activity type for the workspace. Will create a new activity type if it does not exist."
        },
        "key": {
          "type": "string",
          "description": "Supply a key that must be unique or leave blank to have one generated."
        },
        "occurred_at": {
          "type": "string",
          "description": "The date and time the activity occurred; defaults to now"
        },
        "properties": {
          "type": "object",
          "description": "Key-value pairs to provide contextual metadata about an activity."
        }
      },
      "required": [
        "title"
      ]
    },
    "post_activity": {
      "title": "Content Activity",
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "description": "The url representing the post"
        },
        "occurred_at": {
          "type": "string",
          "description": "The date and time at which the content was published; defaults to now"
        },
        "activity_type": {
          "type": "string",
          "enum": [
            "content"
          ]
        }
      },
      "required": [
        "url",
        "activity_type"
      ]
    }
  }
}