{
  "$id": "https://intentschema.org/intents/communication/chat/channel/get/v1.json",
  "fqdn": "org.intentschema.communication.chat.channel.get.v1",
  "title": "Get chat channel",
  "description": "Fetch metadata for a single channel by id, including topic and membership.",
  "payload": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "required": [
      "target"
    ],
    "properties": {
      "target": {
        "allOf": [
          {
            "$ref": "https://intentschema.org/common/target/v1.json"
          },
          {
            "required": [
              "external_id"
            ]
          }
        ]
      }
    }
  },
  "result": {
    "type": "object",
    "required": [
      "external_id"
    ],
    "properties": {
      "external_id": {
        "type": "string"
      },
      "object": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "topic": {
            "type": "string"
          },
          "purpose": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "channel",
              "dm",
              "group_dm"
            ]
          },
          "private": {
            "type": "boolean"
          },
          "archived": {
            "type": "boolean"
          },
          "member_count": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    }
  },
  "examples": [
    {
      "name": "get a channel",
      "value": {
        "target": {
          "system": "slack",
          "external_id": "C0123456"
        }
      }
    }
  ]
}
