{
  "openapi": "3.1.0",
  "info": {
    "title": "Avertyn API",
    "version": "2026-11-19",
    "description": "**The key.** Send it as Authorization: Bearer avk_… A key can have an expiry date and a list of addresses it may be used from.\n\n**Request ID.** Every answer carries x-request-id. Quote it when you write to us.\n\n**Errors.** Every error has one shape: type, title, status, detail and request_id, sent as application/problem+json. A 422 may add errors, one line for each field.\n\n**Pages.** Lists return data, has_more and next_cursor. Pass next_cursor as cursor to get the next page. A cursor is good only for the list and filters it came from.\n\n**Safe repeats.** On a POST, PATCH or DELETE, send an Idempotency-Key header (any text up to 200 characters). Sending the same request with the same key within 24 hours returns the first answer, marked idempotent-replayed: true, and does nothing twice. The same key with a different request answers 409.\n\n**Limits.** Each key has a limit for each minute, 120 unless changed. Every answer carries x-ratelimit-limit, x-ratelimit-remaining and x-ratelimit-reset (seconds). Over the limit answers 429 with retry-after; refused requests do not count toward the limit.\n\n**Members.** A roster is patient information: members:write keys, and live members:read keys, can be made once the workspace may hold patient information. Avertyn keeps member ID, name, date of birth, sex, relationship, subscriber ID, ZIP code and coverage by plan; never a Social Security number. A full file that would end coverage answers 409 until it is sent with confirm_ends true.\n\n**Email.** POST /v1/email sends from a mailbox your workspace has on its own domain (Settings → Domains and Mailboxes), never from an Avertyn address. An email can carry patient information, so an email:send key can be made once the workspace may hold it. An address on your do-not-send list, or a paused workspace, holds the email instead (status held, with held_reason). Webhook events: email.sent, email.delivered, email.delayed, email.bounced, email.complained, email.received, email.junk, email.held and email.failed.\n\n**Patient details.** A key with cases:read:basic gets operational fields; cases:read adds amounts, codes and plan names; cases:read:phi adds the patient reference, the claim number and the date of service. Events follow the same three levels."
  },
  "servers": [
    {
      "url": "https://ssjougrsaecdwfuxeasd.supabase.co/functions/v1/api-gateway"
    }
  ],
  "tags": [
    {
      "name": "Keys"
    },
    {
      "name": "Events"
    },
    {
      "name": "Cases"
    },
    {
      "name": "Documents"
    },
    {
      "name": "Messages"
    },
    {
      "name": "Remittances"
    },
    {
      "name": "Metrics"
    },
    {
      "name": "Timesheets"
    },
    {
      "name": "Members"
    },
    {
      "name": "Email"
    },
    {
      "name": "Webhooks"
    }
  ],
  "paths": {
    "/v1/me": {
      "get": {
        "operationId": "get_me",
        "tags": [
          "Keys"
        ],
        "summary": "The workspace this key belongs to, its scopes, its limit and when it expires",
        "description": "The workspace this key belongs to, its scopes, its limit and when it expires. Use it to check a key.",
        "x-scopes": [],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Key"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/event-types": {
      "get": {
        "operationId": "get_event_types",
        "tags": [
          "Events"
        ],
        "summary": "The event catalog: every event name with its group and meaning",
        "description": "The event catalog: every event name with its group and meaning.",
        "x-scopes": [],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EventType"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/cases": {
      "get": {
        "operationId": "get_cases",
        "tags": [
          "Cases"
        ],
        "summary": "Cases, soonest response date first, 50 at a time (200 at most)",
        "description": "Cases, soonest response date first, 50 at a time (200 at most). Follow next_cursor for the next page.",
        "x-scopes": [
          "cases:read:basic",
          "cases:read",
          "cases:read:phi"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many to return: 1 to 200, 50 if left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The next_cursor of the page before."
          },
          {
            "name": "stage",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only cases at this step, for example triage."
          },
          {
            "name": "phase",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only cases in this phase: open_negotiation or idr."
          },
          {
            "name": "disposition",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only cases with this outcome, for example open or settled."
          },
          {
            "name": "external_ref",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The case with exactly this case number."
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only cases changed at or after this time (ISO 8601)."
          },
          {
            "name": "respond_by_before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only cases whose response date is before this time (ISO 8601)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Case"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "limit, cursor or a date filter is not valid.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/cases/{id}": {
      "get": {
        "operationId": "get_cases__by_id",
        "tags": [
          "Cases"
        ],
        "summary": "One case",
        "description": "One case. The fields returned depend on the key's read scope.",
        "x-scopes": [
          "cases:read:basic",
          "cases:read",
          "cases:read:phi"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID (a UUID)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Case"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this ID in your workspace.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/disputes": {
      "post": {
        "operationId": "post_disputes",
        "tags": [
          "Cases"
        ],
        "summary": "Open cases from your claims system",
        "description": "Open cases from your claims system.",
        "x-scopes": [
          "cases:write"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "disputes": [
                  {
                    "external_ref": "CLM-10442",
                    "cpt_code": "99285",
                    "billed_amount": 4200,
                    "qpa_amount": 1150,
                    "notice_received_on": "2026-11-10"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "The Idempotency-Key was used with a different request, or the first request is still running.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "The request was understood and refused; detail says why.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/cases/{id}/actions": {
      "post": {
        "operationId": "post_cases__by_id_actions",
        "tags": [
          "Cases"
        ],
        "summary": "Run a governed step on a case",
        "description": "Run a governed step on a case. A step that moves money or needs a second person is staged for approval and answers 202.",
        "x-scopes": [
          "cases:write"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID (a UUID)."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "action": "add_note",
                "params": {
                  "text": "Called the provider's billing office."
                },
                "rationale": "Follow-up"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "202": {
            "description": "Staged for approval by a person.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this ID in your workspace.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "The Idempotency-Key was used with a different request, or the first request is still running.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "The request was understood and refused; detail says why.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/cases/{id}/documents": {
      "post": {
        "operationId": "post_cases__by_id_documents",
        "tags": [
          "Documents"
        ],
        "summary": "Attach a file to a case: PDF, PNG, JPEG, TIFF, DOCX, XLSX, text or CSV, 15 MB at most",
        "description": "Attach a file to a case: PDF, PNG, JPEG, TIFF, DOCX, XLSX, text or CSV, 15 MB at most.",
        "x-scopes": [
          "documents:write",
          "cases:write"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID (a UUID)."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "filename": "eob.pdf",
                "mime": "application/pdf",
                "content_base64": "JVBERi0xLjcK…",
                "category": "eob"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this ID in your workspace.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "The Idempotency-Key was used with a different request, or the first request is still running.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "The request was understood and refused; detail says why.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/cases/{id}/fields": {
      "patch": {
        "operationId": "patch_cases__by_id_fields",
        "tags": [
          "Cases"
        ],
        "summary": "Change case fields",
        "description": "Change case fields. All of the changes are saved or none; the old and new values go in the ledger.",
        "x-scopes": [
          "cases:fields",
          "cases:write"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID (a UUID)."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "fields": {
                  "claim_number": "CLM-10442"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this ID in your workspace.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "The Idempotency-Key was used with a different request, or the first request is still running.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "The request was understood and refused; detail says why.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/inbound/{source}": {
      "post": {
        "operationId": "post_inbound__by_source",
        "tags": [
          "Messages"
        ],
        "summary": "Bring a message into the Inbox from another system, such as zendesk or front",
        "description": "Bring a message into the Inbox from another system, such as zendesk or front. It never changes a deadline or opens a case by itself.",
        "x-scopes": [
          "inbound:write"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Where the message comes from, for example zendesk or front."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "subject": "Open negotiation notice",
                "body": "Text of the message",
                "from": "billing@provider.example",
                "case": "IDR-2026-5203",
                "external_id": "48213"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "The Idempotency-Key was used with a different request, or the first request is still running.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "The request was understood and refused; detail says why.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/remittances": {
      "post": {
        "operationId": "post_remittances",
        "tags": [
          "Remittances"
        ],
        "summary": "Send an X12 835 from your claims system or payment vendor, as the raw file (Content-Type application/edi-x12) or as JSON",
        "description": "Send an X12 835 from your claims system or payment vendor, as the raw file (Content-Type application/edi-x12) or as JSON. Avertyn reads it, checks every line against the No Surprises Act remark-code rules and links it to its cases. direction is outbound (your own remittance, the default) or inbound (one a provider sent). Needs a workspace that may hold patient information.",
        "x-scopes": [
          "remittances:write"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "x12": "ISA*00*…~ST*835*0001~…~SE*12*0001~GE*1*1~IEA*1*000000001~",
                "direction": "outbound"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "The Idempotency-Key was used with a different request, or the first request is still running.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "The request was understood and refused; detail says why.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/metrics/scorecard": {
      "get": {
        "operationId": "get_metrics_scorecard",
        "tags": [
          "Metrics"
        ],
        "summary": "The workspace scorecard",
        "description": "The workspace scorecard.",
        "x-scopes": [
          "metrics:read"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/metrics/exposure": {
      "get": {
        "operationId": "get_metrics_exposure",
        "tags": [
          "Metrics"
        ],
        "summary": "Open exposure by plan sponsor",
        "description": "Open exposure by plan sponsor.",
        "x-scopes": [
          "metrics:read"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/documents/{id}": {
      "get": {
        "operationId": "get_documents__by_id",
        "tags": [
          "Documents"
        ],
        "summary": "One document with its text and signing state",
        "description": "One document with its text and signing state.",
        "x-scopes": [
          "documents:read"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID (a UUID)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this ID in your workspace.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/timesheets": {
      "get": {
        "operationId": "get_timesheets",
        "tags": [
          "Timesheets"
        ],
        "summary": "Hours for one pay period: each person's days, each work week's total and overtime, and who approved it",
        "description": "Hours for one pay period: each person's days, each work week's total and overtime, and who approved it. Only approved time unless status is all; anyone whose weeks still wait for approval is named in waiting. Overtime is counted for each work week and listed in the pay period where the week ends.",
        "x-scopes": [
          "time:read"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Any day in the pay period you want, as YYYY-MM-DD. Left out, the last pay period that has ended."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "approved",
                "all"
              ],
              "default": "approved"
            },
            "description": "approved (the default) for approved time only, or all to include time still waiting for approval."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Timesheet"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "period is not a date, or status is not approved or all.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/timesheets/periods": {
      "get": {
        "operationId": "get_timesheets_periods",
        "tags": [
          "Timesheets"
        ],
        "summary": "The recent pay periods, newest first, each with its dates, whether it has ended and whether all of its time is approved",
        "description": "The recent pay periods, newest first, each with its dates, whether it has ended and whether all of its time is approved.",
        "x-scopes": [
          "time:read"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 26,
              "default": 6
            },
            "description": "How many pay periods: 1 to 26, 6 if left out."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PayPeriod"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "limit is not a whole number from 1 to 26.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/members": {
      "get": {
        "operationId": "get_members",
        "tags": [
          "Members"
        ],
        "summary": "Members on your clients' rosters, each with the plans covering them and when",
        "description": "Members on your clients' rosters, each with the plans covering them and when. Find one by member ID, or list a plan's members covered on a date.",
        "x-scopes": [
          "members:read"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "member_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The member with this member ID (spaces and dashes don't matter)."
          },
          {
            "name": "plan",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "A plan: its ID, plan number, name, or the group number a roster file uses for it."
          },
          {
            "name": "active_on",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Only members covered on this date (YYYY-MM-DD), for example a date of service."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            },
            "description": "How many: 1 to 500, 100 if left out."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "How many to skip, for the next page."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Member"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "limit, offset or active_on is not valid, or plan doesn't match one of your plans.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_members",
        "tags": [
          "Members"
        ],
        "summary": "Add or update members and their coverage, up to 5,000 at a time",
        "description": "Add or update members and their coverage, up to 5,000 at a time. mode change (the default) changes only the members sent; full also ends, the day before today, the coverage of members on those plans who aren't sent (send confirm_ends true).",
        "x-scopes": [
          "members:write"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "mode": "change",
                "plan": "GRP-7781",
                "members": [
                  {
                    "member_id": "M100",
                    "first_name": "Nora",
                    "last_name": "Quill",
                    "dob": "1984-03-12",
                    "sex": "F",
                    "relationship": "self",
                    "coverage_start": "2026-01-01",
                    "coverage_end": null
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RosterResult"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "The Idempotency-Key was used with a different request, or the first request is still running.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "The request was understood and refused; detail says why.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rosters": {
      "post": {
        "operationId": "post_rosters",
        "tags": [
          "Members"
        ],
        "summary": "Send a whole roster file: CSV (any column names Avertyn can match) or an X12 834 (Content-Type application/edi-x12)",
        "description": "Send a whole roster file: CSV (any column names Avertyn can match) or an X12 834 (Content-Type application/edi-x12). An 834 replace or verify file is read as every member. Social Security numbers are never kept.",
        "x-scopes": [
          "members:write"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "change",
                "full"
              ],
              "default": "change"
            },
            "description": "change (the default) or full: every member of the plans in the file."
          },
          {
            "name": "plan",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "A plan: its ID, plan number, name, or the group number a roster file uses for it."
          },
          {
            "name": "confirm_ends",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "true to go ahead when a full file would end the coverage of members not in it."
          },
          {
            "name": "file_name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The file's name, shown in Avertyn's roster history."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "content": "Member ID,Last Name,First Name,DOB,Group Number,Effective Date\nM100,Quill,Nora,03/12/1984,GRP-7781,01/01/2026\n",
                "mode": "change"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RosterResult"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "The Idempotency-Key was used with a different request, or the first request is still running.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "The request was understood and refused; detail says why.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rosters/{id}": {
      "get": {
        "operationId": "get_rosters__by_id",
        "tags": [
          "Members"
        ],
        "summary": "What a roster file or members batch did: members added, coverage lines, coverage ended, and rows not loaded",
        "description": "What a roster file or members batch did: members added, coverage lines, coverage ended, and rows not loaded.",
        "x-scopes": [
          "members:read",
          "members:write"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID (a UUID)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Roster"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this ID in your workspace.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events": {
      "get": {
        "operationId": "get_events",
        "tags": [
          "Events"
        ],
        "summary": "The event history of the last 30 days, newest first",
        "description": "The event history of the last 30 days, newest first. Read it to catch up after an outage instead of waiting for retries.",
        "x-scopes": [
          "cases:read:basic",
          "cases:read",
          "cases:read:phi"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "How many to return: 1 to 200, 50 if left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The next_cursor of the page before."
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only events with this name, for example dispute.state_changed."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Event"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "limit, cursor or a date filter is not valid.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events/{id}": {
      "get": {
        "operationId": "get_events__by_id",
        "tags": [
          "Events"
        ],
        "summary": "One event by its ID (evt_ and 32 characters)",
        "description": "One event by its ID (evt_ and 32 characters).",
        "x-scopes": [
          "cases:read:basic",
          "cases:read",
          "cases:read:phi"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The event ID: evt_ and 32 characters."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Event"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this ID in your workspace.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/email": {
      "post": {
        "operationId": "post_email",
        "tags": [
          "Email"
        ],
        "summary": "Send an email from one of your own mailboxes on your own domain (Enterprise)",
        "description": "Send an email from one of your own mailboxes on your own domain (Enterprise). It is queued and sent through your domain; follow it with GET /v1/email/{id} or the email.* webhook events.",
        "x-scopes": [
          "email:send"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "from": "disputes@mail.yourplan.example",
                "to": "billing@provider.example",
                "subject": "Open negotiation: claim CLM-10442",
                "text": "Please find our response attached in the portal.",
                "case": "IDR-2026-0001"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "The Idempotency-Key was used with a different request, or the first request is still running.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "The request was understood and refused; detail says why.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/email/{id}": {
      "get": {
        "operationId": "get_email__by_id",
        "tags": [
          "Email"
        ],
        "summary": "One email sent through the API or from Avertyn: its mailbox, recipient, status (queued, held, sent, delivered, delayed, bounced, complaint, failed) and each event",
        "description": "One email sent through the API or from Avertyn: its mailbox, recipient, status (queued, held, sent, delivered, delayed, bounced, complaint, failed) and each event.",
        "x-scopes": [
          "email:send"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID (a UUID)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this ID in your workspace.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks": {
      "post": {
        "operationId": "post_webhooks",
        "tags": [
          "Webhooks"
        ],
        "summary": "Add a webhook endpoint",
        "description": "Add a webhook endpoint. The signing secret is in the answer and is not shown again by the API.",
        "x-scopes": [
          "webhooks:manage"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "url": "https://your-system.example/avertyn",
                "events": [
                  "dispute.state_changed",
                  "deadline.due_soon"
                ],
                "payload_level": "full",
                "label": "Claims system"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "secret": {
                          "type": "string",
                          "description": "The signing secret (whsec_…). Keep it; the API does not show it again."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "The Idempotency-Key was used with a different request, or the first request is still running.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "The request was understood and refused; detail says why.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "get_webhooks",
        "tags": [
          "Webhooks"
        ],
        "summary": "Every webhook endpoint with its health",
        "description": "Every webhook endpoint with its health.",
        "x-scopes": [
          "webhooks:manage"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Webhook"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks/{id}": {
      "get": {
        "operationId": "get_webhooks__by_id",
        "tags": [
          "Webhooks"
        ],
        "summary": "One webhook endpoint with its health and the number of held events",
        "description": "One webhook endpoint with its health and the number of held events.",
        "x-scopes": [
          "webhooks:manage"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID (a UUID)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Webhook"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this ID in your workspace.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "patch_webhooks__by_id",
        "tags": [
          "Webhooks"
        ],
        "summary": "Pause or resume an endpoint",
        "description": "Pause or resume an endpoint. While paused its events are held; resuming sends them unless send_held is false.",
        "x-scopes": [
          "webhooks:manage"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID (a UUID)."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "paused": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Webhook"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this ID in your workspace.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "The Idempotency-Key was used with a different request, or the first request is still running.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "The request was understood and refused; detail says why.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete_webhooks__by_id",
        "tags": [
          "Webhooks"
        ],
        "summary": "Remove a webhook endpoint and its delivery history",
        "description": "Remove a webhook endpoint and its delivery history.",
        "x-scopes": [
          "webhooks:manage"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID (a UUID)."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Done. No body.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "The key is missing, wrong, revoked or expired, or the request came from an address the key does not allow.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have a scope this route needs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this ID in your workspace.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "The Idempotency-Key was used with a different request, or the first request is still running.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Over the key's limit for this minute.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "retry-after": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait."
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Avertyn could not complete the request.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "avk_live_… or avk_test_…"
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "maxLength": 200
        },
        "description": "Makes a repeat of this request safe for 24 hours."
      }
    },
    "headers": {
      "RequestId": {
        "schema": {
          "type": "string"
        },
        "description": "The ID of this request: req_ and 32 characters."
      },
      "RateLimit": {
        "schema": {
          "type": "integer"
        },
        "description": "Requests allowed each minute."
      },
      "RateRemaining": {
        "schema": {
          "type": "integer"
        },
        "description": "Requests left in the current minute."
      },
      "RateReset": {
        "schema": {
          "type": "integer"
        },
        "description": "Seconds until the oldest request leaves the minute."
      }
    },
    "schemas": {
      "Problem": {
        "type": "object",
        "required": [
          "type",
          "title",
          "status",
          "request_id"
        ],
        "properties": {
          "type": {
            "type": "string",
            "description": "A URL that names the kind of error."
          },
          "title": {
            "type": "string",
            "description": "A short name, for example invalid_cursor."
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": [
              "string",
              "null"
            ],
            "description": "One sentence saying what to do."
          },
          "request_id": {
            "type": "string",
            "description": "Quote this when you write to us."
          },
          "errors": {
            "type": "array",
            "description": "On a 422 for case fields: one entry for each field refused.",
            "items": {}
          }
        }
      },
      "Key": {
        "type": "object",
        "properties": {
          "workspace_id": {
            "type": "string",
            "description": "",
            "format": "uuid"
          },
          "key_id": {
            "type": "string",
            "description": "",
            "format": "uuid"
          },
          "environment": {
            "type": "string",
            "description": "live or test"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rate_limit_per_min": {
            "type": "integer"
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the key stops working, if it has an expiry.",
            "format": "date-time"
          },
          "api_version": {
            "type": "string",
            "description": ""
          }
        }
      },
      "EventType": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "The event name."
          },
          "group": {
            "type": "string",
            "description": "notice, case, deadline, message, document, money or approval"
          },
          "title": {
            "type": "string",
            "description": ""
          },
          "detail": {
            "type": "string",
            "description": ""
          }
        }
      },
      "Case": {
        "type": "object",
        "description": "Fields depend on the key's read scope.",
        "properties": {
          "id": {
            "type": "string",
            "description": "",
            "format": "uuid"
          },
          "external_ref": {
            "type": "string",
            "description": "The case number."
          },
          "workflow_state": {
            "type": "string",
            "description": "The step."
          },
          "disposition": {
            "type": "string",
            "description": "The outcome; open until one is recorded."
          },
          "phase": {
            "type": "string",
            "description": "open_negotiation or idr"
          },
          "eligibility_score": {
            "type": [
              "number",
              "null"
            ],
            "description": ""
          },
          "win_prob": {
            "type": [
              "number",
              "null"
            ],
            "description": ""
          },
          "respond_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "",
            "format": "date-time"
          },
          "pay_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "description": "",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "description": "",
            "format": "date-time"
          },
          "cpt_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "With cases:read."
          },
          "service_category": {
            "type": [
              "string",
              "null"
            ],
            "description": "With cases:read."
          },
          "billed_amount": {
            "type": [
              "number",
              "null"
            ],
            "description": "With cases:read."
          },
          "demand_amount": {
            "type": [
              "number",
              "null"
            ],
            "description": "With cases:read."
          },
          "qpa_amount": {
            "type": [
              "number",
              "null"
            ],
            "description": "With cases:read."
          },
          "plan_legal_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "With cases:read."
          },
          "sponsor_legal_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "With cases:read."
          },
          "idr_registration_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "With cases:read."
          },
          "patient_ref": {
            "type": [
              "string",
              "null"
            ],
            "description": "With cases:read:phi."
          },
          "claim_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "With cases:read:phi."
          },
          "service_date": {
            "type": [
              "string",
              "null"
            ],
            "description": "With cases:read:phi.",
            "format": "date"
          }
        }
      },
      "Event": {
        "type": "object",
        "description": "The same body a webhook endpoint receives.",
        "properties": {
          "id": {
            "type": "string",
            "description": "evt_ and 32 characters; the same on every retry and every send-again."
          },
          "type": {
            "type": "string",
            "description": "The event name."
          },
          "created": {
            "type": "string",
            "description": "",
            "format": "date-time"
          },
          "api_version": {
            "type": "string",
            "description": ""
          },
          "workspace_id": {
            "type": "string",
            "description": "",
            "format": "uuid"
          },
          "sample": {
            "type": "boolean",
            "description": "True when the case is sample data."
          },
          "level": {
            "type": "string",
            "description": "thin, full or phi"
          },
          "data": {
            "type": "object",
            "description": "The change. data.case uses the Case field names."
          }
        }
      },
      "Member": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "",
            "format": "uuid"
          },
          "member_id": {
            "type": "string",
            "description": ""
          },
          "first_name": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "last_name": {
            "type": "string",
            "description": ""
          },
          "middle_name": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "dob": {
            "type": "string",
            "description": "",
            "format": "date"
          },
          "sex": {
            "type": [
              "string",
              "null"
            ],
            "description": "F, M, X or U"
          },
          "relationship": {
            "type": [
              "string",
              "null"
            ],
            "description": "self, spouse, child or other"
          },
          "subscriber_id": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "zip": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "updated_at": {
            "type": "string",
            "description": "",
            "format": "date-time"
          },
          "coverage": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "plan_id": {
                  "type": "string",
                  "description": "",
                  "format": "uuid"
                },
                "plan": {
                  "type": "string",
                  "description": ""
                },
                "plan_number": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": ""
                },
                "starts_on": {
                  "type": "string",
                  "description": "",
                  "format": "date"
                },
                "ends_on": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Null while coverage continues.",
                  "format": "date"
                }
              }
            }
          }
        }
      },
      "RosterResult": {
        "type": "object",
        "properties": {
          "roster_id": {
            "type": "string",
            "description": "",
            "format": "uuid"
          },
          "mode": {
            "type": "string",
            "description": "change or full"
          },
          "format": {
            "type": "string",
            "description": "json, csv or 834"
          },
          "stats": {
            "type": "object",
            "properties": {
              "members_added": {
                "type": "integer"
              },
              "coverage_lines": {
                "type": "integer",
                "description": "Coverage lines added or changed."
              },
              "ended_by_term": {
                "type": "integer",
                "description": "Coverage ended by terminations in the file."
              },
              "ended_absent": {
                "type": "integer",
                "description": "Coverage ended because a full file left the member out."
              },
              "rows": {
                "type": "integer"
              },
              "not_applied": {
                "type": "integer"
              }
            }
          },
          "not_loaded": {
            "type": "integer",
            "description": "Rows that couldn't be loaded; problems lists the first 50."
          },
          "problems": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "line": {
                  "type": "integer"
                },
                "why": {
                  "type": "string",
                  "description": ""
                }
              }
            }
          },
          "unmatched_plans": {
            "type": "array",
            "description": "Plan names in the file that match none of your plans; their rows weren't loaded. Match them once in Avertyn (Directory → Patients) or send plan.",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "description": ""
                },
                "rows": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "Roster": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "",
            "format": "uuid"
          },
          "source": {
            "type": "string",
            "description": "upload, api or sample"
          },
          "format": {
            "type": "string",
            "description": ""
          },
          "mode": {
            "type": "string",
            "description": ""
          },
          "file_name": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "status": {
            "type": "string",
            "description": "staged, applying, applied or discarded"
          },
          "stats": {
            "type": "object"
          },
          "created_at": {
            "type": "string",
            "description": "",
            "format": "date-time"
          },
          "applied_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "",
            "format": "date-time"
          }
        }
      },
      "PayPeriod": {
        "type": "object",
        "properties": {
          "start": {
            "type": "string",
            "description": "",
            "format": "date"
          },
          "end": {
            "type": "string",
            "description": "",
            "format": "date"
          },
          "label": {
            "type": "string",
            "description": "For example 11/8/2026 to 11/14/2026."
          },
          "kind": {
            "type": "string",
            "description": "weekly, biweekly, semimonthly or monthly"
          },
          "ended": {
            "type": "boolean"
          },
          "complete": {
            "type": "boolean",
            "description": "Every week with time in it is approved."
          },
          "people": {
            "type": "integer",
            "description": "People with time in the pay period."
          },
          "waiting": {
            "type": "integer",
            "description": "People with weeks still waiting for approval."
          },
          "total_min": {
            "type": "integer",
            "description": "All recorded minutes, approved or not."
          }
        }
      },
      "Timesheet": {
        "type": "object",
        "properties": {
          "period": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "description": ""
              },
              "start": {
                "type": "string",
                "description": "",
                "format": "date"
              },
              "end": {
                "type": "string",
                "description": "",
                "format": "date"
              },
              "days": {
                "type": "integer"
              },
              "label": {
                "type": "string",
                "description": ""
              }
            }
          },
          "ended": {
            "type": "boolean"
          },
          "complete": {
            "type": "boolean",
            "description": "Every week with time in it is approved."
          },
          "overtime_hours": {
            "type": [
              "number",
              "null"
            ],
            "description": "Hours in a work week after which time is overtime; null when the workspace does not count overtime."
          },
          "total_min": {
            "type": "integer"
          },
          "overtime_min": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Overtime in work weeks that end in this pay period."
          },
          "rule": {
            "type": "string",
            "description": "How overtime is placed in pay periods."
          },
          "people": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "",
                  "format": "uuid"
                },
                "name": {
                  "type": "string",
                  "description": ""
                },
                "email": {
                  "type": "string",
                  "description": ""
                },
                "tz": {
                  "type": "string",
                  "description": "The person's time zone."
                },
                "approved": {
                  "type": "boolean"
                },
                "period_min": {
                  "type": "integer",
                  "description": "Minutes worked on days inside the pay period."
                },
                "overtime_min": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": ""
                },
                "weeks": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "start": {
                        "type": "string",
                        "description": "",
                        "format": "date"
                      },
                      "end": {
                        "type": "string",
                        "description": "",
                        "format": "date"
                      },
                      "total_min": {
                        "type": "integer"
                      },
                      "overtime_min": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "description": ""
                      },
                      "regular_min": {
                        "type": "integer"
                      },
                      "in_period_min": {
                        "type": "integer",
                        "description": "This week's minutes on days inside the pay period."
                      },
                      "ends_in_period": {
                        "type": "boolean",
                        "description": "The week ends in this pay period, so its overtime is paid here."
                      },
                      "approved": {
                        "type": "boolean"
                      },
                      "approved_by": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": ""
                      },
                      "approved_at": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "",
                        "format": "date-time"
                      },
                      "self_approved": {
                        "type": "boolean"
                      }
                    }
                  }
                },
                "days": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "day": {
                        "type": "string",
                        "description": "",
                        "format": "date"
                      },
                      "in": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": ""
                      },
                      "out": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": ""
                      },
                      "break_min": {
                        "type": "integer"
                      },
                      "worked_min": {
                        "type": "integer"
                      },
                      "week_start": {
                        "type": "string",
                        "description": "",
                        "format": "date"
                      }
                    }
                  }
                }
              }
            }
          },
          "waiting": {
            "type": "array",
            "description": "People whose weeks still wait for approval, with those weeks.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "",
                  "format": "uuid"
                },
                "name": {
                  "type": "string",
                  "description": ""
                },
                "weeks": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "Webhook": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "",
            "format": "uuid"
          },
          "url": {
            "type": "string",
            "description": ""
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "payload_level": {
            "type": "string",
            "description": "thin, full or phi"
          },
          "active": {
            "type": "boolean"
          },
          "health": {
            "type": "string",
            "description": "ok, failing, paused or new"
          },
          "paused_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "",
            "format": "date-time"
          },
          "paused_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "user, or auto after 3 days with no success"
          },
          "paused_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "failing_since": {
            "type": [
              "string",
              "null"
            ],
            "description": "",
            "format": "date-time"
          },
          "last_success_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "",
            "format": "date-time"
          },
          "last_failure_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "",
            "format": "date-time"
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "held": {
            "type": "integer",
            "description": "Events held while paused."
          },
          "created_at": {
            "type": "string",
            "description": "",
            "format": "date-time"
          }
        }
      }
    }
  }
}
