JokeAPI · Schema
JokeSubmission
Submission payload for `POST /submit`.
JokesHumorEntertainmentOpen SourceREST APIGames And ComicsPublic APIs
Properties
| Name | Type | Description |
|---|---|---|
| formatVersion | integer | Submission format version. Currently `3`. |
| category | string | Target category for the joke. |
| type | string | Joke shape. |
| joke | string | Joke text (required when `type` is `single`). |
| setup | string | Setup line (required when `type` is `twopart`). |
| delivery | string | Punchline (required when `type` is `twopart`). |
| flags | object | Content classification flags carried on every joke. |
| lang | string | ISO 639-1 language code of the joke. |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/api-evangelist/jokeapi/refs/heads/main/json-schema/jokeapi-joke-submission-schema.json",
"title": "JokeSubmission",
"description": "Submission payload for `POST /submit`.",
"type": "object",
"properties": {
"formatVersion": {
"type": "integer",
"description": "Submission format version. Currently `3`.",
"example": 3
},
"category": {
"type": "string",
"description": "Target category for the joke.",
"enum": [
"Misc",
"Programming",
"Dark",
"Pun",
"Spooky",
"Christmas"
],
"example": "Programming"
},
"type": {
"type": "string",
"description": "Joke shape.",
"enum": [
"single",
"twopart"
],
"example": "twopart"
},
"joke": {
"type": "string",
"description": "Joke text (required when `type` is `single`).",
"example": "Why do programmers prefer dark mode? Because light attracts bugs."
},
"setup": {
"type": "string",
"description": "Setup line (required when `type` is `twopart`).",
"example": "Why don't programmers like nature?"
},
"delivery": {
"type": "string",
"description": "Punchline (required when `type` is `twopart`).",
"example": "It has too many bugs."
},
"flags": {
"type": "object",
"description": "Content classification flags carried on every joke.",
"properties": {
"nsfw": {
"type": "boolean",
"description": "Joke contains adult or explicit sexual content.",
"example": false
},
"religious": {
"type": "boolean",
"description": "Joke references or mocks religion.",
"example": false
},
"political": {
"type": "boolean",
"description": "Joke references politics or political figures.",
"example": false
},
"racist": {
"type": "boolean",
"description": "Joke contains racist content.",
"example": false
},
"sexist": {
"type": "boolean",
"description": "Joke contains sexist content.",
"example": false
},
"explicit": {
"type": "boolean",
"description": "Joke contains explicit language unrelated to NSFW.",
"example": false
}
},
"required": [
"nsfw",
"religious",
"political",
"racist",
"sexist",
"explicit"
]
},
"lang": {
"type": "string",
"description": "ISO 639-1 language code of the joke.",
"example": "en"
}
},
"required": [
"formatVersion",
"category",
"type",
"flags",
"lang"
]
}