# Container Registry API reference

Source: `@socra/scr-api@0.2.0` (ScrContract).

Socra Container Registry — private project-scoped OCI distribution.

## API surface

Base URL: `https://scr.socra.cloud`

## Container Repositories

A project-scoped OCI repository, created by the first authorized push.

### Resource schema

- `id` custom, required
- `project_id` custom, required
- `account` string, required
- `project` string, required
- `name` string (min length: 1; max length: 128; pattern: ^[a-z0-9]+(?:(?:[._]|__|-+)[a-z0-9]+)*$), required
- `status` "active" | "disabled", required
- `image_count` integer (min: 0; max: 9007199254740991), required
- `size_bytes` integer (min: 0; max: 9007199254740991), required
- `created_at` custom, required
- `updated_at` custom, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {},
    "project_id": {},
    "account": {
      "type": "string"
    },
    "project": {
      "type": "string"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "pattern": "^[a-z0-9]+(?:(?:[._]|__|-+)[a-z0-9]+)*$"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "disabled"
      ]
    },
    "image_count": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "size_bytes": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "created_at": {},
    "updated_at": {}
  },
  "required": [
    "id",
    "project_id",
    "account",
    "project",
    "name",
    "status",
    "image_count",
    "size_bytes",
    "created_at",
    "updated_at"
  ],
  "additionalProperties": false
}
```

### List container repositories

`GET /v1/repositories`

#### Query parameters

- `project_id` custom, required
- `status` "active" | "disabled", optional
- `limit` integer (min: 1; max: 100), optional
- `after` string, optional

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "project_id": {},
    "status": {
      "type": "string",
      "enum": [
        "active",
        "disabled"
      ]
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    },
    "after": {
      "type": "string"
    }
  },
  "required": [
    "project_id"
  ]
}
```

#### Response

- `data` object[], required
  - `id` custom, required
  - `project_id` custom, required
  - `account` string, required
  - `project` string, required
  - `name` string (min length: 1; max length: 128; pattern: ^[a-z0-9]+(?:(?:[._]|__|-+)[a-z0-9]+)*$), required
  - `status` "active" | "disabled", required
  - `image_count` integer (min: 0; max: 9007199254740991), required
  - `size_bytes` integer (min: 0; max: 9007199254740991), required
  - `created_at` custom, required
  - `updated_at` custom, required
- `has_more` boolean, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {},
          "project_id": {},
          "account": {
            "type": "string"
          },
          "project": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[a-z0-9]+(?:(?:[._]|__|-+)[a-z0-9]+)*$"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "disabled"
            ]
          },
          "image_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "created_at": {},
          "updated_at": {}
        },
        "required": [
          "id",
          "project_id",
          "account",
          "project",
          "name",
          "status",
          "image_count",
          "size_bytes",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      }
    },
    "has_more": {
      "type": "boolean"
    }
  },
  "required": [
    "data",
    "has_more"
  ],
  "additionalProperties": false
}
```

### Get container repository

`GET /v1/repositories/{id}`

#### Path parameters

- `id` custom, required

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
```


#### Response

- `id` custom, required
- `project_id` custom, required
- `account` string, required
- `project` string, required
- `name` string (min length: 1; max length: 128; pattern: ^[a-z0-9]+(?:(?:[._]|__|-+)[a-z0-9]+)*$), required
- `status` "active" | "disabled", required
- `image_count` integer (min: 0; max: 9007199254740991), required
- `size_bytes` integer (min: 0; max: 9007199254740991), required
- `created_at` custom, required
- `updated_at` custom, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {},
    "project_id": {},
    "account": {
      "type": "string"
    },
    "project": {
      "type": "string"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "pattern": "^[a-z0-9]+(?:(?:[._]|__|-+)[a-z0-9]+)*$"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "disabled"
      ]
    },
    "image_count": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "size_bytes": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "created_at": {},
    "updated_at": {}
  },
  "required": [
    "id",
    "project_id",
    "account",
    "project",
    "name",
    "status",
    "image_count",
    "size_bytes",
    "created_at",
    "updated_at"
  ],
  "additionalProperties": false
}
```

### Update container repository

`PATCH /v1/repositories/{id}`

#### Path parameters

- `id` custom, required

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
```


