{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/redocly/main/json-schema/redocly-push-2-schema.json",
  "title": "Push event",
  "x-generated": "2026-10-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/redocly-webhooks-api-openapi.yml#/components/schemas/push-2",
  "type": "object",
  "required": [
    "object_kind",
    "before",
    "after",
    "ref",
    "checkout_sha",
    "user_id",
    "user_name",
    "user_username",
    "user_email",
    "user_avatar",
    "project_id",
    "project",
    "repository",
    "commits",
    "total_commits_count"
  ],
  "properties": {
    "object_kind": {
      "type": "string",
      "description": "Type of webhook event data."
    },
    "before": {
      "type": "string",
      "description": "The SHA of the most recent commit on `ref` before the push."
    },
    "after": {
      "type": "string",
      "description": "The SHA of the most recent commit on `ref` after the push."
    },
    "ref": {
      "type": "string",
      "description": "The full git ref that is pushed. Example: `refs/heads/main`."
    },
    "checkout_sha": {
      "type": "string",
      "description": "The SHA of the most recent commit on `ref` after the push."
    },
    "user_id": {
      "type": "integer",
      "description": "Id of a gitlab user."
    },
    "user_name": {
      "type": "string",
      "description": "Name of a gitlab user."
    },
    "user_username": {
      "type": "string",
      "description": "Nickname of a gitlab user."
    },
    "user_email": {
      "type": "string",
      "description": "Email of a gitlab user."
    },
    "user_avatar": {
      "type": "string",
      "description": "User avatar url."
    },
    "project_id": {
      "type": "integer",
      "description": "Project id."
    },
    "project": {
      "$ref": "#/$defs/project"
    },
    "repository": {
      "$ref": "#/$defs/repository-2"
    },
    "commits": {
      "type": "array",
      "description": "An array of commit objects describing the pushed commits. (Pushed commits are all commits that are included in the `compare` between the `before` commit and the `after` commit.) The array includes a maximum of 20 commits.",
      "items": {
        "$ref": "#/$defs/commit-2"
      }
    },
    "total_commits_count": {
      "type": "integer",
      "description": "Contains the actual number of commits."
    }
  },
  "additionalProperties": false,
  "$defs": {
    "author": {
      "required": [
        "name",
        "email"
      ],
      "type": "object",
      "description": "Author details.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Author name."
        },
        "email": {
          "type": "string",
          "description": "Author email."
        }
      },
      "additionalProperties": false
    },
    "commit-2": {
      "description": "Commit details.",
      "type": "object",
      "required": [
        "id",
        "message",
        "title",
        "timestamp",
        "url",
        "author",
        "added",
        "modified",
        "removed"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Commit sha."
        },
        "message": {
          "type": "string",
          "description": "The commit message."
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "The ISO 8601 timestamp of the commit."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "URL that points to the commit API resource."
        },
        "author": {
          "$ref": "#/$defs/author"
        },
        "added": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "An array of files added in the commit."
        },
        "modified": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "An array of files modified by the commit."
        },
        "removed": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "An array of files removed in the commit."
        }
      },
      "additionalProperties": false,
      "title": "Commit"
    },
    "project": {
      "description": "GitLab Project details.",
      "type": "object",
      "required": [
        "id",
        "name",
        "description",
        "web_url",
        "avatar_url",
        "git_ssh_url",
        "git_http_url",
        "namespace",
        "visibility_level",
        "path_with_namespace",
        "default_branch",
        "homepage",
        "url",
        "ssh_url",
        "http_url"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "description": "Unique identifier of the project."
        },
        "name": {
          "type": "string",
          "description": "The name of the project."
        },
        "description": {
          "type": "string",
          "description": "The description of the project."
        },
        "web_url": {
          "type": "string",
          "description": "The URL to view the repository.",
          "format": "uri"
        },
        "avatar_url": {
          "type": "string",
          "description": "Repository avatar url.",
          "format": "uri"
        },
        "git_ssh_url": {
          "type": "string",
          "description": "SSH url of a project.",
          "format": "uri"
        },
        "git_http_url": {
          "type": "string",
          "description": "Url of a project.",
          "format": "uri"
        },
        "namespace": {
          "type": "string",
          "description": "Project namespace."
        },
        "visibility_level": {
          "type": "integer",
          "description": "Visibility level of a project."
        },
        "path_with_namespace": {
          "type": "string",
          "description": "Project path including namespace."
        },
        "default_branch": {
          "type": "string",
          "description": "Project default branch."
        },
        "homepage": {
          "type": "string",
          "description": "Project homepage url.",
          "format": "uri"
        },
        "url": {
          "type": "string",
          "description": "Url of a project.",
          "format": "uri"
        },
        "ssh_url": {
          "type": "string",
          "description": "SSH url of a project.",
          "format": "uri"
        },
        "http_url": {
          "type": "string",
          "description": "Url of a project.",
          "format": "uri"
        }
      },
      "additionalProperties": false,
      "title": "Project"
    },
    "repository-2": {
      "description": "GitLab repository details.",
      "type": "object",
      "required": [
        "name",
        "url",
        "description",
        "homepage",
        "git_http_url",
        "git_ssh_url",
        "visibility_level"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the project."
        },
        "url": {
          "type": "string",
          "description": "Repository git url.",
          "format": "uri"
        },
        "description": {
          "type": "string",
          "description": "The description of the project."
        },
        "homepage": {
          "type": "string",
          "description": "Project homepage url.",
          "format": "uri"
        },
        "git_http_url": {
          "type": "string",
          "description": "Git url of a project.",
          "format": "uri"
        },
        "git_ssh_url": {
          "type": "string",
          "description": "SSH url of a project.",
          "format": "uri"
        },
        "web_url": {
          "type": "string",
          "description": "The URL to view the repository.",
          "format": "uri"
        },
        "avatar_url": {
          "type": "string",
          "description": "Avatar url of the repository.",
          "format": "uri"
        },
        "visibility_level": {
          "type": "integer",
          "description": "Visibility level of a project."
        }
      },
      "additionalProperties": false,
      "title": "Repository"
    }
  }
}