{
  "openapi": "3.1.0",
  "info": {
    "title": "Hybrid-ID Developer Application API",
    "version": "1.0.0",
    "description": "Owner-delegated application registration and management. Distinct from OIDC login, API signing keys and Hybrid-Chain V2. Provision/revoke a 30-day developer credential in the signed-in Hybrid-ID Developer applications area. No anonymous registration. See the integration guide for scopes, limitations, callbacks and non-idempotent mutation handling."
  },
  "servers": [
    {
      "url": "https://hybrid-id.com"
    }
  ],
  "externalDocs": {
    "url": "https://hybrid-id.com/developers/integration"
  },
  "security": [
    {
      "DeveloperBearer": []
    }
  ],
  "components": {
    "securitySchemes": {
      "DeveloperBearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "hid_dev_ credential. permissions: applications:read, applications:write, credentials:rotate. Never an OIDC user access token or client secret."
      }
    }
  },
  "paths": {
    "/api/developer/v1/applications": {
      "get": {
        "operationId": "listDeveloperApplications",
        "summary": "List owned apps and usage",
        "description": "Requires applications:read. Does not reveal stored client secrets.",
        "responses": {
          "200": {
            "description": "Successful owner-scoped operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "List: applications array, each with usage. Create/rotate: app metadata and one-time client_secret. Update/disable: app metadata without secret. Never log create/rotate responses."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid, expired or revoked developer credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Application not found or not owned",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Disabled application or quota reached",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Body too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "JSON required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "manageDeveloperApplication",
        "summary": "Create, update, rotate or disable an owned application",
        "description": "Requires applications:write for create/update/disable, credentials:rotate for rotate, applications:read for list. All callback URLs must use one fixed public HTTPS origin without query, fragment or wildcards. No profile storage or billing API. Writes are not idempotent.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "create",
                      "update",
                      "rotate",
                      "disable",
                      "list"
                    ]
                  },
                  "client_id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "redirect_uris": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 5,
                    "items": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "post_logout_redirect_uris": {
                    "type": "array",
                    "maxItems": 5,
                    "items": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                },
                "required": [
                  "action"
                ],
                "oneOf": [
                  {
                    "properties": {
                      "action": {
                        "const": "create"
                      }
                    },
                    "required": [
                      "name",
                      "redirect_uris"
                    ]
                  },
                  {
                    "properties": {
                      "action": {
                        "const": "update"
                      }
                    },
                    "required": [
                      "client_id",
                      "name",
                      "redirect_uris"
                    ]
                  },
                  {
                    "properties": {
                      "action": {
                        "const": "rotate"
                      }
                    },
                    "required": [
                      "client_id"
                    ]
                  },
                  {
                    "properties": {
                      "action": {
                        "const": "disable"
                      }
                    },
                    "required": [
                      "client_id"
                    ]
                  },
                  {
                    "properties": {
                      "action": {
                        "const": "list"
                      }
                    },
                    "required": []
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful owner-scoped operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "List: applications array, each with usage. Create/rotate: app metadata and one-time client_secret. Update/disable: app metadata without secret. Never log create/rotate responses."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid, expired or revoked developer credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Application not found or not owned",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Disabled application or quota reached",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Body too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "JSON required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
