{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/logbrew/json-schema/logbrew-account-invitation-response-schema.json",
  "title": "AccountInvitationResponse",
  "description": "One invitation as the invited account sees it, before accepting.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/logbrew-organizations-api-openapi.yml#/components/schemas/AccountInvitationResponse",
  "properties": {
    "accept_path": {
      "description": "Same-origin path the invited account can POST to accept.",
      "type": "string"
    },
    "created_at": {
      "description": "Invitation creation timestamp.",
      "format": "date-time",
      "type": "string"
    },
    "expires_at": {
      "description": "Expiration timestamp.",
      "format": "date-time",
      "type": "string"
    },
    "id": {
      "description": "Invitation identifier.",
      "format": "uuid",
      "type": "string"
    },
    "inviter_name": {
      "description": "Display name of the account that sent the invitation; `null` when unknown.",
      "type": [
        "string",
        "null"
      ]
    },
    "organization_id": {
      "description": "Organization issuing the invitation.",
      "format": "uuid",
      "type": "string"
    },
    "organization_name": {
      "description": "Organization display name.",
      "type": "string"
    },
    "role": {
      "$ref": "#/$defs/OrganizationRole",
      "description": "Role the account gets on accept."
    },
    "state": {
      "$ref": "#/$defs/OrganizationInvitationState",
      "description": "Invitation state; a pending invitation past `expires_at` reads `expired`."
    }
  },
  "required": [
    "id",
    "organization_id",
    "organization_name",
    "role",
    "state",
    "created_at",
    "expires_at",
    "inviter_name",
    "accept_path"
  ],
  "type": "object",
  "$defs": {
    "OrganizationInvitationState": {
      "description": "Organization invitation state.",
      "oneOf": [
        {
          "const": "pending",
          "description": "Invitation is pending acceptance.",
          "type": "string"
        },
        {
          "const": "accepted",
          "description": "Invitation was accepted.",
          "type": "string"
        },
        {
          "const": "expired",
          "description": "Invitation expired before acceptance.",
          "type": "string"
        },
        {
          "const": "revoked",
          "description": "Invitation was revoked.",
          "type": "string"
        }
      ]
    },
    "OrganizationRole": {
      "description": "Organization membership role.",
      "oneOf": [
        {
          "const": "owner",
          "description": "Organization owner with billing and destructive permissions.",
          "type": "string"
        },
        {
          "const": "admin",
          "description": "Organization admin for membership operations, without implicit project visibility.",
          "type": "string"
        },
        {
          "const": "member",
          "description": "Organization member whose project visibility comes only from explicit assignments.",
          "type": "string"
        }
      ]
    }
  }
}