Skip to content

Instantly share code, notes, and snippets.

@renatorib
Last active October 13, 2023 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save renatorib/1fb1a9bd71435b41bee602d15bc56899 to your computer and use it in GitHub Desktop.
Save renatorib/1fb1a9bd71435b41bee602d15bc56899 to your computer and use it in GitHub Desktop.
Slack Block Kit Json Schema

Slack Block Kit Json Schema

Open schema raw file

Schema extracted from https://a.slack-edge.com/bv1-6-8cacda2/block-kit-builder.93ca53691de7cf9d4417.min.js
Probably the url/bundle will change every deploy so you might want to go https://api.slack.com/tools/block-kit-builder, open devtools and search for that file (block-kit-builder) in source tab. Pass some unminify tool and search for "JSON Schema".

PS1: Some block/element types simply does not work, idk why.
PS2: If you want to explore easily, copy the code and paste to the devtools console.


json schema by @lawrencegripper

@AditiNavale
Copy link

I also facing an issue that I added the block kit builder code in json file and tried to display the card but empty card is getting displayed.

@lawrencegripper
Copy link

Anyone landing here, the currently linked version is truncated but the first uploaded revision is complete:

https://gist.githubusercontent.com/renatorib/1fb1a9bd71435b41bee602d15bc56899/raw/f3a759f1d948a27a648f1739f3f6436440f01e95/schema.js

@lawrencegripper
Copy link

Playing with this more it looks like it's no longer up-to-date

@lawrencegripper
Copy link

TLDR: With some manual effort and the typescript type information I generated the schema. Here it is for others to use.. Note: It validates an array of blocks for input.

 [
    {
	    "type": "header",
	    "text": {
		    "type": "plain_text",
		    "text": "Pipeline Deployment of Heaven Started 🧵 👇",
		    "emoji": true
	    }
		}
]

Full details here: slackapi/slack-api-specs#18 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment