Skip to content
WP EngineDocumentation

Lists previously created Builds for specified environment ID.

GET
/v1/accounts/{account}/apps/{app}/environments/{environment}/builds
curl --request GET \
--url https://js.wpengineapi.com/v1/accounts/example/apps/example/environments/example/builds \
--header 'Authorization: Basic <credentials>'
account
required
string

Name of your WP Engine Headless Platform account

app
required
string

Name of your Headless Platform application

environment
required
string

ID of your environment

pageSize
integer format: int32

The maximum number of Build to return. The service may return fewer than this value. If unspecified, no more than 10 environments will be returned. The maximum value is 200, values above 200 will be coerced to 200.

pageToken
string

A page token, returned from the previous ListBuilds call. Provide this to retrieve the next page.

orderBy
string

Default sorting order (empty string) is ascending for created_at. The order can be ascending or descending. If we do not specify the order, we will get the result in ascending order. Format: “”, “column”, “column order”.

startTime
string format: date-time

Only list builds that are newer than start_time.

endTime
string format: date-time

Only list builds that are older than end_time.

A successful response.

Media typeapplication/json

Response including listed Builds.

object
builds

A list of Builds.

Array<object>

Build represents a single build for a given Environment.

Unlike other resources, it is mostly designed to be read by consumers instead of directly being manipulated, hence so many OUTPUT_ONLY annotations. See https://google.aip.dev/203 for more information about documenting field behavior.

object
archived
Output only. Is the build archived?
boolean
branch

Output only. Name of the branch from which the build was created.

string
commitMessage
commit message
string
commitSha

The exact commit sha being built. At most 40 characters.

string
createTime

Output only. Time at which the Build was scheduled.

string format: date-time
finishTime

Output only. Time at which execution of the build was finished. Not set if the Build is still running.

string format: date-time
name
Output only. Build name in the format of: `accounts/{account}/apps/{app}/environments/{environment}/builds/{build}`
string
shellVariables
Wrapped list of shell variables for proper json representation
object
value

A list of shell variables available in the App’s container which was used with build.

Array<object>
ShellVariable

Environment variable represents a value available in the environment’s container under the specific key.

object
key
Environment variable key. Must match regex: `[-._a-zA-Z][-._a-zA-Z0-9]*`. Must not match any of the following case-insensitive globs: WPE_*, ATLAS_METADATA*, HEADLESS_METADATA_*, HOME, PORT, K_*, TMP, TMPDIR, TEMP
string
value

Environment variable value.

string
startTime

Output only. Time at which execution of the build was started.

string format: date-time
state

Possible states for a Build.

  • STATE_UNSPECIFIED: State of the build is unknown or not applicable.
  • PENDING: The Build is pending, no work has yet begun.
  • RUNNING: The build is in progress (started and not yet finished).
  • SUCCEEDED: The Build finished successfully.

Note: this does not necessarily mean that all BuildTasks comprising this Build succeeded (for example, some tasks may have been optional.)

Note: this does not necessarily mean that this Build is currently deployed. For example, it may have been deployed at some point in the past, and since been superseded by another Build.

  • FAILED: The Build has failed.
  • CANCELLING: The build is being cancelled
  • CANCELLED: The build was cancelled
  • QUEUED: The Build is queued.
  • TIMEOUT: Build timeout
string
default: STATE_UNSPECIFIED
Allowed values: STATE_UNSPECIFIED PENDING RUNNING SUCCEEDED FAILED CANCELLING CANCELLED QUEUED TIMEOUT
trigger

Possible states for a Build.

  • TRIGGER_UNSPECIFIED: Trigger of the build is unknown or not applicable.
  • REBUILD: The Build was triggered by invoking server rebuild method.
  • COMMIT: The build was triggered by commit in github.
  • WEBHOOK: The build was triggered by webhook system.
  • INITIAL: deprecated, use FIRST_BUILD instead
  • FIRST_BUILD: The first created build
string
default: TRIGGER_UNSPECIFIED
Allowed values: TRIGGER_UNSPECIFIED REBUILD COMMIT WEBHOOK INITIAL FIRST_BUILD
nextPageToken

A token which can be sent as page_token to retrieve the next page. Unset if there are no more pages.

string
totalSize

Total number of builds in the entire list of Builds.

integer format: int32
Example
{
"builds": [
{
"state": "STATE_UNSPECIFIED",
"trigger": "TRIGGER_UNSPECIFIED"
}
]
}