Skip to content

Object Request REST API

Published: 2025-06-26

Last Updated: 2026-09-15

Create or update an object request (check-out) in MDCMS. Optionally associate the request with a Git repository, path, file, and branch. Optionally attach a file to the request.

Method Path Description
POST /object-request Create an object request.
PATCH /object-request Update an existing object request.

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.

POST

Create an object request (check-out) in MDCMS.

POST /object-request

The request body is JSON. When requesting for *MIGRATE you can also attach a file in a multipart/mixed request. The file will be used as the object for *IFS or *REMOTE object types, or used as the source for object types created from source (IFS or member). See File attachments.

Preconditions

  • The owner of the authentication token is authorized in MDSEC to run command MDADDREQ.

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.
objn string Yes Name of the object to request.
objt string No System or MDCMS object type code for the object. If omitted, MDCMS determines the object type from Git repository attribute mapping, installation history, and MDXREF.
attr string No MDCMS attribute code that identifies the behavior and target locations for the requested object. If omitted, MDCMS will try to determine the attribute from Git repository attribute mapping using repo, gpath, and gfile or from MDCMS installation history when not mapping to a Git file.
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.
srca string No Source type of the source member, for example RPGLE, CLLE, or PF. Ignored if the attribute has no source or the source is an IFS file. If omitted, the existing member source type is used.
srcd string No Text description of the source member. Ignored if the attribute has no source or the source is an IFS file. If omitted, the existing member text is used. When source is imported and the member text is empty, MDCMS sets the description from the source in the higher level.
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 name based on the Developer Naming Template definition for the target level.
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 library is set to the name based on the Developer Naming Template definition for the target level.
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.
repo string No Git repository ID defined in MDCMS. Pass with branch to associate the request with Git. Required if branch is set or proj is *BRANCH. See Git.
gpath string No Path to the file in the Git repository. Used with repo and gfile to determine attr when attr is omitted. See Git.
gfile string No File name in the Git repository. Used with repo and gpath to determine attr when attr is omitted. A multipart attachment whose part file name matches gfile is copied for deployment. See Git and File attachments.
branch string No Git branch associated with the requested object. Pass with repo to associate the request with Git. Required when proj is *BRANCH. See Git.
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. See Project.
task integer No Existing, active task number. Omit or set to 0 to assign the request directly to the project. Ignored when proj is *BRANCH.
stsk integer No Existing, active subtask number. Omit or set to 0 to assign the request directly to the project or task. Ignored when proj is *BRANCH.
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. If omitted, *TASK is used. See RFP description.
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.

Git

Pass repo and branch to associate the object request with a Git repository defined in MDCMS. See Git Repositories REST API.

When repo and branch are set, MDCMS stores the request as repository type *GIT.

If attr is omitted, MDCMS determines the attribute from Git repository attribute mapping using repo, gpath, and gfile. If mapping does not resolve an attribute, the request fails with MDCMS Attribute missing.

If objt is omitted, MDCMS determines the object type from Git repository attribute mapping, installation history, and MDXREF. If the type still cannot be resolved, the request fails with Object Type missing.

If proj is *BRANCH, MDCMS sets proj, task, and stsk from the project that is linked to branch. repo and branch are required.

Project

Value Description
*BRANCH Derive the project, task, and subtask from the Git branch. Requires repo and branch.
(name) Existing open project ID.

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.

RFP description

Used only when arfp is *AUTO or *NEW.

Value Description
*TASK Default if rfpd is omitted. Use the project description, or the task description when task is greater than 0. Requires proj.
(text) Description used for a new RFP or to search for an existing RFP.

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.

{
  "appl": "TEST",
  "lvl": "10",
  "objn": "MYNEWPGM",
  "objt": "*PGM",
  "attr": "SQLRPGLE",
  "srca": "SQLRPGLE",
  "srcd": "Demo program",
  "user": "MMORGAN",
  "rsn": "*migrate",
  "folb": "MMORGAN13",
  "fsfl": "QRPGLESRC",
  "proj": "DEMOCH",
  "task": "2",
  "stsk": "3",
  "arfp": "*YES",
  "rfp": "1709",
  "vref": "ep1234"
}
curl -X POST "https://{endpoint}/object-request" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{"appl":"TEST","lvl":"10","objn":"MYNEWPGM","objt":"*PGM","attr":"SQLRPGLE","srca":"SQLRPGLE","srcd":"Demo program","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",
  "objn": "MYNEWPGM",
  "objt": "*PGM",
  "attr": "SQLRPGLE",
  "srca": "SQLRPGLE",
  "srcd": "Demo program",
  "user": "MMORGAN",
  "rsn": "*migrate",
  "folb": "MMORGAN13",
  "fsfl": "QRPGLESRC",
  "proj": "DEMOCH",
  "task": "2",
  "stsk": "3",
  "arfp": "*YES",
  "rfp": "1709",
  "vref": "ep1234"
}

Example: Git-linked request

Create an object request for a file in a Git repository. MDCMS resolves the attribute and object type from Git repository attribute mapping and the project from the branch.

{
  "appl": "TEST",
  "lvl": "10",
  "objn": "MYNEWPGM",
  "rsn": "*MIGRATE",
  "repo": "MDCMS",
  "gpath": "source/MCRPGLE",
  "gfile": "MYNEWPGM.sqlrpgle",
  "branch": "V8.6-83",
  "proj": "*BRANCH",
  "arfp": "*AUTO",
  "rfpd": "*TASK"
}
curl -X POST "https://{endpoint}/object-request" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{"appl":"TEST","lvl":"10","objn":"MYNEWPGM","rsn":"*MIGRATE","repo":"MDCMS","gpath":"source/MCRPGLE","gfile":"MYNEWPGM.sqlrpgle","branch":"V8.6-83","proj":"*BRANCH","arfp":"*AUTO","rfpd":"*TASK"}'
POST /object-request HTTP/1.1
Host: {endpoint}
Authorization: Bearer {token}
Content-Type: application/json

{
  "appl": "TEST",
  "lvl": "10",
  "objn": "MYNEWPGM",
  "rsn": "*MIGRATE",
  "repo": "MDCMS",
  "gpath": "source/MCRPGLE",
  "gfile": "MYNEWPGM.sqlrpgle",
  "branch": "V8.6-83",
  "proj": "*BRANCH",
  "arfp": "*AUTO",
  "rfpd": "*TASK"
}

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 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.

If the source is a native source member and the POST includes an attached file of the same name as srcn, the file is imported as the source member.

If the POST includes an attached file of the same name as gfile, the file is copied for the Git-linked request.

The part file name must be non-blank and must match objn, srcn, or gfile. Attachments are considered only when rsn is *MIGRATE and copy is *NO.

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:

  • $1 is the authorization token
  • $2 is the URL of the MDCMS REST API server
  • $3 is 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. When the request is created (sev is 10 or 20), it also provides a request object with the values MDCMS used, including values derived from Git mapping, *BRANCH, or *TASK.

Schema

Property Type Description
rtn object Result object. See Result object.
request object Created object request. Present when sev is 10 or 20. See Request object.

Result object

Property Type Description
sev string Result severity. See Severity.
msg string Message text.
existingObjectId integer Object request number that already holds a lock on the target object. Returned only when sev is 30 and a conflicting request exists.

Request object

Property Type Description
objectId integer Object request number.
objt string Object type used for the request, including a type resolved from Git mapping, history, or MDXREF.
attr string MDCMS attribute used for the request, including an attribute resolved from Git mapping.
rfp integer RFP number assigned to the request. 0 if the request is not assigned to an RFP.
rfpd string RFP description used, including a description resolved from *TASK.
proj string Project assigned to the request, including a project resolved from *BRANCH.
task integer Task number assigned to the request. 0 when the request is assigned directly to the project.
stsk integer Subtask number assigned to the request. 0 when the request is assigned directly to the project or task.
folb string Library or IFS path that contains the object.
fslb string Library or IFS path that contains the source.
fsfl string Source file that contains the source member.

Severity

Value Meaning
10 Processed without errors or warnings
20 Processed, but warnings occurred
30 Did not process successfully due to errors

Example

{
  "rtn": {
    "sev": "10",
    "msg": "Request created"
  },
  "request": {
    "objectId": 45281,
    "objt": "*PGM",
    "attr": "SQLRPGLE",
    "rfp": 1709,
    "rfpd": "Demo change",
    "proj": "DEMOCH",
    "task": 2,
    "stsk": 3,
    "folb": "MMORGAN13",
    "fslb": "MMORGAN13",
    "fsfl": "QRPGLESRC"
  }
}

Example: object already requested

{
  "rtn": {
    "sev": "30",
    "msg": "Target Object already locked by another request",
    "existingObjectId": 45270
  }
}

PATCH

Update an existing object request. Only fields that you send are changed. Omitted alphanumeric fields default to *SAME and are left unchanged. csqo of 0 is treated as unchanged.

The request can be identified only by objectId. The request must exist and be in status 00 (open) or 01 (assigned to an RFP).

PATCH /object-request

The request body is JSON. 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.
  • The owner of the authentication token is authorized for the request's application and level: code 37 to update a request they own, or code 31 to update a request owned by another user.
  • The object request exists and its status is 00 or 01.

If objectId is missing or is not greater than 0, the API returns HTTP 400 Bad Request.

Request body

Schema

Omitted alphanumeric properties are treated as *SAME. You can also send *SAME explicitly.

