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

# Create opportunity

> Creates an opportunity in a pipeline and resolves related account, primary contact, additional contacts, owner, and stage from the supplied identifiers.



## OpenAPI

````yaml post /v1/opportunities
openapi: 3.1.0
info:
  title: Octolane Public API
  version: 1.0.0
  description: >-
    OpenAPI specification for Octolane public APIs. These endpoints let external
    systems read CRM data and create or update accounts, contacts,
    opportunities, notes, and activities through the public API gateway.
  contact:
    name: Octolane
    url: https://octolane.com
servers:
  - url: https://api.octolane.com
    description: Public API gateway
security:
  - ApiKeyAuth: []
tags:
  - name: CRM
    description: >-
      Public endpoints for creating, bulk creating, listing, searching, and
      updating CRM data.
paths:
  /v1/opportunities:
    post:
      tags:
        - CRM
      summary: Create opportunity
      description: >-
        Creates an opportunity in a pipeline and resolves related account,
        primary contact, additional contacts, owner, and stage from the supplied
        identifiers.
      operationId: createOpportunityV1
      requestBody:
        required: true
        description: Opportunity payload.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpportunityInput'
      responses:
        '200':
          description: Opportunity was created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '201':
          description: Opportunity was created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '400':
          description: The request failed validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: >-
            The API key is missing, invalid, or not allowed to access this
            route.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: The route rate limit was exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    OpportunityInput:
      type: object
      required:
        - pipeline_id
        - opportunity
        - related_objects
      properties:
        pipeline_id:
          type: string
          format: uuid
          description: Target pipeline ID.
          example: 018f13b3-8239-7ef8-a8f1-93ad10b76110
        opportunity:
          $ref: '#/components/schemas/OpportunityFields'
        related_objects:
          $ref: '#/components/schemas/OpportunityRelatedObjects'
      additionalProperties: true
    ApiResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
        data:
          description: Endpoint-specific response payload.
      additionalProperties: true
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          example: Validation failed
        statusCode:
          type: integer
          example: 400
      additionalProperties: true
    OpportunityFields:
      type: object
      properties:
        name:
          type:
            - string
            - 'null'
          description: Opportunity name. Derived if omitted.
        stage_id:
          type:
            - string
            - 'null'
          format: uuid
        stage_name:
          type:
            - string
            - 'null'
          description: Stage label fallback.
        deal_size:
          type:
            - number
            - 'null'
        close_date:
          type:
            - integer
            - 'null'
          description: Unix timestamp in seconds.
        next_action_date:
          type:
            - integer
            - 'null'
          description: Unix timestamp in seconds.
        next_steps:
          type:
            - string
            - 'null'
        custom_attributes:
          type: object
          additionalProperties:
            type:
              - string
              - number
              - boolean
              - 'null'
      additionalProperties: true
    OpportunityRelatedObjects:
      type: object
      properties:
        account_domain:
          type:
            - string
            - 'null'
          example: acme.com
        primary_contact_email:
          type:
            - string
            - 'null'
          format: email
        additional_contact_emails:
          type:
            - array
            - 'null'
          items:
            type: string
            format: email
        owner_email:
          type:
            - string
            - 'null'
          format: email
        owner_id:
          type:
            - string
            - 'null'
          format: uuid
      additionalProperties: false
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Public API key for the Octolane organization.

````