Skip to content

Pause Run Schedule By Name

agents.schedules.pause_by_name(strname, SchedulePauseByNameParams**kwargs) -> SchedulePauseByNameResponse
POST/agents/{agent_id}/schedules/name/{name}/pause

Pause a run schedule by its active name.

ParametersExpand Collapse
agent_id: str
name: str
note: Optional[str]

Optional note explaining the pause.

ReturnsExpand Collapse
class SchedulePauseByNameResponse: …

Response model describing a scheduled agent run.

id: str

The unique identifier of the run schedule.

agent_id: str

The agent this schedule belongs to.

initial_input: InitialInput

The initial input.

content: str

The initial prompt delivered to the task.

author: Optional[MessageAuthor]

The author attributed to the initial input.

One of the following:
"user"
"agent"
type: Optional[Literal["text"]]

Input content type.

initial_input_method: str

Delivery method, inferred from the agent’s ACP type.

name: str

Human-readable schedule name.

created_at: Optional[datetime]

When the schedule was created.

formatdate-time
creator_principal: Optional[CreatorPrincipal]

Credential-free creator identity stored with the schedule.

Never carries cookies, JWTs, API keys, OAuth tokens, or request headers — it is creator context used only for AuthZ and ownership at fire time.

account_id: Optional[str]

Account/workspace id of the creator.

principal_type: Optional[str]

e.g. ‘user’ or ‘service_account’.

service_account_id: Optional[str]

Creator service-account id, if a service principal.

user_id: Optional[str]

Creator user id, if a user principal.

cron_expression: Optional[str]

Cron cadence, if cron-based.

description: Optional[str]

Optional description.

end_at: Optional[datetime]

Schedule deactivation time.

formatdate-time
interval_seconds: Optional[int]

Interval cadence in seconds, if interval-based.

last_action_time: Optional[datetime]

When the schedule last fired.

formatdate-time
live_data_available: Optional[bool]

Whether requested live Temporal fields were retrieved successfully. Null when live enrichment was not requested.

next_action_times: Optional[List[datetime]]

Upcoming scheduled fire times.

num_actions_taken: Optional[int]

Number of times the schedule has fired.

paused: Optional[bool]

Whether the schedule is paused.

skipped_action_times: Optional[List[datetime]]

Skipped one-off scheduled fire times.

start_at: Optional[datetime]

Schedule activation time.

formatdate-time
state: Optional[Literal["ACTIVE", "PAUSED"]]

Live schedule state from Temporal.

One of the following:
"ACTIVE"
"PAUSED"
task_metadata: Optional[Dict[str, object]]

Task metadata at fire time.

task_params: Optional[Dict[str, object]]

Task params at fire time.

timezone: Optional[str]

Timezone the cron expression is evaluated in.

updated_at: Optional[datetime]

When the schedule was updated.

formatdate-time

Pause Run Schedule By Name

import os
from agentex import Agentex

client = Agentex(
    api_key=os.environ.get("AGENTEX_SDK_API_KEY"),  # This is the default and can be omitted
)
response = client.agents.schedules.pause_by_name(
    name="name",
    agent_id="agent_id",
)
print(response.id)
{
  "id": "id",
  "agent_id": "agent_id",
  "initial_input": {
    "content": "content",
    "author": "user",
    "type": "text"
  },
  "initial_input_method": "initial_input_method",
  "name": "name",
  "created_at": "2019-12-27T18:11:19.117Z",
  "creator_principal": {
    "account_id": "account_id",
    "principal_type": "principal_type",
    "service_account_id": "service_account_id",
    "user_id": "user_id"
  },
  "cron_expression": "cron_expression",
  "description": "description",
  "end_at": "2019-12-27T18:11:19.117Z",
  "interval_seconds": 0,
  "last_action_time": "2019-12-27T18:11:19.117Z",
  "live_data_available": true,
  "next_action_times": [
    "2019-12-27T18:11:19.117Z"
  ],
  "num_actions_taken": 0,
  "paused": true,
  "skipped_action_times": [
    "2019-12-27T18:11:19.117Z"
  ],
  "start_at": "2019-12-27T18:11:19.117Z",
  "state": "ACTIVE",
  "task_metadata": {
    "foo": "bar"
  },
  "task_params": {
    "foo": "bar"
  },
  "timezone": "timezone",
  "updated_at": "2019-12-27T18:11:19.117Z"
}
Returns Examples
{
  "id": "id",
  "agent_id": "agent_id",
  "initial_input": {
    "content": "content",
    "author": "user",
    "type": "text"
  },
  "initial_input_method": "initial_input_method",
  "name": "name",
  "created_at": "2019-12-27T18:11:19.117Z",
  "creator_principal": {
    "account_id": "account_id",
    "principal_type": "principal_type",
    "service_account_id": "service_account_id",
    "user_id": "user_id"
  },
  "cron_expression": "cron_expression",
  "description": "description",
  "end_at": "2019-12-27T18:11:19.117Z",
  "interval_seconds": 0,
  "last_action_time": "2019-12-27T18:11:19.117Z",
  "live_data_available": true,
  "next_action_times": [
    "2019-12-27T18:11:19.117Z"
  ],
  "num_actions_taken": 0,
  "paused": true,
  "skipped_action_times": [
    "2019-12-27T18:11:19.117Z"
  ],
  "start_at": "2019-12-27T18:11:19.117Z",
  "state": "ACTIVE",
  "task_metadata": {
    "foo": "bar"
  },
  "task_params": {
    "foo": "bar"
  },
  "timezone": "timezone",
  "updated_at": "2019-12-27T18:11:19.117Z"
}