> ## 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

> Genera un nuevo signingSecret para tu integración

<Warning>
  Al regenerar el signing secret, el secret anterior deja de ser válido inmediatamente.
</Warning>

## Descripción

Genera un nuevo `signingSecret` para la integración del proyecto indicado. El secret anterior queda invalidado de forma inmediata en el momento de la regeneración.

## Endpoint

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

## Parámetros de ruta

<ParamField path="projectId" type="string" required>
  Identificador único del proyecto de Jelou cuyo signing secret se desea regenerar.
</ParamField>

## Autenticación

Todas las peticiones deben incluir el encabezado `x-api-key` con la API key del proyecto de Jelou.

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

## Ejemplo de solicitud

El siguiente ejemplo regenera el signing secret del proyecto `PROJECT_ID`. No se envía cuerpo en la petición:

```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'
```

## Respuestas

| Código | Estado                | Descripción                                                               |
| ------ | --------------------- | ------------------------------------------------------------------------- |
| 200    | OK                    | Signing secret regenerado exitosamente. Incluye el nuevo `signingSecret`. |
| 401    | Unauthorized          | Credenciales de autenticación inválidas o faltantes.                      |
| 404    | Not Found             | No existe una integración para el `projectId` indicado.                   |
| 500    | Internal Server Error | Error interno del servidor.                                               |

## Ejemplo de respuesta

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

## Consideraciones de seguridad

* Guarda el nuevo `signingSecret` de forma segura (variables de entorno, vault, etc.).
* El secret solo se muestra en la respuesta de creación y regeneración; no puede recuperarse después.


## 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

````