#### Request body

- `status` "active" | "disabled", optional

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "active",
        "disabled"
      ]
    }
  }
}
```

#### Response

- `id` custom, required
- `project_id` custom, required
- `account` string, required
- `project` string, required
- `name` string (min length: 1; max length: 128; pattern: ^[a-z0-9]+(?:(?:[._]|__|-+)[a-z0-9]+)*$), required
- `status` "active" | "disabled", required
- `image_count` integer (min: 0; max: 9007199254740991), required
- `size_bytes` integer (min: 0; max: 9007199254740991), required
- `created_at` custom, required
- `updated_at` custom, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {},
    "project_id": {},
    "account": {
      "type": "string"
    },
    "project": {
      "type": "string"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "pattern": "^[a-z0-9]+(?:(?:[._]|__|-+)[a-z0-9]+)*$"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "disabled"
      ]
    },
    "image_count": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "size_bytes": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "created_at": {},
    "updated_at": {}
  },
  "required": [
    "id",
    "project_id",
    "account",
    "project",
    "name",
    "status",
    "image_count",
    "size_bytes",
    "created_at",
    "updated_at"
  ],
  "additionalProperties": false
}
```

### Delete empty container repository

`DELETE /v1/repositories/{id}`

#### Path parameters

- `id` custom, required

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
```


#### Response

No response body.

## Container Images

An immutable OCI image manifest or index identified by digest.

### Resource schema

- `id` custom, required
- `repository_id` custom, required
- `digest` string (pattern: ^sha256:[0-9a-f]{64}$), required
- `media_type` string, required
- `kind` "image" | "index" | "artifact", required
- `size_bytes` integer (min: 0; max: 9007199254740991), required
- `tags` string[], required
- `created_at` custom, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {},
    "repository_id": {},
    "digest": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "media_type": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "enum": [
        "image",
        "index",
        "artifact"
      ]
    },
    "size_bytes": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "created_at": {}
  },
  "required": [
    "id",
    "repository_id",
    "digest",
    "media_type",
    "kind",
    "size_bytes",
    "tags",
    "created_at"
  ],
  "additionalProperties": false
}
```

### List container images

`GET /v1/images`

#### Query parameters

- `repository_id` custom, required
- `limit` integer (min: 1; max: 100), optional
- `after` string, optional

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "repository_id": {},
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    },
    "after": {
      "type": "string"
    }
  },
  "required": [
    "repository_id"
  ]
}
```

#### Response

- `data` object[], required
  - `id` custom, required
  - `repository_id` custom, required
  - `digest` string (pattern: ^sha256:[0-9a-f]{64}$), required
  - `media_type` string, required
  - `kind` "image" | "index" | "artifact", required
  - `size_bytes` integer (min: 0; max: 9007199254740991), required
  - `tags` string[], required
  - `created_at` custom, required
- `has_more` boolean, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {},
          "repository_id": {},
          "digest": {
            "type": "string",
            "pattern": "^sha256:[0-9a-f]{64}$"
          },
          "media_type": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "image",
              "index",
              "artifact"
            ]
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "created_at": {}
        },
        "required": [
          "id",
          "repository_id",
          "digest",
          "media_type",
          "kind",
          "size_bytes",
          "tags",
          "created_at"
        ],
        "additionalProperties": false
      }
    },
    "has_more": {
      "type": "boolean"
    }
  },
  "required": [
    "data",
    "has_more"
  ],
  "additionalProperties": false
}
```

### Get container image

`GET /v1/images/{id}`

#### Path parameters

