---
updatedAt: 2025-06-03T20:40:10.000Z
agentTools:
  projectIndex: https://docs.ol-hub.com/llms.txt
---

# tag project by id

The **tag project by id** API sends a POST request to create a new version of the project by the project id.

**Prerequisites**: The caller must supply the **projectId**.

**Input parameters**:

| Field name    | Description | Format |
| :------------ | :---------- | :----- |
| **projectId** | Project id  | UUID   |
| **reason**    | Description | String |

**Output parameters**:

| Field name         | Description           | Format         |
| :----------------- | :-------------------- | :------------- |
| **ProjectVersion** | Container - see below | ProjectVersion |

**ProjectVersion**:

| Field name      | Description                     | Format  |
| :-------------- | :------------------------------ | :------ |
| **projectId**   | Project id                      | UUID    |
| **version**     | Project version number          | Integer |
| **reason**      | Description                     | String  |
| **versionedBy** | User who versioned the project  | String  |
| **versionedAt** | Date-time project was versioned | Instant |

**Example**:

```
{
    "projectId": "b8d28b7e-edfb-4c18-8fb7-e5b3d09db83f",
    "version": 1,
    "versionedBy": "local dev",
    "reason": "tag project by id reason",
    "versionedAt": "2021-07-18T14:23:52.060612Z"
}
```

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Public APIs - Projects",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.ol-hub.com/backend"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-KEY"
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "tags": [
    {
      "name": "Project"
    }
  ],
  "paths": {
    "/api/v1/projects/{id}/versions": {
      "post": {
        "tags": [
          "Project"
        ],
        "summary": "tag project by id",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "example": {
                  "reason": "tag project by id reason"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "example": "application/json"
          },
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "transfer-encoding": {
                "schema": {
                  "type": "string",
                  "example": "chunked"
                }
              },
              "Content-Type": {
                "schema": {
                  "type": "string",
                  "example": "application/json"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "projectId": "b8d28b7e-edfb-4c18-8fb7-e5b3d09db83f",
                  "version": 1,
                  "versionedBy": "local dev",
                  "reason": "tag project by id reason",
                  "versionedAt": "2021-07-18T14:23:52.060612Z"
                }
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```