Scheduled

For instructions on how to authenticate to use this endpoint, see API overview.

Endpoints

GET
POST
GET
PATCH
DELETE

List all scheduled changes

Create, read, update and delete scheduled changes.

Required API key scopes

feature_flag:read

Query parameters

  • limit
    integer
  • model_name
    string
  • offset
    integer
  • record_id
    string

Response


Example request

GET /api/projects/:project_id/scheduled_changes
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/scheduled_changes/

Example response

Status 200
RESPONSE
{
"count": 123,
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100",
"results": [
{
"id": 0,
"team_id": 0,
"record_id": "string",
"model_name": "FeatureFlag",
"payload": null,
"scheduled_at": "2019-08-24T14:15:22Z",
"executed_at": "2019-08-24T14:15:22Z",
"failure_reason": "string",
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"updated_at": "2019-08-24T14:15:22Z",
"is_recurring": false,
"recurrence_interval": "daily",
"cron_expression": "string",
"last_executed_at": "2019-08-24T14:15:22Z",
"end_date": "2019-08-24T14:15:22Z",
"timezone": "string"
}
]
}

Create scheduled changes

Create, read, update and delete scheduled changes.

Required API key scopes

feature_flag:write

Request parameters

  • record_id
    string
  • model_name
  • payload
  • scheduled_at
    string
  • is_recurring
    boolean
    Default: false
  • recurrence_interval
  • cron_expression
    stringnull
  • end_date
    stringnull

Response


Example request

POST /api/projects/:project_id/scheduled_changes
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/scheduled_changes/\
-d record_id="string",\
-d model_name=undefined,\
-d payload=undefined,\
-d scheduled_at="string"

Example response

Status 201
RESPONSE
{
"id": 0,
"team_id": 0,
"record_id": "string",
"model_name": "FeatureFlag",
"payload": null,
"scheduled_at": "2019-08-24T14:15:22Z",
"executed_at": "2019-08-24T14:15:22Z",
"failure_reason": "string",
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"updated_at": "2019-08-24T14:15:22Z",
"is_recurring": false,
"recurrence_interval": "daily",
"cron_expression": "string",
"last_executed_at": "2019-08-24T14:15:22Z",
"end_date": "2019-08-24T14:15:22Z",
"timezone": "string"
}

Retrieve scheduled changes

Create, read, update and delete scheduled changes.

Required API key scopes

feature_flag:read

Path parameters

  • id
    integer

Response


Example request

GET /api/projects/:project_id/scheduled_changes/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/scheduled_changes/:id/

Example response

Status 200
RESPONSE
{
"id": 0,
"team_id": 0,
"record_id": "string",
"model_name": "FeatureFlag",
"payload": null,
"scheduled_at": "2019-08-24T14:15:22Z",
"executed_at": "2019-08-24T14:15:22Z",
"failure_reason": "string",
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"updated_at": "2019-08-24T14:15:22Z",
"is_recurring": false,
"recurrence_interval": "daily",
"cron_expression": "string",
"last_executed_at": "2019-08-24T14:15:22Z",
"end_date": "2019-08-24T14:15:22Z",
"timezone": "string"
}

Update scheduled changes

Create, read, update and delete scheduled changes.

Required API key scopes

feature_flag:write

Path parameters

  • id
    integer

Request parameters

  • record_id
    string
  • model_name
  • payload
  • scheduled_at
    string
  • is_recurring
    boolean
    Default: false
  • recurrence_interval
  • cron_expression
    stringnull
  • end_date
    stringnull

Response


Example request

PATCH /api/projects/:project_id/scheduled_changes/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/scheduled_changes/:id/\
-d team_id="integer"

Example response

Status 200
RESPONSE
{
"id": 0,
"team_id": 0,
"record_id": "string",
"model_name": "FeatureFlag",
"payload": null,
"scheduled_at": "2019-08-24T14:15:22Z",
"executed_at": "2019-08-24T14:15:22Z",
"failure_reason": "string",
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"updated_at": "2019-08-24T14:15:22Z",
"is_recurring": false,
"recurrence_interval": "daily",
"cron_expression": "string",
"last_executed_at": "2019-08-24T14:15:22Z",
"end_date": "2019-08-24T14:15:22Z",
"timezone": "string"
}

Delete scheduled changes

Create, read, update and delete scheduled changes.

Required API key scopes

feature_flag:write

Path parameters

  • id
    integer

Example request

DELETE /api/projects/:project_id/scheduled_changes/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X DELETE \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/scheduled_changes/:id/

Example response

Status 204 No response body

Community questions