Site Factory REST API

The Site Factory REST API allows developers to interact with their Site Factory platform. API docs are also available on Acquia Developer Portal, these docs might not be 100% accurate and always check against your factory version.

API Overview

Versionv1
Endpointhttps://www.demo.acquia-cc.com/api/v1
FormatJSON
AuthenticationHTTP Basic Auth over SSL
CredentialsUsername and API key (found on your user profile page)
Status codesStandard HTTP status codes

API functions are listed below, first summarized by category, then followed with complete documentation including parameters, return values, and an example curl command.

Status

Check service response

GET /api/v1/ping

Get service status information

GET /api/v1/status

Modify service status

PUT /api/v1/status

Sites

Create a site

POST /api/v1/sites

Transfer the site ownership.

POST /api/v1/site-ownership/{site_id}

Trigger the site variables set up on the sites.

POST /api/v1/site-variables

Get the site variables for a given site.

GET /api/v1/site-variables/{site_id}

Change a site variable for a given site.

PUT /api/v1/site-variables/{site_id}

Clear all site variables for a given site.

DELETE /api/v1/site-variables/{site_id}

Remove a site variable for a given site.

DELETE /api/v1/site-variables/{site_id}/{variable_key}

Site collections

List site collections

GET /api/v1/collections

Create a site collection

POST /api/v1/collections

Add site(s) to a site collection.

POST /api/v1/collections/{collection_id}/add

Remove site(s) from a site collection.

POST /api/v1/collections/{collection_id}/remove

Set the primary site of a site collection.

POST /api/v1/collections/{collection_id}/set-primary

Groups

Create a group

POST /api/v1/groups

Add site(s) to a site group.

POST /api/v1/groups/{group_id}/sites

Remove members from a group

DELETE /api/v1/groups/{group_id}/members

Remove group admin from members

DELETE /api/v1/groups/{group_id}/admins

Remove site(s) from a site group.

DELETE /api/v1/groups/{group_id}/sites

Themes

Send a theme notification

POST /api/v1/theme/notification

External theme repository deploy key

GET /api/v1/theme/deploy-key

Process theme modifications

POST /api/v1/theme/process

Tasks

Get list of available stacks.

GET /api/v1/stacks

Edit stack information.

PUT /api/v1/stacks/{codebase_id}

Get details of available stacks.

GET /api/v1/stacks/details

Domains

Get all domains.

GET /api/v1/domains

User

Regenerate ALL users API keys

DELETE /api/v1/users/all/api-keys

Regenerate a user's API key

DELETE /api/v1/users/{user_id}/api-keys

Check service response

Checks whether the API is responding.

GET /api/v1/ping

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/ping' \
    -v -u {user_name}:{api_key}

Example response

  {
    "message": "pong",
    "server_time": "2014-02-16T20:04:12-06:00"
  }

Get service status information

Get a service status report.

GET /api/v1/status

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/status' \
    -v -u {user_name}:{api_key}

Example response

  {
    "site_creation": "Disabled",
    "site_duplication": "Enabled",
    "domain_management": "Disabled until 2014-02-14T11:52:17-05:00",
    "bulk_operations": "Disabled until 2014-02-14T11:52:17-05:00"
  }

Modify service status

Modify the status of the services.

PUT /api/v1/status

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/status' \
    -X PUT -d '{"all": "on"}' \
    -H 'Content-Type: application/json' \
    -v -u {user_name}:{api_key}

