Skip to content

Instantly share code, notes, and snippets.

@tylerjohnst
Last active February 2, 2022 17:26
Show Gist options
  • Save tylerjohnst/dc0ac6a798ea64134cf15c274a464708 to your computer and use it in GitHub Desktop.
Save tylerjohnst/dc0ac6a798ea64134cf15c274a464708 to your computer and use it in GitHub Desktop.
{
"openapi": "3.0.1",
"info": {
"title": "Claims API",
"version": "v1",
"description": "This is the Claims API top level description. \n\nEdit me in /lib/tasks/open_api.rake.\n"
},
"paths": {
"/api/v1/notices/claims": {
"post": {
"summary": "/api/v1/notices/claims",
"description": "This endpoint is for unauthenticated users to begin the Claim Notice process.\n",
"tags": [
"claims"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NoticesInputsClaimCreateType"
}
}
}
},
"parameters": [
],
"responses": {
"201": {
"description": "Endpoint returning type of NoticesResponsesClaimWithTokenType.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NoticesResponsesClaimWithTokenType"
}
}
}
},
"404": {
"description": "Could not find a Policy for the given information.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MessageErrorType"
}
}
}
},
"406": {
"description": "Could not determine the Policy for this Claim. You must contact Kin.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MessageErrorType"
}
}
}
},
"424": {
"description": "Downstream service required for this call was unavailable.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MessageErrorType"
}
}
}
},
"422": {
"description": "Endpoint returning type of ValidationErrorsType.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationErrorsType"
}
}
}
}
},
"security": [
]
},
"put": {
"summary": "/api/v1/notices/claims",
"description": "This endpoint is for authenticated users to update a Claim.\n",
"tags": [
"claims"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NoticesInputsClaimUpdateType"
}
}
}
},
"parameters": [
],
"responses": {
"200": {
"description": "Endpoint returning type of APIV1NoticesClaimsControllerUpdate200Type.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/APIV1NoticesClaimsControllerUpdate200Type"
}
}
}
},
"422": {
"description": "Endpoint returning type of ValidationErrorsType.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationErrorsType"
}
}
}
},
"401": {
"description": "Endpoint returning type of MessageErrorType.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MessageErrorType"
}
}
}
}
},
"security": [
{
"bearerAuth": [
]
}
]
}
}
},
"servers": [
{
"url": "https://localhost:3008",
"description": "Local"
},
{
"url": "https://claims.dev.kin.co",
"description": "Dev"
},
{
"url": "https://claims.kin.co",
"description": "Production"
}
],
"components": {
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT",
"description": "Authentication for this API is done via HTTP header:\n\n```\nAuthorization: Bearer $TOKEN\n```\n\nJWT tokens will be issued after performing unauthenticated actions that return authenticated payloads.\n"
}
},
"schemas": {
"MessageErrorType": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
]
},
"ValidationErrorType": {
"type": "object",
"properties": {
"path": {
"type": "string"
},
"messages": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"path",
"messages"
]
},
"ValidationErrorsType": {
"type": "object",
"properties": {
"errors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string"
},
"messages": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"path",
"messages"
]
}
}
},
"required": [
"errors"
]
},
"NoticesAgreementType": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"content": {
"type": "string",
"description": "The content that the user agreed to."
},
"timestamp": {
"type": "string",
"format": "datetime",
"description": "The date and time of agreement."
}
},
"required": [
"id",
"content",
"timestamp"
]
},
"NoticesAddressType": {
"type": "object",
"properties": {
"formatted": {
"type": "string",
"description": "A fully formatted address string for showing in UIs.",
"example": "20045 Satin Leaf Ave, Suite 4, Tampa, FL 33647, USA"
},
"predirection": {
"type": "string",
"description": "Directional information before a street name (N, SW, etc.)",
"example": "N"
},
"primaryNumber": {
"type": "string",
"description": "The house, PO Box, or building number",
"example": "20045"
},
"streetName": {
"type": "string",
"description": "The name of the street",
"example": "Satin Leaf"
},
"streetSuffix": {
"type": "string",
"description": "Abbreviated value describing the street (St, Ave, Blvd, etc.)",
"example": "Ave"
},
"postdirection": {
"type": "string",
"description": "Directional information after a street name (N, SW, etc.)",
"example": "N"
},
"unitDesignator": {
"type": "string",
"example": "Suite"
},
"unitNumber": {
"type": "string",
"example": "4"
},
"city": {
"type": "string",
"description": "The USPS-preferred city name for this particular address",
"example": "Saint Petersburg"
},
"state": {
"type": "string",
"enum": [
"AK",
"AL",
"AR",
"AS",
"AZ",
"CA",
"CO",
"CT",
"DC",
"DE",
"FL",
"GA",
"GU",
"HI",
"IA",
"ID",
"IL",
"IN",
"KS",
"KY",
"LA",
"MA",
"MD",
"ME",
"MI",
"MN",
"MO",
"MS",
"MT",
"NC",
"ND",
"NE",
"NH",
"NJ",
"NM",
"NV",
"NY",
"OH",
"OK",
"OR",
"PA",
"PR",
"RI",
"SC",
"SD",
"TN",
"TX",
"UT",
"VA",
"VI",
"VT",
"WA",
"WI",
"WV",
"WY"
],
"example": "FL"
},
"zipCode": {
"type": "string",
"description": "Five or nine digit zip code.",
"example": "11324-1234"
}
},
"required": [
"formatted",
"primaryNumber",
"streetName",
"streetSuffix",
"city",
"state",
"zipCode"
]
},
"NoticesSubmitterType": {
"type": "object",
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"email": {
"type": "string",
"format": "email"
},
"phoneNumber": {
"type": "string",
"format": "phone"
},
"preferredContactMethodType": {
"type": "string",
"enum": [
"phone",
"email"
]
}
}
},
"NoticesInjuredPartyType": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"firstName": {
"type": "string",
"example": "Jill"
},
"lastName": {
"type": "string",
"example": "Jillington"
},
"email": {
"type": "string",
"format": "email"
},
"phoneNumber": {
"type": "string",
"format": "phone"
}
},
"required": [
"id",
"firstName",
"lastName",
"phoneNumber"
]
},
"NoticesAdditionalDamageType": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"type": {
"type": "string",
"enum": [
"structure",
"possession"
]
},
"address": {
"$ref": "#/components/schemas/NoticesAddressType",
"description": "When type is 'structure', this is required."
},
"property_description": {
"type": "string",
"description": "When type is 'possession', this is required. Description of the personal possession that was losed."
},
"loss_description": {
"type": "string",
"description": "Description of how the additional damage type occurred."
}
},
"required": [
"id",
"type",
"loss_description"
]
},
"NoticesAttachmentType": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"url": {
"type": "string",
"description": "Expiring URL that expires after (TODO: Add days after configuring ActiveStorage) days."
},
"type": {
"type": "string",
"enum": [
"document_of_representation",
"damage_documentation"
],
"description": "The type of attachment."
}
},
"required": [
"id",
"url",
"type"
]
},
"NoticesClaimType": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"role": {
"type": "string",
"enum": [
"policyholder",
"contractor",
"public_adjuster",
"attourney",
"other",
"kin",
"unknown"
],
"example": "policyholder"
},
"claimNumber": {
"type": "string",
"description": "External facing identifier for the claim",
"example": "HO-0000000"
},
"policyNumber": {
"type": "string",
"description": "Full policy number related to the claim",
"example": "KIN-HO-FL-000000000"
},
"locked": {
"type": "boolean",
"description": "When the Claim is locked to editing, we will want to show a spinner."
},
"lossDate": {
"type": "string",
"format": "date",
"description": "The date of damage in this claim."
},
"lossDateRangeEndOn": {
"type": "string",
"format": "date",
"description": "The maximum value the loss date can be set to."
},
"lossDateRangeStartOn": {
"type": "string",
"format": "date",
"description": "The mininum value the loss date can be set to."
},
"lossType": {
"type": "string"
},
"lossSubtype": {
"type": "string"
},
"lossDescription": {
"type": "string",
"description": "Explicit details of the claim and why it's being filed."
},
"exposures": {
"type": "array",
"items": {
"type": "string",
"enum": [
"dwelling",
"personal_property",
"other_structures"
]
},
"description": "Which type of structure is the claim associated with.",
"example": [
"dwelling"
]
},
"address": {
"$ref": "#/components/schemas/NoticesAddressType"
},
"submitter": {
"$ref": "#/components/schemas/NoticesSubmitterType"
},
"injuredParties": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"firstName": {
"type": "string",
"example": "Jill"
},
"lastName": {
"type": "string",
"example": "Jillington"
},
"email": {
"type": "string",
"format": "email"
},
"phoneNumber": {
"type": "string",
"format": "phone"
}
},
"required": [
"id",
"firstName",
"lastName",
"phoneNumber"
]
}
},
"otherDamages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"type": {
"type": "string",
"enum": [
"structure",
"possession"
]
},
"address": {
"$ref": "#/components/schemas/NoticesAddressType",
"description": "When type is 'structure', this is required."
},
"property_description": {
"type": "string",
"description": "When type is 'possession', this is required. Description of the personal possession that was losed."
},
"loss_description": {
"type": "string",
"description": "Description of how the additional damage type occurred."
}
},
"required": [
"id",
"type",
"loss_description"
]
}
},
"attachments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"url": {
"type": "string",
"description": "Expiring URL that expires after (TODO: Add days after configuring ActiveStorage) days."
},
"type": {
"type": "string",
"enum": [
"document_of_representation",
"damage_documentation"
],
"description": "The type of attachment."
}
},
"required": [
"id",
"url",
"type"
]
},
"description": "Collection of attachments for various files."
},
"agreements": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"content": {
"type": "string",
"description": "The content that the user agreed to."
},
"timestamp": {
"type": "string",
"format": "datetime",
"description": "The date and time of agreement."
}
},
"required": [
"id",
"content",
"timestamp"
]
},
"description": "Collection of agreements the user consented to."
},
"hasCheckedInjuredParties": {
"type": "boolean",
"description": "Tracks the state of the UI for this question."
},
"hasCheckedOthersPropertyDamaged": {
"type": "boolean",
"description": "Tracks the state of the UI for this question."
},
"hasConfirmedAgreements": {
"type": "boolean",
"description": "Tracks the state of the UI for this question."
}
},
"required": [
"id",
"role",
"locked",
"exposures",
"injuredParties",
"otherDamages",
"attachments",
"agreements"
]
},
"NoticesResponsesClaimWithTokenType": {
"type": "object",
"properties": {
"claim": {
"$ref": "#/components/schemas/NoticesClaimType"
},
"token": {
"type": "string",
"format": "jwt",
"description": "The token to use with authentication."
}
},
"required": [
"claim",
"token"
]
},
"NoticesInputsClaimUpdateType": {
"type": "object",
"properties": {
"lossDescription": {
"type": "string",
"description": "Explicit details of the claim and why it's being filed."
},
"lossDate": {
"type": "string",
"format": "date",
"description": "The date of damage in this claim."
},
"lossType": {
"type": "string"
},
"lossSubtype": {
"type": "string"
},
"exposures": {
"type": "array",
"items": {
"type": "string",
"enum": [
"dwelling",
"personal_property",
"other_structures"
]
},
"description": "Which type of structure is the claim associated with.",
"example": [
"dwelling"
]
},
"hasCheckedInjuredParties": {
"type": "boolean",
"description": "Tracks the state of the UI for this question."
},
"hasCheckedOthersPropertyDamaged": {
"type": "boolean",
"description": "Tracks the state of the UI for this question."
},
"hasConfirmedAgreements": {
"type": "boolean",
"description": "Tracks the state of the UI for this question."
},
"submitter": {
"$ref": "#/components/schemas/NoticesSubmitterType"
}
}
},
"NoticesInputsClaimCreateType": {
"type": "object",
"properties": {
"street": {
"type": "string",
"description": "The first line of an address, without unit number."
},
"unit": {
"type": "string",
"description": "The unit number of the address"
},
"city": {
"type": "string",
"description": "The USPS-preferred city name for this particular address",
"example": "Saint Petersburg"
},
"state": {
"type": "string",
"enum": [
"AK",
"AL",
"AR",
"AS",
"AZ",
"CA",
"CO",
"CT",
"DC",
"DE",
"FL",
"GA",
"GU",
"HI",
"IA",
"ID",
"IL",
"IN",
"KS",
"KY",
"LA",
"MA",
"MD",
"ME",
"MI",
"MN",
"MO",
"MS",
"MT",
"NC",
"ND",
"NE",
"NH",
"NJ",
"NM",
"NV",
"NY",
"OH",
"OK",
"OR",
"PA",
"PR",
"RI",
"SC",
"SD",
"TN",
"TX",
"UT",
"VA",
"VI",
"VT",
"WA",
"WI",
"WV",
"WY"
],
"example": "FL"
},
"zipCode": {
"type": "string",
"description": "Five or nine digit zip code.",
"example": "11324-1234"
},
"lastName": {
"type": "string",
"description": "Last name of the applicant or coapplicant."
}
},
"required": [
"street",
"city",
"state",
"zipCode",
"lastName"
]
},
"APIV1NoticesClaimsControllerUpdate200Type": {
"type": "object",
"properties": {
"claim": {
"$ref": "#/components/schemas/NoticesClaimType"
}
},
"required": [
"claim"
]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment