Object Request REST API
Published: 2025-06-26
Last Updated: 2026-08-26
Create an object request (check-out) in MDCMS.
The request body is JSON. For *IFS or *REMOTE objects, you can also attach a file in a multipart/mixed request. See File attachments.
Preconditions
- The owner of the authentication token is authorized in MDSEC to run command
MDADDREQ.
JSON payloads
All MDCMS REST API request and response bodies use JSON. Send Content-Type: application/json unless you are attaching a file.
Authorization
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Bearer token for the MDSEC user. See Authenticate requests to the MDCMS REST API server. |
Content-Type | string | Yes | application/json, or multipart/mixed when attaching a file. |
A missing or invalid token returns HTTP 401 Unauthorized.
Request body
Schema
| Property | Type | Required | Description |
|---|---|---|---|
appl | string | Yes | ID of the target application for the object. |
lvl | integer | Yes | Level number of the application that allows check-outs. |
objt | string | Yes | System or MDCMS object type code for the object. |
attr | string | Yes | MDCMS attribute code that identifies the behavior and target locations for the requested object. |
objn | string | Yes | Name of the object to request. |
rpth | string | No | Relative portion of an IFS path that is deployed with the object. For example, if the *IFS attribute has a target fixed directory of /srv/dev and this object should be deployed to srv/dev/app1/dist, set rpth to /app1/dist. |
srcn | string | No | Name of the source member or IFS source file to request. If omitted, the source name is set to the object name. Ignored if the attribute is defined as having no source. |
rsn | string | No | Reason (purpose) of the object request. If omitted, *MIGRATE is used. See Reason. |
user | string | No | Developer to assign to the object request. If omitted, the owner of the authentication token is used. |
folb | string | No | Library or IFS path that contains the object to migrate. The library should be a developer or team library that is not managed by MDCMS. If the attribute contains source only, enter the library or path containing the source. If the object resides in IFS, provide the entire directory path starting with /. If omitted, the library is set to the user name. See File attachments. |
fslb | string | No | Library or IFS path that contains the source to migrate. The library should be a developer or team library that is not managed by MDCMS. If omitted, the object library (folb) is used. See File attachments. |
fsfl | string | No | Source file containing the source member to migrate. Ignored if the attribute is defined as having no source. If omitted, the source file defined on the attribute is used. |
copy | string | No | Whether to copy the source or object from the target environment to the from-library. Considered only for reason *MIGRATE. If the attribute defines a source and object location, only the source is copied. If the source or object already exists in the from-library, it is not replaced. See Copy. |
proj | string | No | Project to assign to the request. The project must already exist and be in an open status. If the project is not yet authorized, the user must have MDSEC authority to authorize it, and MDCMS does so automatically. |
task | integer | No | Existing, active task number. Omit or set to 0 to assign the request directly to the project. |
stsk | integer | No | Existing, active subtask number. Omit or set to 0 to assign the request directly to the project or task. |
arfp | string | No | Whether to assign the request to an RFP immediately, and how to determine the RFP. See Assign RFP. |
rfp | integer | No | RFP to assign to the request. Used only when arfp is *YES. |
rfpd | string | No | Description used for a new RFP or to search for an existing RFP. Used only when arfp is *AUTO or *NEW. |
creq | string | No | If a level exists to migrate after this target level, whether object requests should be generated for that level once this level's RFP is complete. Applied only if the RFP is created during this request. See Continue requests. |
areq | string | No | If a level exists to migrate after this target level, whether the generated object requests should be assigned to an RFP. Applied only if the RFP is created during this request. See Assign next-level requests. |
sreq | string | No | If distribution levels are defined for this level, whether the RFP should be placed in the Send list. Applied only if the RFP is created during this request. Default *YES. |
lock | string | No | Whether the request is placed in locked status. Default *YES. |
csqo | integer | No | Compile sequence (lowest first) for objects in the same RFP that have the same primary sort sequence, to handle dependency issues. |
data | string | No | Origin of the data copied into a new or modified physical file or SQL table. See Data origin. |
dmbr | string | No | Member(s) to copy to the new version of a physical file or SQL table, or to migrate from the prior environment. See Data members. |
rpgm | string | No | Whether MDRapid should map data from the old version of a file to the new version. See MDRapid. |
rjrn | string | No | Whether the new version of a table or access path should receive the journaling attributes of the file it replaced. See Reapply options. |
rcst | string | No | Whether the new version of a table should receive the constraints of the file it replaced. See Reapply options. |
rtrg | string | No | Whether the new version of a table should receive the triggers of the file it replaced. See Reapply options. |
rlfm | string | No | Whether the new version of a logical file should receive the members of the logical file it replaced. See Reapply options. |
dir | string | No | Whether a request of an object of type *IFS is a directory. *NO treats it as a file. *YES treats it as a directory. |
vref | string | No | Vendor-generated identifier so an external process can identify the transaction record in table MDDAREQ, where each object-request transaction is logged. |
pipe | string | No | Pipeline server ID defined in MDOpen. Pass with pipa and tkey to notify a pipeline server job of RFP activity for the RFP that contains this object request. |
pipa | string | No | MDCMS attribute defined for a *PIPE object. MDCMS generates a *PIPE object request and assigns it to the same RFP as the primary object. Pass with pipe and tkey. |
tkey | string | No | Key that uniquely identifies the pipeline job to update. Typically a one-time build number. Pass with pipe and pipa. |
Reason
| Value | Description |
|---|---|
*MIGRATE | Source and/or object is migrated into the target application level. Default if rsn is omitted. |
*DELETE | An existing object is deleted. |
*RECOMPILE | An object is recompiled based on the source already in the environment. |
*UPDATE | An ILE program or service program is updated to re-bind the current modules and service programs to the program. |
Copy
| Value | Description |
|---|---|
*NO | Default. The source or object is otherwise placed in the from-library prior to migration. |
*YES | MDCMS copies the source or object from the target environment to the from-library if it does not already exist there. |
Assign RFP
| Value | Description |
|---|---|
*NO | Default. The request is created without being assigned to an RFP. |
*YES | The request is assigned to the RFP number in rfp. |
*AUTO | MDCMS searches for an open RFP matching the application, level, user, and description. If found, the request is assigned to that RFP. If not found, a new RFP is created. |
*NEW | A new RFP is created for the application, level, user, and description. |
Continue requests
| Value | Description |
|---|---|
*YES | Default. Generate object requests for the next level when this level's RFP is complete. |
*NO | Do not generate object requests for the next level. |
Assign next-level requests
| Value | Description |
|---|---|
*YES | Default. Assign generated object requests for the next level to an RFP. |
*NO | Do not assign generated requests to an RFP. |
*MANUAL | Assign requests for the next level to a new RFP, but do not automatically submit the RFP, even if the next level is set to automatically submit RFPs by default. |
Data origin
| Value | Description |
|---|---|
*SAME | Default. Data is mapped from the old format of the modified file to the new format of the file of the same name and target library. |
*MIGRATE | Data is migrated with the file from the check-out location to the target library. |
*NONE | Data is not migrated. The new file format is empty. Required for a logical file if it is replacing a physical file. |
| (name) | System or SQL name of the file to copy from when deploying the requested file. |
Data members
| Value | Description |
|---|---|
*ALL | Default. All existing members are included for the copy. |
*FIRST | The first member in the originating file is copied. Any other members are omitted. |
| (name) | Specific member name to copy from the originating file. Any other members are omitted. |
MDRapid
| Value | Description |
|---|---|
*DEFAULT | Default. MDRapid is used if the number of records in the file is at least the number in the MDRapid template for the attribute. |
*NO | MDRapid is not used. |
*YES | MDRapid is used. |
Reapply options
Used by rjrn, rcst, rtrg, and rlfm.
| Value | Description |
|---|---|
*DFT | Default. Use the default option defined for the application. |
*NO | Do not reapply automatically. |
*YES | Reapply automatically. |
Example
Create an object request and assign it to an RFP. Replace {endpoint} with the URL endpoint defined for the MDCMS HTTP server.
curl -X POST "https://{endpoint}/object-request" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"appl":"TEST","lvl":"10","objt":"*PGM","attr":"SQLRPGLE","objn":"MYNEWPGM","user":"MMORGAN","rsn":"*migrate","folb":"MMORGAN13","fsfl":"QRPGLESRC","proj":"DEMOCH","task":"2","stsk":"3","arfp":"*YES","rfp":"1709","vref":"ep1234"}'
POST /object-request HTTP/1.1
Host: {endpoint}
Authorization: Bearer {token}
Content-Type: application/json
{
"appl": "TEST",
"lvl": "10",
"objt": "*PGM",
"attr": "SQLRPGLE",
"objn": "MYNEWPGM",
"user": "MMORGAN",
"rsn": "*migrate",
"folb": "MMORGAN13",
"fsfl": "QRPGLESRC",
"proj": "DEMOCH",
"task": "2",
"stsk": "3",
"arfp": "*YES",
"rfp": "1709",
"vref": "ep1234"
}
File attachments
If the object is of type *IFS or *REMOTE and the POST includes an attached file of the same name as objn, the file is copied to the path in folb for eventual deployment on an RFP.
If the source file is of type *IFS and the POST includes an attached file of the same name as srcn, the file is copied to the path in fslb.
Use Content-Type: multipart/mixed with a JSON payload part and a file part.
Example: request without attachment
curl -v -H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"appl":"GITAPT","lvl":"100","objt":"*IFS","attr":"JAVA-APP","rsn":"*MIGRATE","folb":"/gitapt/java-app/staging","objn":"java-app-1.0-SNAPSHOT.jar"}' \
"https://{endpoint}/object-request"
Example: loop through files to request and upload
## set current directory to target
cd target
## place list of jar files into array variable
jarFiles=($(ls *.jar))
## loop through array and create MDChange object request for each jar file
for jarFile in "${jarFiles[@]}"
do
curl -v -H "Content-Type: multipart/mixed" \
-H "Authorization: Bearer $1" \
-F 'payload={"appl":"GITAPT","lvl":"100","objt":"*IFS","attr":"JAVA-APP","rsn":"*MIGRATE","folb":"/gitapt/java-app/staging","objn":"'"$jarFile"'","proj":"JAVA-APP","arfp":"*AUTO","rfpd":"java-app deployment for build number '"$3"'"};type=application/json' \
-F "file=@$jarFile" \
"$2/object-request"
done
Where:
$1is the authorization token$2is the URL of the MDCMS REST API server$3is the pipeline build number invoking the shell
Example pipeline YAML step:
- step:
name: post to MDChange
script:
- sh ./request-object.sh $MD_TOKEN $MD_URL $BITBUCKET_BUILD_NUMBER
Response body
The response provides a rtn object.
Schema
| Property | Type | Description |
|---|---|---|
rtn | object | Result object. See Result object. |
Result object
| Property | Type | Description |
|---|---|---|
sev | string | Result severity. See Severity. |
msg | string | Message text. |
Severity
| Value | Meaning |
|---|---|
10 | Processed without errors or warnings |
20 | Processed, but warnings occurred |
30 | Did not process successfully due to errors |
Example
Related resources
| Resource | Description |
|---|---|
| Attributes REST API | List attributes for an application and level |
| Object Requests REST API | List or delete object requests |
| Open RFPs REST API | List active RFPs |
| RFP Submission REST API | Submit RFPs after creating object requests |
| Pipeline Request Trigger REST API | Check out from Git when not triggered by a webhook |