{
   "security" : [
      {
         "api_key" : []
      }
   ],
   "paths" : {
      "/users/{username}/icons/{picid}" : {
         "parameters" : [
            {
               "in" : "path",
               "schema" : {
                  "pattern" : "^[0-9A-Za-z_]+$",
                  "example" : "example",
                  "minLength" : 3,
                  "type" : "string",
                  "maxLength" : 25
               },
               "name" : "username",
               "description" : "The username you want icon information for",
               "required" : true
            },
            {
               "required" : true,
               "in" : "path",
               "schema" : {
                  "type" : "integer"
               },
               "description" : "The picid you want information for.",
               "name" : "picid"
            }
         ],
         "get" : {
            "responses" : {
               "400" : {
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "properties" : {
                              "error" : {
                                 "description" : "A description of the error encountered.",
                                 "example" : "Bad format for username. Errors: String is too long: 77/25.",
                                 "type" : "string"
                              },
                              "success" : {
                                 "type" : "number"
                              }
                           },
                           "type" : "object"
                        }
                     }
                  },
                  "description" : "Bad or missing request parameters."
               },
               "404" : {
                  "description" : "No such username or icon."
               },
               "200" : {
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "required" : [
                              "comment",
                              "picid",
                              "username",
                              "url",
                              "keywords"
                           ],
                           "type" : "object",
                           "properties" : {
                              "url" : {
                                 "type" : "string"
                              },
                              "picid" : {
                                 "type" : "integer"
                              },
                              "username" : {
                                 "type" : "string",
                                 "description" : "The name of the journal this icon belongs to."
                              },
                              "comment" : {
                                 "type" : "string"
                              },
                              "keywords" : {
                                 "type" : "array",
                                 "items" : {
                                    "type" : "string"
                                 }
                              }
                           }
                        }
                     }
                  },
                  "description" : "An icon with its information"
               }
            },
            "description" : "Returns a single icon for a specified picid and username"
         }
      },
      "/journals/{username}/tags" : {
         "delete" : {
            "parameters" : [
               {
                  "description" : "A tag to remove from the journal.",
                  "name" : "tag",
                  "schema" : {
                     "type" : "string"
                  },
                  "in" : "query"
               }
            ],
            "description" : "Delete tags for a given journal",
            "responses" : {
               "404" : {
                  "description" : "Username specified does not exist.",
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "properties" : {
                              "success" : {
                                 "type" : "number"
                              },
                              "error" : {
                                 "description" : "A description of the error encountered.",
                                 "example" : "Bad format for username. Errors: String is too long: 77/25.",
                                 "type" : "string"
                              }
                           },
                           "type" : "object"
                        }
                     }
                  }
               },
               "403" : {
                  "description" : "You cannot remove tags on that journal."
               },
               "204" : {
                  "description" : "The tags were successfully deleted."
               },
               "400" : {
                  "description" : "Bad or missing request parameters.",
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "properties" : {
                              "success" : {
                                 "type" : "number"
                              },
                              "error" : {
                                 "description" : "A description of the error encountered.",
                                 "example" : "Bad format for username. Errors: String is too long: 77/25.",
                                 "type" : "string"
                              }
                           },
                           "type" : "object"
                        }
                     }
                  }
               }
            }
         },
         "post" : {
            "responses" : {
               "403" : {
                  "description" : "You cannot create tags on that journal."
               },
               "204" : {
                  "description" : "Tags were successfully created."
               },
               "404" : {
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "properties" : {
                              "success" : {
                                 "type" : "number"
                              },
                              "error" : {
                                 "description" : "A description of the error encountered.",
                                 "example" : "Bad format for username. Errors: String is too long: 77/25.",
                                 "type" : "string"
                              }
                           },
                           "type" : "object"
                        }
                     }
                  },
                  "description" : "Username specified does not exist."
               }
            },
            "requestBody" : {
               "content" : {
                  "application/json" : {
                     "schema" : {
                        "type" : "array",
                        "description" : "An array of tags to add to the journal.",
                        "items" : {
                           "type" : "string"
                        }
                     }
                  }
               }
            },
            "description" : "Add new tags for a given journal"
         },
         "get" : {
            "description" : "Returns a list of tags for the given journal",
            "responses" : {
               "200" : {
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "type" : "array",
                           "items" : {
                              "type" : "object",
                              "properties" : {
                                 "url" : {
                                    "description" : "A link to the journal filtered by this tag",
                                    "type" : "string"
                                 },
                                 "name" : {
                                    "description" : "The tag name",
                                    "type" : "string"
                                 },
                                 "visibility" : {
                                    "type" : "string"
                                 },
                                 "use_count" : {
                                    "type" : "integer",
                                    "description" : "The total number of times the tag has been used on the journal."
                                 },
                                 "security_counts" : {
                                    "type" : "object",
                                    "properties" : {
                                       "private" : {
                                          "type" : "integer",
                                          "description" : "The number of times the tag has been used on private entries"
                                       },
                                       "group" : {
                                          "type" : "integer",
                                          "description" : "The number of times the tag has been used on entries filtered to an accesslist"
                                       },
                                       "protected" : {
                                          "description" : "The number of times the tag has been used on access-locked",
                                          "type" : "integer"
                                       },
                                       "public" : {
                                          "description" : "The number of times the tag has been used on public entries",
                                          "type" : "integer"
                                       }
                                    }
                                 }
                              }
                           }
                        }
                     }
                  },
                  "description" : "A list of tags and the number of times they've been used."
               },
               "404" : {
                  "description" : "Username specified does not exist.",
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "properties" : {
                              "success" : {
                                 "type" : "number"
                              },
                              "error" : {
                                 "description" : "A description of the error encountered.",
                                 "example" : "Bad format for username. Errors: String is too long: 77/25.",
                                 "type" : "string"
                              }
                           },
                           "type" : "object"
                        }
                     }
                  }
               }
            }
         },
         "parameters" : [
            {
               "name" : "username",
               "description" : "The journal you want tag information for",
               "schema" : {
                  "minLength" : 3,
                  "maxLength" : 25,
                  "type" : "string",
                  "pattern" : "^[0-9A-Za-z_]+$",
                  "example" : "example"
               },
               "in" : "path",
               "required" : true
            }
         ]
      },
      "/users/{username}/icons" : {
         "parameters" : [
            {
               "schema" : {
                  "maxLength" : 25,
                  "type" : "string",
                  "minLength" : 3,
                  "example" : "example",
                  "pattern" : "^[0-9A-Za-z_]+$"
               },
               "in" : "path",
               "name" : "username",
               "description" : "The username you want icon information for",
               "required" : true
            }
         ],
         "get" : {
            "description" : "Returns all icons for a specified username.",
            "responses" : {
               "200" : {
                  "description" : "a list of icons",
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "items" : {
                              "properties" : {
                                 "picid" : {
                                    "type" : "integer"
                                 },
                                 "url" : {
                                    "type" : "string"
                                 },
                                 "username" : {
                                    "type" : "string",
                                    "description" : "The name of the journal this icon belongs to."
                                 },
                                 "keywords" : {
                                    "type" : "array",
                                    "items" : {
                                       "type" : "string"
                                    }
                                 },
                                 "comment" : {
                                    "type" : "string"
                                 }
                              },
                              "required" : [
                                 "comment",
                                 "picid",
                                 "username",
                                 "url",
                                 "keywords"
                              ],
                              "type" : "object"
                           },
                           "type" : "array"
                        }
                     }
                  }
               },
               "404" : {
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "properties" : {
                              "success" : {
                                 "type" : "number"
                              },
                              "error" : {
                                 "type" : "string",
                                 "example" : "Bad format for username. Errors: String is too long: 77/25.",
                                 "description" : "A description of the error encountered."
                              }
                           },
                           "type" : "object"
                        }
                     }
                  },
                  "description" : "Username specified does not exist."
               }
            }
         }
      },
      "/comments/screening" : {
         "get" : {
            "description" : "Returns descriptions of all possible comment screening options.",
            "responses" : {
               "200" : {
                  "description" : "A list of comment screening options and their descriptions."
               }
            }
         }
      },
      "/journals/{username}/accesslists/{accesslistid}" : {
         "parameters" : [
            {
               "schema" : {
                  "pattern" : "^[0-9A-Za-z_]+$",
                  "example" : "example",
                  "minLength" : 3,
                  "maxLength" : 25,
                  "type" : "string"
               },
               "in" : "path",
               "name" : "username",
               "description" : "The username you want accesslist information for",
               "required" : true
            },
            {
               "description" : "The id of the accesslist you want information for.",
               "name" : "accesslistid",
               "in" : "path",
               "schema" : {
                  "type" : "integer"
               },
               "required" : true
            }
         ],
         "get" : {
            "responses" : {
               "404" : {
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "type" : "object",
                           "properties" : {
                              "success" : {
                                 "type" : "number"
                              },
                              "error" : {
                                 "description" : "A description of the error encountered.",
                                 "example" : "Bad format for username. Errors: String is too long: 77/25.",
                                 "type" : "string"
                              }
                           }
                        }
                     }
                  },
                  "description" : "Username specified does not exist."
               },
               "200" : {
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "items" : {
                              "pattern" : "^[0-9A-Za-z_]+$",
                              "example" : "example",
                              "minLength" : 3,
                              "maxLength" : 25,
                              "type" : "string"
                           },
                           "type" : "array"
                        }
                     }
                  },
                  "description" : "A list of journals on this accesslist."
               },
               "400" : {
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "type" : "object",
                           "properties" : {
                              "success" : {
                                 "type" : "number"
                              },
                              "error" : {
                                 "description" : "A description of the error encountered.",
                                 "example" : "Bad format for username. Errors: String is too long: 77/25.",
                                 "type" : "string"
                              }
                           }
                        }
                     }
                  },
                  "description" : "Bad or missing request parameters."
               },
               "403" : {
                  "description" : "You cannot view accesslists on that journal."
               }
            },
            "description" : "Returns a list journals on a given access list."
         },
         "post" : {
            "description" : "Add users to a given accesslist",
            "responses" : {
               "400" : {
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "type" : "object",
                           "properties" : {
                              "success" : {
                                 "type" : "number"
                              },
                              "error" : {
                                 "description" : "A description of the error encountered.",
                                 "example" : "Bad format for username. Errors: String is too long: 77/25.",
                                 "type" : "string"
                              }
                           }
                        }
                     }
                  },
                  "description" : "Bad or missing request parameters."
               },
               "403" : {
                  "description" : "You cannot update accesslists on that journal."
               },
               "200" : {
                  "description" : "The newly updated accesslist."
               },
               "404" : {
                  "description" : "Username specified does not exist.",
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "type" : "object",
                           "properties" : {
                              "success" : {
                                 "type" : "number"
                              },
                              "error" : {
                                 "description" : "A description of the error encountered.",
                                 "example" : "Bad format for username. Errors: String is too long: 77/25.",
                                 "type" : "string"
                              }
                           }
                        }
                     }
                  }
               }
            },
            "requestBody" : {
               "content" : {
                  "application/json" : {
                     "schema" : {
                        "type" : "array",
                        "items" : {
                           "pattern" : "^[0-9A-Za-z_]+$",
                           "example" : "example",
                           "minLength" : 3,
                           "maxLength" : 25,
                           "type" : "string"
                        }
                     }
                  }
               },
               "required" : true
            }
         }
      },
      "/journals/{username}/accesslists" : {
         "get" : {
            "description" : "Returns a list of entry accesslists for the journal",
            "responses" : {
               "200" : {
                  "description" : "A list of accesslists."
               },
               "404" : {
                  "description" : "Username specified does not exist.",
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "properties" : {
                              "success" : {
                                 "type" : "number"
                              },
                              "error" : {
                                 "example" : "Bad format for username. Errors: String is too long: 77/25.",
                                 "description" : "A description of the error encountered.",
                                 "type" : "string"
                              }
                           },
                           "type" : "object"
                        }
                     }
                  }
               },
               "403" : {
                  "description" : "You cannot view accesslists on that journal."
               }
            }
         },
         "parameters" : [
            {
               "required" : true,
               "description" : "The username you want accesslist information for",
               "name" : "username",
               "schema" : {
                  "example" : "example",
                  "pattern" : "^[0-9A-Za-z_]+$",
                  "maxLength" : 25,
                  "type" : "string",
                  "minLength" : 3
               },
               "in" : "path"
            }
         ],
         "post" : {
            "description" : "Create a new entry accesslist for the journal",
            "responses" : {
               "400" : {
                  "description" : "Bad or missing request parameters.",
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "properties" : {
                              "success" : {
                                 "type" : "number"
                              },
                              "error" : {
                                 "example" : "Bad format for username. Errors: String is too long: 77/25.",
                                 "description" : "A description of the error encountered.",
                                 "type" : "string"
                              }
                           },
                           "type" : "object"
                        }
                     }
                  }
               },
               "403" : {
                  "description" : "You cannot create accesslists on that journal."
               },
               "404" : {
                  "description" : "Username specified does not exist.",
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "properties" : {
                              "success" : {
                                 "type" : "number"
                              },
                              "error" : {
                                 "example" : "Bad format for username. Errors: String is too long: 77/25.",
                                 "description" : "A description of the error encountered.",
                                 "type" : "string"
                              }
                           },
                           "type" : "object"
                        }
                     }
                  }
               },
               "200" : {
                  "description" : "The id of the newly created accesslist."
               }
            },
            "requestBody" : {
               "content" : {
                  "application/json" : {
                     "schema" : {
                        "properties" : {
                           "sortorder" : {
                              "description" : "Sort order for the new accesslist, 0 to 255.",
                              "maximum" : 255,
                              "minimum" : 0,
                              "type" : "integer"
                           },
                           "name" : {
                              "type" : "string",
                              "minLength" : 1,
                              "description" : "The name of the new accesslist."
                           }
                        },
                        "required" : [
                           "name"
                        ],
                        "type" : "object"
                     }
                  }
               }
            }
         },
         "delete" : {
            "responses" : {
               "404" : {
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "properties" : {
                              "success" : {
                                 "type" : "number"
                              },
                              "error" : {
                                 "example" : "Bad format for username. Errors: String is too long: 77/25.",
                                 "description" : "A description of the error encountered.",
                                 "type" : "string"
                              }
                           },
                           "type" : "object"
                        }
                     }
                  },
                  "description" : "Username specified does not exist."
               },
               "204" : {
                  "description" : "Successfully deleted accesslist."
               },
               "400" : {
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "properties" : {
                              "success" : {
                                 "type" : "number"
                              },
                              "error" : {
                                 "example" : "Bad format for username. Errors: String is too long: 77/25.",
                                 "description" : "A description of the error encountered.",
                                 "type" : "string"
                              }
                           },
                           "type" : "object"
                        }
                     }
                  },
                  "description" : "Bad or missing request parameters."
               },
               "403" : {
                  "description" : "You can't remove that accesslist."
               }
            },
            "description" : "Permanently delete an access group, removing it from all entries.",
            "parameters" : [
               {
                  "schema" : {
                     "type" : "integer"
                  },
                  "in" : "query",
                  "name" : "id",
                  "description" : "ID of accesslist to delete.",
                  "required" : true
               }
            ]
         }
      },
      "/spec" : {
         "parameters" : [],
         "get" : {
            "responses" : {
               "200" : {
                  "description" : "This API specification!"
               }
            },
            "parameters" : [],
            "description" : "Returns the API specification"
         }
      },
      "/journals/{username}/xpostaccounts" : {
         "get" : {
            "responses" : {
               "403" : {
                  "description" : "Not allowed to view crosspost accounts for that user."
               },
               "200" : {
                  "description" : "A list of accounts."
               },
               "404" : {
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "properties" : {
                              "success" : {
                                 "type" : "number"
                              },
                              "error" : {
                                 "type" : "string",
                                 "example" : "Bad format for username. Errors: String is too long: 77/25.",
                                 "description" : "A description of the error encountered."
                              }
                           },
                           "type" : "object"
                        }
                     }
                  },
                  "description" : "Username specified does not exist."
               }
            },
            "description" : "Returns a list of crosspost identities for the given journal"
         },
         "parameters" : [
            {
               "in" : "path",
               "schema" : {
                  "minLength" : 3,
                  "maxLength" : 25,
                  "type" : "string",
                  "pattern" : "^[0-9A-Za-z_]+$",
                  "example" : "example"
               },
               "name" : "username",
               "description" : "The journal you want entry information for",
               "required" : true
            }
         ]
      }
   },
   "openapi" : "3.0.0",
   "components" : {
      "securitySchemes" : {
         "api_key" : {
            "bearerFormat" : "Bearer <api_key>",
            "scheme" : "bearer",
            "type" : "http"
         }
      }
   },
   "info" : {
      "version" : "1",
      "description" : "An OpenAPI-compatible API for Dreamwidth Studios",
      "title" : "Dreamwidth Studios API"
   },
   "servers" : [
      {
         "url" : "https://www.dreamwidth.org/api/v1"
      }
   ]
}
