---
title: "Using the Site Factory API"
date: "2024-02-14T06:18:38+00:00"
summary: "Explore Site Factory's REST API for website management, job status tracking, and secure access with API keys."
image:
type: "page"
url: "/site-factory/using-site-factory-api"
id: "cefd32e8-a98a-4559-9245-0debf4b29a79"
---

Site Factory includes a REST API that you can use to create and manage your hosted websites, and to obtain the status of jobs in your Site Factory Management Console.

Note

You cannot use the [Cloud Platform API](/acquia-cloud-platform/develop-apps/api) to access or interact with Site Factory environments.

Obtaining your API key
----------------------

Each of the Site Factory API calls requires you to enter your Site Factory username and API key to either complete the action or to return results. 

To obtain your API key:

1.  [Sign in](/site-factory/login) to your Site Factory Management Console using an account with the [platform admin](/site-factory/manage/users/admin/platform-admin) role.
2.  In the admin menu, click your username.
3.  Click the **API key** tab.

Site Factory displays your API key. Due to the key being required for use by the different Site Factory API calls, save the key to a text file or some other secure location.

Site Factory API documentation access permissions
-------------------------------------------------

To view all documentation endpoints in the Site Factory API, you must first [sign in](/site-factory/login) to your Site Factory Management Console as a user with the [developer](/site-factory/manage/users/admin/developer) or [release engineer](../manage/users/admin/release-engineer.html) role.

Attempting to access the Site Factory API as an anonymous user, or not having the appropriate role when signing in to the Site Factory Management Console, will cause the Site Factory API website to not display all available endpoints.

Using the REST API
------------------

Similar to many other APIs, the Site Factory API uses standard HTTP methods to communicate with the service, including GET, PUT, and POST.

After you [ensure that you can access](#acsf-view-api) all of the available endpoints in the Site Factory API, you can view the list of API calls on your instance of Site Factory, along with specific parameters and examples of their use, at the following URLs (where `[site_URL]` is the URL of your Site Factory interface):

    https://[site_URL]/api/v1
    https://[site_URL]/api/v2

You can also review complete documentation for all of the available Site Factory API methods by visiting the [Site Factory API Reference](https://docs.acquia.com/site-factory/site-factory-api) or view customer [Factory API examples](/site-factory/extend/api/examples).

Important

Ensure that you use the JSON format in your array to interact with the Site Factory API.

### Sample API methods

Here are some examples of the methods provided in the Site Factory API:

REST API call

Description

`groups`

Obtain a group listing, or create a group

`ping`

Determine if the API is responding

`sites`

Create, duplicate, or manage backups and third-party themes for a website

`stage`

Start the staging process

`status`

Obtain or modify the status of the factory

`theme`

Retrieve the deployment key, required by third-party theme repositories

`users`

Create, modify, list, or delete user accounts in the factory

For complete documentation, see the [Site Factory API Reference](https://docs.acquia.com/site-factory/site-factory-api).

### Testing your connection

When you first start using the Site Factory API, we encourage you to use the `ping` call to test your connection to the API. To do this, complete the following steps:

1.  [Obtain your user account’s API key](#api-key) from the Site Factory Management Console.
2.  Open a command prompt, and then enter the following command:
    
        curl 'https://[site_URL]/api/v1/ping' -u [user_name]:[api_key]
    
    where:
    
    *   `[site URL]` is the URL of your Site Factory Management Console
    *   `[user_name]` is your Site Factory Management Console user account name
    *   `[api_key]` is your user account’s API key from the Site Factory Management Console
3.  Verify that the API call returns results similar to the following:
    
        {"message":"pong","server_time":"2014-11-18T13:44:57+00:00"}
    

### Using the REST API with staging environments

Staging environments do not have access to the SSL certificates that are made available to production environments, so you must append the `-k` command line switch to your `curl` command when you make calls to a staging environment using the Site Factory API.

For example, using the `ping` call on a staging environment would require a command similar to the following:

    curl 'https://[site_URL]/api/v1/ping' -u [user_name]:[api_key] -k

Resetting user API keys
-----------------------

Site Factory administrators can use the Site Factory Management Console or the [Site Factory API](#) to reset API keys of an individual user, or all users. Users can also reset their own API key. For more information, see [Resetting API keys on Site Factory](/site-factory/extend/api/resetkeys).