{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/passtru/json-schema/passtru-passtru-app-create-response-schema.json",
  "title": "PasstruAppCreateResponse",
  "x-generated": "2026-12-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/passtru-openapi.yml#/components/schemas/PasstruAppCreateResponse",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "app",
    "client_id",
    "validate_only"
  ],
  "properties": {
    "app": {
      "$ref": "#/$defs/PasstruApp"
    },
    "client_id": {
      "type": "string"
    },
    "client_secret": {
      "type": [
        "string",
        "null"
      ]
    },
    "client_secret_expires_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "validate_only": {
      "type": "boolean"
    },
    "problem": {
      "anyOf": [
        {
          "$ref": "#/$defs/ProblemDetails"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "$defs": {
    "AuditSummary": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "created_by": {
          "type": [
            "string",
            "null"
          ]
        },
        "last_event": {
          "type": [
            "string",
            "null"
          ]
        },
        "last_event_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "idempotency_key": {
          "type": [
            "string",
            "null"
          ]
        },
        "request_digest": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "PasstruApp": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "object",
        "environment",
        "display_name",
        "status",
        "capabilities",
        "redirect_uris",
        "allowed_origins",
        "native_callback_schemes",
        "deep_link_domains",
        "webhook_subscriptions",
        "created_at",
        "updated_at",
        "credential_state",
        "audit_summary"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "object": {
          "const": "passtru_app"
        },
        "environment": {
          "$ref": "#/$defs/PublicEnvironment"
        },
        "display_name": {
          "type": "string"
        },
        "status": {
          "$ref": "#/$defs/PublicAppStatus"
        },
        "capabilities": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "redirect_uris": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "allowed_origins": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "native_callback_schemes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "deep_link_domains": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "webhook_endpoint": {
          "type": [
            "string",
            "null"
          ]
        },
        "webhook_subscriptions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        },
        "created_by": {
          "type": [
            "string",
            "null"
          ]
        },
        "last_session_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "credential_state": {
          "$ref": "#/$defs/PublicCredentialState"
        },
        "audit_summary": {
          "$ref": "#/$defs/AuditSummary"
        }
      }
    },
    "ProblemDetails": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "title",
        "status",
        "detail",
        "code",
        "retryable",
        "docs_url",
        "errors"
      ],
      "properties": {
        "type": {
          "type": "string",
          "default": "https://docs.passtru.io/errors/problem"
        },
        "title": {
          "type": "string"
        },
        "status": {
          "type": "integer",
          "minimum": 400,
          "maximum": 599
        },
        "detail": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "instance": {
          "type": [
            "string",
            "null"
          ]
        },
        "request_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "docs_url": {
          "type": "string",
          "format": "uri"
        },
        "errors": {
          "type": "array",
          "items": {
            "type": "object"
          }
        }
      }
    },
    "PublicAppStatus": {
      "enum": [
        "active",
        "suspended",
        "revoked"
      ]
    },
    "PublicCredentialState": {
      "enum": [
        "not_created",
        "ready",
        "revealed",
        "rotated",
        "expired",
        "locked"
      ]
    },
    "PublicEnvironment": {
      "enum": [
        "sandbox",
        "live"
      ]
    }
  }
}