---
title: "Valider les modifications de l’espace de travail"
description: "Enregistre toutes les modifications non validées de l’espace de travail dans une seule entrée d’historique, après vérification par le garde-fou de validation."
canonical: "https://atelier201.com/docs/fr/api/workspace/commit"
updated: "2026-11-06"
---

# Valider les modifications de l’espace de travail

Nécessite `sites:write`. Ne coûte aucun crédit. Le chemin se termine par `/workspace:commit`. Les changements ne concernent que le brouillon. Les visiteurs ne voient rien tant que vous n’avez pas [publié](/docs/api/publishing/publish).

Toutes les modifications non validées de l’espace de travail sont réunies dans une seule entrée d’historique, quel que soit le nombre de fichiers. `summary` est obligatoire et limité à 500 caractères : décrivez en une phrase ce que fait le changement. C’est ce texte qui apparaît dans l’historique.

Le même garde-fou s’applique que pour toute autre modification. La présence d’un secret, d’un fichier `.env`, de code serveur ou de JSON invalide entraîne un refus avec `400` et le motif ; rien n’est enregistré. Corrigez le fichier dans l’espace de travail, puis relancez la validation. Tous les problèmes sont répertoriés en même temps, avec le fichier et la ligne concernés.

Un fichier répertorié dans le `.gitignore` du projet (un `.env.local`, un fichier de clé) n’est jamais inclus dans une validation et n’est donc jamais refusé : il est exclu. Si un tel fichier semble contenir un secret, la réponse le signale dans `not_committed` avec un `warning` : il n’a pas été enregistré, n’est jamais transmis au site et disparaît au redémarrage de l’espace de travail.

S’il n’y a aucune modification non validée, l’appel réussit avec `changed: false` et ne crée pas d’entrée. Sinon, `revision` correspond à la nouvelle entrée, `parent` à celle qui la précède et `changes` aux chemins modifiés. Si une autre modification a été apportée au brouillon entre-temps, vos changements sont conservés et `note` le signale.

Ensuite, [lancez une compilation](/docs/api/builds/start) pour voir le résultat dans un aperçu.

```http
POST https://api.atelier201.com/v1/sites/{site_id}/workspace:commit
```

## Authorizations

- `Authorization` (bearer, in header, required)

## Path parameters

- `site_id` (`string`, required): L’identifiant du site ou son slug (l’adresse avant .atelier201.page).

## Body

`application/json`, required

- `summary` (`string`, required, length: `1–500 chars`): Ce que fait la modification, en une phrase : le texte de l’entrée d’historique que les utilisateurs consultent.

## Response

**201**: Valider les changements de l’espace de travail

- `data` (`object`, required)
- `data.revision` (`string`, required, length: `40–40 chars`): Un identifiant de commit Git (40 caractères hexadécimaux) du dépôt du site.
- `data.parent` (`string | null`, required)
- `data.changed` (`boolean`, required)
- `data.changes` (`object[]`, required)
- `data.changes.path` (`string`, required)
- `data.changes.action` (`string`, required)
- `data.note` (`string,null`, required)
- `data.build` (`object | null`, required): La génération démarrée (ou rejointe) par cette modification : l’aperçu la suit. Aucun appel à build_site n’est nécessaire.
- `data.build.id` (`string`, required)
- `data.build.state` (`string`, required)
- `data.build.next_action` (`string`, required)
- `data.not_committed` (`string[]`): Les fichiers susceptibles de contenir des secrets (.env.local, fichier de clé) que le `.gitignore` du projet exclut de tous les commits : ils ne sont jamais enregistrés ni rendus publics.
- `data.warning` (`string`): En une phrase, expliquez ce que signifie not_committed.
- `request_id` (`string`, required)

```json
{
  "data": {
    "revision": "<string>",
    "parent": "<string>",
    "changed": true,
    "changes": [
      {
        "path": "<string>",
        "action": "<string>"
      }
    ],
    "note": null,
    "build": {
      "id": "<string>",
      "state": "<string>",
      "next_action": "<string>"
    },
    "not_committed": [
      "<string>"
    ],
    "warning": "<string>"
  },
  "request_id": "<string>"
}
```

**400**: Codes possibles : invalid_request, unknown_field, invalid_parameter, invalid_cursor

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `error.details` (`Record<string, object>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>",
    "details": {}
  },
  "request_id": "<string>"
}
```

**401**: Codes possibles : authentication_required, invalid_api_key, api_key_expired, api_key_revoked

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `error.details` (`Record<string, object>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>",
    "details": {}
  },
  "request_id": "<string>"
}
```

**402**: Codes possibles : insufficient_credits

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `error.details` (`Record<string, object>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>",
    "details": {}
  },
  "request_id": "<string>"
}
```

**403**: Codes possibles : insufficient_scope, feature_not_available, admin_required

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `error.details` (`Record<string, object>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>",
    "details": {}
  },
  "request_id": "<string>"
}
```

**404**: Codes possibles : resource_not_found

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `error.details` (`Record<string, object>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>",
    "details": {}
  },
  "request_id": "<string>"
}
```

**409**: Codes possibles : conflict, result_not_ready, idempotency_key_reused

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `error.details` (`Record<string, object>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>",
    "details": {}
  },
  "request_id": "<string>"
}
```

**410**: Codes possibles : result_expired

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `error.details` (`Record<string, object>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>",
    "details": {}
  },
  "request_id": "<string>"
}
```

**413**: Codes possibles : request_too_large

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `error.details` (`Record<string, object>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>",
    "details": {}
  },
  "request_id": "<string>"
}
```

**422**: Codes possibles : request_too_large_for_plan

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `error.details` (`Record<string, object>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>",
    "details": {}
  },
  "request_id": "<string>"
}
```

**429**: Codes possibles : rate_limited

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `error.details` (`Record<string, object>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>",
    "details": {}
  },
  "request_id": "<string>"
}
```

**500**: Codes possibles : internal_error

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `error.details` (`Record<string, object>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>",
    "details": {}
  },
  "request_id": "<string>"
}
```

**503**: Codes possibles : service_unavailable

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `error.details` (`Record<string, object>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>",
    "details": {}
  },
  "request_id": "<string>"
}
```

**Example request**

```bash
curl --request POST \
  --url 'https://api.atelier201.com/v1/sites/<site_id>/workspace:commit' \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "summary": "<string>"
}'
```
