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

# Criação de origem de oportunidade

> Adiciona nova origem de oportunidade



## OpenAPI

````yaml /api-reference/oportunidades.yaml post /opportunity-source
openapi: 3.0.4
info:
  title: API de Oportunidades
  description: API de integração de Oportunidades.
  contact:
    email: ti@fretatech.com.br
  version: 1.0.0
servers:
  - url: https://fretatech.com.br/api
security: []
tags:
  - name: Oportunidades
    description: Operações com oportunidades
  - name: Origens de Oportunidades
    description: Operações com origens de oportunidades
paths:
  /opportunity-source:
    post:
      tags:
        - Origens de Oportunidades
      summary: Criação de origem de oportunidade
      description: Adiciona nova origem de oportunidade
      operationId: createOpportunitySource
      requestBody:
        description: Adiciona nova origem de oportunidade
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpportunitySourceRequest'
        required: true
      responses:
        '201':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpportunitySourceResponse'
        '422':
          description: Validation exception or source already exists
          content:
            application/json:
              schema:
                type: object
                properties:
                  msg:
                    type: string
                    example: Já existe uma origem com este nome
                  error:
                    type: string
                    example: source_already_exists
                  source:
                    $ref: '#/components/schemas/OpportunitySource'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    OpportunitySourceRequest:
      type: object
      properties:
        name:
          type: string
          example: Website
          description: Nome da origem
        description:
          type: string
          example: Oportunidades vindas do website
          nullable: true
          description: Descrição da origem
      required:
        - name
      xml:
        name: opportunitySourceRequest
    OpportunitySourceResponse:
      type: object
      properties:
        msg:
          type: string
          example: Origem criada com sucesso
        source:
          $ref: '#/components/schemas/OpportunitySource'
      xml:
        name: opportunitySourceResponse
    OpportunitySource:
      type: object
      properties:
        id:
          type: integer
          format: int64
          example: 1
        name:
          type: string
          example: Website
        slug:
          type: string
          example: website
        description:
          type: string
          example: Oportunidades vindas do website
          nullable: true
      xml:
        name: opportunitySource
    Error:
      type: object
      properties:
        msg:
          type: string
          example: Erro interno no servidor
        error:
          type: string
          example: Internal Server Error
      xml:
        name: error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````