---
title: "Replaces a Source site's configuration"
method: PUT
path: "/source-sites/{sourceSiteId}/config"
tags: ["Source Sites"]
---

# Replaces a Source site's configuration

`PUT /source-sites/{sourceSiteId}/config`

## Request

- Base URL: `https://api.acquia.com/v3`
- URL: `https://api.acquia.com/v3/source-sites/{sourceSiteId}/config`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/acquia/apis/acquia-cloud-platform-api/docs/source-sites/:sourceSiteId/config/put.ts> (a function with typed inputs; its response is checked against the schema)

Replaces the active configuration of a Source CMS site. Every request says in its
`source` property where the replacement configuration is to be read from:

- **`request`** — the configuration is the YAML document in the `configuration`
  property. Send back what this path's GET returned, edited or unchanged; a
  document larger than 1 MiB is refused with a 400.
- **`github`** — the site reads the configuration from its own connected GitHub
  repository. Nothing is sent, so the body is just `{"source": "github"}`; sending a
  `configuration` alongside it is refused with a 400 rather than ignored.

Both do the same work from there on. Each starts one import, returns the same 202,
and is read at `/source-sites/{sourceSiteId}/config/import`, whose own `source`
property reports the value the request asked for.

This write is what starts an import. There is nothing to POST or PUT to
`/source-sites/{sourceSiteId}/config/import`, which is read-only: naming the
configuration the site should end up with keeps this resource's read and write on
one path, and the import that write creates is read at that other one.

This is an asynchronous operation. The endpoint returns immediately with a
202 Accepted response, which means the import was accepted, not that it has
been applied.

The response's `self` link points at
`/source-sites/{sourceSiteId}/config/import`, which is where the import reports
what it did — including a refusal, whether for a document whose site UUID does not
match or for configuration the site rejects. Neither this response nor re-reading
this path says anything about the outcome. That read is cheap and safe to poll.

A site may have only one configuration sync in progress at a time. A request for a
site that already has one is refused with a 409 straight away — the rule is checked
before the document is read or applied and without touching the site, so a second
request is rejected rather than queued, and nothing about the running import
changes. That running import can be read at
`/source-sites/{sourceSiteId}/config/import`.

A `github` request against a site with no connected GitHub repository is refused with
a 409 the same way, and for the same reason: there is nothing to read the
configuration from, and that is known before the site is touched.

**Permissions:** The authenticated user must have the `site admin` role on the site.

## Path parameters

- `sourceSiteId` string, required

## Request body

- union
  - object: The configuration is the document in this request.
    - `source` 'request', required: Read the configuration from this request's `configuration` property.
    - `configuration` string, required: The configuration to apply, as a single YAML document, keyed by config collection, then config name. The default collection is the empty string; other collections are named after their language (for example `language.nl`). The document must carry the UUID Source CMS holds for the site it was exported from, in its `system.site` object. That UUID is checked against the target site before anything else, and the import is refused if it does not match or is absent. It is not the same identifier as `sourceSiteId`.
  - object: The site reads the configuration from its own connected GitHub repository. Nothing is sent, so there is no `configuration` property to send — including one is refused with a 400 rather than silently ignored.
    - `source` 'github', required: Have the site read the configuration from its connected GitHub repository.

## Response `202`

Site configuration import accepted

- object
  - `_links` object, required: HAL links for the resource
    - `self` SourcePlatformAPIHalLink, required: HAL link object
      - `href` union, required: The target URI of the link (can be a URI or URI template)
        - string, uri
        - string, uri-template
      - `templated` boolean: Whether the link is a URI template
      - `type` string: Hint about the media type expected when dereferencing the target resource
      - `deprecation` string: A URL to a resource that provides deprecation information
      - `name` string: A secondary key for selecting links
      - `profile` string: A URI that hints about the profile of the target resource
      - `title` string: A human-readable identifier for the link
      - `hreflang` string: The language of the target resource
  - `_embedded` object: Embedded resources (optional)
  - `message` 'Site configuration import started.', required: Confirmation message indicating the configuration import has been initiated

## Other responses

- `400`: Validation Error
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `500`: Internal Server Error

---

[API](https://skmtc.dev/acquia/apis/acquia-cloud-platform-api.md) - [All operations](https://skmtc.dev/acquia/apis/acquia-cloud-platform-api/llms.txt) - [OpenAPI document](https://skmtc.dev/acquia/apis/acquia-cloud-platform-api/revisions/508f8f94456d?raw)
