# Save a draft (https://docs-ecmrhub-v2.lucaspiera.com/docs/api/drafts/save_draft)

## POST /rest/v1/rpc/save_draft

Save a draft

Creates a draft or saves a new revision. Send the revision you started from; a newer one on the server answers 409 VERSION_CONFLICT. The operation id makes a retry safe.

```json
{
  "operationId": "save_draft",
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "operation_id": {
              "type": "string",
              "format": "uuid"
            },
            "draft_id": {
              "type": "string",
              "format": "uuid"
            },
            "base_revision": {
              "type": "integer",
              "minimum": 0
            },
            "data": {
              "type": "object",
              "additionalProperties": {}
            }
          },
          "required": [
            "operation_id",
            "draft_id",
            "base_revision",
            "data"
          ]
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Success",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": {}
          }
        }
      }
    },
    "default": {
      "$ref": "#/components/responses/Problem"
    }
  }
}
```

Schemas referenced as `#/components/...` are in the full contract: https://docs-ecmrhub-v2.lucaspiera.com/openapi.json