> ## Documentation Index
> Fetch the complete documentation index at: https://trust.denialbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create form template

> Creates a new form template.



## OpenAPI

````yaml /api-reference/openapi.yaml post /api/v1/admin/form_templates
openapi: 3.1.1
info:
  title: Denialbase API
  version: 1.0.0
  description: >-
    The Denialbase API is organized around REST. Our API accepts JSON-encoded
    request bodies, returns JSON-encoded responses, and uses standard HTTP
    response codes, authentication, and verbs.


    ## Base URL


    ```

    /api/v1

    ```


    ## Authentication


    Denialbase uses **httpOnly cookie-based JWT** authentication. Authenticate
    by sending a `POST /api/v1/auth/session` request with your credentials. The
    server sets a secure session cookie that is automatically included in
    subsequent requests.


    All API requests must be made over HTTPS in production. Requests without
    valid authentication return a `401 Unauthorized` error.


    Two-factor authentication (TOTP), passkeys (WebAuthn), magic links, and
    Google OAuth are also supported.


    ## Errors


    Denialbase uses conventional HTTP response codes to indicate the success or
    failure of an API request. Codes in the `2xx` range indicate success. Codes
    in the `4xx` range indicate an error with the information provided. Codes in
    the `5xx` range indicate a server error.


    | Code | Description |

    |------|-------------|

    | 200 | OK — Request succeeded |

    | 201 | Created — Resource successfully created |

    | 400 | Bad Request — Invalid parameters |

    | 401 | Unauthorized — Invalid or missing authentication |

    | 403 | Forbidden — Insufficient permissions |

    | 404 | Not Found — Resource does not exist |

    | 422 | Unprocessable Entity — Validation failed |

    | 429 | Too Many Requests — Rate limit exceeded |

    | 500 | Internal Server Error — Something went wrong on our end |


    ## Pagination


    List endpoints return paginated results. Use `page` and `per_page` query
    parameters to control pagination. Responses include pagination metadata in
    the response body.


    ## Rate Limiting


    API requests are rate limited per IP address and per authenticated user.
    When rate limited, you will receive a `429 Too Many Requests` response. Back
    off and retry after a brief delay.
servers:
  - url: /api/v1
