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

# Datastore - Generate Upload Link

Genera un URL prefirmado de S3 (válido por **15 minutos**) para subir un archivo directamente a S3 sin pasar por el servidor de Bravilo. Ideal para subidas grandes desde el cliente.

> Si el datastore es **público**, no se requiere token de autorización.

### Ejemplo

```bash theme={null}
curl -X POST https://app.braviloai.com/api/external/datastores/file-upload/generate-link/${datastoreId} \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"fileName": "mi-documento.pdf",
"type": "application/pdf"
}'
```

Después de subir a S3, llamá a `/api/external/datastores/file-upload/process/{id}` para iniciar el procesamiento.


## OpenAPI

````yaml POST /external/datastores/file-upload/generate-link/{id}
openapi: 3.0.1
info:
  title: Bravilo AI.ai - API OpenAPI specifications
  description: ''
  termsOfService: http://braviloai.com/terms
  contact:
    email: support@braviloai.com
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.0
servers:
  - url: https://app.braviloai.com/api
security:
  - bearerAuth: []
tags:
  - name: agents
  - name: datastores
  - name: datasources
paths:
  /external/datastores/file-upload/generate-link/{id}:
    post:
      tags:
        - datastores
      summary: Genera un link prefirmado de S3 para subida directa
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ID del datastore
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                fileName:
                  type: string
                type:
                  type: string
                  description: MIME type del archivo
              required:
                - type
      responses:
        '200':
          description: Link generado exitosamente
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  link:
                    type: string
                    format: uri
        '401':
          description: Unauthorized
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````