Перейти к содержимому
Главное меню
На этой странице

goal.updated

Цель · изменение.

Типы SDK

Python: from shtab_sdk.events import GoalUpdated
TypeScript: import type { GoalUpdated } from '@shtab/sdk/webhooks'.

Поля события

  • event_id — Идентификатор события для дедупликации.

  • type — Тип события.

  • occurred_at — Время события в ISO 8601.

  • resource_type — Тип ресурса.

  • resource_id — ID ресурса.

  • task_id — Связанная задача.

  • project_id — Связанный проект.

  • actor_id — Пользователь, совершивший действие.

  • origin — Канал изменения.

  • changed_fields — Имена затронутых полей.

  • body — Данные ресурса, если доступны.

  • tombstone — Данные для идентификации удалённого ресурса.

Значения changed_fields: datasources, date_start, date_start_time, deadline, deadline_time, emoji, files, icon, key_results, members, name, parent_id, portfolios, progress, responsible, status, tasks, weight, weights_type.

Пример доставки

{
  "delivery_id": "d94a840b-0e61-4af1-89cd-b5cbbd6d02da",
  "events": [
    {
      "event_id": "ea49f33e-a606-4872-8d3d-ad9e092fa97b",
      "type": "goal.updated",
      "occurred_at": "2026-11-23T10:00:00Z",
      "resource_type": "goal",
      "resource_id": 42,
      "task_id": null,
      "project_id": null,
      "actor_id": null,
      "origin": "app",
      "changed_fields": [],
      "body": {
        "id": 42,
        "name": "Пример",
        "icon": "Пример",
        "emoji": "Пример",
        "status": "on_schedule",
        "parent_id": null,
        "date_start": "Пример",
        "date_start_time": "Пример",
        "deadline": "Пример",
        "deadline_time": "Пример",
        "date_period": "full_year",
        "date_year": 42,
        "progress": 42,
        "weights_type": "equal",
        "weight": null,
        "created_by": {
          "id": 42,
          "first_name": "Пример",
          "last_name": "Пример",
          "full_name": "Пример"
        },
        "responsible": null,
        "created_at": "2026-11-23T10:00:00Z",
        "updated_at": "2026-11-23T10:00:00Z"
      },
      "tombstone": null
    }
  ]
}

Схема события

{
  "type": "object",
  "properties": {
    "event_id": {
      "type": "string"
    },
    "type": {
      "const": "goal.updated"
    },
    "occurred_at": {
      "type": "string"
    },
    "resource_type": {
      "const": "goal"
    },
    "resource_id": {
      "type": "integer"
    },
    "task_id": {
      "type": [
        "integer",
        "null"
      ]
    },
    "project_id": {
      "type": [
        "integer",
        "null"
      ]
    },
    "actor_id": {
      "type": [
        "integer",
        "null"
      ]
    },
    "origin": {
      "type": "string"
    },
    "changed_fields": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "body": {
      "anyOf": [
        {
          "$ref": "#/definitions/PublicGoal"
        },
        {
          "type": "null"
        }
      ]
    },
    "tombstone": {
      "type": "null"
    }
  },
  "required": [
    "event_id",
    "type",
    "occurred_at",
    "resource_type",
    "resource_id",
    "task_id",
    "project_id",
    "actor_id",
    "origin",
    "changed_fields",
    "body",
    "tombstone"
  ]
}

PublicGoal

{
  "type": "object",
  "properties": {
    "id": {
      "type": "integer"
    },
    "name": {
      "type": "string"
    },
    "icon": {
      "type": "string"
    },
    "emoji": {
      "type": "string"
    },
    "status": {
      "enum": [
        "on_schedule",
        "waiting",
        "at_risk",
        "deviated",
        "completed",
        "partially_completed",
        "not_completed",
        "cancelled"
      ]
    },
    "parent_id": {},
    "date_start": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "date_start_time": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "deadline": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "deadline_time": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "date_period": {
      "anyOf": [
        {
          "enum": [
            "full_year",
            "first_half",
            "second_half",
            "first_quarter",
            "second_quarter",
            "third_quarter",
            "fourth_quarter"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "date_year": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "progress": {
      "type": "integer"
    },
    "weights_type": {
      "enum": [
        "equal",
        "manually"
      ]
    },
    "weight": {},
    "created_by": {
      "anyOf": [
        {
          "$ref": "#/definitions/PublicUser"
        },
        {
          "type": "null"
        }
      ]
    },
    "responsible": {},
    "created_at": {
      "type": "string"
    },
    "updated_at": {
      "type": "string"
    }
  },
  "required": [
    "id"
  ]
}

PublicUser

{
  "type": "object",
  "properties": {
    "id": {
      "type": "integer"
    },
    "first_name": {
      "type": "string"
    },
    "last_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "full_name": {
      "type": "string"
    }
  },
  "required": [
    "id"
  ]
}