- `id` custom, required

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
```


#### Response

- `id` custom, required
- `repository_id` custom, required
- `digest` string (pattern: ^sha256:[0-9a-f]{64}$), required
- `media_type` string, required
- `kind` "image" | "index" | "artifact", required
- `size_bytes` integer (min: 0; max: 9007199254740991), required
- `tags` string[], required
- `created_at` custom, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {},
    "repository_id": {},
    "digest": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "media_type": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "enum": [
        "image",
        "index",
        "artifact"
      ]
    },
    "size_bytes": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "created_at": {}
  },
  "required": [
    "id",
    "repository_id",
    "digest",
    "media_type",
    "kind",
    "size_bytes",
    "tags",
    "created_at"
  ],
  "additionalProperties": false
}
```

### Delete untagged container image

`DELETE /v1/images/{id}`

#### Path parameters

- `id` custom, required

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
```


#### Response

No response body.

## Container Tags

A mutable human-readable reference to an immutable image digest.

### Resource schema

- `id` custom, required
- `repository_id` custom, required
- `name` string (min length: 1; max length: 128; pattern: ^[A-Za-z0-9_][A-Za-z0-9._-]*$), required
- `digest` string (pattern: ^sha256:[0-9a-f]{64}$), required
- `created_at` custom, required
- `updated_at` custom, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {},
    "repository_id": {},
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "pattern": "^[A-Za-z0-9_][A-Za-z0-9._-]*$"
    },
    "digest": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "created_at": {},
    "updated_at": {}
  },
  "required": [
    "id",
    "repository_id",
    "name",
    "digest",
    "created_at",
    "updated_at"
  ],
  "additionalProperties": false
}
```

### List container tags

`GET /v1/tags`

#### Query parameters

- `repository_id` custom, required
- `limit` integer (min: 1; max: 100), optional
- `after` string, optional

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "repository_id": {},
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    },
    "after": {
      "type": "string"
    }
  },
  "required": [
    "repository_id"
  ]
}
```

#### Response

- `data` object[], required
  - `id` custom, required
  - `repository_id` custom, required
  - `name` string (min length: 1; max length: 128; pattern: ^[A-Za-z0-9_][A-Za-z0-9._-]*$), required
  - `digest` string (pattern: ^sha256:[0-9a-f]{64}$), required
  - `created_at` custom, required
  - `updated_at` custom, required
- `has_more` boolean, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {},
          "repository_id": {},
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_][A-Za-z0-9._-]*$"
          },
          "digest": {
            "type": "string",
            "pattern": "^sha256:[0-9a-f]{64}$"
          },
          "created_at": {},
          "updated_at": {}
        },
        "required": [
          "id",
          "repository_id",
          "name",
          "digest",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      }
    },
    "has_more": {
      "type": "boolean"
    }
  },
  "required": [
    "data",
    "has_more"
  ],
  "additionalProperties": false
}
```

### Get container tag

`GET /v1/tags/{id}`

#### Path parameters

- `id` custom, required

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
```


#### Response

- `id` custom, required
- `repository_id` custom, required
- `name` string (min length: 1; max length: 128; pattern: ^[A-Za-z0-9_][A-Za-z0-9._-]*$), required
- `digest` string (pattern: ^sha256:[0-9a-f]{64}$), required
- `created_at` custom, required
- `updated_at` custom, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {},
    "repository_id": {},
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "pattern": "^[A-Za-z0-9_][A-Za-z0-9._-]*$"
    },
    "digest": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "created_at": {},
    "updated_at": {}
  },
  "required": [
    "id",
    "repository_id",
    "name",
    "digest",
    "created_at",
    "updated_at"
  ],
  "additionalProperties": false
}
```

### Delete container tag

`DELETE /v1/tags/{id}`

#### Path parameters

- `id` custom, required

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
```


#### Response

No response body.

---

Company: Socra — Multiply Your Judgment
Canonical URL: https://cloud.socra.com/docs/scr/reference/api
