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

# Publicar evento

> Status → published (espelha o painel)



## OpenAPI

````yaml /openapi.json post /events/{event}/publish
openapi: 3.1.0
info:
  title: Eventor Management API v1
  version: 1.0.0
  description: >-
    Management API do Eventor (Fase 9) — configuração de evento ponta a ponta
    por agente/CLI. Autenticação: `Authorization: Bearer <api_key>` com escopo
    `manage`.


    Envelope de sucesso: `{data}` (item) e `{data,meta,links}` (coleção
    paginada).

    Envelope de erro: `{error,message,details}`.
servers:
  - url: http://localhost/api/v1
security:
  - bearerAuth: []
paths:
  /events/{event}/publish:
    post:
      tags:
        - Events
      summary: Publicar evento
      description: Status → published (espelha o painel)
      operationId: events.publish
      parameters:
        - name: event
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: '`JsonResource`'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/EventResource'
                required:
                  - data
        '401':
          description: API key ausente ou inválida.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '403':
          description: A API key não tem o escopo `manage`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: Recurso não encontrado neste hub.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '409':
          description: 'Conflito (ex.: dependência que impede a operação).'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '422':
          description: Falha de validação dos dados enviados.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
components:
  schemas:
    EventResource:
      type: object
      properties:
        id:
          type: integer
        code:
          type: string
        name:
          type: string
        status:
          type: string
        date:
          type: string
        city:
          type:
            - string
            - 'null'
        state:
          type:
            - string
            - 'null'
        document:
          type:
            - string
            - 'null'
        organizer_id:
          type:
            - integer
            - 'null'
        hub_unit_id:
          type:
            - integer
            - 'null'
        salesperson_person_id:
          type:
            - integer
            - 'null'
        expected_athletes:
          type:
            - integer
            - 'null'
        bib_count:
          type: integer
        tag_count:
          type: integer
        paid_tag_base_count:
          type: integer
        difficulty_grade:
          type:
            - string
            - 'null'
        technical_description:
          type:
            - string
            - 'null'
        commercial_description:
          type:
            - string
            - 'null'
        regulation:
          type:
            - string
            - 'null'
        regulation_acceptance_required:
          type: boolean
        regulation_extra_text:
          type:
            - string
            - 'null'
        has_cronoself:
          type: boolean
          description: Extensões/serviços
        has_qrcode_list:
          type: boolean
        has_medrace:
          type: boolean
        registration_support_whatsapp:
          type:
            - string
            - 'null'
        certificate_enabled:
          type: boolean
        sales_mode:
          type: string
          description: Config de venda
        external_registration_url:
          type:
            - string
            - 'null'
        is_free:
          type: boolean
        registration_open:
          type: boolean
        registration_opens_at:
          type: string
        registration_closes_at:
          type: string
        max_registrations:
          type:
            - integer
            - 'null'
        hub_fee_percent:
          type:
            - string
            - 'null'
        service_fee_cents:
          type: integer
        service_fee_mode:
          type: string
        refund_window_days:
          type:
            - integer
            - 'null'
        refund_summary:
          type:
            - string
            - 'null'
        logo_url:
          type: string
          description: Mídia
        banner_url:
          type: string
        regulation_pdf_url:
          type: string
        pipeline_stage_id:
          type:
            - integer
            - 'null'
          description: Pipeline
        organizer:
          type: object
          description: Relações (só quando carregadas via with())
          properties:
            id:
              type: integer
            name:
              type: string
          required:
            - id
            - name
        races:
          type: array
          items:
            $ref: '#/components/schemas/RaceResource'
        batches:
          type: array
          items:
            $ref: '#/components/schemas/RegistrationBatchResource'
        counters:
          type: object
          properties:
            registrations:
              type:
                - string
                - 'null'
            results:
              type:
                - string
                - 'null'
          required:
            - registrations
            - results
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - code
        - name
        - status
        - date
        - city
        - state
        - document
        - organizer_id
        - hub_unit_id
        - salesperson_person_id
        - expected_athletes
        - bib_count
        - tag_count
        - paid_tag_base_count
        - difficulty_grade
        - technical_description
        - commercial_description
        - regulation
        - regulation_acceptance_required
        - regulation_extra_text
        - has_cronoself
        - has_qrcode_list
        - has_medrace
        - registration_support_whatsapp
        - certificate_enabled
        - sales_mode
        - external_registration_url
        - is_free
        - registration_open
        - registration_opens_at
        - registration_closes_at
        - max_registrations
        - hub_fee_percent
        - service_fee_cents
        - service_fee_mode
        - refund_window_days
        - refund_summary
        - logo_url
        - banner_url
        - regulation_pdf_url
        - pipeline_stage_id
        - created_at
        - updated_at
      title: EventResource
    ApiError:
      type: object
      properties:
        error:
          type: string
          description: >-
            Código machine-parseable (ex.: validation_failed, forbidden_scope,
            not_found).
        message:
          type: string
          description: Mensagem legível (português).
        details:
          type:
            - object
            - 'null'
          description: 'Detalhes opcionais (ex.: erros de validação por campo).'
          additionalProperties: {}
      required:
        - error
        - message
      title: ApiError
    RaceResource:
      type: object
      properties:
        id:
          type: integer
        event_id:
          type: integer
        code:
          type: string
        name:
          type: string
        distance:
          type:
            - number
            - 'null'
        distance_label:
          type:
            - string
            - 'null'
        sort_order:
          type:
            - integer
            - 'null'
        starts_at:
          type: string
        type:
          type:
            - string
            - 'null'
        scoring_type:
          type: string
        duration_minutes:
          type:
            - integer
            - 'null'
        lap_count:
          type:
            - integer
            - 'null'
        lap_distance:
          type:
            - number
            - 'null'
        registration_limit:
          type:
            - integer
            - 'null'
        sem_classificacao:
          type: boolean
        status:
          type: string
        results_status:
          type: string
        modalities:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              name:
                type: string
              is_default:
                type: boolean
            required:
              - id
              - name
              - is_default
        categories:
          type: array
          items:
            $ref: '#/components/schemas/CategoryResource'
        prize_rules:
          type: array
          items:
            $ref: '#/components/schemas/PrizeRuleResource'
        categories_count:
          type: string
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - event_id
        - code
        - name
        - distance
        - distance_label
        - sort_order
        - starts_at
        - type
        - scoring_type
        - duration_minutes
        - lap_count
        - lap_distance
        - registration_limit
        - sem_classificacao
        - status
        - results_status
        - created_at
        - updated_at
      title: RaceResource
    RegistrationBatchResource:
      type: object
      properties:
        id:
          type: integer
        event_id:
          type: integer
        name:
          type: string
        starts_at:
          type: string
        ends_at:
          type: string
        includes_kit:
          type: boolean
        max_quantity:
          type:
            - integer
            - 'null'
        quantity_sold:
          type: integer
        quantity_reserved:
          type: integer
        is_active:
          type: boolean
        installments_enabled:
          type: boolean
        max_installments:
          type: integer
        absorb_installment_interest:
          type: boolean
        sort_order:
          type: integer
        race_prices:
          type: array
          description: >-
            { race_id: price_cents } — única fonte de preço E cobertura do
            ingresso.
          items: {}
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - event_id
        - name
        - starts_at
        - ends_at
        - includes_kit
        - max_quantity
        - quantity_sold
        - quantity_reserved
        - is_active
        - installments_enabled
        - max_installments
        - absorb_installment_interest
        - sort_order
        - race_prices
        - created_at
        - updated_at
      title: RegistrationBatchResource
    CategoryResource:
      type: object
      properties:
        id:
          type: integer
        race_id:
          type: integer
        event_id:
          type:
            - integer
            - 'null'
        name:
          type: string
        type:
          type: string
        modality_id:
          type:
            - integer
            - 'null'
        category_group_id:
          type:
            - string
            - 'null'
        sex:
          type:
            - string
            - 'null'
        age_min:
          type:
            - integer
            - 'null'
        age_max:
          type:
            - integer
            - 'null'
        award_count:
          type: integer
        is_pwd:
          type: boolean
        is_team:
          type: boolean
        sort_order:
          type:
            - integer
            - 'null'
        status:
          type: string
        modality:
          type: object
          properties:
            id:
              type: integer
            name:
              type: string
          required:
            - id
            - name
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - race_id
        - event_id
        - name
        - type
        - modality_id
        - category_group_id
        - sex
        - age_min
        - age_max
        - award_count
        - is_pwd
        - is_team
        - sort_order
        - status
        - created_at
        - updated_at
      title: CategoryResource
    PrizeRuleResource:
      type: object
      properties:
        id:
          type: integer
        race_id:
          type: integer
        event_id:
          type: integer
        seq:
          type: integer
        modality_id:
          type:
            - integer
            - 'null'
        ranking_type:
          type: string
        ranking_cut:
          type: integer
        gender_filter:
          type:
            - string
            - 'null'
        pne_filter:
          type:
            - string
            - 'null'
        dupla_prem:
          type:
            - array
            - 'null'
          items: {}
        tipo_premiacao:
          type: string
        eqp_apuracao:
          type:
            - string
            - 'null'
        eqp_n_melhores:
          type:
            - integer
            - 'null'
        eqp_base_ranking:
          type:
            - string
            - 'null'
        status:
          type: string
        modality:
          type: object
          properties:
            id:
              type: integer
            name:
              type: string
          required:
            - id
            - name
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - race_id
        - event_id
        - seq
        - modality_id
        - ranking_type
        - ranking_cut
        - gender_filter
        - pne_filter
        - dupla_prem
        - tipo_premiacao
        - eqp_apuracao
        - eqp_n_melhores
        - eqp_base_ranking
        - status
        - created_at
        - updated_at
      title: PrizeRuleResource
  securitySchemes:
    bearerAuth:
      type: http
      description: >-
        API key do hub com escopo `manage`. Header: `Authorization: Bearer
        <api_key>`.
      scheme: bearer

````