Skip to content

Push files to remote

Request

Push discovered files as a remote content. Files should be sent as a multipart/form-data. Commit details like commit message and author can be sent as a JSON object in the commit field. The complete multipart body must not exceed 500 MiB, including files, fields, and multipart overhead.

Requires project.remotes.update permission. The CLI push command creates or updates the remote before it pushes files, so it also requires project.remotes.create.

Security
ApiKey
Path
orgIdstring^org_[0-9abcdefghjkmnpqrstvwxyz]{26}$required
Organization ID.
Example:org_01h1s5z6vf2mm1mz3hevnn9va7
projectIdstring^prj_[0-9abcdefghjkmnpqrstvwxyz]{26}$required
Project ID.
Example:prj_01hh1t9sa6gwfv5naz04gr7ehm
Headers
x-redocly-clientstring^[a-z0-9-]{1,64}/[\w.+-]{1,32}$

Identifies the calling client as <name>/<version>, for example reunite-ui/0.92.1. Used for API consumer observability. Requests without it are attributed as unknown.

Example:reunite-ui/0.92.1
Bodymultipart/form-data
remoteIdsArray of stringsrequired
commitobjectrequired
Commit details.
scoutJobIdstring or null^job_[0-9abcdefghjkmnpqrstvwxyz]{26}$

PROCESS_GIT_REPO job, if any. Required for Scout pushes. Unique identifier prefixed with job_.

Example:"job_01h2captefvs9bpg3v6twqqj9n"
scoutJobContextstringwrite-only

Context of the PROCESS_GIT_REPO job, if any. Applies to Scout pushes only. Used as commit status context.

Example:"Team A"
replaceboolean
Whether to replace the existing files. If provided, all files from the remote are removed and the new files are added. If not provided, the existing files are kept and the new files are added, overwriting the existing files where they overlap.
Default:false
Example:true
filesobjectwrite-only
Map of files to upload.
isMainBranchboolean
Is push provided to the main branch.
Example:true
remoteIdstring^rem_[0-9abcdefghjkmnpqrstvwxyz]{26}$deprecated

Remote ID. Unique identifier prefixed with rem_ for pushed remotes. Used only for single remote push.

curl -i -X POST \
  https://redocly.com/_mock/docs/platform/customization/reunite-api/openapi/orgs/org_01h1s5z6vf2mm1mz3hevnn9va7/projects/prj_01hh1t9sa6gwfv5naz04gr7ehm/pushes \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: multipart/form-data' \
  -H 'x-redocly-client: reunite-ui/0.92.1' \
  -F remoteIds=string \
  -F remoteId=string \
  -F 'commit="{\"message\":\"chore: Add new API\",\"branchName\":\"main\",\"sha\":\"f64ae8ea9dd7cf28822c471ea56b6d6765971305\",\"url\":\"https://gitlab.com/example-user/example-project/-/commit/f64ae8ea9dd7cf28822c471ea56b6d6765971305\",\"createdAt\":\"2020-01-01T00:00:00.000Z\",\"namespaceId\":\"Redocly\",\"repositoryId\":\"redoc\",\"author\":{\"name\":\"John Doe\",\"email\":\"johndoe@example.com\",\"image\":\"string\"}}";type=application/json' \
  -F scoutJobId=job_01h2captefvs9bpg3v6twqqj9n \
  -F 'scoutJobContext=Team A' \
  -F replace=true \
  -F 'files="{\"property1\":\"string\",\"property2\":\"string\"}";type=application/json' \
  -F isMainBranch=true

Responses

Content pushed.
Bodyapplication/json
idstring^push_[0-9abcdefghjkmnpqrstvwxyz]{26}$read-onlyrequired

Push ID. Unique identifier prefixed with push_.

Example:"push_01h2captefvs9bpg3v6twqqj9n"
objectstringread-only
Entity name.
Value:"push"
remoteIdsArray of stringsrequired
commitobjectrequired
Commit details.
scoutJobIdstring or null^job_[0-9abcdefghjkmnpqrstvwxyz]{26}$

PROCESS_GIT_REPO job, if any. Required for Scout pushes. Unique identifier prefixed with job_.

Example:"job_01h2captefvs9bpg3v6twqqj9n"
replaceboolean
Whether to replace the existing files. If provided, all files from the remote are removed and the new files are added. If not provided, the existing files are kept and the new files are added, overwriting the existing files where they overlap.
Default:false
Example:true
uploadedFilesArray of objectsread-onlyrequired
List of pushed files.
isMainBranchboolean
Is push provided to the main branch.
Example:true
isOutdatedbooleanread-onlyrequired

Indicates whether the push is discarded. In case several pushes are performed in a row, the one with most recent commit is applied only. Always false when commit's createdAt is omitted.

Example:false
hasChangesbooleanread-onlyrequired
Indicates if pushed files have changes.
Example:false
statusobjectread-onlyrequired
Status of the corresponding preview and production builds.
remoteIdstring^rem_[0-9abcdefghjkmnpqrstvwxyz]{26}$deprecated

Remote ID. Unique identifier prefixed with rem_ for pushed remotes. Used only for single remote push.

Response
{ "id": "push_01h2captefvs9bpg3v6twqqj9n", "object": "push", "remoteIds": [ "string" ], "remoteId": "string", "commit": { "message": "chore: Add new API", "branchName": "main", "sha": "f64ae8ea9dd7cf28822c471ea56b6d6765971305", "url": "https://gitlab.com/example-user/example-project/-/commit/f64ae8ea9dd7cf28822c471ea56b6d6765971305", "createdAt": "2020-01-01T00:00:00.000Z", "namespaceId": "Redocly", "repositoryId": "redoc", "author": { … }, "statuses": [ … ] }, "scoutJobId": "job_01h2captefvs9bpg3v6twqqj9n", "replace": true, "uploadedFiles": [ { … } ], "isMainBranch": true, "isOutdated": false, "hasChanges": false, "status": { "preview": { … }, "production": { … } } }