Example response

  {
    "site_creation": "",
    "site_duplication": "2022-02-17T05:06:55-08:00",
    "domain_management": "",
    "bulk_operations": "2022-02-17T05:06:55-08:00"
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
all stringnoon, off, or something strtotime accepts
site_creation stringnoon, off, or something strtotime accepts
site_duplication stringnoon, off, or something strtotime accepts
domain_managementstringnoon, off, or something strtotime accepts
bulk_operations stringnoon, off, or something strtotime accepts

List sites

Gets a list of sites.

GET /api/v1/sites

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/sites?limit=20&page=2' \
    -v -u {user_name}:{api_key}

Example response

  {
    "count": 111,
    "sites": [
      {
        "id": 191,
        "created": 1616611353,
        "owner": "John Drupal",
        "site": "site1",
        "db_name": "bdpref191",
        "stack_id": 1,
        "domain": "domain1.site-factory.com",
        "groups": [
          91
        ],
        "site_collection": 176,
        "is_primary": true
      },
      {
        "id": 196,
        "created": 1616611353,
        "owner": "John Drupal",
        "site": "site2",
        "db_name": "bdpref196",
        "stack_id": 2,
        "domain": "domain2.site-factory.com",
        "groups": [
          91,
          105
        ],
        "site_collection": false,
        "is_primary": true
      }
    ]
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
limit int noA positive integer (max 1000).
minimum: 1, maximum: 1000
10
page int noA positive integer.
minimum: 1
1
canary boolnoNo value necessary. false
show_incompleteboolnoShow sites that are incomplete.false
stack_id int noShow sites on a specific stack.
domain_containsstring noShow sites whose domain contains this value.
domain_not_containsstringnoShow sites whose domain does not contain this value.
has_custom_domainboolnoWhether to only show sites with custom domains.
site_owner int[]noEither a user id or a comma separated list of user ids.
show_custom_domainboolnoReturn the first custom domain if the site has one instead of the internal one.

Site details

Get detailed information about a site.

GET /api/v1/sites/{site_id}

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/sites/123' \
    -v -u {user_name}:{api_key}

Example response

  {
    "id": 123,
    "created": 1397483647,
    "owner": "John Drupal",
    "site": "site1",
    "stack_id": 1,
    "db_name": "bdpref196",
    "domains": [
      "domain1.site-factory.com",
      "domain2.site-factory.com"
    ],
    "groups": [
      91
    ],
    "part_of_collection": true,
    "is_primary": true,
    "collection_id": 241,
    "collection_domains": [
      "domain241.example.com",
      "anotherdomain.com"
    ],
    "external_theme": {
      "vcs_url": "git@github.com:username\/drupal-theme-repo.git",
      "vcs_path": "master"
    }
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
site_id intyesSite ID

Create a site

Create a new site.

POST /api/v1/sites

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/sites' \
    -X POST -H 'Content-Type: application/json' \
    -d '{"site_name": "mysite"}' \
    -v -u {user_name}:{api_key}

Example response

  {
    "id": 191,
    "site": "site1",
    "domains": [
      "mysite.site-factory.com"
    ],
    "task_id": 12345
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
site_name string yesThe new site name.
group_ids int[]yes Either a single group ID, or an array of group IDs.
install_profilestring no The install profile to be used to install the site.
stack_id int if multiple stacks existThe stack id where the site should go.

Site delete

Delete a site.

DELETE /api/v1/sites/{site_id}

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/sites/123' \
    -X DELETE -v -u {user_name}:{api_key}

Example response

  {
    "id": 123,
    "owner": "johnsmith",
    "site": "unicorns",
    "time": "1970-01-01T01:02:03+00:00",
    "task_id": 16
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
site_id intyesSite ID

Duplicate a site

Duplicate a site.

POST /api/v1/sites/{site_id}/duplicate

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/sites/123/duplicate' \
    -X POST -H 'Content-Type: application/json' \
    -d '{"site_name": "mysite2", "exact_copy": true}' \
    -v -u {user_name}:{api_key}

Example response

  {
    "id": 183,
    "site": "mysite2"
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
site_id int yesSite ID
site_name string yesThe new site name.
group_ids int[]no Either a single group ID, or an array of group IDs.
exact_copybool no A boolean indicating whether or not to create an exact copy.false

Create a site backup

Create a site backup.

POST /api/v1/sites/{site_id}/backup

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/sites/123/backup' \
    -X POST -H 'Content-Type: application/json' \
    -d '{"label": "Weekly", "callback_url": "http://mysite.com", "callback_method": "GET"}' \
    -v -u {user_name}:{api_key}

Example response

  {
    "task_id": 183
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
site_id intyesSite ID
label stringnoThe human-readable description of this backup.
callback_url stringnoThe callback URL, which is invoked upon completion.
callback_methodstringnoThe callback method, "GET", or "POST". Uses "POST" if empty.
caller_data stringnoData that should be included in the callback, json encoded.
components string[] noArray of components to be included in the backup. The following component names are accepted: codebase, database, public files, private files, themes. When omitting this parameter it will default to a backup with every component.

List site backups

List site backups.

GET /api/v1/sites/{site_id}/backups

Note that the results are sorted from newest backup to oldest.

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/sites/123/backups?limit=20&page=2' \
    -v -u {user_name}:{api_key}

Example response

  {
    "backups": [
      {
        "id": 6,
        "nid": 123,
        "status": 1,
        "uid": 16,
        "timestamp": 1415044083,
        "bucket": "sitefactorybackups",
        "directory": "oldschool",
        "file": "oldschool_91_1415044083.tar.gz",
        "label": "Weekly",
        "componentList": [
          "codebase",
          "database",
          "public files",
          "private files",
          "themes"
        ],
        "complete": true
      },
      {
        "id": 1,
        "nid": 123,
        "status": 1,
        "uid": 16,
        "timestamp": 1415042116,
        "bucket": "sitefactorybackups",
        "directory": "oldschool",
        "file": "oldschool_91_1415042116.tar.gz",
        "label": "Monthly",
        "componentList": [
          "codebase",
          "database",
          "public files",
          "private files",
          "themes"
        ],
        "complete": false
      }
    ]
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
site_id intyesSite ID
limit int noA positive integer (max 100).
minimum: 1, maximum: 100
10
page int noA positive integer.
minimum: 1
1

Get a temporary site backup URL

Get temporary site backup URL.

GET /api/v1/sites/{site_id}/backups/{backup_id}/url

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/sites/123/backups/101/url?lifetime=300' \
    -v -u {user_name}:{api_key}

Example response

  {
    "url": "https:\/\/s3.amazonaws.com\/sitefactorybackups\/site\/backup1_101_1415643727.tar.gz?AWSAccessKeyId=AKIAINAAC2EGOVCRW4WA\u0026Expires=1415713064\u0026Signature=pWucd8b6T%2FqzoNewXH6EuTyIr1g%3D",
    "lifetime": 300
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
site_id intyesSite ID
backup_idintyesBackup ID
lifetime intnoThe number of seconds the temporary URL is good for.60

Delete a site backup

Delete a site backup.

DELETE /api/v1/sites/{site_id}/backups/{backup_id}

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/sites/123/backups/101' \
    -X DELETE -H 'Content-Type: application/json' \
    -d '{"callback_url": "http://mysite.com", "callback_method": "GET"}' \
    -v -u {user_name}:{api_key}

Example response

  {
    "task_id": 16
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
site_id int yesSite ID
backup_id int yesBackup ID
callback_url stringnoThe callback URL, which is invoked upon completion.
callback_methodstringnoThe callback method, "GET", or "POST". Uses "POST" if empty.
caller_data stringnoData that should be included in the callback, json encoded.

Restore a site backup

Restore a site backup.

POST /api/v1/sites/{site_id}/restore

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/sites/123/restore' \
    -X POST -H 'Content-Type: application/json' \
    -d '{"target_site_id": 456, "backup_id": 789, "callback_url": "http://mysite.com", "callback_method": "GET"}' \
    -v -u {user_name}:{api_key}

Example response

  {
    "task_id": 1024
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
site_id int yesSite ID
target_site_id int noID of the site to restore the backup onto.
backup_id int noID of the backup to restore defaults to the most recent.
callback_url stringnoThe callback URL, which is invoked upon completion.
callback_methodstringnoThe callback method, "GET", or "POST". Uses "POST" if empty.
caller_data stringnoData that should be included in the callback, json encoded.
components string[] noArray of components to be restored from the backup. The following component names are accepted: database, public files, private files, themes. When omitting this parameter it will default to the backup's every component.

Clear a site's caches

Clear Drupal and Varnish caches for a site.

POST /api/v1/sites/{site_id}/cache-clear

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/sites/123/cache-clear' \
    -X POST -H 'Content-Type: application/json' \
    -v -u {user_name}:{api_key}

Example response

  {
    "id" : 123,
    "time" : "2017-05-04T09:25:26+00:00",
    "task_ids": {
      "drupal_cache_clear" : 1234,
      "varnish_cache_clear" : 1234
    }
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
site_id intyesSite ID

Site external theme refresh

Refreshes the site's themes from the external theme repository.

POST /api/v1/sites/{site_id}/external-theme-refresh

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/sites/121/external-theme-refresh' \
    -X POST -H 'Content-Type: application/json' \
    -v -u {user_name}:{api_key}

Example response

  {
     "id": 121,
     "accepted": true,
     "time": "2024-05-11T18:15:19+00:00"
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
site_idintyesSite ID.

Set site external theme

Sets the site's external theme data.

PUT /api/v1/sites/{site_id}/external-theme

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/sites/121/external-theme' \
    -X PUT -H 'Content-Type: application/json' \
    -d '{"vcs_url": "git@github.com:user/repo.git", "vcs_path": "tag2"}' \
    -v -u {user_name}:{api_key}

Example response

  {
    "id": 121,
    "vcs_url": "git@github.com:user\/repo.git",
    "vcs_path": "master",
    "time": "2020-01-09T15:57:24+00:00"
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
site_id int yesSite ID.
vcs_url stringno The external theme repository's url.
vcs_pathstringyesThe VCS path to use.

Delete site external theme

Deletes the site's external theme data.

DELETE /api/v1/sites/{site_id}/external-theme

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/sites/121/external-theme' \
    -v -u {user_name}:{api_key} -X DELETE \
    -H 'Content-Type: application/json'

Example response

  {
     "id": 121,
     "accepted": true,
     "time": "2024-05-11T18:15:19+00:00"
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
site_id int yesSite ID.

Transfer the site ownership.

Transfer the site ownership.

POST /api/v1/site-ownership/{site_id}

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/site-ownership/123' \
    -v -u {user_name}:{api_key} -X POST \
    -H 'Content-Type: application/json' \
    -d '{"username": "john.doe"}'

Example response

  {
    "message" : "To transfer your site, please follow the instructions in the e-mail that was sent to site-owner@email.com"
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
site_id intyesSite ID
usernamestring noNew owner username to which site needs to be transferred (either username or email field is required).
email string noNew owner email id to which site needs to be transferred.
force_transferbooleannoTransfer site ownership without mail confirmation from owner and recipient.

Trigger the site variables set up on the sites.

Trigger the site variables set up on the sites.

POST /api/v1/site-variables

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/site-variables' \
    -v -u {user_name}:{api_key} -X POST \
    -H 'Content-Type: application/json'

Example response

  {
    "task_ids" : {
      "glitch.01live.01update" : "1901",
      "glitch2.01live.01liveup" : "1906"
    },
    "time" : "2022-11-23T12:49:57+00:00"
  }

Get the site variables for a given site.

Get the site variables for a given site.

GET /api/v1/site-variables/{site_id}

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/site-variables/1234' \
    -v -u {user_name}:{api_key} -X GET \
    -H 'Content-Type: application/json'

Example response

  {
    "time" : "2022-11-23T12:38:06+00:00",
    "vars" : {
      "external_service_api_key" : {
        "id" : 1,
        "nid" : 101,
        "scrub_during_stage" : 1,
        "variable_key" : "external_service_api_key",
        "variable_value" : "apikey-value2"
      },
      "external_service_api_key_non-secret" : {
        "id" : 11,
        "nid" : 101,
        "scrub_during_stage" : 0,
        "variable_key" : "external_service_api_key_non-secret",
        "variable_value" : "apikey-value xx1234"
      }
    }
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
site_id intyesSite ID

Change a site variable for a given site.

Change a site variable for a given site.

PUT /api/v1/site-variables/{site_id}

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/site-variables/1234' \
    -v -u {user_name}:{api_key} -X PUT \
    -H 'Content-Type: application/json' \
    -d '{"variable_key": "external_service_api_key", "variable_value": "apikey-value", "variable_scrub": 1}'

Example response

  {
    "message" : "The configuration options have been saved.",
    "time" : "2022-01-19T08:38:09+00:00"
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
site_id intyesSite ID
variable_key string yesThe variable key.
variable_value string yesThe variable value.
variable_scrub int noIf the variable should be removed during staging.

Clear all site variables for a given site.

Clear all site variables for a given site.

DELETE /api/v1/site-variables/{site_id}

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/site-variables/1234' \
    -v -u {user_name}:{api_key} -X DELETE \
    -H 'Content-Type: application/json'

Example response

  {
    "message" : "The configuration options have been saved.",
    "time" : "2022-01-19T08:38:09+00:00"
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
site_id intyesSite ID

Remove a site variable for a given site.

Remove a site variable for a given site.

DELETE /api/v1/site-variables/{site_id}/{variable_key}

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/site-variables/1234/external_service_api_key' \
    -v -u {user_name}:{api_key} -X DELETE \
    -H 'Content-Type: application/json'

Example response

  {
    "message" : "The configuration options have been saved.",
    "time" : "2022-01-19T08:38:09+00:00"
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
site_id intyesSite ID
variable_key string yesThe variable key.

List site collections

Gets a list of site collections.

GET /api/v1/collections

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/collections?limit=20&page=2' \
    -v -u {user_name}:{api_key}

Example response

  {
     "count": 111,
     "time" : "2016-11-25T13:18:44+00:00",
     "collections": [
       {
         "id": 196,
         "name": "collection2",
         "internal_domain": "domain1.site-factory.com",
         "primary_site": 220,
         "site_count": 2,
         "groups": [
            91
         ],
         "customer_standard_domains": [
           "collection2-coll.example.com"
         ],
         "external_domains": [
           "external1-coll.example.com"
         ]
       }
     ]
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
remove_empty boolean noTrue to only return collections containing active sites.false
limit int noA positive integer (max 100).
minimum: 1, maximum: 100
10
page int noA positive integer.
minimum: 1
1

Site collection details

Get detailed information about a site collection.

GET /api/v1/collections/{collection_id}

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/collections/123' \
    -v -u {user_name}:{api_key}

Example response

  {
   "id": 261,
   "time": "2016-11-25T13:18:44+00:00",
   "created": 1489075420,
   "owner": "admin",
   "name": "collection1",
   "internal_domain": "collection1.site-factory.com",
   "external_domains": [
     "domain1.site-factory.com"
   ],
   "groups": [
     91
   ],
   "sites": [
     236,
     231
   ],
   "primary_site": 236
 }

Request parameters

NameData typeMandatoryPossible valuesDefault
collection_idintyesCollection ID.

Create a site collection

Create a new site collection.

POST /api/v1/collections

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/collections' \
    -X POST -H 'Content-Type: application/json' \
    -d '{"name": "mycollection", "site_ids": [100, 200], "group_ids": [2]}' \
    -v -u {user_name}:{api_key}

Example response

  {
    "id": 191,
    "name": "mycollection",
    "time": "2016-11-25T13:18:44+00:00",
    "internal_domain": "mycollecton.site-factory.com"
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
name string yesThe name of the new site collection.
site_ids int|int[]yesEither a single site ID, or an array of site IDs.
group_ids int|int[]yesEither a single group ID, or an array of group IDs.
internal_domain_prefixstring no The site collection's internal domain prefix. Uses the "name" parameter's value if not set.

Delete a site collection

Delete a site collection.

DELETE /api/v1/collections/{collection_id}

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/collections/101' \
    -X DELETE \
    -v -u {user_name}:{api_key}

Example response

  {
    "id" : 101,
    "time" : "2016-10-28T09:25:26+00:00",
    "deleted" : true,
    "message" : "Your site collection was successfully deleted."
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
collection_idintyesCollection ID.

Add site(s) to a site collection.

Add site(s) to a site collection.

POST /api/v1/collections/{collection_id}/add

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/collections/191/add' \
    -X POST -H 'Content-Type: application/json' \
    -d '{"site_ids": [101, 121, 126]}' \
    -v -u {user_name}:{api_key}

Example response

  {
    "id": 191,
    "name": "foobarcollection",
    "time": "2017-04-20T10:58:18+00:00",
    "site_ids_added": [
      121
    ],
    "added": true,
    "message": "One site was successfully added to the site collection.",
    "warning": [
      "The site aabbcc (site ID: 101) is already part of the current site collection.; The site ddeeff (site ID: 126) is already part of the current site collection.",
      "Site xxyyzz (site ID: 121) was removed from examplegroup (group ID: 91)."
    ],
    "site_ids_skipped": [
      101,
      126
    ]
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
collection_idintyesCollection ID.
site_idsint|int[]yesA site ID or an array of site IDs.

Remove site(s) from a site collection.

Remove site(s) from a site collection.

POST /api/v1/collections/{collection_id}/remove

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/collections/191/remove' \
    -X POST -H 'Content-Type: application/json' \
    -d '{"site_ids": [121]}' \
    -v -u {user_name}:{api_key}

Example response

  {
    "id": 191,
    "name": "foobarcollection",
    "time": "2017-04-20T10:58:18+00:00",
    "site_ids_removed": [
      121
    ],
    "removed": true,
    "message": "One site was successfully removed from the site collection."
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
collection_idintyesCollection ID.
site_ids int|int[]yesA site ID, or an array of site IDs.

Set the primary site of a site collection.

Set the primary site of a site collection.

POST /api/v1/collections/{collection_id}/set-primary

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/collections/191/set-primary' \
    -X POST -H 'Content-Type: application/json' \
    -d '{"site_id": 101}' \
    -v -u {user_name}:{api_key}

Example response

  {
    "id": 191,
    "name": "foobarcollection",
    "time": "2017-04-20T10:58:18+00:00",
    "primary_site_id": 101,
    "switched": true,
    "message": "It can take a few minutes to switch over to the new primary site."
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
collection_idintyesCollection ID.
site_id intyesA single site ID.

List group members

Get the members of a group.

GET /api/v1/groups/{group_id}/members

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/groups/{group_id}/members?limit=20' \
    -v -u {user_name}:{api_key}

Example response

  {
    "time": "2016-11-25T13:18:44+00:00",
    "group_id": 123,
    "count": 3,
    "members": [
      {
        "uid": 101,
        "group owner": true,
        "group administrator": true
      },
      {
        "uid": 106,
        "group owner": false,
        "group administrator": true
      },
      {
        "uid": 111,
        "group owner": false,
        "group administrator": false
      }
    ]
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
group_id int yesGroup id.
limit int no A positive integer (max 1000).
minimum: 1, maximum: 1000
10
page int no A positive integer.
minimum: 1
1

Get a group

Get a group by group ID.

GET /api/v1/groups/{group_id}

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/groups/{group_id}' \
    -v -u {user_name}:{api_key}

Example response

  {
    "created": 1399421609,
    "group_id": 123,
    "group_name": "mygroup",
    "owner": "user_name",
    "owner_id": 456,
    "parent_id": 789,
    "parent_name": "parentgroup",
    "live_site_count": 1,
    "total_site_count": 3,
    "status": 1
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
group_id int yesGroup id.

List groups

Get a list of groups.

GET /api/v1/groups

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/groups?page=2&limit=20' \
    -v -u {user_name}:{api_key}

Example response

  {
    "count": 123,
    "groups": [
      {
        "group_name": "test",
        "group_id": 10002246,
        "owner": "user_name",
        "owner_id": 10000461,
        "parent_name": "foo",
        "parent_id": 4242,
        "status": 1,
        "created": 1473142941,
        "live_site_count": 1,
        "total_site_count": 2
      },
      {
        "group_name": "subgroup",
        "group_id": 10002251,
        "owner": "user_name",
        "owner_id": 10000461,
        "parent_name": "test",
        "parent_id": 10002246,
        "status": 1,
        "created": 1473142941,
        "live_site_count": 0,
        "total_site_count": 1
      }
    ]
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
limitintnoA positive integer not higher than 100.
minimum: 1, maximum: 100
10
page intnoA positive integer.
minimum: 1
1

Create a group

Create a site group.

POST /api/v1/groups

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/groups' \
    -X POST -H 'Content-Type: application/json' \
    -d '{"group_name": "mygroup"}' \
    -v -u {user_name}:{api_key}

Example response

  {
    "group_id": 123,
    "group_name": "mygroup"
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
group_namestringyesThe name of the site group to create.
parent_id int no The parent group ID, if applicable.

Edit a group

Edit a group.

PUT /api/v1/groups/{group_id}/update

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/groups/{group_id}/update' \
    -X PUT -H 'Content-Type: application/json' \
    -d '{"group_name": "mygroup"}' \
    -v -u {user_name}:{api_key}

Example response

  {
    "time": "2016-11-25T13:18:44+00:00",
    "group_id": 123
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
group_id int yesGroup ID.
group_namestringyesNew name for the group.

Delete a group

Delete a site group.

DELETE /api/v1/groups/{group_id}

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/groups/{group_id}' \
    -X DELETE \
    -v -u {user_name}:{api_key}

Example response

  {
    "time": "2016-11-25T13:18:44+00:00",
    "group_id": 123
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
group_id int yesGroup id.

Add members to a group

Add members to a group.

POST /api/v1/groups/{group_id}/members

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/groups/{group_id}/members' \
    -X POST -H 'Content-Type: application/json' \
    -d '{"uids": [66, 71]}' \
    -v -u {user_name}:{api_key}

Example response

  {
    "time": "2016-11-25T13:18:44+00:00",
    "group_id": 123,
    "uids_added": [66]
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
group_idint yesGroup id.
uidsint|int[]yesA single user ID, or an array of user IDs.

Make members group admin

Make members group admin.

POST /api/v1/groups/{group_id}/admins

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/groups/{group_id}/admins' \
    -X POST -H 'Content-Type: application/json' \
    -d '{"uids": [66, 71]}' \
    -v -u {user_name}:{api_key}

Example response

  {
    "time": "2016-11-25T13:18:44+00:00",
    "group_id": 123,
    "uids_promoted": [66]
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
group_idint yesGroup id.
uidsint|int[]yesA single user ID, or an array of user IDs.

Add site(s) to a site group.

Add site(s) to a site group.

POST /api/v1/groups/{group_id}/sites

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/groups/191/sites' \
    -X POST -H 'Content-Type: application/json' \
    -d '{"site_ids": [101, 121, 126]}' \
    -v -u {user_name}:{api_key}

Example response

  {
    "group_id": 191,
    "name": "foobargroup",
    "time": "2020-04-20T10:58:18+00:00",
    "site_ids_added": [
      121
    ],
    "message": "One site was successfully added to the site group.",
    "site_ids_skipped": [
      101,
      126
    ]
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
group_idint yesGroup id.
site_idsint|int[]yesEither a single site ID, or an array of site IDs.

Remove members from a group

Remove members from a group.

DELETE /api/v1/groups/{group_id}/members

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/groups/{group_id}/members' \
    -X DELETE -H 'Content-Type: application/json' \
    -d '{"uids": [66, 71]}' \
    -v -u {user_name}:{api_key}

Example response

  {
    "time": "2016-11-25T13:18:44+00:00",
    "group_id": 123,
    "uids_removed": [66]
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
group_idint yesGroup id.
uidsint|int[]yesA single user ID, or an array of user IDs.

Remove group admin from members

Remove group admin from members.

DELETE /api/v1/groups/{group_id}/admins

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/groups/{group_id}/admins' \
    -X DELETE -H 'Content-Type: application/json' \
    -d '{"uids": [66, 71]}' \
    -v -u {user_name}:{api_key}

Example response

  {
    "time": "2016-11-25T13:18:44+00:00",
    "group_id": 123,
    "uids_demoted": [66]
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
group_idint yesGroup id.
uidsint|int[]yesA single user ID, or an array of user IDs.

Remove site(s) from a site group.

Remove site(s) from a site group.

DELETE /api/v1/groups/{group_id}/sites

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/groups/191/sites' \
    -X DELETE -H 'Content-Type: application/json' \
    -d '{"site_ids": [121, 101, 126]}' \
    -v -u {user_name}:{api_key}

Example response

  {
    "group_id": 191,
    "name": "foobargroup",
    "time": "2020-04-20T10:58:18+00:00",
    "site_ids_removed": [
      121
    ],
    "message": "One site was successfully removed from the site group.",
    "site_ids_skipped": [
      101,
      126
    ]
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
group_idint yesGroup id.
site_idsint|int[]yesEither a single site ID, or an array of site IDs.

List sites in a group.

Get the sites of a group.

GET /api/v1/groups/{group_id}/sites

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/groups/{group_id}/sites?limit=20' \
    -v -u {user_name}:{api_key}

Example response

  {
    "time": "2021-02-19T12:54:23+00:00",
    "group_id": 101,
    "count": 2,
    "sites": [
      {
        "id": 151,
        "db_name": "iade151",
        "site": "site1",
        "stack_id": 1,
        "domain": "{base_url}",
        "groups": [
          91
        ],
        "site_collection": 5,
        "is_primary": true
      },
      {
        "id": 156,
        "db_name": "iade156",
        "site": "site2",
        "stack_id": 1,
        "domain": "{base_url}",
        "groups": [
          91
        ],
        "site_collection": 6,
        "is_primary": true
      }
    ]
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
group_idint yesGroup id.
limit int no A positive integer (max 1000).
minimum: 1, maximum: 1000
10
page int no A positive integer.
minimum: 1
1

Send a theme notification

Sends a theme event notification.

POST /api/v1/theme/notification

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/theme/notification' \
    -v -u {user_name}:{api_key} -X POST \
    -H 'Content-Type: application/json' \
    -d '{"scope": "site", "event": "modify", "nid": 123}'

Example response

  {
    "message": "The site.modify notification has been received.",
    "time": "2014-02-16T20:04:12-06:00",
    "notification": {
      "scope": "site",
      "event": "modify",
      "nid": 123
    }
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
scope stringyesThe scope. Either "theme", "site", "group", or "global".
pattern: "^(theme|site|group|global)$"
event stringyesThe type of theme event. Either "create", "modify", or "delete".
pattern: "^(create|modify|delete)$"
nid int no The node ID of the related entity (site or group). Not relevant for the "global" scope.
theme stringno The system name of the theme. Only relevant for "theme" scope notifications.
uid int no The user id owning the notification and who should get notified if an error occurs during processing.

External theme repository deploy key

Gets the deploy key that needs to be added to external theme repositories.

GET /api/v1/theme/deploy-key

Add this deploy key to your theme repositories, so that the Acquia Cloud Site Factory platform gets access to your repository and is able to deploy updated themes to your sites.

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/theme/deploy-key' \
    -v -u {user_name}:{api_key}

Example response

  {
    "deploy_key": "ssh-rsa...== id_rsa_external_theme",
    "time": "2034-05-11T18:15:19+00:00"
  }

Process theme modifications

Processes the stored theme change notifications.

POST /api/v1/theme/process

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/theme/process' \
    -H 'Content-Type: application/json' \
    -X POST -d '{"sitegroup_id": "tangle001"}' \
    -v -u {user_name}:{api_key}

Example response

  {
    "message": "The request to process theme notification has been accepted.",
    "sitegroups": [
      "tangle001"
    ],
    "time": "2014-05-02T16:21:25+00:00"
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
sitegroup_idstringnoThe ID of a specific sitegroup to process e.g. "tangle001".

Get list of available stacks.

Fetches the list of available stacks.

GET /api/v1/stacks

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/stacks' \
    -v -u {user_name}:{api_key} -X GET

Example response

  {
    "stacks": {
      "1": "abcde",
      "2": "fghij"
    }
  }

Edit stack information.

Edit stack information.

PUT /api/v1/stacks/{codebase_id}

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/stacks/1' \
    -v -u {user_name}:{api_key} -X PUT \
    -H 'Content-Type: application/json' \
    -d '{"name": "new-name", "description": "new-description", "tangle_alias":"tangle1"}'

Example response

  {
    "message" : "Stack details are updated successfully."
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
codebase_idintegeryesId of stack whose details are to be changed.
namestringnoNew stack name to be updated.
descriptionstringnoStack description to be updated.
tangle_aliasstringnoNew tangle alias name for tangle associated with that stack.

Get details of available stacks.

Fetches the details of available stacks.

GET /api/v1/stacks/details

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/stacks/details' \
    -v -u {user_name}:{api_key} -X GET

Example response

  {
    "1": {
      "id": 1,
      "name": "abcd",
      "description": "stack description",
      "tangle_alias": "tangle1"
    },
    "2": {
      "id": 2,
      "name": "fghj",
      "description": "stack description 2",
      "tangle_alias": "tangle2"
    }
  }

Get all domains.

Get all domains known to Site Factory.

GET /api/v1/domains

Possible domain types: simple|collectionLive|collectionInternal|factoryStandard.

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/domains?limit=20&page=2' \
    -v -u {user_name}:{api_key}

Example response

  {
    "count": 111,
    "domains": [
      {
        "nid": 2,
        "domain": "foobar.com",
        "type": "simple",
        "readonly": true
      },
      {
        "nid": 6,
        "domain": "zoofoo.com",
        "type": "factoryStandard",
        "readonly": false
      }
    ]
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
limit int noA positive integer (max 1000).
minimum: 1, maximum: 1000
10
page int noA positive integer.
minimum: 1
1

Get domains

Get domains by node ID.

GET /api/v1/domains/{node_id}

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/domains/{node_id}' \
    -v -u {user_name}:{api_key}

Example response

  {
    "node_id": 121,
    "node_type": "site collection",
    "time": "2016-10-28T09:25:26+00:00",
    "domains": {
      "protected_domains": [
        "site.example.sfdev.acquia-test.co"
      ],
      "custom_domains": [
        "www.abc.com/def",
        "www.xyz.com"
      ]
    }
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
node_id int yesSite node id.

Get domain status

Get domain status.

GET /api/v1/domains/status/{domain_name}

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/domains/status/www.example.com' \
    -v -u {user_name}:{api_key}

Example response

  {
    "domain_name": "www.example.com",
    "associated_status": "registered|registered_unstable|unregistered|unregistered_unstable",
    "node_id": 123,
    "node_type": "site",
    "stack_id": 1,
    "time": "2016-10-28T09:25:26+00:00"
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
domain_namestringyesThe domain name.

Add domain

Adds a domain.

POST /api/v1/domains/{node_id}/add

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/domains/{node_id}/add' \
    -X POST -H 'Content-Type: application/json' \
    -d '{"domain_name": "www.domaintoadd.com" }' \
    -v -u {user_name}:{api_key}

Example response

  {
    "node_id": 121,
    "node_type": "site collection",
    "domain": "www.domaintoadd.com",
    "time": "2016-10-28T09:25:26+00:00",
    "added": true,
    "messages": [
      "Your domain name was successfully added to the site collection."
    ]
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
node_id int yesSite node id.
domain_namestringyesThe domain name to add.

Remove domain

Removes a domain.

POST /api/v1/domains/{node_id}/remove

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/domains/{node_id}/remove' \
    -X POST -H 'Content-Type: application/json' \
    -d '{"domain_name": "www.domaintoremove.com" }' \
    -v -u {user_name}:{api_key}

Example response

  {
    "node_id": 121,
    "node_type": "site collection",
    "domain": "www.domaintoremove.com",
    "time": "2016-10-28T09:25:26+00:00",
    "removed": true,
    "message": "Your domain name has been successfully removed from <site collection name>."
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
node_id int yesSite node id.
domain_namestringyesThe domain name to remove.

Regenerate ALL users API keys

Regenerate ALL users API keys.

DELETE /api/v1/users/all/api-keys

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/users/all/api-keys' \
    -X DELETE -H 'Content-Type: application/json' \
    -v -u {user_name}:{api_key}

Example response

  {
    "message": "API keys will be regenerated in a few minutes",
    "server_time": "2014-02-16T20:04:12-06:00",
    "task_id": 1234
  }

Regenerate a user's API key

Regenerate a user's API key.

DELETE /api/v1/users/{user_id}/api-keys

Example command

  curl 'https://www.demo.acquia-cc.com/api/v1/users/32/api-keys' \
    -X DELETE -H 'Content-Type: application/json' \
    -v -u {user_name}:{api_key}

Example response

  {
    "message": "The API key for user 32 was regenerated.",
    "server_time": "2014-02-16T20:04:12-06:00"
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
user_idint yesThe user ID of the user.
Loading