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

# Webhook SalesForce (Carta de Serviços)

> Recebe notificações de criação/atualização. Valida HMAC-SHA256 via X-Salesforce-Signature. Usa sobject.Slug (ou Id como fallback) como identificador do serviço na API CloudHub. Sem SALESFORCE_WEBHOOK_SECRET retorna 401. Payload > 64KiB retorna 413.



## OpenAPI

````yaml https://raw.githubusercontent.com/prefeitura-rio/app-catalogo/refs/heads/main/docs/openapi-v3.json post /api/webhooks/salesforce
openapi: 3.0.0
info:
  description: >-
    Discovery layer unificada da Prefeitura do Rio de Janeiro. Indexa serviços
    públicos, cursos, vagas e oportunidades MEI com busca full-text e
    recomendação personalizada por perfil de cidadão.
  title: app-catalogo
  contact:
    name: Prefeitura do Rio de Janeiro
    url: https://github.com/prefeitura-rio/app-catalogo
  version: '1.0'
servers:
  - url: https://services.staging.app.dados.rio/catalogo
    description: Staging
  - url: https://services.pref.rio/catalogo
    description: Produção
security: []
paths:
  /api/webhooks/salesforce:
    post:
      tags:
        - webhooks
      summary: Webhook SalesForce (Carta de Serviços)
      description: >-
        Recebe notificações de criação/atualização. Valida HMAC-SHA256 via
        X-Salesforce-Signature. Usa sobject.Slug (ou Id como fallback) como
        identificador do serviço na API CloudHub. Sem SALESFORCE_WEBHOOK_SECRET
        retorna 401. Payload > 64KiB retorna 413.
      parameters:
        - description: HMAC-SHA256 do body em hex
          name: X-Salesforce-Signature
          in: header
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1.sfWebhookPayload'
        description: Payload do evento
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string
        '413':
          description: Request Entity Too Large
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string
components:
  schemas:
    v1.sfWebhookPayload:
      type: object
      properties:
        event:
          type: object
          properties:
            created:
              type: string
              example: '2026-04-08T10:00:00Z'
            type:
              type: string
              example: updated
        sobject:
          type: object
          properties:
            Id:
              type: string
              example: a001Q000003ABCDE
            Slug:
              type: string
              example: iptu-cobranca
            type:
              type: string
              example: Servico__c

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.