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

# Post Naics Prediction Request

> Submit an ad-hoc NAICS code prediction request.



## OpenAPI

````yaml /api-reference/openapi.json post /naics_prediction_requests
openapi: 3.1.0
info:
  title: baselayer-api-service
  version: 0.1.0
servers:
  - url: https://api.baselayer.com/
security: []
paths:
  /naics_prediction_requests:
    post:
      tags:
        - Industry Prediction
      summary: Post Naics Prediction Request
      description: Submit an ad-hoc NAICS code prediction request.
      operationId: post_naics_prediction_request_naics_prediction_requests_post
      parameters:
        - name: Prefer
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Request execution preference (RFC 7240). Use ``respond-async`` for
              asynchronous execution, ``wait=N`` to specify a synchronous
              timeout hint in seconds, or ``priority=low`` to route the task to
              the low-priority queue.
            examples:
              - respond-async
              - wait=30
              - priority=low
            title: Prefer
          description: >-
            Request execution preference (RFC 7240). Use ``respond-async`` for
            asynchronous execution, ``wait=N`` to specify a synchronous timeout
            hint in seconds, or ``priority=low`` to route the task to the
            low-priority queue.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1.AdHocNAICSPredictionRequest'
      responses:
        '201':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1.PredictedNaicsRequestResponse'
            application/vnd.baselayer.v1+json:
              schema:
                $ref: '#/components/schemas/v1.PredictedNaicsRequestResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    v1.AdHocNAICSPredictionRequest:
      properties:
        name:
          type: string
          title: Name
          description: The name of the business.
        address:
          type: string
          title: Address
          description: The address of the business.
        alternative_names:
          anyOf:
            - items:
                type: string
              type: array
              maxItems: 10
              uniqueItems: true
            - type: 'null'
          title: Alternative Names
          description: Alternative names for the business (e.g., DBA names)
        officer_names:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Officer Names
          description: List of business officers' names.
        website:
          anyOf:
            - type: string
              maxLength: 2083
            - type: 'null'
          title: Website
          description: The website URL associated with the business.
        phone_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone Number
          description: A phone number associated with the business.
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: An email address associated with the business.
        reference_id:
          anyOf:
            - maxLength: 128
              type: string
            - type: 'null'
          title: Reference Id
          description: An optional reference ID to associate with the request.
      additionalProperties: false
      type: object
      required:
        - name
        - address
      title: AdHocNAICSPredictionRequest (v1)
      description: Request model for ad-hoc NAICS code prediction.
    v1.PredictedNaicsRequestResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: Unique identifier for the NAICS prediction request.
          examples:
            - 25c3910b-5423-46fb-bbe2-63b9a639f034
        state:
          $ref: '#/components/schemas/TaskState'
          description: The status of the NAICS prediction request
          examples:
            - COMPLETED
            - FAILED
        business_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Business Id
          description: The ID of the business for which the NAICS code was predicted.
          examples:
            - 4099bc48-3ad9-46c2-99a2-c864a6ac0208
        business_search_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Business Search Id
          description: >-
            The ID of the business search from which this NAICS prediction
            request originated.
          examples:
            - 98e11f83-e0a0-4ef9-8001-d39be1c00f25
        predicted_naics:
          anyOf:
            - $ref: '#/components/schemas/v1.PredictedNaicsResponse'
            - type: 'null'
          description: The predicted NAICS code(s) for the business entity.
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: Any errors that occurred during the NAICS prediction request.
        reference_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Reference Id
          description: >-
            An optional reference ID associated with this request, inherited
            from the parent search.
          examples:
            - Search1234
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The date and time when the NAICS prediction request was created.
          examples:
            - '2026-08-31T10:31:07.747451'
      type: object
      required:
        - id
        - state
        - created_at
      title: PredictedNaicsRequestResponse (v1)
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TaskState:
      enum:
        - PENDING
        - EXECUTING
        - COMPLETED
        - FAILED
        - CANCELLED
      title: TaskState
      type: string
    v1.PredictedNaicsResponse:
      properties:
        code:
          description: The predicted NAICS code for the business.
          examples:
            - '336111'
          title: Code
          type: string
        title:
          description: The title of the predicted NAICS code.
          examples:
            - Automobile Manufacturing
          title: Title
          type: string
        accuracy:
          anyOf:
            - type: number
            - type: 'null'
          default: null
          description: The accuracy of the NAICS code prediction.
          examples:
            - 1
            - 0.4
          title: Accuracy
        keywords:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          description: >-
            Any keywords associated with the NAICS code to indicate area of
            business activity.
          examples:
            - - Automobiles
              - Manufacturing
              - Cars
              - Trucks
          title: Keywords
        mcc_codes:
          anyOf:
            - items:
                $ref: '#/components/schemas/v1.MCC'
              type: array
            - type: 'null'
          default: null
          description: List of MCC codes associated with the NAICS code.
          title: Mcc Codes
        sic_codes:
          anyOf:
            - items:
                $ref: '#/components/schemas/v1.SICCode'
              type: array
            - type: 'null'
          default: null
          description: List of SIC codes associated with the NAICS code.
          title: Sic Codes
        risk_level:
          anyOf:
            - $ref: '#/components/schemas/v1.RiskLevel'
            - type: 'null'
          default: null
          description: The risk level associated with the NAICS code.
          examples:
            - low
            - medium
            - high
        reasoning:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            Explanation of why this specific NAICS code was chosen for the
            business.
          examples:
            - >-
              Based on homepage content mentioning automobile manufacturing and
              assembly processes.
            - >-
              Reviews and social profiles consistently reference restaurant and
              food service operations.
          title: Reasoning
      required:
        - code
        - title
      title: PredictedNaicsResponse (v1)
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    v1.MCC:
      description: Represents a Merchant Category Code (MCC).
      properties:
        code:
          description: The 4-digit MCC.
          title: Code
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Description of the MCC.
          title: Description
        mastercard_risk:
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
          description: >-
            Indicates if there is a risk associated with Mastercard
            transactions.
          title: Mastercard Risk
        visa_risk_tier:
          anyOf:
            - $ref: '#/components/schemas/v1.VisaRiskTier'
            - type: 'null'
          default: null
          description: The Visa risk tier associated with this MCC.
      required:
        - code
      title: MCC
      type: object
    v1.SICCode:
      description: Represents a Standard Industrial Classification (SIC) code.
      properties:
        code:
          description: The 4-digit SIC code.
          title: Code
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Description of the SIC code.
          title: Description
      required:
        - code
      title: SICCode
      type: object
    v1.RiskLevel:
      enum:
        - high
        - medium
        - low
        - no_risk
      title: RiskLevel
      type: string
    v1.VisaRiskTier:
      enum:
        - 1
        - 2
        - 3
      title: VisaRiskTier
      type: integer
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````