---
title: "Primeros pasos con la API de Flowsery Analytics"
description: "La API de Flowsery Analytics te da acceso programático a tus datos de analítica: desde objetivos personalizados hasta detalles de visitantes e ingresos."
url: "https://flowsery.com/es/docs/api-introduction"
---

# Primeros pasos con la API de Flowsery Analytics

La API de Flowsery Analytics te permite acceder programáticamente a tus datos de analítica -- desde el seguimiento de objetivos personalizados hasta la obtención de detalles de visitantes y más.

## 1. Create an API token or website key

Create a **workspace API token** from the workspace **API Tokens** page when you need programmatic access across every website in your workspace, including MCP and OpenClaw integrations. Workspace tokens use the `flow_ws_` prefix.

Create a **website API key** from a website's **Settings > API** page when you only need server-to-server access for one website, such as custom payment or goal tracking. Website keys use the `flow_` prefix.

Copy new secrets immediately because they are shown only once. Treat them like passwords: store them securely and never expose them in client-side code or public repositories.

## 2. Authenticate your requests

Every API call must include the `Authorization` header using the Bearer scheme. Substitute `YOUR_API_TOKEN` with the token or key you created.

`Authorization: Bearer YOUR_API_TOKEN`

## 3. Choose a website for workspace tokens

The base URL for all v1 endpoints is:
`https://analytics.flowsery.com/analytics/api/v1/`

When you authenticate with a workspace token, call [List websites](https://flowsery.com/docs/api-websites) first. Then pass either `websiteId` or `domain` to endpoint requests. For `GET` and `DELETE` endpoints, pass the selector as a query parameter. For `POST` endpoints such as goals and payments, pass it in the JSON body.

Website API keys are already scoped to one website, so they do not require `websiteId` or `domain`.

Here are a few common use cases to get you started:

- [List websites](https://flowsery.com/docs/api-websites)
- [Track a custom goal](https://flowsery.com/docs/api-create-goal)
- [Fetch visitor details](https://flowsery.com/docs/api-get-visitor)
- [Retrieve time series data](https://flowsery.com/docs/api-timeseries)

---

**Las respuestas exitosas** devuelven un estado `200 OK` con un cuerpo estructurado como:

```json
{
  "status": "success",
  "data": { ... }
}
```

**Las respuestas de error** devuelven el código de estado HTTP correspondiente (4xx o 5xx) con un cuerpo como:

```json
{
  "status": "error",
  "error": {
    "code": HTTP_STATUS_CODE,
    "message": "A descriptive error message"
  }
}
```

Códigos de error estándar:

- `400 Bad Request`: La entrada no es válida o faltan parámetros obligatorios.
- `401 Unauthorized`: La clave de API falta o no es válida.
- `404 Not Found`: El recurso solicitado no existe (p. ej., visitante desconocido).
- `500 Internal Server Error`: Ocurrió un problema inesperado en el servidor.
