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

# Update Series

Changes the next automatic folio of a series, in production and/or sandbox. The series name cannot be changed.

## Authentication

This endpoint requires authentication with a **user session** (Bearer token). API keys are not accepted on series routes.

* **Authorization**: `Bearer <token>`

## Path Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `organizationId` | string (UUID) | Yes | Organization ID |
| `series` | string | Yes | Series name (for example `FAC`) |

## Request Body

| Field | Type | Required | Description |
| - | - | - | - |
| `nextFolio` | integer | No | Next automatic folio in **production**. Minimum 1 |
| `nextFolioTest` | integer | No | Next automatic folio in **sandbox**. Minimum 1 |

Folios that are already used are skipped automatically, so moving the counter back never produces a duplicate: the next invoice takes the first free folio from that number on.

## Permissions

Only **OWNERS** and **ADMINS** can update series. Writes on a closed organization return `403 ORGANIZATION_CLOSED`.

## Example Request

```bash theme={null}
curl -X PUT https://api.timbrix.mx/organizations/550e8400-e29b-41d4-a716-446655440000/series/FAC \
  -H "Authorization: Bearer <your_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "nextFolioTest": 1
  }'
```

```typescript theme={null}
import { Timbrix } from "@timbrix/sdk"

const client = new Timbrix({ bearerToken: "<your_token>" })

const series = await client.series.update(
  "550e8400-e29b-41d4-a716-446655440000",
  "FAC",
  { nextFolioTest: 1 }
)
console.log(series)
```

## Example Response

```json theme={null}
{
  "series": "FAC",
  "nextFolio": 1523,
  "nextFolioTest": 1,
  "defaultFor": ["I"]
}
```

## Common Errors

### 400 Bad Request

A folio below 1 or not an integer.

### 401 Unauthorized

Authentication required.

### 403 Forbidden

Only owners and admins can update series, or the organization is closed (`ORGANIZATION_CLOSED`).

### 404 Not Found — `SERIES_NOT_FOUND`

The organization has no series with that name.

```json theme={null}
{
  "statusCode": 404,
  "message": "La serie FAC no existe. Créala en Configuración → Series y folios o manda el folio.",
  "error": "SERIES_NOT_FOUND"
}
```


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