security: []
tags:
  - name: WellKnown
    x-displayName: JWKS & Discovery
    description: JSON Web Key Set (JWKS) and OpenID Connect discovery endpoints.
  - name: Api::V1::ActionPlan
    x-displayName: Action Plans
    description: AI-generated appeal action plans with approval and execution workflows.
  - name: Api::V1::Action
    x-displayName: Actions
    description: Individual appeal actions (calls, faxes, letters) within action plans.
  - name: Api::V1::Confirmation
    x-displayName: Email Confirmation
    description: >-
      Action confirmation workflow — review, confirm, modify, or cancel pending
      actions.
  - name: Api::V1::Admin::AuditLog
    x-displayName: Audit Logs
    description: HIPAA-aligned audit logs with resource history and user activity tracking.
  - name: Api::V1::Admin::BetaSignup
    x-displayName: Beta Signups
    description: Admin management of beta signup requests (approve or reject).
  - name: Api::V1::Admin::Denial
    x-displayName: Denial Management
    description: Admin denial management — insurer and provider assignment.
  - name: Api::V1::Admin::EobReview
    x-displayName: EobReview
  - name: Api::V1::Admin::Feedback
    x-displayName: User Feedback (Admin)
    description: Admin feedback management — view, respond to, and update feedback status.
  - name: Api::V1::Admin::FormTemplate
    x-displayName: Form Templates (Admin)
    description: Admin form template management with DocuSeal field mapping.
  - name: Api::V1::Admin::HealthcareCode
    x-displayName: Healthcare Codes
    description: Admin healthcare code management (CPT, CARC/RARC) with external sync.
  - name: Api::V1::Admin::InsurerLearningPattern
    x-displayName: Learning Patterns
    description: >-
      Insurer-specific learning patterns discovered by AI, with approval
      workflow.
  - name: Api::V1::Admin::Insurer
    x-displayName: Insurers
    description: Admin insurer configuration, intelligence, and analytics.
  - name: Api::V1::Admin::InvestorCredential
    x-displayName: InvestorCredential
  - name: Api::V1::Admin::LearningInsight
    x-displayName: Learning Insights
    description: AI learning insights — trends, strategies, and operational metrics.
  - name: Api::V1::Admin::Operational
    x-displayName: Operational Monitoring
    description: Admin operational monitoring — escalations, costs, and external events.
  - name: Api::V1::Admin::Organization
    x-displayName: Organization
  - name: Api::V1::Admin::ProviderOnboarding
    x-displayName: ProviderOnboarding
  - name: Api::V1::Admin::Provider
    x-displayName: Providers
    description: Admin healthcare provider management and request tracking.
  - name: Api::V1::Admin::SsoConnection
    x-displayName: SsoConnection
  - name: Api::V1::Admin::SupportGap
    x-displayName: Support Gaps
    description: Identified gaps in platform support coverage for denial types or insurers.
  - name: Api::V1::Admin::UserStat
    x-displayName: User Statistics
    description: Aggregate user statistics and platform usage metrics.
  - name: Api::V1::Admin::User
    x-displayName: User Management
    description: >-
      Admin user management — view details, block, unblock, and set spending
      limits.
  - name: Api::V1::Admin::UserJourney
    x-displayName: User Journeys
    description: Admin view of user journey timelines and activity history.
  - name: Api::V1::OmniauthCallback
    x-displayName: OAuth Callbacks
    description: OAuth callback handlers for third-party login providers.
  - name: Api::V1::Auth::Session
    x-displayName: Sessions
    description: User login and session management via httpOnly cookie-based JWT.
  - name: Api::V1::Auth::Sso
    x-displayName: Sso
  - name: Api::V1::AuthorizationForm
    x-displayName: Authorization Forms
    description: HIPAA authorization forms with DocuSeal e-signature integration.
  - name: Api::V1::AuthorizationGrant
    x-displayName: AuthorizationGrant
  - name: Api::V1::AuthorizationGrants::GrantedScope
    x-displayName: GrantedScope
  - name: Api::V1::AuthorizationGrants::Revoke
    x-displayName: Revoke
  - name: Api::V1::BetaSignup
    x-displayName: Beta Signup
    description: Beta signup requests for early access to the platform.
  - name: Api::V1::Conversation
    x-displayName: Conversations
    description: AI-powered conversations for appeal guidance and support.
  - name: Api::V1::Cost
    x-displayName: Costs
    description: Cost tracking and financial summaries for appeal-related actions.
  - name: Api::V1::DataExport
    x-displayName: Data Export
    description: User data exports in various formats for portability.
  - name: Api::V1::DelegationScope
    x-displayName: DelegationScope
  - name: Api::V1::Document
    x-displayName: Documents
    description: User-uploaded documents such as EOBs, medical records, and correspondence.
  - name: Api::V1::Feedback
    x-displayName: Feedback
    description: User feedback submissions for features and support requests.
  - name: Api::V1::FormDelivery
    x-displayName: Form Deliveries
    description: Form delivery tracking (fax, email, portal) with confirmation workflows.
  - name: Api::V1::FormTemplate
    x-displayName: Form Templates
    description: Reusable form templates for insurer-specific submissions.
  - name: Api::V1::Health
    x-displayName: Health
  - name: Api::V1::Help
    x-displayName: Help & Support
    description: Help articles and contextual assistance for platform pages.
  - name: Api::V1::InsuranceCard
    x-displayName: Insurance Cards
    description: Insurance card image uploads with OCR-based data extraction.
  - name: Api::V1::InsuranceProfile
    x-displayName: Insurance Profiles
    description: Insurance plan profiles with coverage and plan details.
  - name: Api::V1::InsuranceProfileMember
    x-displayName: Profile Members
    description: Members and dependents on insurance profiles.
  - name: Api::V1::Integration
    x-displayName: Integrations
    description: Third-party integrations (EHR, patient portals) via OAuth.
  - name: Api::V1::InvestorSession
    x-displayName: InvestorSession
  - name: Api::V1::Invitation
    x-displayName: Invitation
  - name: Api::V1::Lookup
    x-displayName: Lookup
  - name: Api::V1::MySponsorship
    x-displayName: MySponsorship
  - name: Api::V1::Notification
    x-displayName: Notifications
    description: In-app notification inbox with read and dismiss controls.
  - name: Api::V1::Npi
    x-displayName: Npi
  - name: Api::V1::Onboarding
    x-displayName: Onboarding
    description: Guided onboarding wizard steps and progress tracking.
  - name: Api::V1::Org::Appeal
    x-displayName: Appeal
  - name: Api::V1::Org::Approval
    x-displayName: Approval
  - name: Api::V1::Org::Authorization
    x-displayName: Authorization
  - name: Api::V1::Org::Caseload
    x-displayName: Caseload
  - name: Api::V1::Org::Client
    x-displayName: Client
  - name: Api::V1::Org::PatientInsuranceProfile
    x-displayName: PatientInsuranceProfile
  - name: Api::V1::Org::Dashboard
    x-displayName: Dashboard
  - name: Api::V1::Org::DenialSubmission
    x-displayName: DenialSubmission
  - name: Api::V1::Org::FormRequirement
    x-displayName: FormRequirement
  - name: Api::V1::Org::Insurer
    x-displayName: Insurer
  - name: Api::V1::Org::Intake
    x-displayName: Intake
  - name: Api::V1::Org::Invoice
    x-displayName: Invoice
  - name: Api::V1::Org::Logo
    x-displayName: Logo
  - name: Api::V1::Org::Notification
    x-displayName: Notification
  - name: Api::V1::Org::Onboarding
    x-displayName: Onboarding
  - name: Api::V1::Org::PartnerApiKey
    x-displayName: PartnerApiKey
  - name: Api::V1::Org::Provider
    x-displayName: Provider
  - name: Api::V1::Org::PublicInfo
    x-displayName: PublicInfo
  - name: Api::V1::Org::Report
    x-displayName: Report
  - name: Api::V1::Org::Session
    x-displayName: Session
  - name: Api::V1::Org::Setting
    x-displayName: Setting
  - name: Api::V1::Org::SsoConnection
    x-displayName: SsoConnection
  - name: Api::V1::Org::SupportedInsurer
    x-displayName: SupportedInsurer
  - name: Api::V1::OrgIntake
    x-displayName: OrgIntake
  - name: Api::V1::Organization
    x-displayName: Organization
  - name: Api::V1::Organizations::ClientSponsorship
    x-displayName: ClientSponsorship
  - name: Api::V1::Organizations::Invitation
    x-displayName: Invitation
  - name: Api::V1::Organizations::Membership
    x-displayName: Membership
  - name: Api::V1::OverturnableDenial
    x-displayName: Denials
    description: Insurance claim denials eligible for appeal, with AI-powered analysis.
  - name: Api::V1::CallbackPromise
    x-displayName: Callback Promises
    description: Scheduled callback promises from insurers with follow-up tracking.
  - name: Api::V1::Deadline
    x-displayName: Deadlines
    description: Appeal deadline tracking and urgency management.
  - name: Api::V1::Evidence
    x-displayName: Evidence
    description: Evidence documents and confidence tracking for denial appeals.
  - name: Api::V1::ExternalEvent
    x-displayName: External Events
    description: >-
      External events related to denials, such as insurer responses and status
      changes.
  - name: Api::V1::Partner::EmbedToken
    x-displayName: EmbedToken
  - name: Api::V1::Passkey
    x-displayName: Passkeys (WebAuthn)
    description: Passkey (WebAuthn) registration and authentication for passwordless login.
  - name: Api::V1::ProductFeedback
    x-displayName: ProductFeedback
  - name: Api::V1::ReasonCode
    x-displayName: Reason Codes
    description: CARC and RARC reason code lookup and search.
  - name: Api::V1::Scan
    x-displayName: Document Scans
    description: Document scanning and OCR-based data extraction from uploaded images.
  - name: Api::V1::Search
    x-displayName: Search
    description: Global search across denials, documents, and actions.
  - name: Api::V1::SecurityPreference
    x-displayName: Security Preferences
    description: >-
      Security and privacy settings including data sharing consent and
      verification.
  - name: Api::V1::ServiceCode
    x-displayName: Service Codes
    description: CPT and HCPCS service code lookup and search.
  - name: Api::V1::TaskCredential
    x-displayName: TaskCredential
  - name: Api::V1::TwoFactor
    x-displayName: Two-Factor Auth
    description: >-
      TOTP-based two-factor authentication setup, verification, and backup
      codes.
  - name: Api::V1::Unsubscribe
    x-displayName: Unsubscribe
    description: Email notification unsubscribe management via token-based links.
  - name: Api::V1::User
    x-displayName: User Profile
    description: Current user profile, password management, and account deletion.
  - name: Api::V1::Webhooks::BlandAi
    x-displayName: Bland AI (Calls)
    description: Bland AI webhook callbacks for automated phone call results.
  - name: Api::V1::DeckWebhook
    x-displayName: DeckWebhook
  - name: Api::V1::Webhooks::Docuseal
    x-displayName: DocuSeal (Signatures)
    description: DocuSeal webhook callbacks for e-signature completion events.
  - name: Api::V1::Webhooks::InboundEmail
    x-displayName: Inbound Email
    description: Inbound email webhook callbacks for insurer correspondence.
  - name: Api::V1::Webhooks::Lob
    x-displayName: Lob
  - name: Api::V1::Webhooks::Phaxio
    x-displayName: Phaxio (Fax)
    description: Phaxio webhook callbacks for fax delivery status updates.
  - name: Api::V1::Webhooks::Telnyx
    x-displayName: Telnyx (SMS)
    description: Telnyx webhook callbacks for SMS delivery status updates.
  - name: Api::V1::WebsocketTicket
    x-displayName: WebSocket Tickets
    description: WebSocket authentication tickets for real-time update channels.
  - name: Api::V1::Whitelabel::Embed
    x-displayName: Embed
  - name: Api::V1::Whitelabel::Form
    x-displayName: Form
  - name: Api::V1::Whitelabel::Guest
    x-displayName: Guest
  - name: Api::V1::Whitelabel::Intake
    x-displayName: Intake
  - name: Api::V1::Whitelabel::ProviderIntake
    x-displayName: ProviderIntake
