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

# Regenerar signing secret

> Gera um novo signingSecret para sua integração

<Warning>
  Ao regenerar o signing secret, o secret anterior é invalidado imediatamente.
</Warning>

## Descrição

Gera um novo `signingSecret` para a integração do projeto indicado. O secret anterior é invalidado de forma imediata no momento da regeneração.

## Endpoint

```
POST https://gateway.jelou.ai/platform/v1/external-support/{projectId}/secret/regenerate
```

## Parâmetros de rota

<ParamField path="projectId" type="string" required>
  Identificador único do projeto Jelou cujo signing secret se deseja regenerar.
</ParamField>

## Autenticação

Todas as requisições devem incluir o cabeçalho `x-api-key` com a API key do projeto Jelou.

```
x-api-key: API_KEY
```

## Exemplo de requisição

O exemplo a seguir regenera o signing secret do projeto `PROJECT_ID`. Nenhum corpo é enviado na requisição:

```bash cURL theme={null}
curl --request POST \
  --url https://gateway.jelou.ai/platform/v1/external-support/PROJECT_ID/secret/regenerate \
  --header 'x-api-key: API_KEY'
```

## Respostas

| Código | Status                | Descrição                                                             |
| ------ | --------------------- | --------------------------------------------------------------------- |
| 200    | OK                    | Signing secret regenerado com sucesso. Inclui o novo `signingSecret`. |
| 401    | Unauthorized          | Credenciais de autenticação inválidas ou ausentes.                    |
| 404    | Not Found             | Não existe uma integração para o `projectId` indicado.                |
| 500    | Internal Server Error | Erro interno do servidor.                                             |

## Exemplo de resposta

```json theme={null}
{
  "message": [
    "Signing secret regenerated successfully"
  ],
  "statusMessage": "success",
  "status": 1,
  "data": {
    "brainId": "PROJECT_ID",
    "signingSecret": "SIGNING_SECRET"
  }
}
```

## Considerações de segurança

* Armazene o novo `signingSecret` com segurança (variáveis de ambiente, vault, etc.).
* O secret é exibido apenas na resposta de criação e regeneração; não pode ser recuperado posteriormente.


## OpenAPI

````yaml POST /v1/external-support/{projectId}/secret/regenerate
openapi: 3.1.0
info:
  title: Jelou API
  description: >-
    API for the Jelou platform. Send messages, manage campaigns, handle
    conversations, users, databases, and widgets.
  version: 1.0.0
servers:
  - url: https://api.jelou.ai
    description: Production server
security:
  - basicAuth: []
tags:
  - name: Messages
    description: Send messages to users
  - name: Campaigns
    description: HSM campaigns and templates
  - name: Conversations
    description: Chat history and metrics
  - name: Users
    description: User state and cache management
  - name: Resources
    description: Media resource management
  - name: Datum
    description: Database CRUD operations
  - name: Widget
    description: Widget and room management
  - name: PMA Custom
    description: External support panel integration
paths:
  /v1/external-support/{projectId}/secret/regenerate:
    servers:
      - url: https://gateway.jelou.ai/platform
        description: External Support Panel API
    post:
      tags:
        - External Support Panel
      summary: Regenerate Signing Secret
      description: >-
        Generate a new signingSecret for the integration. The previous secret
        becomes invalid immediately.
      operationId: regenerateExternalSupportSecret
      parameters:
        - name: projectId
          in: path
          required: true
          description: Unique identifier of the Jelou project
          schema:
            type: string
      responses:
        '200':
          description: Signing secret regenerated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegenerateSecretResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - apiKey: []
components:
  schemas:
    RegenerateSecretResponse:
      type: object
      properties:
        signingSecret:
          type: string
          example: e5f6g7h8...new_signing_secret_hex
        regeneratedAt:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        message:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        statusMessage:
          type: string
        status:
          type: integer
        error:
          type: object
          properties:
            code:
              type: string
            key:
              type: string
            description:
              type: string
            developerMessages:
              type: object
            clientMessages:
              type: object
        validationError:
          type: object
  responses:
    Unauthorized:
      description: Unauthorized - Invalid authentication credentials
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Not found - Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: Basic authentication using Base64 encoded clientId:clientSecret
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: API key del proyecto de Jelou

````