Skip to content

GET /wpcom/v2/sites/$wpcom_site/hosting/code-deployments

Get a list of site code deployments configured for a given site.

Resource Information

   
Method GET
URL https://public-api.wordpress.com/wpcom/v2/sites/$wpcom_site/hosting/code-deployments
Requires authentication? Yes

Method Parameters

Parameter Type Required Description
wpcom_site string | integer Yes A domain or blog ID.
query string No Query term to search for code deployments

Response Example

					
						[
    {
        "id": 1,
        "blog_id": 1,
        "created_by_user_id": 123,
        "created_on": "2024-06-03T13:52:00+00:00",
        "updated_on": "2024-06-03T13:59:04+00:00",
        "external_repository_id": 1,
        "repository_name": "owner\/repository-name",
        "branch_name": "master",
        "target_dir": "\/wp-content\/plugins\/repository-name",
        "is_automated": true,
        "installation_id": 1,
        "created_by": {
            "id": 123,
            "name": "Some User"
        },
        "current_deployed_run": {
            "id": 1,
            "code_deployment_id": 1,
            "created_on": "2024-06-03T13:57:30+00:00",
            "started_on": "2024-06-03T13:57:34+00:00",
            "completed_on": "2024-06-03T13:59:04+00:00",
            "status": "success",
            "failure_code": null,
            "triggered_by_user_id": 123,
            "metadata": {
                "commit_message": "Last commit message of this branch",
                "commit_sha": "eaf266ff11f14fc06bd69ab42b1c9c8044190a3c",
                "author": {
                    "id": 1,
                    "name": "owner",
                    "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/123?v=4",
                    "profile_url": "https:\/\/github.com\/owner"
                },
                "workflow_run_id": 1
            },
            "code_deployment": null
        },
        "current_deployment_run": {
            "id": 1,
            "code_deployment_id": 1,
            "created_on": "2024-06-03T13:57:30+00:00",
            "started_on": "2024-06-03T13:57:34+00:00",
            "completed_on": "2024-06-03T13:59:04+00:00",
            "status": "success",
            "failure_code": null,
            "triggered_by_user_id": 123,
            "metadata": {
                "commit_message": "Last commit message of this branch",
                "commit_sha": "eaf266ff11f14fc06bd69ab42b1c9c8044190a3c",
                "author": {
                    "id": 1,
                    "name": "owner",
                    "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/123?v=4",
                    "profile_url": "https:\/\/github.com\/owner"
                },
                "workflow_run_id": 1
            },
            "code_deployment": null
        },
        "workflow_path": ".github\/workflows\/wpcom.yml"
    }
]					
				

Resource Errors

This endpoint does not return any errors.