paths:
  /api/v1/admin/form_templates:
    post:
      tags:
        - Api::V1::Admin::FormTemplate
      summary: Create form template
      description: Creates a new form template.
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                form_template:
                  type: object
                  properties:
                    form_type:
                      type: string
                    name:
                      type: string
                    description:
                      type: string
                    validity_days:
                      type: string
                    active:
                      type: string
                    docuseal_template_id:
                      type: string
                    conditional_requirements:
                      type: array
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                          name:
                            type: string
                          requirement_type:
                            type: string
                          condition:
                            type: object
                            properties:
                              operator:
                                type: string
                              rules:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    field:
                                      type: string
                                    operator:
                                      type: string
                                    value:
                                      type: string
                                  required:
                                    - field
                                    - operator
                                    - value
                            required:
                              - operator
                              - rules
                          requirement_config:
                            type: object
                            properties:
                              role:
                                type: string
                              label:
                                type: string
                            required:
                              - label
                              - role
                        required:
                          - condition
                          - id
                          - name
                          - requirement_config
                          - requirement_type
                  required:
                    - active
                    - description
                    - form_type
                    - name
                    - validity_days
              required:
                - form_template
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  active:
                    type: boolean
                  conditional_requirements:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                        requirement_type:
                          type: string
                        condition:
                          type: object
                          properties:
                            operator:
                              type: string
                            rules:
                              type: array
                              items:
                                type: object
                                properties:
                                  field:
                                    type: string
                                  operator:
                                    type: string
                                  value:
                                    type: string
                                required:
                                  - field
                                  - operator
                                  - value
                          required:
                            - operator
                            - rules
                        requirement_config:
                          type: object
                          properties:
                            role:
                              type: string
                            label:
                              type: string
                          required:
                            - label
                            - role
                      required:
                        - condition
                        - id
                        - name
                        - requirement_config
                        - requirement_type
                  created_at:
                    type: string
                  delivery_instructions:
                    type: object
                    properties: {}
                  delivery_instructions_extracted_at:
                    type:
                      - string
                      - 'null'
                  delivery_instructions_reviewed_at:
                    type:
                      - string
                      - 'null'
                  delivery_instructions_status:
                    type: string
                    enum:
                      - not_extracted
                      - ai_extracted
                      - admin_reviewed
                      - confirmed
                  description:
                    type: string
                  docuseal_fields:
                    type: array
                    items:
                      type: object
                  docuseal_template_id:
                    type:
                      - string
                      - 'null'
                  field_mappings:
                    type: object
                    properties: {}
                  form_type:
                    type: string
                    enum:
                      - hipaa_release
                      - delegation_of_representative
                      - insurer_specific
                      - provider_release
                      - dmhc_imr
                      - limited_poa_external_review
                  insurer_id:
                    type:
                      - string
                      - 'null'
                  is_entity_specific:
                    type: boolean
                  is_generic:
                    type: boolean
                  mapping_complete:
                    type: boolean
                  mapping_status:
                    type: string
                    enum:
                      - draft
                      - pending_review
                      - cleared
                      - active
                  mapping_verified_at:
                    type:
                      - string
                      - 'null'
                  mapping_verified_by_id:
                    type:
                      - string
                      - 'null'
                  name:
                    type: string
                  organization_id:
                    type:
                      - string
                      - 'null'
                  provider_id:
                    type:
                      - string
                      - 'null'
                  required_fields:
                    type: array
                    items:
                      type: object
                  state_code:
                    type:
                      - string
                      - 'null'
                  updated_at:
                    type: string
                  validity_days:
                    type: integer
                required:
                  - active
                  - conditional_requirements
                  - created_at
                  - delivery_instructions
                  - delivery_instructions_extracted_at
                  - delivery_instructions_reviewed_at
                  - delivery_instructions_status
                  - description
                  - docuseal_fields
                  - docuseal_template_id
                  - field_mappings
                  - form_type
                  - id
                  - insurer_id
                  - is_entity_specific
                  - is_generic
                  - mapping_complete
                  - mapping_status
                  - mapping_verified_at
                  - mapping_verified_by_id
                  - name
                  - organization_id
                  - provider_id
                  - required_fields
                  - state_code
                  - updated_at
                  - validity_days
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: string
                required:
                  - errors

````