Property Type Required Description
objectId integer Yes Object request number to update. Must be greater than 0.
attr string No Replacement MDCMS attribute. The attribute must be defined for the request's application and level. Default *SAME.
srcn string No Replacement source member or IFS source file name. *OBJ sets the source name to the object name. Default *SAME.
srca string No Replacement source type of the source member. Ignored if the attribute has no source or the source is an IFS file. Default *SAME.
srcd string No Replacement text description of the source member. Ignored if the attribute has no source or the source is an IFS file. Default *SAME.
user string No Replacement programmer assigned to the request. Must be a valid MDSEC user. Default *SAME.
csqo integer No Replacement compile subsequence. 0 leaves the current value unchanged. Ignored for object types *IFS, *PIPE, and *REMOTE.
arfp string No Whether to change the RFP assignment. Default *SAME. See Assign RFP on PATCH.
rfp integer No RFP to assign when arfp is *YES and the request is not already assigned.
rfpd string No Description used for a new RFP or to search for an existing RFP when arfp is *AUTO or *NEW. If omitted or *SAME, the object name is used.
lock string No Whether the request is locked. *YES or *NO. Default *SAME.
gpath string No Replacement Git path. Applied only when the request is already linked to Git and the reason is modify or delete. Default *SAME.
gfile string No Replacement Git file name. Applied only when the request is already linked to Git and the reason is modify or delete. Default *SAME.

Assign RFP on PATCH

Value Description
*SAME Default. Leave the current RFP assignment unchanged.
*NO If the request is not assigned to an RFP, do nothing. If it is assigned, remove it from the RFP and set status to 00.
*YES If the request is already assigned to an RFP, do nothing. If it is not assigned, assign it to rfp.
*AUTO If the request is already assigned to an RFP, do nothing. If it is not assigned, search for an open RFP matching the application, level, user, and description, or create one.
*NEW Create a new RFP for the application, level, user, and description, and assign the request to it.

Example

Change the programmer and lock an existing object request, then assign it to an RFP. Replace {endpoint} with the URL endpoint defined for the MDCMS HTTP server.

{
  "objectId": 45281,
  "user": "MMORGAN",
  "lock": "*YES",
  "arfp": "*YES",
  "rfp": 1709
}
curl -X PATCH "https://{endpoint}/object-request" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{"objectId":45281,"user":"MMORGAN","lock":"*YES","arfp":"*YES","rfp":1709}'
PATCH /object-request HTTP/1.1
Host: {endpoint}
Authorization: Bearer {token}
Content-Type: application/json

{
  "objectId": 45281,
  "user": "MMORGAN",
  "lock": "*YES",
  "arfp": "*YES",
  "rfp": 1709
}

Example: update source and Git file

{
  "objectId": 45281,
  "srcn": "MDWSREQS",
  "srca": "SQLRPGLE",
  "srcd": "Object request REST API",
  "gpath": "source/MCRPGLE",
  "gfile": "MDWSREQS.sqlrpgle"
}

File attachments

PATCH accepts a multipart/mixed body with a JSON payload part and a file part, the same way as POST.

The attached file is imported into the existing request's from-library. The part file name must match srcn or gfile. If both srcn and gfile are omitted (treated as *SAME), any non-JSON attached file is used.

Response body

The response provides a rtn object. When the request is updated (sev is 10 or 20), it also provides a request object with the values stored after the update.

Schema

Property Type Description
rtn object Result object. See PATCH result object.
request object Updated object request. Present when sev is 10 or 20. See Updated request object.

Result object

Property Type Description
sev string Result severity. 10 succeeded, 20 succeeded with warnings, 30 failed.
msg string Message text.
existingObjectId integer Conflicting object request number. Returned only when sev is 30 and a lock conflict exists.

Updated request object

Property Type Description
objectId integer Object request number.
objt string Object type.
attr string MDCMS attribute after the update.
srcn string Source name after the update.
srca string Source attribute after the update.
srcd string Source description after the update.
user string Programmer assigned to the request.
csqo integer Compile subsequence.
arfp string Assign-RFP value applied to the update.
rfp integer RFP number after the update. 0 if the request is not assigned to an RFP.
lock string *YES if the request is locked, *NO if it is unlocked.
gpath string Git path after the update.
gfile string Git file name after the update.

Error messages

msg Description
objectId is required objectId was omitted or is not greater than 0. HTTP 400.
Request not found No object request exists for objectId.
Request record is locked Another job holds the request record.
Request not in open or assigned status The request status is not 00 or 01.
User not authorized to update Request The token user lacks MDSEC code 37 (own request) or 31 (another user's request).
Target Object already locked by another request Locking the request would conflict with another object request.

Example

{
  "rtn": {
    "sev": "10",
    "msg": "Request updated"
  },
  "request": {
    "objectId": 45281,
    "objt": "*PGM",
    "attr": "SQLRPGLE",
    "srcn": "MDWSREQS",
    "srca": "SQLRPGLE",
    "srcd": "Object request REST API",
    "user": "MMORGAN",
    "csqo": 10,
    "arfp": "*YES",
    "rfp": 1709,
    "lock": "*YES",
    "gpath": "source/MCRPGLE",
    "gfile": "MDWSREQS.sqlrpgle"
  }
}
Resource Description
Attributes REST API List attributes for an application and level
Git Repositories REST API List Git repositories defined in MDCMS
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