How to discover available REST API properties

Last Reviewed:2026-01-02()
1 minute readKnowledge base

Issue

It is difficult to determine which properties are available for REST API requests when the /api/schema endpoint is not user-friendly.

Resolution

Use the /api/schema endpoint to discover available properties for Jenkins resources.

  1. Navigate to the resource URL and append /api to view available API information.

    For example, for a build:

    $JENKINS_URL/job/$JOB_NAME/$BUILD_NUMBER/api
  2. Access the schema link shown on the API page:

    $JENKINS_URL/job/$JOB_NAME/$BUILD_NUMBER/api/schema
  3. Understand how the XML schema maps to JSON properties:

    • A complexType name=$SOMETHING contains elements inside.

    • If an element is not a simple type (such as artifacts with type hudson.model.Run-Artifact), it has nested elements defined separately.

    • The nested elements are defined as complexType name=hudson.model.Run-Artifact with their own elements.

      For example, to find the artifacts property structure:

      1. Locate the main complexType for the resource.

      2. Find the artifacts element with type hudson.model.Run-Artifact.

      3. Search for complexType name=hudson.model.Run-Artifact to see its nested properties.

  4. Apply this schema knowledge to construct efficient ?tree= parameters following the best practices outlined in Best Practice For Using Jenkins REST API.

Tested product/plugin versions

This article is part of our Knowledge Base and is provided for guidance-based purposes only. The solutions or workarounds described here are not officially supported by CloudBees and may not be applicable in all environments. Use at your own discretion, and test changes in a safe environment before applying them to production systems.