REST API repository endpoints

The repository endpoints under /rhui/api/v1/repo/ list, inspect, add, create, delete, and synchronize Red Hat Update Infrastructure repositories. All repository endpoints require HTTP Basic authentication or a rhuiSessionId cookie.

Table 1. Repository endpoints
Endpoint Description

GET /rhui/api/v1/repo/info/{repo_id}

Get repository details by id.

GET /rhui/api/v1/repo/list

List all Red Hat Update Infrastructure repositories.

GET /rhui/api/v1/repo/unused

List entitled Red Hat candidate repositories not yet created in the product.

POST /rhui/api/v1/repo/add

Add Red Hat repositories by id or product.

POST /rhui/api/v1/repo/create_custom

Create a custom RPM repository.

POST /rhui/api/v1/repo/delete

Delete repositories by id.

POST /rhui/api/v1/repo/sync

Trigger repository syncs.

GET /rhui/api/v1/repo/info/{repo_id}

Gets details for a single repository. The repo_id path parameter is the Red Hat Update Infrastructure repository identifier.

Table 2. Parameters
Parameter Type In Description

repo_id

RepoIdValue

path

Required. Red Hat Update Infrastructure repository identifier.

sync_details

boolean

query

When true, include sync scheduling and last-sync fields (sync_due, next_sync_date, last_sync_*). Defaults to false; those fields are omitted unless explicitly requested.

Returns 200 with a Repository object (application/json). Endpoint-specific code: 404 if the requested resource is not found. Common response codes also apply.

GET /rhui/api/v1/repo/list

Returns all Red Hat Update Infrastructure-managed repositories, including RPM (yum) and container repositories.

Table 3. Parameters
Parameter Type In Description

sync_details

boolean

query

When true, include sync scheduling and last-sync fields (sync_due, next_sync_date, last_sync_*). Defaults to false; those fields are omitted unless explicitly requested.

Returns 200 with a RepositoryListResponse object (application/json). Common response codes also apply.

GET /rhui/api/v1/repo/unused

Lists entitled Red Hat candidate repositories that are available in the entitlement but not yet created in Red Hat Update Infrastructure.

Returns 200 with an UnusedRedHatRepositoriesResponse object (application/json). Common response codes also apply.

POST /rhui/api/v1/repo/add

Registers undeployed Red Hat repositories. Supply exactly one of the following non-empty arrays in the request body:

  • repo_ids: explicit repository identifiers.
  • product_names: all undeployed repositories in each named entitlement product.

Unknown product names are reported in the error. The optional sync_now field schedules a Pulp sync task immediately after each repository is successfully created. The response is always application/x-ndjson, with one JSON object per line for each repository processed.

Table 4. Request body: RepositoryCreateRequest (application/json)
Field Type Required Description

repo_ids

array of string

Conditional

Red Hat Update Infrastructure repository identifiers to add. Mutually exclusive with product_names.

product_names

array of string

Conditional

Entitlement product names; all undeployed repositories in each product are added. Mutually exclusive with repo_ids.

sync_now

boolean

No

When true, schedule a sync immediately after each repository is successfully created.

Returns 200 with per-repository add results streamed as RepoOpStreamEvent (application/x-ndjson). Common response codes also apply.

POST /rhui/api/v1/repo/create_custom

Creates a custom RPM repository.

Table 5. Request body: RepoCreateCustomRequest (application/json)
Field Type Required Description

repo_id

string

Yes

Repository id. Alphanumerics, underscore, and hyphen only.

display_name

string

No

Human-readable name. Defaults to repo_id.

path

string

No

Relative path segment. Defaults to repo_id.

protected

boolean

No

If true, the repository is placed under the protected URL prefix.

gpg_public_keys

array of string

No

Absolute paths to GPG public key files.

redhat_content

boolean

No

If true, associate Red Hat release RPM GPG key metadata.

Returns 201 with a RepoCreateCustomResponse object (application/json). Endpoint-specific code: 409 if the resource already exists or cannot be created in the current state. Common response codes also apply.

POST /rhui/api/v1/repo/delete

Deletes repositories by id.

Table 6. Request body: RepoDeleteRequest (application/json)
Field Type Required Description

repo_ids

array of string

Yes

Repository identifiers to delete.

Returns 200 with repository delete scheduling events streamed as RepoOpStreamEvent (application/x-ndjson). Common response codes also apply.

POST /rhui/api/v1/repo/sync

Schedules repository syncs. Supply exactly one of the following selectors in the request body:

  • all: must be true to sync all Red Hat repositories.
  • repo_ids: a non-empty array of specific repositories to sync.

The optional cron field defaults to false. When cron is true, the same due-date filtering is applied as rhui-tools sync uses when run from cron, skipping repositories whose scheduled sync is not yet due. The response is always application/x-ndjson, with one event per line while scheduling.

Table 7. Request body: RepoSyncRequest (application/json)
Field Type Required Description

all

boolean

Conditional

Must be true; sync all Red Hat repositories. Mutually exclusive with repo_ids.

repo_ids

array of string

Conditional

Repositories to sync. Mutually exclusive with all.

cron

boolean

No

When true, skip repositories whose scheduled sync is not yet due (cron-style). Defaults to false.

Returns 200 with sync scheduling events streamed as RepoOpStreamEvent (application/x-ndjson). Endpoint-specific code: 502 for an upstream Pulp service error. Common response codes also apply.

Table 8. Common response codes
Number Description Response

201

Client configuration RPM created — application/json

ClientRpmResponse

400

Invalid request — application/json

Error

401

Authentication required or invalid credentials — application/json

Error

500

Unexpected internal error — application/json

Error

503

Required session signing configuration is missing or invalid — application/json

Error