# Update style artifact

```http
PUT /projects/{project_reference}/style-artifacts/current
```

Record the state of the compiled CSS artifact for a branch, environment or release after a build; returns the style artifact record. Requires project.files.write.

## Parameters

| Name                | In   | Required | Description                                                |
| ------------------- | ---- | -------- | ---------------------------------------------------------- |
| `project_reference` | path | Yes      | Project slug, UUID, or domain that identifies the project. |

## Request body

| Field                | Type   | Required | Description                                                                                                                                                                                                                    |
| -------------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `style_profile_hash` | string | Yes      | Style profile identifier used with the selector to find current metadata.                                                                                                                                                      |
| `branch`             | string |          | Branch name. Exactly one of branch, environment\_name, or release\_id is required. Main may be implicit before its branch row exists; other branch and environment names must exist in the project or the request returns 404. |
| `environment_name`   | string |          | Environment name. Exactly one selector is required.                                                                                                                                                                            |
| `release_id`         | string |          | Release UUID. Exactly one selector is required.                                                                                                                                                                                |
| `status`             | string |          | Metadata state. Ready requires artifact\_hash; other states forbid it. Failed requires failure\_reason.                                                                                                                        |
| `artifact_hash`      | string |          | CSS artifact hash; required only for ready status and forbidden for other states.                                                                                                                                              |
| `asset_path`         | string |          | Registered CSS asset path. This operation does not upload the asset.                                                                                                                                                           |
| `content_type`       | string |          | Registered MIME type of the CSS asset.                                                                                                                                                                                         |
| `etag`               | string |          | Registered entity tag for the CSS asset.                                                                                                                                                                                       |
| `build_run_id`       | string |          | Style build run identifier, when available.                                                                                                                                                                                    |
| `failure_reason`     | string |          | Failure detail; required when registering failed status.                                                                                                                                                                       |

## Responses

| Status | Description                        |
| ------ | ---------------------------------- |
| 200    | Registered style artifact metadata |
| 400    | Bad request                        |
| 401    | Unauthorized                       |
| 403    | Forbidden                          |
| 404    | Not found                          |
| 500    | Server error                       |
