Site Factory REST API

The Site Factory REST API allows developers to interact with their Site Factory platform.

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 status information

GET /api/v1/status

Modify status

PUT /api/v1/status

Sites

Create a site

POST /api/v1/sites

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

Edit a group

PUT /api/v1/groups

Remove members from a group

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

Remove group admin from members

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

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

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 status information

Get a 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 status

Modify the status.

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": null,
    "site_duplication": null,
    "domain_management": null,
    "bulk_operations": null
  }

Request body

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,
        "site": "site1",
        "db_name": "bdpref191",
        "stack_id": 1,
        "domain": "domain1.site-factory.com"
        "groups": [
          91
        ],
        "site_collection": 176,
        "is_primary": true
      },
      {
        "id": 196,
        "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 100).10
page int noA positive integer. 1
canary boolnoNo value necessary. false
show_incompleteboolnoNo value necessary. false

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"
    }
  }

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"
    ]
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
site_name string yesThe new site name.
group_ids int|arrayno 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
  }

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_name string yesThe new site name.
group_ids int|arrayno 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
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 array 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"
        ]
      },
      {
        "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"
        ]
      }
    ]
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
limit int noA positive integer (max 100).10
page int noA positive integer. 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
lifetimeintnoThe 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
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
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 array 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
    }
  }

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"
  }

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
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"
  }

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
         ],
       }
     ]
  }

Request parameters

NameData typeMandatoryPossible valuesDefault
limit int noA positive integer (max 100).10
page int noA positive integer. 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
 }

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|arrayyesEither a single site ID, or an array of site IDs.
group_ids int|arrayyesEither 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."
  }

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
site_ids int|arrayyesEither a single 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
site_ids int|arrayyesEither a single 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
site_idintyesA 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
limit int noA positive integer (max 100).10
page int noA positive integer. 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
  }

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,
        "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.10
page intnoA positive integer. 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

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_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,
  }

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
uidsint|arrayyesEither a 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
uidsint|arrayyesEither a single user ID, or an array of user 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
uidsint|arrayyesEither a 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
uidsint|arrayyesEither a single user ID, or an array of user IDs.

Send a theme notification

Receives 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".
event stringyesThe type of theme event. Either "create", "modify", or "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 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"
      ]
    }
  }

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
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
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.