{
  "openapi": "3.1.0",
  "info": {
    "title": "Demofy API (partial)",
    "version": "1",
    "description": "A partial index of the REST API behind the composer: create a demo, list demos, read one, cancel one and list voices. It does not describe the sign-in answer, the event stream, the session handoff or the connection endpoints, and it leaves the optional body fields, the limits and the error names to the documentation at https://demofy.io/docs/api."
  },
  "externalDocs": {
    "description": "Demofy API documentation",
    "url": "https://demofy.io/docs/api"
  },
  "servers": [
    {
      "url": "https://app.demofy.io"
    }
  ],
  "security": [
    {
      "bearerKey": []
    },
    {
      "apiKeyHeader": []
    }
  ],
  "paths": {
    "/api/jobs": {
      "get": {
        "operationId": "listJobs",
        "summary": "List the videos in your active workspace",
        "description": "Newest first, one page at a time. The body carries `next`, the opaque cursor of the following page: pass it back as `after`, unchanged, until it is null. A bad `after` or `limit` is a 400.",
        "security": [
          {
            "bearerKey": []
          },
          {
            "apiKeyHeader": []
          },
          {}
        ],
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "The `next` of the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Videos per page, 1 to 100. Default 50.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The workspace’s jobs, the same set the library page shows.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "The API key is not valid (unknown, revoked, expired and disabled are one answer).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key’s workspace has been left, or the key was sent to a path a key may not reach.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The key’s rate limit is spent; carries Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createJob",
        "summary": "Create a demo, or replay a complete demoscript",
        "description": "A demo create takes url and prompt. A body with kind \"scripted\" takes a complete demoscript instead and calls no model. An unknown key on a demo create is dropped rather than refused. See the docs for the rest.",
        "security": [
          {
            "bearerKey": []
          },
          {
            "apiKeyHeader": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "title": "Demo create",
                    "type": "object",
                    "required": [
                      "url",
                      "prompt"
                    ],
                    "properties": {
                      "url": {
                        "type": "string",
                        "description": "The page to record."
                      },
                      "prompt": {
                        "type": "string",
                        "description": "The intent line: what to show."
                      }
                    },
                    "additionalProperties": true
                  },
                  {
                    "title": "Scripted job",
                    "type": "object",
                    "required": [
                      "kind",
                      "demoscript"
                    ],
                    "properties": {
                      "kind": {
                        "const": "scripted"
                      },
                      "demoscript": {
                        "type": "object",
                        "description": "A complete demoscript with at least two steps."
                      },
                      "title": {
                        "type": "string",
                        "description": "The library title; optional."
                      }
                    },
                    "additionalProperties": true
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: the job id, its status and its job-page path.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The body is not JSON, or a field fails validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The API key is not valid (unknown, revoked, expired and disabled are one answer).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "A paid lever on a workspace that has not paid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key’s workspace has been left, or the key was sent to a path a key may not reach.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A well-formed body that one of the rules refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The key’s rate limit is spent; carries Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/jobs/{id}": {
      "get": {
        "operationId": "getJob",
        "summary": "Read a job’s state and, once finished, signed URLs for its files",
        "security": [
          {
            "bearerKey": []
          },
          {
            "apiKeyHeader": []
          },
          {}
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The job id. An id you cannot see, unknown or somebody else’s, is a 404 either way."
          }
        ],
        "responses": {
          "200": {
            "description": "The job. Every URL in the body expires.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "The API key is not valid (unknown, revoked, expired and disabled are one answer).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key’s workspace has been left, or the key was sent to a path a key may not reach.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or not yours.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The key’s rate limit is spent; carries Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/jobs/{id}/cancel": {
      "post": {
        "operationId": "cancelJob",
        "summary": "Stop a job that has not finished",
        "security": [
          {
            "bearerKey": []
          },
          {
            "apiKeyHeader": []
          },
          {}
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The job id. An id you cannot see, unknown or somebody else’s, is a 404 either way."
          }
        ],
        "responses": {
          "200": {
            "description": "The job stopped.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "The API key is not valid (unknown, revoked, expired and disabled are one answer).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key’s workspace has been left, or the key was sent to a path a key may not reach.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or not yours.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The job already finished.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The key’s rate limit is spent; carries Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/voices": {
      "get": {
        "operationId": "listVoices",
        "summary": "List the voices a demo can narrate with",
        "description": "A signed-out caller is refused. An unreachable voice service answers 503 with voices set to null.",
        "responses": {
          "200": {
            "description": "Voices, each with an id that voiceProfileId takes.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "The API key is not valid (unknown, revoked, expired and disabled are one answer).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key’s workspace has been left, or the key was sent to a path a key may not reach.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The key’s rate limit is spent; carries Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The voice service could not be reached; voices is null, which is not an empty list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key from Settings, API keys."
      },
      "apiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "A machine-readable name or a sentence you can show."
          }
        }
      }
    }
  }
}