# GET Registry by ID

You can retrieve the information of a particular container registry. At this point, a `hostname` will be allocated to your registry. The registry `hostname` becomes a part of your image or your manifest or the repository name.

With the `GET` request, you can fetch the registry information by ID. The `registryId` must be provided. You can get it through [<mark style="color:blue;">GET Registries API call</mark>](/cloud/containers/private-container-registry/api-howtos/registries.md).

{% hint style="info" %}
**Note:** The sample `requestID` is `789f8e3c-d5c8-4359-8f85-c200fb89e97c`.
{% endhint %}

## Request

```bash
curl --location  \
    --request GET 'https://api.ionos.com/containerregistries/registries/789f8e3c-d5c8-4359-8f85-c200fb89e97c' \
    --header 'Authorization: Bearer ${TOKEN}' \
    --data-raw ''
```

### Path parameters

| **Field**      | **Type** |                   **Description**                   | **Example**                            |
| -------------- | :------: | :-------------------------------------------------: | -------------------------------------- |
| **registryId** |  string  | The ID of the registry to return. This is required. | `789f8e3c-d5c8-4359-8f85-c200fb89e97c` |

## Response

**200 OK - Successful operation**

```json
{
   "id": "8fb59000-494c-11ed-0242ac120002",
   "type": "registry",
   "href": "",
   "metadata": {
       "createdBy": "sample@test.com",
       "createdByUserId": "a5af0375-1c1d-4387-9ef1-6ee95d30e54a",
       "createdDate": "2022-10-07T14:30:06Z",
       "state": "Running"
   },
   "properties": {
       "name": "demo",
       "location": "de/fra",
       "garbageCollectionSchedule": {
           "days": [
               "Sunday",
               "Saturday"
           ],
           "time": "19:30:00+00:00"
       },
       "storageUsage": {
           "bytes": 0,
           "updatedAt": "2022-10-07T14:40:20Z"
       },
       "hostname": "demo.cr.de-fra.test.com",
       "apiSubnetAllowList": ["198.51.100.0/24", "203.0.113.1/32"]
   }
}
```

### Response fields

| **Field**              | **Type** |                           **Description**                           | **Example**                       |
| ---------------------- | :------: | :-----------------------------------------------------------------: | --------------------------------- |
| **createdBy**          |  string  |                  The user who created the registry.                 | `sample@test.com`                 |
| **type**               |  string  |                        The type of resource.                        | `registry`                        |
| **createdByUserId**    |  string  | The ID of the user or service account that initiated the operation. | `8fb59000-494c-11ed-0242ac120002` |
| **createdDate**        |  string  |              The date when the operation was initiated.             | `2022-10-07T14:30:06Z`            |
| **state**              |  string  |                     The status of the registry.                     | `Running`                         |
| **hostname**           |  string  |         The allocated hostname for the particular registry.         | `demo.cr.de-fra.test.com`         |
| **apiSubnetAllowList** |   array  |         The list of IP subnets that can access the registry.        | `198.51.100.0/24`                 |

{% hint style="info" %}
**Note:**

* Your values will differ from those in the sample code. Your response will have a different `id` and a `hostname`.
* Save the hostname in the response sample for using the [<mark style="color:blue;">**Docker commands**</mark>](https://docs.docker.com/registry/spec/api/).
  {% endhint %}

**400 Bad Request - The request made is invalid or corrupted**

```json
{
 "httpStatus": 400,
 "messages": [
   {
     "errorCode": "123",
     "message": "ad velit dolor dolore laboris"
   },
   {
     "errorCode": "123",
     "message": "tempor"
   }
 ]
}
```

**404 Not Found - The server did not find anything matching the request**

```json
{
 "httpStatus": 404,
 "messages": [
   {
     "errorCode": "123",
     "message": "ad velit dolor dolore laboris"
   },
   {
     "errorCode": "123",
     "message": "tempor"
   }
 ]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ionos.com/cloud/containers/private-container-registry/api-howtos/registry_id.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
