archastro.platform.v1.resources.custom_objects

  1# Copyright (c) 2026 ArchAstro Inc. Licensed under the MIT License.
  2# This file is auto-generated by @archastro/sdk-generator. Do not edit.
  3# Content hash: ff8413024cce
  4
  5from __future__ import annotations
  6
  7import builtins
  8from datetime import datetime
  9from typing import Any, Required, TypedDict
 10
 11from pydantic import BaseModel, Field
 12
 13from ...runtime.http_client import HttpClient, SyncHttpClient
 14from ...types.common import CustomObject, CustomObjectListResponse
 15
 16
 17class CustomObjectCreateInputAclAddItem(TypedDict, total=False):
 18    actions: Required[list[str]]
 19    'Array of action strings the principal is permitted to perform, e.g. `["read", "write"]`. Must contain at least one entry.'
 20    principal: str | None
 21    'The identifier of the principal. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`; omit entirely when `principal_type` is `"everyone"`.'
 22    principal_type: Required[str]
 23    'The kind of principal receiving the grant. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.'
 24
 25
 26class CustomObjectCreateInputAclGrantsItem(TypedDict, total=False):
 27    actions: Required[list[str]]
 28    'Array of action strings the principal is permitted to perform, e.g. `["read", "write"]`. Must contain at least one entry.'
 29    principal: str | None
 30    'The identifier of the principal. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`; omit entirely when `principal_type` is `"everyone"`.'
 31    principal_type: Required[str]
 32    'The kind of principal receiving the grant. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.'
 33
 34
 35class CustomObjectCreateInputAclRemoveItem(TypedDict, total=False):
 36    principal: str | None
 37    'The identifier of the principal to remove. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`. Omit when `principal_type` is `"everyone"`.'
 38    principal_type: Required[str]
 39    'The kind of principal to remove. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.'
 40
 41
 42class CustomObjectCreateInputAcl(TypedDict, total=False):
 43    add: list[CustomObjectCreateInputAclAddItem] | None
 44    "Patch mode: grants to add or merge into the existing list. Cannot be combined with `grants`."
 45    grants: list[CustomObjectCreateInputAclGrantsItem] | None
 46    "Replace mode: the complete new list of grants that replaces all existing entries. Send an empty array (`[]`) to clear all grants. Cannot be combined with `add` or `remove`."
 47    remove: list[CustomObjectCreateInputAclRemoveItem] | None
 48    "Patch mode: principals whose grants should be removed from the existing list. Cannot be combined with `grants`."
 49
 50
 51class CustomObjectCreateInput(TypedDict, total=False):
 52    "Create a custom object"
 53
 54    acl: CustomObjectCreateInputAcl | None
 55    "Access control list for the custom object. Supports explicit `read` and `write` grants to users, teams, organizations, organization roles, agents, or everyone."
 56    agent: str | None
 57    "Agent user ID to set as the object owner. Used when neither `team` nor `user` is supplied."
 58    config: str | None
 59    "Config ID (`cfg_...`) that resolves to the target schema. Provide one of `type`, `schema_key`, or `config`."
 60    expires_at: datetime | None
 61    "Absolute expiry time in RFC 3339 format. Pass null to clear; omit to leave unchanged on update."
 62    fields: dict[str, Any] | None
 63    "Key-value map of field values for the new object. Must conform to the schema's field definitions. Omit to create an object with all fields at their default or null values."
 64    org: str | None
 65    "Organization ID (`org_...`) to associate with the object. Typically required for system-owned objects."
 66    schema_key: str | None
 67    "Legacy alias for `type` (schema `lookup_key`). Prefer `type` on new clients. Provide one of `type`, `schema_key`, or `config`."
 68    system: bool | None
 69    "When `true`, creates a system-owned object with no team, user, or agent owner. Requires elevated API credentials; returns 403 if the caller lacks permission."
 70    team: str | None
 71    "Team ID (`team_...`) to set as the object owner. When supplied, takes priority over `user` and `agent`."
 72    type: str | None
 73    "Schema type identifier (`lookup_key`) that defines the object's shape and validation rules. Preferred over the legacy `schema_key` / `config` aliases."
 74    upsert: bool | None
 75    "When `true` and the schema declares a `row_key`, updates the existing object at that key for the same owner instead of returning 409 Conflict. Returns HTTP 200 on update and 201 on create."
 76    user: str | None
 77    "User ID (`user_...`) to set as the object owner. Used when neither `team` nor a higher-priority owner is set."
 78
 79
 80class CustomObjectPatchInput(TypedDict, total=False):
 81    "Apply numeric patch ops to a custom object"
 82
 83    agent: str | None
 84    "Agent user ID owning the keyed row. At most one owner selector may be present."
 85    create_with: dict[str, Any] | None
 86    "Field values used to create the row when the keyed form finds no existing row. Merged over the key fields before validation; ignored by the `object` form."
 87    idempotency_key: str | None
 88    "Client-supplied deduplication key for this patch. A retry with the same key and the same ops replays the stored result without re-applying the write (survives server restarts); reusing a key with different ops returns 409."
 89    object: str | None
 90    "Custom object ID (`cobj_...`) to patch. Exactly one of `object` or `schema` + `row_key` is required."
 91    ops: Required[list[dict[str, Any]]]
 92    'Numeric patch ops to apply in order (e.g. `[%{"op" => "increment", "path" => "count", "by" => 1}]`). Supported ops: `increment` (`by`), `max`/`min` (`value`), `set_if_newer` (`value`, `fence_path`, `fence`).'
 93    row_key: str | None
 94    "Row key naming the row within `schema` (e.g. a counter name). Requires `schema`."
 95    schema: str | None
 96    "Schema type identifier (`lookup_key`) for the keyed form. Requires `row_key`."
 97    sort_key: list[str] | None
 98    "Sort-key segments partitioning rows within the `row_key` bucket. Only meaningful for schemas that declare a `sort_key`."
 99    team: str | None
100    "Team ID (`tem_...`) owning the keyed row. Defaults to the viewer's owner like the create contract."
101    user: str | None
102    "User ID (`usr_...`) owning the keyed row. At most one owner selector may be present."
103
104
105class CustomObjectReplaceInputAclAddItem(TypedDict, total=False):
106    actions: Required[list[str]]
107    'Array of action strings the principal is permitted to perform, e.g. `["read", "write"]`. Must contain at least one entry.'
108    principal: str | None
109    'The identifier of the principal. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`; omit entirely when `principal_type` is `"everyone"`.'
110    principal_type: Required[str]
111    'The kind of principal receiving the grant. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.'
112
113
114class CustomObjectReplaceInputAclGrantsItem(TypedDict, total=False):
115    actions: Required[list[str]]
116    'Array of action strings the principal is permitted to perform, e.g. `["read", "write"]`. Must contain at least one entry.'
117    principal: str | None
118    'The identifier of the principal. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`; omit entirely when `principal_type` is `"everyone"`.'
119    principal_type: Required[str]
120    'The kind of principal receiving the grant. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.'
121
122
123class CustomObjectReplaceInputAclRemoveItem(TypedDict, total=False):
124    principal: str | None
125    'The identifier of the principal to remove. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`. Omit when `principal_type` is `"everyone"`.'
126    principal_type: Required[str]
127    'The kind of principal to remove. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.'
128
129
130class CustomObjectReplaceInputAcl(TypedDict, total=False):
131    add: list[CustomObjectReplaceInputAclAddItem] | None
132    "Patch mode: grants to add or merge into the existing list. Cannot be combined with `grants`."
133    grants: list[CustomObjectReplaceInputAclGrantsItem] | None
134    "Replace mode: the complete new list of grants that replaces all existing entries. Send an empty array (`[]`) to clear all grants. Cannot be combined with `add` or `remove`."
135    remove: list[CustomObjectReplaceInputAclRemoveItem] | None
136    "Patch mode: principals whose grants should be removed from the existing list. Cannot be combined with `grants`."
137
138
139class CustomObjectReplaceInput(TypedDict, total=False):
140    "Update a custom object"
141
142    acl: CustomObjectReplaceInputAcl | None
143    "Updated access control list. Supports full replacement via `grants` or targeted `add`/`remove` operations."
144    expected_version: int | None
145    "Version number the caller expects to be current. If the object's actual current version does not match, the request returns 409 to signal a concurrent modification. Omit to skip optimistic locking and keep the existing OCC merge retry."
146    expires_at: datetime | None
147    "Absolute expiry time in RFC 3339 format. Pass null to clear; omit to leave unchanged on update."
148    field_ops: dict[str, Any] | None
149    "Granular array operations to apply per field (e.g. append, prepend, remove). A field must not appear in both `fields` and `field_ops`."
150    fields: dict[str, Any] | None
151    "Key-value map of field values to merge into the object. Only the supplied keys are affected."
152    idempotency_key: str | None
153    "Client-supplied deduplication key for this write. A retry with the same key and the same body replays the stored result without re-applying the write (survives server restarts); reusing a key with a different body returns 409."
154    type: str | None
155    "Schema type identifier (`lookup_key`) of the object. Optional; used for routing context only."
156
157
158class CustomObjectPatchResponseDataAclAddItem(BaseModel):
159    actions: list[str] = Field(
160        ...,
161        description='Array of action strings the principal is permitted to perform, e.g. `["read", "write"]`. Must contain at least one entry.',
162    )
163    principal: str | None = Field(
164        default=None,
165        description='The identifier of the principal. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`; omit entirely when `principal_type` is `"everyone"`.',
166    )
167    principal_type: str = Field(
168        ...,
169        description='The kind of principal receiving the grant. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.',
170    )
171
172
173class CustomObjectPatchResponseDataAclGrantsItem(BaseModel):
174    actions: list[str] = Field(
175        ...,
176        description='Array of action strings the principal is permitted to perform, e.g. `["read", "write"]`. Must contain at least one entry.',
177    )
178    principal: str | None = Field(
179        default=None,
180        description='The identifier of the principal. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`; omit entirely when `principal_type` is `"everyone"`.',
181    )
182    principal_type: str = Field(
183        ...,
184        description='The kind of principal receiving the grant. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.',
185    )
186
187
188class CustomObjectPatchResponseDataAclRemoveItem(BaseModel):
189    principal: str | None = Field(
190        default=None,
191        description='The identifier of the principal to remove. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`. Omit when `principal_type` is `"everyone"`.',
192    )
193    principal_type: str = Field(
194        ...,
195        description='The kind of principal to remove. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.',
196    )
197
198
199class CustomObjectPatchResponseDataAcl(BaseModel):
200    add: list[CustomObjectPatchResponseDataAclAddItem] | None = Field(
201        default=None,
202        description="Patch mode: grants to add or merge into the existing list. Cannot be combined with `grants`.",
203    )
204    grants: list[CustomObjectPatchResponseDataAclGrantsItem] | None = Field(
205        default=None,
206        description="Replace mode: the complete new list of grants that replaces all existing entries. Send an empty array (`[]`) to clear all grants. Cannot be combined with `add` or `remove`.",
207    )
208    remove: list[CustomObjectPatchResponseDataAclRemoveItem] | None = Field(
209        default=None,
210        description="Patch mode: principals whose grants should be removed from the existing list. Cannot be combined with `grants`.",
211    )
212
213
214class CustomObjectPatchResponseData(BaseModel):
215    acl: CustomObjectPatchResponseDataAcl | None = Field(
216        default=None,
217        description="Access control list governing read and write access to this custom object. Only returned to resource owners and privileged or organization-admin viewers; `null` for everyone else.",
218    )
219    agent: str | None = Field(
220        default=None,
221        description="ID of the agent that owns this object (`agt_...`). `null` for other ownership types.",
222    )
223    created_at: datetime | None = Field(
224        default=None, description="When the custom object was created (ISO 8601)."
225    )
226    expires_at: datetime | None = Field(
227        default=None, description="Absolute expiry time (RFC 3339). Null when no expiry is set."
228    )
229    fields: dict[str, Any] | None = Field(
230        default=None,
231        description="Map of field names to their current values as defined by the object's schema type.",
232    )
233    id: str = Field(..., description="Unique identifier for the custom object (`cobj_...`).")
234    org: str | None = Field(
235        default=None, description="ID of the organization this object belongs to (`org_...`)."
236    )
237    row_key: str | None = Field(
238        default=None,
239        description="An optional stable key used to identify this object by a caller-controlled string rather than its generated ID. `null` if not set.",
240    )
241    sandbox: str | None = Field(
242        default=None,
243        description="ID of the sandbox environment this object is scoped to (`dsb_...`). `null` for production objects.",
244    )
245    schema_type: str | None = Field(
246        default=None,
247        description="The lookup key of the schema type that defines this object's field structure. `null` if the schema type has not been set.",
248    )
249    team: str | None = Field(
250        default=None,
251        description="ID of the team that owns this object (`tem_...`). `null` if the object is not team-scoped.",
252    )
253    updated_at: datetime | None = Field(
254        default=None,
255        description="When the custom object was last modified (ISO 8601). `null` if the object has never been updated after creation.",
256    )
257    user: str | None = Field(
258        default=None,
259        description="ID of the user that owns this object (`usr_...`). `null` if the object is not user-scoped.",
260    )
261    version: int | None = Field(
262        default=None,
263        description="Optimistic concurrency version of the object. Increments with each successful update; pass this value in write operations to detect conflicting changes.",
264    )
265
266
267class CustomObjectPatchResponse(BaseModel):
268    """
269    Successful response
270    """
271
272    data: CustomObjectPatchResponseData = Field(
273        ..., description="The custom object after the patch has been applied."
274    )
275    meta: dict[str, Any] | None = Field(
276        default=None, description="Version metadata and per-op patch results."
277    )
278
279
280class CustomObjectDeleteResponse(BaseModel):
281    """
282    Successful response
283    """
284
285    deleted: bool = Field(..., description="Always `true` when the deletion succeeds.")
286    id: str = Field(..., description="ID of the deleted custom object (`cobj_...`).")
287
288
289class CustomObjectReplaceResponseDataAclAddItem(BaseModel):
290    actions: list[str] = Field(
291        ...,
292        description='Array of action strings the principal is permitted to perform, e.g. `["read", "write"]`. Must contain at least one entry.',
293    )
294    principal: str | None = Field(
295        default=None,
296        description='The identifier of the principal. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`; omit entirely when `principal_type` is `"everyone"`.',
297    )
298    principal_type: str = Field(
299        ...,
300        description='The kind of principal receiving the grant. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.',
301    )
302
303
304class CustomObjectReplaceResponseDataAclGrantsItem(BaseModel):
305    actions: list[str] = Field(
306        ...,
307        description='Array of action strings the principal is permitted to perform, e.g. `["read", "write"]`. Must contain at least one entry.',
308    )
309    principal: str | None = Field(
310        default=None,
311        description='The identifier of the principal. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`; omit entirely when `principal_type` is `"everyone"`.',
312    )
313    principal_type: str = Field(
314        ...,
315        description='The kind of principal receiving the grant. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.',
316    )
317
318
319class CustomObjectReplaceResponseDataAclRemoveItem(BaseModel):
320    principal: str | None = Field(
321        default=None,
322        description='The identifier of the principal to remove. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`. Omit when `principal_type` is `"everyone"`.',
323    )
324    principal_type: str = Field(
325        ...,
326        description='The kind of principal to remove. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.',
327    )
328
329
330class CustomObjectReplaceResponseDataAcl(BaseModel):
331    add: list[CustomObjectReplaceResponseDataAclAddItem] | None = Field(
332        default=None,
333        description="Patch mode: grants to add or merge into the existing list. Cannot be combined with `grants`.",
334    )
335    grants: list[CustomObjectReplaceResponseDataAclGrantsItem] | None = Field(
336        default=None,
337        description="Replace mode: the complete new list of grants that replaces all existing entries. Send an empty array (`[]`) to clear all grants. Cannot be combined with `add` or `remove`.",
338    )
339    remove: list[CustomObjectReplaceResponseDataAclRemoveItem] | None = Field(
340        default=None,
341        description="Patch mode: principals whose grants should be removed from the existing list. Cannot be combined with `grants`.",
342    )
343
344
345class CustomObjectReplaceResponseData(BaseModel):
346    acl: CustomObjectReplaceResponseDataAcl | None = Field(
347        default=None,
348        description="Access control list governing read and write access to this custom object. Only returned to resource owners and privileged or organization-admin viewers; `null` for everyone else.",
349    )
350    agent: str | None = Field(
351        default=None,
352        description="ID of the agent that owns this object (`agt_...`). `null` for other ownership types.",
353    )
354    created_at: datetime | None = Field(
355        default=None, description="When the custom object was created (ISO 8601)."
356    )
357    expires_at: datetime | None = Field(
358        default=None, description="Absolute expiry time (RFC 3339). Null when no expiry is set."
359    )
360    fields: dict[str, Any] | None = Field(
361        default=None,
362        description="Map of field names to their current values as defined by the object's schema type.",
363    )
364    id: str = Field(..., description="Unique identifier for the custom object (`cobj_...`).")
365    org: str | None = Field(
366        default=None, description="ID of the organization this object belongs to (`org_...`)."
367    )
368    row_key: str | None = Field(
369        default=None,
370        description="An optional stable key used to identify this object by a caller-controlled string rather than its generated ID. `null` if not set.",
371    )
372    sandbox: str | None = Field(
373        default=None,
374        description="ID of the sandbox environment this object is scoped to (`dsb_...`). `null` for production objects.",
375    )
376    schema_type: str | None = Field(
377        default=None,
378        description="The lookup key of the schema type that defines this object's field structure. `null` if the schema type has not been set.",
379    )
380    team: str | None = Field(
381        default=None,
382        description="ID of the team that owns this object (`tem_...`). `null` if the object is not team-scoped.",
383    )
384    updated_at: datetime | None = Field(
385        default=None,
386        description="When the custom object was last modified (ISO 8601). `null` if the object has never been updated after creation.",
387    )
388    user: str | None = Field(
389        default=None,
390        description="ID of the user that owns this object (`usr_...`). `null` if the object is not user-scoped.",
391    )
392    version: int | None = Field(
393        default=None,
394        description="Optimistic concurrency version of the object. Increments with each successful update; pass this value in write operations to detect conflicting changes.",
395    )
396
397
398class CustomObjectReplaceResponse(BaseModel):
399    """
400    Successful response
401    """
402
403    data: CustomObjectReplaceResponseData = Field(
404        ..., description="The custom object after the update has been applied."
405    )
406    meta: dict[str, Any] | None = Field(
407        default=None, description="Version metadata for the updated object."
408    )
409
410
411class AsyncCustomObjectResource:
412    def __init__(self, http: HttpClient):
413        self._http = http
414
415    async def list(
416        self,
417        *,
418        type: str | None = None,
419        schema_key: str | None = None,
420        field_filters: dict[str, Any] | None = None,
421        system_only: bool | None = None,
422        order_by_field: str | None = None,
423        row_key: str | None = None,
424        sort_key: builtins.list[str] | None = None,
425        keys: builtins.list[dict[str, Any]] | None = None,
426        team: builtins.list[str] | None = None,
427        user: builtins.list[str] | None = None,
428        agent: builtins.list[str] | None = None,
429        org: builtins.list[str] | None = None,
430        query: str | None = None,
431        search: str | None = None,
432        page: int | None = None,
433        updated_since: datetime | None = None,
434        page_size: int | None = None,
435        include_count: bool | None = None,
436    ) -> CustomObjectListResponse:
437        """
438        List custom objects
439        Returns a paginated list of custom objects visible to the authenticated
440        viewer, ordered by creation time descending. Results span all ownership
441        types (team-owned, user-owned, agent-owned, and system-owned) that the
442        viewer has access to.
443        Filter by schema type with `type` (preferred) or the legacy alias
444        `schema_key`. Use the `row_key` param to perform an exact-match partition
445        lookup. You may additionally supply `sort_key` to narrow within that
446        partition `sort_key` requires `row_key` and the request returns 400 if
447        `sort_key` is provided alone. Owner filters (`team`, `user`, `agent`,
448        `org`) are additive: each accepts an array of IDs (or a single ID, which
449        is wrapped) and returns objects matching any of the supplied values.
450        When `query` is supplied, results are ranked by full-text relevance
451        (descending `ts_rank`) rather than creation time. The legacy `search`
452        param performs a case-insensitive substring match and is retained for
453        developer-namespace clients.
454
455        Args:
456            type: Schema type identifier (`lookup_key`) to filter by. Only objects of this type are returned. Alias of `schema_key`; either name is accepted.
457            schema_key: Legacy alias for `type`. Prefer `type` on new clients. When both are supplied, `type` wins.
458            field_filters: JSON containment predicates on fields, applied before pagination and counting.
459            system_only: Only system-owned objects (no user, team, agent or thread owner). Visibility is unchanged.
460            order_by_field: Top-level JSON field for descending text order, with ID tie-breaker. Full-text relevance takes precedence.
461            row_key: Exact `row_key` value to match. When supplied, only objects with this partition key are returned.
462            sort_key: One or more `sort_key` values to match within the `row_key` partition. Requires `row_key` to be set.
463            keys: JSON-encoded array of up to 100 objects with required string row_key and optional string-array sort_key. Missing or empty sort_key selects the whole partition. Mutually exclusive with row_key and sort_key. Pagination applies globally across all matched partitions.
464            team: One or more team IDs (`team_...`) to filter by owning team. Returns objects owned by any of the supplied teams.
465            user: One or more user IDs (`user_...`) to filter by owning user. Returns objects owned by any of the supplied users.
466            agent: One or more agent IDs to filter by owning agent. Returns objects owned by any of the supplied agents.
467            org: One or more organization IDs (`org_...`) to filter by. Typically used by admins to query system-owned objects in a specific org.
468            query: Full-text search string matched against the schema's configured search fields. When supplied, results are ordered by relevance score descending instead of creation time descending.
469            search: Case-insensitive substring search applied across the schema type and serialized field values. Deprecated prefer `query` for full-text search. Retained for developer-namespace clients.
470            page: Page number to retrieve (1-indexed). Defaults to `1`.
471            updated_since: Include only objects updated at or after this ISO 8601 timestamp. Applies before pagination and counting.
472            page_size: Number of objects per page. Defaults to `25`; maximum is `100`.
473            include_count: Include total_entries and total_pages (default true). When false, totals are null, has_next uses one extra row, and pages beyond the end return an empty list without clamping. The page offset must fit PostgreSQL's signed 64-bit integer range.
474
475        Returns:
476            Paginated list of custom objects matching the supplied filters.
477        """
478        query: dict[str, object] = {}
479        if type is not None:
480            query["type"] = type
481        if schema_key is not None:
482            query["schema_key"] = schema_key
483        if field_filters is not None:
484            query["field_filters"] = field_filters
485        if system_only is not None:
486            query["system_only"] = system_only
487        if order_by_field is not None:
488            query["order_by_field"] = order_by_field
489        if row_key is not None:
490            query["row_key"] = row_key
491        if sort_key is not None:
492            query["sort_key"] = sort_key
493        if keys is not None:
494            query["keys"] = keys
495        if team is not None:
496            query["team"] = team
497        if user is not None:
498            query["user"] = user
499        if agent is not None:
500            query["agent"] = agent
501        if org is not None:
502            query["org"] = org
503        if query is not None:
504            query["query"] = query
505        if search is not None:
506            query["search"] = search
507        if page is not None:
508            query["page"] = page
509        if updated_since is not None:
510            query["updated_since"] = updated_since
511        if page_size is not None:
512            query["page_size"] = page_size
513        if include_count is not None:
514            query["include_count"] = include_count
515        return await self._http.request(
516            "/api/v1/custom_objects",
517            query=query,
518            response_type=CustomObjectListResponse,
519        )
520
521    async def create(self, input: CustomObjectCreateInput) -> CustomObject:
522        """
523        Create a custom object
524        Creates a new custom object of the given schema type and returns the
525        persisted object. The caller must be authenticated and authorized to create
526        objects of the specified type.
527        Identify the schema with `type` (preferred), or the legacy aliases
528        `schema_key` (lookup key) / `config` (config ID). Exactly one identifier is
529        required; when more than one is supplied, `type` wins over `schema_key`,
530        which wins over `config`.
531        Owner resolution follows a priority order: if `team` is supplied the object
532        is team-owned; if `user` is supplied it is owned by that user; if `agent` is
533        supplied it is agent-owned; otherwise the object is owned by the authenticated
534        user. Pass `system: true` explicitly to force system ownership this requires
535        elevated API credentials and returns 403 if the caller lacks permission.
536        If the schema declares a `row_key` (and optionally a `sort_key`), you may
537        pass `upsert: true` to update an existing object at that key instead of
538        receiving a 409 Conflict. The response status is `200` on an update and
539        `201` on a new create.
540
541        Args:
542            input: Request body.
543            input.acl: Access control list for the custom object. Supports explicit `read` and `write` grants to users, teams, organizations, organization roles, agents, or everyone.
544            input.agent: Agent user ID to set as the object owner. Used when neither `team` nor `user` is supplied.
545            input.config: Config ID (`cfg_...`) that resolves to the target schema. Provide one of `type`, `schema_key`, or `config`.
546            input.expires_at: Absolute expiry time in RFC 3339 format. Pass null to clear; omit to leave unchanged on update.
547            input.fields: Key-value map of field values for the new object. Must conform to the schema's field definitions. Omit to create an object with all fields at their default or null values.
548            input.org: Organization ID (`org_...`) to associate with the object. Typically required for system-owned objects.
549            input.schema_key: Legacy alias for `type` (schema `lookup_key`). Prefer `type` on new clients. Provide one of `type`, `schema_key`, or `config`.
550            input.system: When `true`, creates a system-owned object with no team, user, or agent owner. Requires elevated API credentials; returns 403 if the caller lacks permission.
551            input.team: Team ID (`team_...`) to set as the object owner. When supplied, takes priority over `user` and `agent`.
552            input.type: Schema type identifier (`lookup_key`) that defines the object's shape and validation rules. Preferred over the legacy `schema_key` / `config` aliases.
553            input.upsert: When `true` and the schema declares a `row_key`, updates the existing object at that key for the same owner instead of returning 409 Conflict. Returns HTTP 200 on update and 201 on create.
554            input.user: User ID (`user_...`) to set as the object owner. Used when neither `team` nor a higher-priority owner is set.
555
556        Returns:
557            The created (or upserted) custom object.
558        """
559        return await self._http.request(
560            "/api/v1/custom_objects",
561            method="POST",
562            body=input,
563            response_type=CustomObject,
564        )
565
566    async def patch(self, input: CustomObjectPatchInput) -> CustomObjectPatchResponse:
567        """
568        Apply numeric patch ops to a custom object
569        Applies numeric patch ops (`increment`, `max`, `min`, `set_if_newer` with
570        dotted `path`s) atomically to a custom object and returns the updated
571        object along with per-op results. The authenticated viewer must have
572        permission to modify the object.
573        Address the row in one of two ways: by `object` ID (`cobj_...`), or by
574        `schema` + `row_key` (with optional `sort_key` for schemas that declare
575        one). The keyed form resolves the row for the same owner the create
576        contract would use and, when no row exists yet, creates it from
577        `create_with` merged over the key fields before applying the ops so an
578        aggregator's first call creates the counter and later calls increment it.
579        A racing create resolves to the same row instead of a duplicate.
580        Pass `idempotency_key` to make retries safe: a retry with the same key and
581        ops replays the stored result without re-applying the write (survives
582        server restarts); reusing a key with different ops returns 409.
583
584        Args:
585            input: Request body.
586            input.agent: Agent user ID owning the keyed row. At most one owner selector may be present.
587            input.create_with: Field values used to create the row when the keyed form finds no existing row. Merged over the key fields before validation; ignored by the `object` form.
588            input.idempotency_key: Client-supplied deduplication key for this patch. A retry with the same key and the same ops replays the stored result without re-applying the write (survives server restarts); reusing a key with different ops returns 409.
589            input.object: Custom object ID (`cobj_...`) to patch. Exactly one of `object` or `schema` + `row_key` is required.
590            input.ops: Numeric patch ops to apply in order (e.g. `[%{"op" => "increment", "path" => "count", "by" => 1}]`). Supported ops: `increment` (`by`), `max`/`min` (`value`), `set_if_newer` (`value`, `fence_path`, `fence`).
591            input.row_key: Row key naming the row within `schema` (e.g. a counter name). Requires `schema`.
592            input.schema: Schema type identifier (`lookup_key`) for the keyed form. Requires `row_key`.
593            input.sort_key: Sort-key segments partitioning rows within the `row_key` bucket. Only meaningful for schemas that declare a `sort_key`.
594            input.team: Team ID (`tem_...`) owning the keyed row. Defaults to the viewer's owner like the create contract.
595            input.user: User ID (`usr_...`) owning the keyed row. At most one owner selector may be present.
596
597        Returns:
598            Successful response
599        """
600        return await self._http.request(
601            "/api/v1/custom_objects/patch",
602            method="POST",
603            body=input,
604            response_type=CustomObjectPatchResponse,
605        )
606
607    async def delete(self, object: str) -> CustomObjectDeleteResponse:
608        """
609        Delete a custom object
610        Permanently deletes the custom object identified by `object`. The caller
611        must be authenticated and have permission to delete the object.
612        On success, returns a confirmation payload containing the deleted object's
613        ID so callers can confirm the deletion without a follow-up fetch.
614        Attempting to delete an object that does not exist or has already been
615        deleted returns 404.
616
617        Args:
618            object: Custom object ID (`cobj_...`) of the object to delete.
619
620        Returns:
621            Successful response
622        """
623        return await self._http.request(
624            f"/api/v1/custom_objects/{object}",
625            method="DELETE",
626            response_type=CustomObjectDeleteResponse,
627        )
628
629    async def get(self, object: str, *, type: str | None = None) -> CustomObject:
630        """
631        Retrieve a custom object
632        Returns a single custom object identified by its ID. The authenticated viewer
633        must have visibility access to the object.
634        Returns 404 if the object does not exist, has been deleted, or is not
635        visible to the viewer.
636
637        Args:
638            object: Custom object ID (`cobj_...`) to retrieve.
639            type: Schema type identifier (`lookup_key`) of the object. Optional; used for routing context only.
640
641        Returns:
642            The requested custom object.
643        """
644        query: dict[str, object] = {}
645        if type is not None:
646            query["type"] = type
647        return await self._http.request(
648            f"/api/v1/custom_objects/{object}",
649            query=query,
650            response_type=CustomObject,
651        )
652
653    async def replace(
654        self, object: str, input: CustomObjectReplaceInput
655    ) -> CustomObjectReplaceResponse:
656        """
657        Update a custom object
658        Updates the fields of an existing custom object and returns the updated
659        object along with its new version number. The authenticated viewer must have
660        permission to modify the object.
661        You may supply `fields` (a full or partial key-value map to merge into the
662        object), `field_ops` (granular array operations per field), `acl`, or any
663        compatible combination. The same field name must not appear in both
664        `fields` and `field_ops`, which returns 422. Returns 404 if the object does
665        not exist or has been deleted.
666        Use `expected_version` for optimistic concurrency: if the object's current
667        `aggregate_version` does not match, the request returns 409 and does not
668        retry the caller write. Omit it to keep the existing OCC merge retry.
669
670        Args:
671            object: Custom object ID (`cobj_...`) to update.
672            input: Request body.
673            input.acl: Updated access control list. Supports full replacement via `grants` or targeted `add`/`remove` operations.
674            input.expected_version: Version number the caller expects to be current. If the object's actual current version does not match, the request returns 409 to signal a concurrent modification. Omit to skip optimistic locking and keep the existing OCC merge retry.
675            input.expires_at: Absolute expiry time in RFC 3339 format. Pass null to clear; omit to leave unchanged on update.
676            input.field_ops: Granular array operations to apply per field (e.g. append, prepend, remove). A field must not appear in both `fields` and `field_ops`.
677            input.fields: Key-value map of field values to merge into the object. Only the supplied keys are affected.
678            input.idempotency_key: Client-supplied deduplication key for this write. A retry with the same key and the same body replays the stored result without re-applying the write (survives server restarts); reusing a key with a different body returns 409.
679            input.type: Schema type identifier (`lookup_key`) of the object. Optional; used for routing context only.
680
681        Returns:
682            Successful response
683        """
684        return await self._http.request(
685            f"/api/v1/custom_objects/{object}",
686            method="PUT",
687            body=input,
688            response_type=CustomObjectReplaceResponse,
689        )
690
691
692class CustomObjectResource:
693    def __init__(self, http: SyncHttpClient):
694        self._http = http
695
696    def list(
697        self,
698        *,
699        type: str | None = None,
700        schema_key: str | None = None,
701        field_filters: dict[str, Any] | None = None,
702        system_only: bool | None = None,
703        order_by_field: str | None = None,
704        row_key: str | None = None,
705        sort_key: builtins.list[str] | None = None,
706        keys: builtins.list[dict[str, Any]] | None = None,
707        team: builtins.list[str] | None = None,
708        user: builtins.list[str] | None = None,
709        agent: builtins.list[str] | None = None,
710        org: builtins.list[str] | None = None,
711        query: str | None = None,
712        search: str | None = None,
713        page: int | None = None,
714        updated_since: datetime | None = None,
715        page_size: int | None = None,
716        include_count: bool | None = None,
717    ) -> CustomObjectListResponse:
718        """
719        List custom objects
720        Returns a paginated list of custom objects visible to the authenticated
721        viewer, ordered by creation time descending. Results span all ownership
722        types (team-owned, user-owned, agent-owned, and system-owned) that the
723        viewer has access to.
724        Filter by schema type with `type` (preferred) or the legacy alias
725        `schema_key`. Use the `row_key` param to perform an exact-match partition
726        lookup. You may additionally supply `sort_key` to narrow within that
727        partition `sort_key` requires `row_key` and the request returns 400 if
728        `sort_key` is provided alone. Owner filters (`team`, `user`, `agent`,
729        `org`) are additive: each accepts an array of IDs (or a single ID, which
730        is wrapped) and returns objects matching any of the supplied values.
731        When `query` is supplied, results are ranked by full-text relevance
732        (descending `ts_rank`) rather than creation time. The legacy `search`
733        param performs a case-insensitive substring match and is retained for
734        developer-namespace clients.
735
736        Args:
737            type: Schema type identifier (`lookup_key`) to filter by. Only objects of this type are returned. Alias of `schema_key`; either name is accepted.
738            schema_key: Legacy alias for `type`. Prefer `type` on new clients. When both are supplied, `type` wins.
739            field_filters: JSON containment predicates on fields, applied before pagination and counting.
740            system_only: Only system-owned objects (no user, team, agent or thread owner). Visibility is unchanged.
741            order_by_field: Top-level JSON field for descending text order, with ID tie-breaker. Full-text relevance takes precedence.
742            row_key: Exact `row_key` value to match. When supplied, only objects with this partition key are returned.
743            sort_key: One or more `sort_key` values to match within the `row_key` partition. Requires `row_key` to be set.
744            keys: JSON-encoded array of up to 100 objects with required string row_key and optional string-array sort_key. Missing or empty sort_key selects the whole partition. Mutually exclusive with row_key and sort_key. Pagination applies globally across all matched partitions.
745            team: One or more team IDs (`team_...`) to filter by owning team. Returns objects owned by any of the supplied teams.
746            user: One or more user IDs (`user_...`) to filter by owning user. Returns objects owned by any of the supplied users.
747            agent: One or more agent IDs to filter by owning agent. Returns objects owned by any of the supplied agents.
748            org: One or more organization IDs (`org_...`) to filter by. Typically used by admins to query system-owned objects in a specific org.
749            query: Full-text search string matched against the schema's configured search fields. When supplied, results are ordered by relevance score descending instead of creation time descending.
750            search: Case-insensitive substring search applied across the schema type and serialized field values. Deprecated prefer `query` for full-text search. Retained for developer-namespace clients.
751            page: Page number to retrieve (1-indexed). Defaults to `1`.
752            updated_since: Include only objects updated at or after this ISO 8601 timestamp. Applies before pagination and counting.
753            page_size: Number of objects per page. Defaults to `25`; maximum is `100`.
754            include_count: Include total_entries and total_pages (default true). When false, totals are null, has_next uses one extra row, and pages beyond the end return an empty list without clamping. The page offset must fit PostgreSQL's signed 64-bit integer range.
755
756        Returns:
757            Paginated list of custom objects matching the supplied filters.
758        """
759        query: dict[str, object] = {}
760        if type is not None:
761            query["type"] = type
762        if schema_key is not None:
763            query["schema_key"] = schema_key
764        if field_filters is not None:
765            query["field_filters"] = field_filters
766        if system_only is not None:
767            query["system_only"] = system_only
768        if order_by_field is not None:
769            query["order_by_field"] = order_by_field
770        if row_key is not None:
771            query["row_key"] = row_key
772        if sort_key is not None:
773            query["sort_key"] = sort_key
774        if keys is not None:
775            query["keys"] = keys
776        if team is not None:
777            query["team"] = team
778        if user is not None:
779            query["user"] = user
780        if agent is not None:
781            query["agent"] = agent
782        if org is not None:
783            query["org"] = org
784        if query is not None:
785            query["query"] = query
786        if search is not None:
787            query["search"] = search
788        if page is not None:
789            query["page"] = page
790        if updated_since is not None:
791            query["updated_since"] = updated_since
792        if page_size is not None:
793            query["page_size"] = page_size
794        if include_count is not None:
795            query["include_count"] = include_count
796        return self._http.request(
797            "/api/v1/custom_objects",
798            query=query,
799            response_type=CustomObjectListResponse,
800        )
801
802    def create(self, input: CustomObjectCreateInput) -> CustomObject:
803        """
804        Create a custom object
805        Creates a new custom object of the given schema type and returns the
806        persisted object. The caller must be authenticated and authorized to create
807        objects of the specified type.
808        Identify the schema with `type` (preferred), or the legacy aliases
809        `schema_key` (lookup key) / `config` (config ID). Exactly one identifier is
810        required; when more than one is supplied, `type` wins over `schema_key`,
811        which wins over `config`.
812        Owner resolution follows a priority order: if `team` is supplied the object
813        is team-owned; if `user` is supplied it is owned by that user; if `agent` is
814        supplied it is agent-owned; otherwise the object is owned by the authenticated
815        user. Pass `system: true` explicitly to force system ownership this requires
816        elevated API credentials and returns 403 if the caller lacks permission.
817        If the schema declares a `row_key` (and optionally a `sort_key`), you may
818        pass `upsert: true` to update an existing object at that key instead of
819        receiving a 409 Conflict. The response status is `200` on an update and
820        `201` on a new create.
821
822        Args:
823            input: Request body.
824            input.acl: Access control list for the custom object. Supports explicit `read` and `write` grants to users, teams, organizations, organization roles, agents, or everyone.
825            input.agent: Agent user ID to set as the object owner. Used when neither `team` nor `user` is supplied.
826            input.config: Config ID (`cfg_...`) that resolves to the target schema. Provide one of `type`, `schema_key`, or `config`.
827            input.expires_at: Absolute expiry time in RFC 3339 format. Pass null to clear; omit to leave unchanged on update.
828            input.fields: Key-value map of field values for the new object. Must conform to the schema's field definitions. Omit to create an object with all fields at their default or null values.
829            input.org: Organization ID (`org_...`) to associate with the object. Typically required for system-owned objects.
830            input.schema_key: Legacy alias for `type` (schema `lookup_key`). Prefer `type` on new clients. Provide one of `type`, `schema_key`, or `config`.
831            input.system: When `true`, creates a system-owned object with no team, user, or agent owner. Requires elevated API credentials; returns 403 if the caller lacks permission.
832            input.team: Team ID (`team_...`) to set as the object owner. When supplied, takes priority over `user` and `agent`.
833            input.type: Schema type identifier (`lookup_key`) that defines the object's shape and validation rules. Preferred over the legacy `schema_key` / `config` aliases.
834            input.upsert: When `true` and the schema declares a `row_key`, updates the existing object at that key for the same owner instead of returning 409 Conflict. Returns HTTP 200 on update and 201 on create.
835            input.user: User ID (`user_...`) to set as the object owner. Used when neither `team` nor a higher-priority owner is set.
836
837        Returns:
838            The created (or upserted) custom object.
839        """
840        return self._http.request(
841            "/api/v1/custom_objects",
842            method="POST",
843            body=input,
844            response_type=CustomObject,
845        )
846
847    def patch(self, input: CustomObjectPatchInput) -> CustomObjectPatchResponse:
848        """
849        Apply numeric patch ops to a custom object
850        Applies numeric patch ops (`increment`, `max`, `min`, `set_if_newer` with
851        dotted `path`s) atomically to a custom object and returns the updated
852        object along with per-op results. The authenticated viewer must have
853        permission to modify the object.
854        Address the row in one of two ways: by `object` ID (`cobj_...`), or by
855        `schema` + `row_key` (with optional `sort_key` for schemas that declare
856        one). The keyed form resolves the row for the same owner the create
857        contract would use and, when no row exists yet, creates it from
858        `create_with` merged over the key fields before applying the ops so an
859        aggregator's first call creates the counter and later calls increment it.
860        A racing create resolves to the same row instead of a duplicate.
861        Pass `idempotency_key` to make retries safe: a retry with the same key and
862        ops replays the stored result without re-applying the write (survives
863        server restarts); reusing a key with different ops returns 409.
864
865        Args:
866            input: Request body.
867            input.agent: Agent user ID owning the keyed row. At most one owner selector may be present.
868            input.create_with: Field values used to create the row when the keyed form finds no existing row. Merged over the key fields before validation; ignored by the `object` form.
869            input.idempotency_key: Client-supplied deduplication key for this patch. A retry with the same key and the same ops replays the stored result without re-applying the write (survives server restarts); reusing a key with different ops returns 409.
870            input.object: Custom object ID (`cobj_...`) to patch. Exactly one of `object` or `schema` + `row_key` is required.
871            input.ops: Numeric patch ops to apply in order (e.g. `[%{"op" => "increment", "path" => "count", "by" => 1}]`). Supported ops: `increment` (`by`), `max`/`min` (`value`), `set_if_newer` (`value`, `fence_path`, `fence`).
872            input.row_key: Row key naming the row within `schema` (e.g. a counter name). Requires `schema`.
873            input.schema: Schema type identifier (`lookup_key`) for the keyed form. Requires `row_key`.
874            input.sort_key: Sort-key segments partitioning rows within the `row_key` bucket. Only meaningful for schemas that declare a `sort_key`.
875            input.team: Team ID (`tem_...`) owning the keyed row. Defaults to the viewer's owner like the create contract.
876            input.user: User ID (`usr_...`) owning the keyed row. At most one owner selector may be present.
877
878        Returns:
879            Successful response
880        """
881        return self._http.request(
882            "/api/v1/custom_objects/patch",
883            method="POST",
884            body=input,
885            response_type=CustomObjectPatchResponse,
886        )
887
888    def delete(self, object: str) -> CustomObjectDeleteResponse:
889        """
890        Delete a custom object
891        Permanently deletes the custom object identified by `object`. The caller
892        must be authenticated and have permission to delete the object.
893        On success, returns a confirmation payload containing the deleted object's
894        ID so callers can confirm the deletion without a follow-up fetch.
895        Attempting to delete an object that does not exist or has already been
896        deleted returns 404.
897
898        Args:
899            object: Custom object ID (`cobj_...`) of the object to delete.
900
901        Returns:
902            Successful response
903        """
904        return self._http.request(
905            f"/api/v1/custom_objects/{object}",
906            method="DELETE",
907            response_type=CustomObjectDeleteResponse,
908        )
909
910    def get(self, object: str, *, type: str | None = None) -> CustomObject:
911        """
912        Retrieve a custom object
913        Returns a single custom object identified by its ID. The authenticated viewer
914        must have visibility access to the object.
915        Returns 404 if the object does not exist, has been deleted, or is not
916        visible to the viewer.
917
918        Args:
919            object: Custom object ID (`cobj_...`) to retrieve.
920            type: Schema type identifier (`lookup_key`) of the object. Optional; used for routing context only.
921
922        Returns:
923            The requested custom object.
924        """
925        query: dict[str, object] = {}
926        if type is not None:
927            query["type"] = type
928        return self._http.request(
929            f"/api/v1/custom_objects/{object}",
930            query=query,
931            response_type=CustomObject,
932        )
933
934    def replace(self, object: str, input: CustomObjectReplaceInput) -> CustomObjectReplaceResponse:
935        """
936        Update a custom object
937        Updates the fields of an existing custom object and returns the updated
938        object along with its new version number. The authenticated viewer must have
939        permission to modify the object.
940        You may supply `fields` (a full or partial key-value map to merge into the
941        object), `field_ops` (granular array operations per field), `acl`, or any
942        compatible combination. The same field name must not appear in both
943        `fields` and `field_ops`, which returns 422. Returns 404 if the object does
944        not exist or has been deleted.
945        Use `expected_version` for optimistic concurrency: if the object's current
946        `aggregate_version` does not match, the request returns 409 and does not
947        retry the caller write. Omit it to keep the existing OCC merge retry.
948
949        Args:
950            object: Custom object ID (`cobj_...`) to update.
951            input: Request body.
952            input.acl: Updated access control list. Supports full replacement via `grants` or targeted `add`/`remove` operations.
953            input.expected_version: Version number the caller expects to be current. If the object's actual current version does not match, the request returns 409 to signal a concurrent modification. Omit to skip optimistic locking and keep the existing OCC merge retry.
954            input.expires_at: Absolute expiry time in RFC 3339 format. Pass null to clear; omit to leave unchanged on update.
955            input.field_ops: Granular array operations to apply per field (e.g. append, prepend, remove). A field must not appear in both `fields` and `field_ops`.
956            input.fields: Key-value map of field values to merge into the object. Only the supplied keys are affected.
957            input.idempotency_key: Client-supplied deduplication key for this write. A retry with the same key and the same body replays the stored result without re-applying the write (survives server restarts); reusing a key with a different body returns 409.
958            input.type: Schema type identifier (`lookup_key`) of the object. Optional; used for routing context only.
959
960        Returns:
961            Successful response
962        """
963        return self._http.request(
964            f"/api/v1/custom_objects/{object}",
965            method="PUT",
966            body=input,
967            response_type=CustomObjectReplaceResponse,
968        )
class CustomObjectCreateInputAclAddItem(typing.TypedDict):
18class CustomObjectCreateInputAclAddItem(TypedDict, total=False):
19    actions: Required[list[str]]
20    'Array of action strings the principal is permitted to perform, e.g. `["read", "write"]`. Must contain at least one entry.'
21    principal: str | None
22    'The identifier of the principal. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`; omit entirely when `principal_type` is `"everyone"`.'
23    principal_type: Required[str]
24    'The kind of principal receiving the grant. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.'
actions: Required[list[str]]

Array of action strings the principal is permitted to perform, e.g. ["read", "write"]. Must contain at least one entry.

principal: str | None

The identifier of the principal. A string ID for "user", "team", "org", and "agent" types; one of "admin", "member", or "viewer" for "org_role"; omit entirely when principal_type is "everyone".

principal_type: Required[str]

The kind of principal receiving the grant. One of "user", "team", "org", "org_role", "agent", or "everyone".

class CustomObjectCreateInputAclGrantsItem(typing.TypedDict):
27class CustomObjectCreateInputAclGrantsItem(TypedDict, total=False):
28    actions: Required[list[str]]
29    'Array of action strings the principal is permitted to perform, e.g. `["read", "write"]`. Must contain at least one entry.'
30    principal: str | None
31    'The identifier of the principal. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`; omit entirely when `principal_type` is `"everyone"`.'
32    principal_type: Required[str]
33    'The kind of principal receiving the grant. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.'
actions: Required[list[str]]

Array of action strings the principal is permitted to perform, e.g. ["read", "write"]. Must contain at least one entry.

principal: str | None

The identifier of the principal. A string ID for "user", "team", "org", and "agent" types; one of "admin", "member", or "viewer" for "org_role"; omit entirely when principal_type is "everyone".

principal_type: Required[str]

The kind of principal receiving the grant. One of "user", "team", "org", "org_role", "agent", or "everyone".

class CustomObjectCreateInputAclRemoveItem(typing.TypedDict):
36class CustomObjectCreateInputAclRemoveItem(TypedDict, total=False):
37    principal: str | None
38    'The identifier of the principal to remove. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`. Omit when `principal_type` is `"everyone"`.'
39    principal_type: Required[str]
40    'The kind of principal to remove. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.'
principal: str | None

The identifier of the principal to remove. A string ID for "user", "team", "org", and "agent" types; one of "admin", "member", or "viewer" for "org_role". Omit when principal_type is "everyone".

principal_type: Required[str]

The kind of principal to remove. One of "user", "team", "org", "org_role", "agent", or "everyone".

class CustomObjectCreateInputAcl(typing.TypedDict):
43class CustomObjectCreateInputAcl(TypedDict, total=False):
44    add: list[CustomObjectCreateInputAclAddItem] | None
45    "Patch mode: grants to add or merge into the existing list. Cannot be combined with `grants`."
46    grants: list[CustomObjectCreateInputAclGrantsItem] | None
47    "Replace mode: the complete new list of grants that replaces all existing entries. Send an empty array (`[]`) to clear all grants. Cannot be combined with `add` or `remove`."
48    remove: list[CustomObjectCreateInputAclRemoveItem] | None
49    "Patch mode: principals whose grants should be removed from the existing list. Cannot be combined with `grants`."

Patch mode: grants to add or merge into the existing list. Cannot be combined with grants.

Replace mode: the complete new list of grants that replaces all existing entries. Send an empty array ([]) to clear all grants. Cannot be combined with add or remove.

Patch mode: principals whose grants should be removed from the existing list. Cannot be combined with grants.

class CustomObjectCreateInput(typing.TypedDict):
52class CustomObjectCreateInput(TypedDict, total=False):
53    "Create a custom object"
54
55    acl: CustomObjectCreateInputAcl | None
56    "Access control list for the custom object. Supports explicit `read` and `write` grants to users, teams, organizations, organization roles, agents, or everyone."
57    agent: str | None
58    "Agent user ID to set as the object owner. Used when neither `team` nor `user` is supplied."
59    config: str | None
60    "Config ID (`cfg_...`) that resolves to the target schema. Provide one of `type`, `schema_key`, or `config`."
61    expires_at: datetime | None
62    "Absolute expiry time in RFC 3339 format. Pass null to clear; omit to leave unchanged on update."
63    fields: dict[str, Any] | None
64    "Key-value map of field values for the new object. Must conform to the schema's field definitions. Omit to create an object with all fields at their default or null values."
65    org: str | None
66    "Organization ID (`org_...`) to associate with the object. Typically required for system-owned objects."
67    schema_key: str | None
68    "Legacy alias for `type` (schema `lookup_key`). Prefer `type` on new clients. Provide one of `type`, `schema_key`, or `config`."
69    system: bool | None
70    "When `true`, creates a system-owned object with no team, user, or agent owner. Requires elevated API credentials; returns 403 if the caller lacks permission."
71    team: str | None
72    "Team ID (`team_...`) to set as the object owner. When supplied, takes priority over `user` and `agent`."
73    type: str | None
74    "Schema type identifier (`lookup_key`) that defines the object's shape and validation rules. Preferred over the legacy `schema_key` / `config` aliases."
75    upsert: bool | None
76    "When `true` and the schema declares a `row_key`, updates the existing object at that key for the same owner instead of returning 409 Conflict. Returns HTTP 200 on update and 201 on create."
77    user: str | None
78    "User ID (`user_...`) to set as the object owner. Used when neither `team` nor a higher-priority owner is set."

Create a custom object

Access control list for the custom object. Supports explicit read and write grants to users, teams, organizations, organization roles, agents, or everyone.

agent: str | None

Agent user ID to set as the object owner. Used when neither team nor user is supplied.

config: str | None

Config ID (cfg_...) that resolves to the target schema. Provide one of type, schema_key, or config.

expires_at: datetime.datetime | None

Absolute expiry time in RFC 3339 format. Pass null to clear; omit to leave unchanged on update.

fields: dict[str, typing.Any] | None

Key-value map of field values for the new object. Must conform to the schema's field definitions. Omit to create an object with all fields at their default or null values.

org: str | None

Organization ID (org_...) to associate with the object. Typically required for system-owned objects.

schema_key: str | None

Legacy alias for type (schema lookup_key). Prefer type on new clients. Provide one of type, schema_key, or config.

system: bool | None

When true, creates a system-owned object with no team, user, or agent owner. Requires elevated API credentials; returns 403 if the caller lacks permission.

team: str | None

Team ID (team_...) to set as the object owner. When supplied, takes priority over user and agent.

type: str | None

Schema type identifier (lookup_key) that defines the object's shape and validation rules. Preferred over the legacy schema_key / config aliases.

upsert: bool | None

When true and the schema declares a row_key, updates the existing object at that key for the same owner instead of returning 409 Conflict. Returns HTTP 200 on update and 201 on create.

user: str | None

User ID (user_...) to set as the object owner. Used when neither team nor a higher-priority owner is set.

class CustomObjectPatchInput(typing.TypedDict):
 81class CustomObjectPatchInput(TypedDict, total=False):
 82    "Apply numeric patch ops to a custom object"
 83
 84    agent: str | None
 85    "Agent user ID owning the keyed row. At most one owner selector may be present."
 86    create_with: dict[str, Any] | None
 87    "Field values used to create the row when the keyed form finds no existing row. Merged over the key fields before validation; ignored by the `object` form."
 88    idempotency_key: str | None
 89    "Client-supplied deduplication key for this patch. A retry with the same key and the same ops replays the stored result without re-applying the write (survives server restarts); reusing a key with different ops returns 409."
 90    object: str | None
 91    "Custom object ID (`cobj_...`) to patch. Exactly one of `object` or `schema` + `row_key` is required."
 92    ops: Required[list[dict[str, Any]]]
 93    'Numeric patch ops to apply in order (e.g. `[%{"op" => "increment", "path" => "count", "by" => 1}]`). Supported ops: `increment` (`by`), `max`/`min` (`value`), `set_if_newer` (`value`, `fence_path`, `fence`).'
 94    row_key: str | None
 95    "Row key naming the row within `schema` (e.g. a counter name). Requires `schema`."
 96    schema: str | None
 97    "Schema type identifier (`lookup_key`) for the keyed form. Requires `row_key`."
 98    sort_key: list[str] | None
 99    "Sort-key segments partitioning rows within the `row_key` bucket. Only meaningful for schemas that declare a `sort_key`."
100    team: str | None
101    "Team ID (`tem_...`) owning the keyed row. Defaults to the viewer's owner like the create contract."
102    user: str | None
103    "User ID (`usr_...`) owning the keyed row. At most one owner selector may be present."

Apply numeric patch ops to a custom object

agent: str | None

Agent user ID owning the keyed row. At most one owner selector may be present.

create_with: dict[str, typing.Any] | None

Field values used to create the row when the keyed form finds no existing row. Merged over the key fields before validation; ignored by the object form.

idempotency_key: str | None

Client-supplied deduplication key for this patch. A retry with the same key and the same ops replays the stored result without re-applying the write (survives server restarts); reusing a key with different ops returns 409.

object: str | None

Custom object ID (cobj_...) to patch. Exactly one of object or schema + row_key is required.

ops: Required[list[dict[str, Any]]]

Numeric patch ops to apply in order (e.g. [%{"op" => "increment", "path" => "count", "by" => 1}]). Supported ops: increment (by), max/min (value), set_if_newer (value, fence_path, fence).

row_key: str | None

Row key naming the row within schema (e.g. a counter name). Requires schema.

schema: str | None

Schema type identifier (lookup_key) for the keyed form. Requires row_key.

sort_key: list[str] | None

Sort-key segments partitioning rows within the row_key bucket. Only meaningful for schemas that declare a sort_key.

team: str | None

Team ID (tem_...) owning the keyed row. Defaults to the viewer's owner like the create contract.

user: str | None

User ID (usr_...) owning the keyed row. At most one owner selector may be present.

class CustomObjectReplaceInputAclAddItem(typing.TypedDict):
106class CustomObjectReplaceInputAclAddItem(TypedDict, total=False):
107    actions: Required[list[str]]
108    'Array of action strings the principal is permitted to perform, e.g. `["read", "write"]`. Must contain at least one entry.'
109    principal: str | None
110    'The identifier of the principal. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`; omit entirely when `principal_type` is `"everyone"`.'
111    principal_type: Required[str]
112    'The kind of principal receiving the grant. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.'
actions: Required[list[str]]

Array of action strings the principal is permitted to perform, e.g. ["read", "write"]. Must contain at least one entry.

principal: str | None

The identifier of the principal. A string ID for "user", "team", "org", and "agent" types; one of "admin", "member", or "viewer" for "org_role"; omit entirely when principal_type is "everyone".

principal_type: Required[str]

The kind of principal receiving the grant. One of "user", "team", "org", "org_role", "agent", or "everyone".

class CustomObjectReplaceInputAclGrantsItem(typing.TypedDict):
115class CustomObjectReplaceInputAclGrantsItem(TypedDict, total=False):
116    actions: Required[list[str]]
117    'Array of action strings the principal is permitted to perform, e.g. `["read", "write"]`. Must contain at least one entry.'
118    principal: str | None
119    'The identifier of the principal. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`; omit entirely when `principal_type` is `"everyone"`.'
120    principal_type: Required[str]
121    'The kind of principal receiving the grant. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.'
actions: Required[list[str]]

Array of action strings the principal is permitted to perform, e.g. ["read", "write"]. Must contain at least one entry.

principal: str | None

The identifier of the principal. A string ID for "user", "team", "org", and "agent" types; one of "admin", "member", or "viewer" for "org_role"; omit entirely when principal_type is "everyone".

principal_type: Required[str]

The kind of principal receiving the grant. One of "user", "team", "org", "org_role", "agent", or "everyone".

class CustomObjectReplaceInputAclRemoveItem(typing.TypedDict):
124class CustomObjectReplaceInputAclRemoveItem(TypedDict, total=False):
125    principal: str | None
126    'The identifier of the principal to remove. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`. Omit when `principal_type` is `"everyone"`.'
127    principal_type: Required[str]
128    'The kind of principal to remove. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.'
principal: str | None

The identifier of the principal to remove. A string ID for "user", "team", "org", and "agent" types; one of "admin", "member", or "viewer" for "org_role". Omit when principal_type is "everyone".

principal_type: Required[str]

The kind of principal to remove. One of "user", "team", "org", "org_role", "agent", or "everyone".

class CustomObjectReplaceInputAcl(typing.TypedDict):
131class CustomObjectReplaceInputAcl(TypedDict, total=False):
132    add: list[CustomObjectReplaceInputAclAddItem] | None
133    "Patch mode: grants to add or merge into the existing list. Cannot be combined with `grants`."
134    grants: list[CustomObjectReplaceInputAclGrantsItem] | None
135    "Replace mode: the complete new list of grants that replaces all existing entries. Send an empty array (`[]`) to clear all grants. Cannot be combined with `add` or `remove`."
136    remove: list[CustomObjectReplaceInputAclRemoveItem] | None
137    "Patch mode: principals whose grants should be removed from the existing list. Cannot be combined with `grants`."

Patch mode: grants to add or merge into the existing list. Cannot be combined with grants.

Replace mode: the complete new list of grants that replaces all existing entries. Send an empty array ([]) to clear all grants. Cannot be combined with add or remove.

Patch mode: principals whose grants should be removed from the existing list. Cannot be combined with grants.

class CustomObjectReplaceInput(typing.TypedDict):
140class CustomObjectReplaceInput(TypedDict, total=False):
141    "Update a custom object"
142
143    acl: CustomObjectReplaceInputAcl | None
144    "Updated access control list. Supports full replacement via `grants` or targeted `add`/`remove` operations."
145    expected_version: int | None
146    "Version number the caller expects to be current. If the object's actual current version does not match, the request returns 409 to signal a concurrent modification. Omit to skip optimistic locking and keep the existing OCC merge retry."
147    expires_at: datetime | None
148    "Absolute expiry time in RFC 3339 format. Pass null to clear; omit to leave unchanged on update."
149    field_ops: dict[str, Any] | None
150    "Granular array operations to apply per field (e.g. append, prepend, remove). A field must not appear in both `fields` and `field_ops`."
151    fields: dict[str, Any] | None
152    "Key-value map of field values to merge into the object. Only the supplied keys are affected."
153    idempotency_key: str | None
154    "Client-supplied deduplication key for this write. A retry with the same key and the same body replays the stored result without re-applying the write (survives server restarts); reusing a key with a different body returns 409."
155    type: str | None
156    "Schema type identifier (`lookup_key`) of the object. Optional; used for routing context only."

Update a custom object

Updated access control list. Supports full replacement via grants or targeted add/remove operations.

expected_version: int | None

Version number the caller expects to be current. If the object's actual current version does not match, the request returns 409 to signal a concurrent modification. Omit to skip optimistic locking and keep the existing OCC merge retry.

expires_at: datetime.datetime | None

Absolute expiry time in RFC 3339 format. Pass null to clear; omit to leave unchanged on update.

field_ops: dict[str, typing.Any] | None

Granular array operations to apply per field (e.g. append, prepend, remove). A field must not appear in both fields and field_ops.

fields: dict[str, typing.Any] | None

Key-value map of field values to merge into the object. Only the supplied keys are affected.

idempotency_key: str | None

Client-supplied deduplication key for this write. A retry with the same key and the same body replays the stored result without re-applying the write (survives server restarts); reusing a key with a different body returns 409.

type: str | None

Schema type identifier (lookup_key) of the object. Optional; used for routing context only.

class CustomObjectPatchResponseDataAclAddItem(pydantic.main.BaseModel):
159class CustomObjectPatchResponseDataAclAddItem(BaseModel):
160    actions: list[str] = Field(
161        ...,
162        description='Array of action strings the principal is permitted to perform, e.g. `["read", "write"]`. Must contain at least one entry.',
163    )
164    principal: str | None = Field(
165        default=None,
166        description='The identifier of the principal. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`; omit entirely when `principal_type` is `"everyone"`.',
167    )
168    principal_type: str = Field(
169        ...,
170        description='The kind of principal receiving the grant. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.',
171    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
actions: list[str] = PydanticUndefined

Array of action strings the principal is permitted to perform, e.g. ["read", "write"]. Must contain at least one entry.

principal: str | None = None

The identifier of the principal. A string ID for "user", "team", "org", and "agent" types; one of "admin", "member", or "viewer" for "org_role"; omit entirely when principal_type is "everyone".

principal_type: str = PydanticUndefined

The kind of principal receiving the grant. One of "user", "team", "org", "org_role", "agent", or "everyone".

class CustomObjectPatchResponseDataAclGrantsItem(pydantic.main.BaseModel):
174class CustomObjectPatchResponseDataAclGrantsItem(BaseModel):
175    actions: list[str] = Field(
176        ...,
177        description='Array of action strings the principal is permitted to perform, e.g. `["read", "write"]`. Must contain at least one entry.',
178    )
179    principal: str | None = Field(
180        default=None,
181        description='The identifier of the principal. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`; omit entirely when `principal_type` is `"everyone"`.',
182    )
183    principal_type: str = Field(
184        ...,
185        description='The kind of principal receiving the grant. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.',
186    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
actions: list[str] = PydanticUndefined

Array of action strings the principal is permitted to perform, e.g. ["read", "write"]. Must contain at least one entry.

principal: str | None = None

The identifier of the principal. A string ID for "user", "team", "org", and "agent" types; one of "admin", "member", or "viewer" for "org_role"; omit entirely when principal_type is "everyone".

principal_type: str = PydanticUndefined

The kind of principal receiving the grant. One of "user", "team", "org", "org_role", "agent", or "everyone".

class CustomObjectPatchResponseDataAclRemoveItem(pydantic.main.BaseModel):
189class CustomObjectPatchResponseDataAclRemoveItem(BaseModel):
190    principal: str | None = Field(
191        default=None,
192        description='The identifier of the principal to remove. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`. Omit when `principal_type` is `"everyone"`.',
193    )
194    principal_type: str = Field(
195        ...,
196        description='The kind of principal to remove. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.',
197    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
principal: str | None = None

The identifier of the principal to remove. A string ID for "user", "team", "org", and "agent" types; one of "admin", "member", or "viewer" for "org_role". Omit when principal_type is "everyone".

principal_type: str = PydanticUndefined

The kind of principal to remove. One of "user", "team", "org", "org_role", "agent", or "everyone".

class CustomObjectPatchResponseDataAcl(pydantic.main.BaseModel):
200class CustomObjectPatchResponseDataAcl(BaseModel):
201    add: list[CustomObjectPatchResponseDataAclAddItem] | None = Field(
202        default=None,
203        description="Patch mode: grants to add or merge into the existing list. Cannot be combined with `grants`.",
204    )
205    grants: list[CustomObjectPatchResponseDataAclGrantsItem] | None = Field(
206        default=None,
207        description="Replace mode: the complete new list of grants that replaces all existing entries. Send an empty array (`[]`) to clear all grants. Cannot be combined with `add` or `remove`.",
208    )
209    remove: list[CustomObjectPatchResponseDataAclRemoveItem] | None = Field(
210        default=None,
211        description="Patch mode: principals whose grants should be removed from the existing list. Cannot be combined with `grants`.",
212    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
add: list[CustomObjectPatchResponseDataAclAddItem] | None = None

Patch mode: grants to add or merge into the existing list. Cannot be combined with grants.

grants: list[CustomObjectPatchResponseDataAclGrantsItem] | None = None

Replace mode: the complete new list of grants that replaces all existing entries. Send an empty array ([]) to clear all grants. Cannot be combined with add or remove.

remove: list[CustomObjectPatchResponseDataAclRemoveItem] | None = None

Patch mode: principals whose grants should be removed from the existing list. Cannot be combined with grants.

class CustomObjectPatchResponseData(pydantic.main.BaseModel):
215class CustomObjectPatchResponseData(BaseModel):
216    acl: CustomObjectPatchResponseDataAcl | None = Field(
217        default=None,
218        description="Access control list governing read and write access to this custom object. Only returned to resource owners and privileged or organization-admin viewers; `null` for everyone else.",
219    )
220    agent: str | None = Field(
221        default=None,
222        description="ID of the agent that owns this object (`agt_...`). `null` for other ownership types.",
223    )
224    created_at: datetime | None = Field(
225        default=None, description="When the custom object was created (ISO 8601)."
226    )
227    expires_at: datetime | None = Field(
228        default=None, description="Absolute expiry time (RFC 3339). Null when no expiry is set."
229    )
230    fields: dict[str, Any] | None = Field(
231        default=None,
232        description="Map of field names to their current values as defined by the object's schema type.",
233    )
234    id: str = Field(..., description="Unique identifier for the custom object (`cobj_...`).")
235    org: str | None = Field(
236        default=None, description="ID of the organization this object belongs to (`org_...`)."
237    )
238    row_key: str | None = Field(
239        default=None,
240        description="An optional stable key used to identify this object by a caller-controlled string rather than its generated ID. `null` if not set.",
241    )
242    sandbox: str | None = Field(
243        default=None,
244        description="ID of the sandbox environment this object is scoped to (`dsb_...`). `null` for production objects.",
245    )
246    schema_type: str | None = Field(
247        default=None,
248        description="The lookup key of the schema type that defines this object's field structure. `null` if the schema type has not been set.",
249    )
250    team: str | None = Field(
251        default=None,
252        description="ID of the team that owns this object (`tem_...`). `null` if the object is not team-scoped.",
253    )
254    updated_at: datetime | None = Field(
255        default=None,
256        description="When the custom object was last modified (ISO 8601). `null` if the object has never been updated after creation.",
257    )
258    user: str | None = Field(
259        default=None,
260        description="ID of the user that owns this object (`usr_...`). `null` if the object is not user-scoped.",
261    )
262    version: int | None = Field(
263        default=None,
264        description="Optimistic concurrency version of the object. Increments with each successful update; pass this value in write operations to detect conflicting changes.",
265    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.

Access control list governing read and write access to this custom object. Only returned to resource owners and privileged or organization-admin viewers; null for everyone else.

agent: str | None = None

ID of the agent that owns this object (agt_...). null for other ownership types.

created_at: datetime.datetime | None = None

When the custom object was created (ISO 8601).

expires_at: datetime.datetime | None = None

Absolute expiry time (RFC 3339). Null when no expiry is set.

fields: dict[str, typing.Any] | None = None

Map of field names to their current values as defined by the object's schema type.

id: str = PydanticUndefined

Unique identifier for the custom object (cobj_...).

org: str | None = None

ID of the organization this object belongs to (org_...).

row_key: str | None = None

An optional stable key used to identify this object by a caller-controlled string rather than its generated ID. null if not set.

sandbox: str | None = None

ID of the sandbox environment this object is scoped to (dsb_...). null for production objects.

schema_type: str | None = None

The lookup key of the schema type that defines this object's field structure. null if the schema type has not been set.

team: str | None = None

ID of the team that owns this object (tem_...). null if the object is not team-scoped.

updated_at: datetime.datetime | None = None

When the custom object was last modified (ISO 8601). null if the object has never been updated after creation.

user: str | None = None

ID of the user that owns this object (usr_...). null if the object is not user-scoped.

version: int | None = None

Optimistic concurrency version of the object. Increments with each successful update; pass this value in write operations to detect conflicting changes.

class CustomObjectPatchResponse(pydantic.main.BaseModel):
268class CustomObjectPatchResponse(BaseModel):
269    """
270    Successful response
271    """
272
273    data: CustomObjectPatchResponseData = Field(
274        ..., description="The custom object after the patch has been applied."
275    )
276    meta: dict[str, Any] | None = Field(
277        default=None, description="Version metadata and per-op patch results."
278    )

Successful response

data: CustomObjectPatchResponseData = PydanticUndefined

The custom object after the patch has been applied.

meta: dict[str, typing.Any] | None = None

Version metadata and per-op patch results.

class CustomObjectDeleteResponse(pydantic.main.BaseModel):
281class CustomObjectDeleteResponse(BaseModel):
282    """
283    Successful response
284    """
285
286    deleted: bool = Field(..., description="Always `true` when the deletion succeeds.")
287    id: str = Field(..., description="ID of the deleted custom object (`cobj_...`).")

Successful response

deleted: bool = PydanticUndefined

Always true when the deletion succeeds.

id: str = PydanticUndefined

ID of the deleted custom object (cobj_...).

class CustomObjectReplaceResponseDataAclAddItem(pydantic.main.BaseModel):
290class CustomObjectReplaceResponseDataAclAddItem(BaseModel):
291    actions: list[str] = Field(
292        ...,
293        description='Array of action strings the principal is permitted to perform, e.g. `["read", "write"]`. Must contain at least one entry.',
294    )
295    principal: str | None = Field(
296        default=None,
297        description='The identifier of the principal. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`; omit entirely when `principal_type` is `"everyone"`.',
298    )
299    principal_type: str = Field(
300        ...,
301        description='The kind of principal receiving the grant. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.',
302    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
actions: list[str] = PydanticUndefined

Array of action strings the principal is permitted to perform, e.g. ["read", "write"]. Must contain at least one entry.

principal: str | None = None

The identifier of the principal. A string ID for "user", "team", "org", and "agent" types; one of "admin", "member", or "viewer" for "org_role"; omit entirely when principal_type is "everyone".

principal_type: str = PydanticUndefined

The kind of principal receiving the grant. One of "user", "team", "org", "org_role", "agent", or "everyone".

class CustomObjectReplaceResponseDataAclGrantsItem(pydantic.main.BaseModel):
305class CustomObjectReplaceResponseDataAclGrantsItem(BaseModel):
306    actions: list[str] = Field(
307        ...,
308        description='Array of action strings the principal is permitted to perform, e.g. `["read", "write"]`. Must contain at least one entry.',
309    )
310    principal: str | None = Field(
311        default=None,
312        description='The identifier of the principal. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`; omit entirely when `principal_type` is `"everyone"`.',
313    )
314    principal_type: str = Field(
315        ...,
316        description='The kind of principal receiving the grant. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.',
317    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
actions: list[str] = PydanticUndefined

Array of action strings the principal is permitted to perform, e.g. ["read", "write"]. Must contain at least one entry.

principal: str | None = None

The identifier of the principal. A string ID for "user", "team", "org", and "agent" types; one of "admin", "member", or "viewer" for "org_role"; omit entirely when principal_type is "everyone".

principal_type: str = PydanticUndefined

The kind of principal receiving the grant. One of "user", "team", "org", "org_role", "agent", or "everyone".

class CustomObjectReplaceResponseDataAclRemoveItem(pydantic.main.BaseModel):
320class CustomObjectReplaceResponseDataAclRemoveItem(BaseModel):
321    principal: str | None = Field(
322        default=None,
323        description='The identifier of the principal to remove. A string ID for `"user"`, `"team"`, `"org"`, and `"agent"` types; one of `"admin"`, `"member"`, or `"viewer"` for `"org_role"`. Omit when `principal_type` is `"everyone"`.',
324    )
325    principal_type: str = Field(
326        ...,
327        description='The kind of principal to remove. One of `"user"`, `"team"`, `"org"`, `"org_role"`, `"agent"`, or `"everyone"`.',
328    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.
principal: str | None = None

The identifier of the principal to remove. A string ID for "user", "team", "org", and "agent" types; one of "admin", "member", or "viewer" for "org_role". Omit when principal_type is "everyone".

principal_type: str = PydanticUndefined

The kind of principal to remove. One of "user", "team", "org", "org_role", "agent", or "everyone".

class CustomObjectReplaceResponseDataAcl(pydantic.main.BaseModel):
331class CustomObjectReplaceResponseDataAcl(BaseModel):
332    add: list[CustomObjectReplaceResponseDataAclAddItem] | None = Field(
333        default=None,
334        description="Patch mode: grants to add or merge into the existing list. Cannot be combined with `grants`.",
335    )
336    grants: list[CustomObjectReplaceResponseDataAclGrantsItem] | None = Field(
337        default=None,
338        description="Replace mode: the complete new list of grants that replaces all existing entries. Send an empty array (`[]`) to clear all grants. Cannot be combined with `add` or `remove`.",
339    )
340    remove: list[CustomObjectReplaceResponseDataAclRemoveItem] | None = Field(
341        default=None,
342        description="Patch mode: principals whose grants should be removed from the existing list. Cannot be combined with `grants`.",
343    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.

Patch mode: grants to add or merge into the existing list. Cannot be combined with grants.

grants: list[CustomObjectReplaceResponseDataAclGrantsItem] | None = None

Replace mode: the complete new list of grants that replaces all existing entries. Send an empty array ([]) to clear all grants. Cannot be combined with add or remove.

remove: list[CustomObjectReplaceResponseDataAclRemoveItem] | None = None

Patch mode: principals whose grants should be removed from the existing list. Cannot be combined with grants.

class CustomObjectReplaceResponseData(pydantic.main.BaseModel):
346class CustomObjectReplaceResponseData(BaseModel):
347    acl: CustomObjectReplaceResponseDataAcl | None = Field(
348        default=None,
349        description="Access control list governing read and write access to this custom object. Only returned to resource owners and privileged or organization-admin viewers; `null` for everyone else.",
350    )
351    agent: str | None = Field(
352        default=None,
353        description="ID of the agent that owns this object (`agt_...`). `null` for other ownership types.",
354    )
355    created_at: datetime | None = Field(
356        default=None, description="When the custom object was created (ISO 8601)."
357    )
358    expires_at: datetime | None = Field(
359        default=None, description="Absolute expiry time (RFC 3339). Null when no expiry is set."
360    )
361    fields: dict[str, Any] | None = Field(
362        default=None,
363        description="Map of field names to their current values as defined by the object's schema type.",
364    )
365    id: str = Field(..., description="Unique identifier for the custom object (`cobj_...`).")
366    org: str | None = Field(
367        default=None, description="ID of the organization this object belongs to (`org_...`)."
368    )
369    row_key: str | None = Field(
370        default=None,
371        description="An optional stable key used to identify this object by a caller-controlled string rather than its generated ID. `null` if not set.",
372    )
373    sandbox: str | None = Field(
374        default=None,
375        description="ID of the sandbox environment this object is scoped to (`dsb_...`). `null` for production objects.",
376    )
377    schema_type: str | None = Field(
378        default=None,
379        description="The lookup key of the schema type that defines this object's field structure. `null` if the schema type has not been set.",
380    )
381    team: str | None = Field(
382        default=None,
383        description="ID of the team that owns this object (`tem_...`). `null` if the object is not team-scoped.",
384    )
385    updated_at: datetime | None = Field(
386        default=None,
387        description="When the custom object was last modified (ISO 8601). `null` if the object has never been updated after creation.",
388    )
389    user: str | None = Field(
390        default=None,
391        description="ID of the user that owns this object (`usr_...`). `null` if the object is not user-scoped.",
392    )
393    version: int | None = Field(
394        default=None,
395        description="Optimistic concurrency version of the object. Increments with each successful update; pass this value in write operations to detect conflicting changes.",
396    )

!!! abstract "Usage Documentation" Models

A base class for creating Pydantic models.

Attributes:
  • __class_vars__: The names of the class variables defined on the model.
  • __private_attributes__: Metadata about the private attributes of the model.
  • __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
  • __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
  • __pydantic_core_schema__: The core schema of the model.
  • __pydantic_custom_init__: Whether the model has a custom __init__ function.
  • __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
  • __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.
  • __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
  • __pydantic_post_init__: The name of the post-init method for the model, if defined.
  • __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel].
  • __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.
  • __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
  • __pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
  • __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
  • __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
  • __pydantic_fields_set__: The names of fields explicitly set during instantiation.
  • __pydantic_private__: Values of private attributes set on the model instance.

Access control list governing read and write access to this custom object. Only returned to resource owners and privileged or organization-admin viewers; null for everyone else.

agent: str | None = None

ID of the agent that owns this object (agt_...). null for other ownership types.

created_at: datetime.datetime | None = None

When the custom object was created (ISO 8601).

expires_at: datetime.datetime | None = None

Absolute expiry time (RFC 3339). Null when no expiry is set.

fields: dict[str, typing.Any] | None = None

Map of field names to their current values as defined by the object's schema type.

id: str = PydanticUndefined

Unique identifier for the custom object (cobj_...).

org: str | None = None

ID of the organization this object belongs to (org_...).

row_key: str | None = None

An optional stable key used to identify this object by a caller-controlled string rather than its generated ID. null if not set.

sandbox: str | None = None

ID of the sandbox environment this object is scoped to (dsb_...). null for production objects.

schema_type: str | None = None

The lookup key of the schema type that defines this object's field structure. null if the schema type has not been set.

team: str | None = None

ID of the team that owns this object (tem_...). null if the object is not team-scoped.

updated_at: datetime.datetime | None = None

When the custom object was last modified (ISO 8601). null if the object has never been updated after creation.

user: str | None = None

ID of the user that owns this object (usr_...). null if the object is not user-scoped.

version: int | None = None

Optimistic concurrency version of the object. Increments with each successful update; pass this value in write operations to detect conflicting changes.

class CustomObjectReplaceResponse(pydantic.main.BaseModel):
399class CustomObjectReplaceResponse(BaseModel):
400    """
401    Successful response
402    """
403
404    data: CustomObjectReplaceResponseData = Field(
405        ..., description="The custom object after the update has been applied."
406    )
407    meta: dict[str, Any] | None = Field(
408        default=None, description="Version metadata for the updated object."
409    )

Successful response

data: CustomObjectReplaceResponseData = PydanticUndefined

The custom object after the update has been applied.

meta: dict[str, typing.Any] | None = None

Version metadata for the updated object.

class AsyncCustomObjectResource:
412class AsyncCustomObjectResource:
413    def __init__(self, http: HttpClient):
414        self._http = http
415
416    async def list(
417        self,
418        *,
419        type: str | None = None,
420        schema_key: str | None = None,
421        field_filters: dict[str, Any] | None = None,
422        system_only: bool | None = None,
423        order_by_field: str | None = None,
424        row_key: str | None = None,
425        sort_key: builtins.list[str] | None = None,
426        keys: builtins.list[dict[str, Any]] | None = None,
427        team: builtins.list[str] | None = None,
428        user: builtins.list[str] | None = None,
429        agent: builtins.list[str] | None = None,
430        org: builtins.list[str] | None = None,
431        query: str | None = None,
432        search: str | None = None,
433        page: int | None = None,
434        updated_since: datetime | None = None,
435        page_size: int | None = None,
436        include_count: bool | None = None,
437    ) -> CustomObjectListResponse:
438        """
439        List custom objects
440        Returns a paginated list of custom objects visible to the authenticated
441        viewer, ordered by creation time descending. Results span all ownership
442        types (team-owned, user-owned, agent-owned, and system-owned) that the
443        viewer has access to.
444        Filter by schema type with `type` (preferred) or the legacy alias
445        `schema_key`. Use the `row_key` param to perform an exact-match partition
446        lookup. You may additionally supply `sort_key` to narrow within that
447        partition `sort_key` requires `row_key` and the request returns 400 if
448        `sort_key` is provided alone. Owner filters (`team`, `user`, `agent`,
449        `org`) are additive: each accepts an array of IDs (or a single ID, which
450        is wrapped) and returns objects matching any of the supplied values.
451        When `query` is supplied, results are ranked by full-text relevance
452        (descending `ts_rank`) rather than creation time. The legacy `search`
453        param performs a case-insensitive substring match and is retained for
454        developer-namespace clients.
455
456        Args:
457            type: Schema type identifier (`lookup_key`) to filter by. Only objects of this type are returned. Alias of `schema_key`; either name is accepted.
458            schema_key: Legacy alias for `type`. Prefer `type` on new clients. When both are supplied, `type` wins.
459            field_filters: JSON containment predicates on fields, applied before pagination and counting.
460            system_only: Only system-owned objects (no user, team, agent or thread owner). Visibility is unchanged.
461            order_by_field: Top-level JSON field for descending text order, with ID tie-breaker. Full-text relevance takes precedence.
462            row_key: Exact `row_key` value to match. When supplied, only objects with this partition key are returned.
463            sort_key: One or more `sort_key` values to match within the `row_key` partition. Requires `row_key` to be set.
464            keys: JSON-encoded array of up to 100 objects with required string row_key and optional string-array sort_key. Missing or empty sort_key selects the whole partition. Mutually exclusive with row_key and sort_key. Pagination applies globally across all matched partitions.
465            team: One or more team IDs (`team_...`) to filter by owning team. Returns objects owned by any of the supplied teams.
466            user: One or more user IDs (`user_...`) to filter by owning user. Returns objects owned by any of the supplied users.
467            agent: One or more agent IDs to filter by owning agent. Returns objects owned by any of the supplied agents.
468            org: One or more organization IDs (`org_...`) to filter by. Typically used by admins to query system-owned objects in a specific org.
469            query: Full-text search string matched against the schema's configured search fields. When supplied, results are ordered by relevance score descending instead of creation time descending.
470            search: Case-insensitive substring search applied across the schema type and serialized field values. Deprecated prefer `query` for full-text search. Retained for developer-namespace clients.
471            page: Page number to retrieve (1-indexed). Defaults to `1`.
472            updated_since: Include only objects updated at or after this ISO 8601 timestamp. Applies before pagination and counting.
473            page_size: Number of objects per page. Defaults to `25`; maximum is `100`.
474            include_count: Include total_entries and total_pages (default true). When false, totals are null, has_next uses one extra row, and pages beyond the end return an empty list without clamping. The page offset must fit PostgreSQL's signed 64-bit integer range.
475
476        Returns:
477            Paginated list of custom objects matching the supplied filters.
478        """
479        query: dict[str, object] = {}
480        if type is not None:
481            query["type"] = type
482        if schema_key is not None:
483            query["schema_key"] = schema_key
484        if field_filters is not None:
485            query["field_filters"] = field_filters
486        if system_only is not None:
487            query["system_only"] = system_only
488        if order_by_field is not None:
489            query["order_by_field"] = order_by_field
490        if row_key is not None:
491            query["row_key"] = row_key
492        if sort_key is not None:
493            query["sort_key"] = sort_key
494        if keys is not None:
495            query["keys"] = keys
496        if team is not None:
497            query["team"] = team
498        if user is not None:
499            query["user"] = user
500        if agent is not None:
501            query["agent"] = agent
502        if org is not None:
503            query["org"] = org
504        if query is not None:
505            query["query"] = query
506        if search is not None:
507            query["search"] = search
508        if page is not None:
509            query["page"] = page
510        if updated_since is not None:
511            query["updated_since"] = updated_since
512        if page_size is not None:
513            query["page_size"] = page_size
514        if include_count is not None:
515            query["include_count"] = include_count
516        return await self._http.request(
517            "/api/v1/custom_objects",
518            query=query,
519            response_type=CustomObjectListResponse,
520        )
521
522    async def create(self, input: CustomObjectCreateInput) -> CustomObject:
523        """
524        Create a custom object
525        Creates a new custom object of the given schema type and returns the
526        persisted object. The caller must be authenticated and authorized to create
527        objects of the specified type.
528        Identify the schema with `type` (preferred), or the legacy aliases
529        `schema_key` (lookup key) / `config` (config ID). Exactly one identifier is
530        required; when more than one is supplied, `type` wins over `schema_key`,
531        which wins over `config`.
532        Owner resolution follows a priority order: if `team` is supplied the object
533        is team-owned; if `user` is supplied it is owned by that user; if `agent` is
534        supplied it is agent-owned; otherwise the object is owned by the authenticated
535        user. Pass `system: true` explicitly to force system ownership this requires
536        elevated API credentials and returns 403 if the caller lacks permission.
537        If the schema declares a `row_key` (and optionally a `sort_key`), you may
538        pass `upsert: true` to update an existing object at that key instead of
539        receiving a 409 Conflict. The response status is `200` on an update and
540        `201` on a new create.
541
542        Args:
543            input: Request body.
544            input.acl: Access control list for the custom object. Supports explicit `read` and `write` grants to users, teams, organizations, organization roles, agents, or everyone.
545            input.agent: Agent user ID to set as the object owner. Used when neither `team` nor `user` is supplied.
546            input.config: Config ID (`cfg_...`) that resolves to the target schema. Provide one of `type`, `schema_key`, or `config`.
547            input.expires_at: Absolute expiry time in RFC 3339 format. Pass null to clear; omit to leave unchanged on update.
548            input.fields: Key-value map of field values for the new object. Must conform to the schema's field definitions. Omit to create an object with all fields at their default or null values.
549            input.org: Organization ID (`org_...`) to associate with the object. Typically required for system-owned objects.
550            input.schema_key: Legacy alias for `type` (schema `lookup_key`). Prefer `type` on new clients. Provide one of `type`, `schema_key`, or `config`.
551            input.system: When `true`, creates a system-owned object with no team, user, or agent owner. Requires elevated API credentials; returns 403 if the caller lacks permission.
552            input.team: Team ID (`team_...`) to set as the object owner. When supplied, takes priority over `user` and `agent`.
553            input.type: Schema type identifier (`lookup_key`) that defines the object's shape and validation rules. Preferred over the legacy `schema_key` / `config` aliases.
554            input.upsert: When `true` and the schema declares a `row_key`, updates the existing object at that key for the same owner instead of returning 409 Conflict. Returns HTTP 200 on update and 201 on create.
555            input.user: User ID (`user_...`) to set as the object owner. Used when neither `team` nor a higher-priority owner is set.
556
557        Returns:
558            The created (or upserted) custom object.
559        """
560        return await self._http.request(
561            "/api/v1/custom_objects",
562            method="POST",
563            body=input,
564            response_type=CustomObject,
565        )
566
567    async def patch(self, input: CustomObjectPatchInput) -> CustomObjectPatchResponse:
568        """
569        Apply numeric patch ops to a custom object
570        Applies numeric patch ops (`increment`, `max`, `min`, `set_if_newer` with
571        dotted `path`s) atomically to a custom object and returns the updated
572        object along with per-op results. The authenticated viewer must have
573        permission to modify the object.
574        Address the row in one of two ways: by `object` ID (`cobj_...`), or by
575        `schema` + `row_key` (with optional `sort_key` for schemas that declare
576        one). The keyed form resolves the row for the same owner the create
577        contract would use and, when no row exists yet, creates it from
578        `create_with` merged over the key fields before applying the ops so an
579        aggregator's first call creates the counter and later calls increment it.
580        A racing create resolves to the same row instead of a duplicate.
581        Pass `idempotency_key` to make retries safe: a retry with the same key and
582        ops replays the stored result without re-applying the write (survives
583        server restarts); reusing a key with different ops returns 409.
584
585        Args:
586            input: Request body.
587            input.agent: Agent user ID owning the keyed row. At most one owner selector may be present.
588            input.create_with: Field values used to create the row when the keyed form finds no existing row. Merged over the key fields before validation; ignored by the `object` form.
589            input.idempotency_key: Client-supplied deduplication key for this patch. A retry with the same key and the same ops replays the stored result without re-applying the write (survives server restarts); reusing a key with different ops returns 409.
590            input.object: Custom object ID (`cobj_...`) to patch. Exactly one of `object` or `schema` + `row_key` is required.
591            input.ops: Numeric patch ops to apply in order (e.g. `[%{"op" => "increment", "path" => "count", "by" => 1}]`). Supported ops: `increment` (`by`), `max`/`min` (`value`), `set_if_newer` (`value`, `fence_path`, `fence`).
592            input.row_key: Row key naming the row within `schema` (e.g. a counter name). Requires `schema`.
593            input.schema: Schema type identifier (`lookup_key`) for the keyed form. Requires `row_key`.
594            input.sort_key: Sort-key segments partitioning rows within the `row_key` bucket. Only meaningful for schemas that declare a `sort_key`.
595            input.team: Team ID (`tem_...`) owning the keyed row. Defaults to the viewer's owner like the create contract.
596            input.user: User ID (`usr_...`) owning the keyed row. At most one owner selector may be present.
597
598        Returns:
599            Successful response
600        """
601        return await self._http.request(
602            "/api/v1/custom_objects/patch",
603            method="POST",
604            body=input,
605            response_type=CustomObjectPatchResponse,
606        )
607
608    async def delete(self, object: str) -> CustomObjectDeleteResponse:
609        """
610        Delete a custom object
611        Permanently deletes the custom object identified by `object`. The caller
612        must be authenticated and have permission to delete the object.
613        On success, returns a confirmation payload containing the deleted object's
614        ID so callers can confirm the deletion without a follow-up fetch.
615        Attempting to delete an object that does not exist or has already been
616        deleted returns 404.
617
618        Args:
619            object: Custom object ID (`cobj_...`) of the object to delete.
620
621        Returns:
622            Successful response
623        """
624        return await self._http.request(
625            f"/api/v1/custom_objects/{object}",
626            method="DELETE",
627            response_type=CustomObjectDeleteResponse,
628        )
629
630    async def get(self, object: str, *, type: str | None = None) -> CustomObject:
631        """
632        Retrieve a custom object
633        Returns a single custom object identified by its ID. The authenticated viewer
634        must have visibility access to the object.
635        Returns 404 if the object does not exist, has been deleted, or is not
636        visible to the viewer.
637
638        Args:
639            object: Custom object ID (`cobj_...`) to retrieve.
640            type: Schema type identifier (`lookup_key`) of the object. Optional; used for routing context only.
641
642        Returns:
643            The requested custom object.
644        """
645        query: dict[str, object] = {}
646        if type is not None:
647            query["type"] = type
648        return await self._http.request(
649            f"/api/v1/custom_objects/{object}",
650            query=query,
651            response_type=CustomObject,
652        )
653
654    async def replace(
655        self, object: str, input: CustomObjectReplaceInput
656    ) -> CustomObjectReplaceResponse:
657        """
658        Update a custom object
659        Updates the fields of an existing custom object and returns the updated
660        object along with its new version number. The authenticated viewer must have
661        permission to modify the object.
662        You may supply `fields` (a full or partial key-value map to merge into the
663        object), `field_ops` (granular array operations per field), `acl`, or any
664        compatible combination. The same field name must not appear in both
665        `fields` and `field_ops`, which returns 422. Returns 404 if the object does
666        not exist or has been deleted.
667        Use `expected_version` for optimistic concurrency: if the object's current
668        `aggregate_version` does not match, the request returns 409 and does not
669        retry the caller write. Omit it to keep the existing OCC merge retry.
670
671        Args:
672            object: Custom object ID (`cobj_...`) to update.
673            input: Request body.
674            input.acl: Updated access control list. Supports full replacement via `grants` or targeted `add`/`remove` operations.
675            input.expected_version: Version number the caller expects to be current. If the object's actual current version does not match, the request returns 409 to signal a concurrent modification. Omit to skip optimistic locking and keep the existing OCC merge retry.
676            input.expires_at: Absolute expiry time in RFC 3339 format. Pass null to clear; omit to leave unchanged on update.
677            input.field_ops: Granular array operations to apply per field (e.g. append, prepend, remove). A field must not appear in both `fields` and `field_ops`.
678            input.fields: Key-value map of field values to merge into the object. Only the supplied keys are affected.
679            input.idempotency_key: Client-supplied deduplication key for this write. A retry with the same key and the same body replays the stored result without re-applying the write (survives server restarts); reusing a key with a different body returns 409.
680            input.type: Schema type identifier (`lookup_key`) of the object. Optional; used for routing context only.
681
682        Returns:
683            Successful response
684        """
685        return await self._http.request(
686            f"/api/v1/custom_objects/{object}",
687            method="PUT",
688            body=input,
689            response_type=CustomObjectReplaceResponse,
690        )
AsyncCustomObjectResource(http: archastro.platform.runtime.http_client.HttpClient)
413    def __init__(self, http: HttpClient):
414        self._http = http
async def list( self, *, type: str | None = None, schema_key: str | None = None, field_filters: dict[str, typing.Any] | None = None, system_only: bool | None = None, order_by_field: str | None = None, row_key: str | None = None, sort_key: list[str] | None = None, keys: list[dict[str, typing.Any]] | None = None, team: list[str] | None = None, user: list[str] | None = None, agent: list[str] | None = None, org: list[str] | None = None, query: str | None = None, search: str | None = None, page: int | None = None, updated_since: datetime.datetime | None = None, page_size: int | None = None, include_count: bool | None = None) -> archastro.platform.types.common.CustomObjectListResponse:
416    async def list(
417        self,
418        *,
419        type: str | None = None,
420        schema_key: str | None = None,
421        field_filters: dict[str, Any] | None = None,
422        system_only: bool | None = None,
423        order_by_field: str | None = None,
424        row_key: str | None = None,
425        sort_key: builtins.list[str] | None = None,
426        keys: builtins.list[dict[str, Any]] | None = None,
427        team: builtins.list[str] | None = None,
428        user: builtins.list[str] | None = None,
429        agent: builtins.list[str] | None = None,
430        org: builtins.list[str] | None = None,
431        query: str | None = None,
432        search: str | None = None,
433        page: int | None = None,
434        updated_since: datetime | None = None,
435        page_size: int | None = None,
436        include_count: bool | None = None,
437    ) -> CustomObjectListResponse:
438        """
439        List custom objects
440        Returns a paginated list of custom objects visible to the authenticated
441        viewer, ordered by creation time descending. Results span all ownership
442        types (team-owned, user-owned, agent-owned, and system-owned) that the
443        viewer has access to.
444        Filter by schema type with `type` (preferred) or the legacy alias
445        `schema_key`. Use the `row_key` param to perform an exact-match partition
446        lookup. You may additionally supply `sort_key` to narrow within that
447        partition `sort_key` requires `row_key` and the request returns 400 if
448        `sort_key` is provided alone. Owner filters (`team`, `user`, `agent`,
449        `org`) are additive: each accepts an array of IDs (or a single ID, which
450        is wrapped) and returns objects matching any of the supplied values.
451        When `query` is supplied, results are ranked by full-text relevance
452        (descending `ts_rank`) rather than creation time. The legacy `search`
453        param performs a case-insensitive substring match and is retained for
454        developer-namespace clients.
455
456        Args:
457            type: Schema type identifier (`lookup_key`) to filter by. Only objects of this type are returned. Alias of `schema_key`; either name is accepted.
458            schema_key: Legacy alias for `type`. Prefer `type` on new clients. When both are supplied, `type` wins.
459            field_filters: JSON containment predicates on fields, applied before pagination and counting.
460            system_only: Only system-owned objects (no user, team, agent or thread owner). Visibility is unchanged.
461            order_by_field: Top-level JSON field for descending text order, with ID tie-breaker. Full-text relevance takes precedence.
462            row_key: Exact `row_key` value to match. When supplied, only objects with this partition key are returned.
463            sort_key: One or more `sort_key` values to match within the `row_key` partition. Requires `row_key` to be set.
464            keys: JSON-encoded array of up to 100 objects with required string row_key and optional string-array sort_key. Missing or empty sort_key selects the whole partition. Mutually exclusive with row_key and sort_key. Pagination applies globally across all matched partitions.
465            team: One or more team IDs (`team_...`) to filter by owning team. Returns objects owned by any of the supplied teams.
466            user: One or more user IDs (`user_...`) to filter by owning user. Returns objects owned by any of the supplied users.
467            agent: One or more agent IDs to filter by owning agent. Returns objects owned by any of the supplied agents.
468            org: One or more organization IDs (`org_...`) to filter by. Typically used by admins to query system-owned objects in a specific org.
469            query: Full-text search string matched against the schema's configured search fields. When supplied, results are ordered by relevance score descending instead of creation time descending.
470            search: Case-insensitive substring search applied across the schema type and serialized field values. Deprecated prefer `query` for full-text search. Retained for developer-namespace clients.
471            page: Page number to retrieve (1-indexed). Defaults to `1`.
472            updated_since: Include only objects updated at or after this ISO 8601 timestamp. Applies before pagination and counting.
473            page_size: Number of objects per page. Defaults to `25`; maximum is `100`.
474            include_count: Include total_entries and total_pages (default true). When false, totals are null, has_next uses one extra row, and pages beyond the end return an empty list without clamping. The page offset must fit PostgreSQL's signed 64-bit integer range.
475
476        Returns:
477            Paginated list of custom objects matching the supplied filters.
478        """
479        query: dict[str, object] = {}
480        if type is not None:
481            query["type"] = type
482        if schema_key is not None:
483            query["schema_key"] = schema_key
484        if field_filters is not None:
485            query["field_filters"] = field_filters
486        if system_only is not None:
487            query["system_only"] = system_only
488        if order_by_field is not None:
489            query["order_by_field"] = order_by_field
490        if row_key is not None:
491            query["row_key"] = row_key
492        if sort_key is not None:
493            query["sort_key"] = sort_key
494        if keys is not None:
495            query["keys"] = keys
496        if team is not None:
497            query["team"] = team
498        if user is not None:
499            query["user"] = user
500        if agent is not None:
501            query["agent"] = agent
502        if org is not None:
503            query["org"] = org
504        if query is not None:
505            query["query"] = query
506        if search is not None:
507            query["search"] = search
508        if page is not None:
509            query["page"] = page
510        if updated_since is not None:
511            query["updated_since"] = updated_since
512        if page_size is not None:
513            query["page_size"] = page_size
514        if include_count is not None:
515            query["include_count"] = include_count
516        return await self._http.request(
517            "/api/v1/custom_objects",
518            query=query,
519            response_type=CustomObjectListResponse,
520        )

List custom objects Returns a paginated list of custom objects visible to the authenticated viewer, ordered by creation time descending. Results span all ownership types (team-owned, user-owned, agent-owned, and system-owned) that the viewer has access to. Filter by schema type with type (preferred) or the legacy alias schema_key. Use the row_key param to perform an exact-match partition lookup. You may additionally supply sort_key to narrow within that partition sort_key requires row_key and the request returns 400 if sort_key is provided alone. Owner filters (team, user, agent, org) are additive: each accepts an array of IDs (or a single ID, which is wrapped) and returns objects matching any of the supplied values. When query is supplied, results are ranked by full-text relevance (descending ts_rank) rather than creation time. The legacy search param performs a case-insensitive substring match and is retained for developer-namespace clients.

Arguments:
  • type: Schema type identifier (lookup_key) to filter by. Only objects of this type are returned. Alias of schema_key; either name is accepted.
  • schema_key: Legacy alias for type. Prefer type on new clients. When both are supplied, type wins.
  • field_filters: JSON containment predicates on fields, applied before pagination and counting.
  • system_only: Only system-owned objects (no user, team, agent or thread owner). Visibility is unchanged.
  • order_by_field: Top-level JSON field for descending text order, with ID tie-breaker. Full-text relevance takes precedence.
  • row_key: Exact row_key value to match. When supplied, only objects with this partition key are returned.
  • sort_key: One or more sort_key values to match within the row_key partition. Requires row_key to be set.
  • keys: JSON-encoded array of up to 100 objects with required string row_key and optional string-array sort_key. Missing or empty sort_key selects the whole partition. Mutually exclusive with row_key and sort_key. Pagination applies globally across all matched partitions.
  • team: One or more team IDs (team_...) to filter by owning team. Returns objects owned by any of the supplied teams.
  • user: One or more user IDs (user_...) to filter by owning user. Returns objects owned by any of the supplied users.
  • agent: One or more agent IDs to filter by owning agent. Returns objects owned by any of the supplied agents.
  • org: One or more organization IDs (org_...) to filter by. Typically used by admins to query system-owned objects in a specific org.
  • query: Full-text search string matched against the schema's configured search fields. When supplied, results are ordered by relevance score descending instead of creation time descending.
  • search: Case-insensitive substring search applied across the schema type and serialized field values. Deprecated prefer query for full-text search. Retained for developer-namespace clients.
  • page: Page number to retrieve (1-indexed). Defaults to 1.
  • updated_since: Include only objects updated at or after this ISO 8601 timestamp. Applies before pagination and counting.
  • page_size: Number of objects per page. Defaults to 25; maximum is 100.
  • include_count: Include total_entries and total_pages (default true). When false, totals are null, has_next uses one extra row, and pages beyond the end return an empty list without clamping. The page offset must fit PostgreSQL's signed 64-bit integer range.
Returns:

Paginated list of custom objects matching the supplied filters.

async def create( self, input: CustomObjectCreateInput) -> archastro.platform.types.common.CustomObject:
522    async def create(self, input: CustomObjectCreateInput) -> CustomObject:
523        """
524        Create a custom object
525        Creates a new custom object of the given schema type and returns the
526        persisted object. The caller must be authenticated and authorized to create
527        objects of the specified type.
528        Identify the schema with `type` (preferred), or the legacy aliases
529        `schema_key` (lookup key) / `config` (config ID). Exactly one identifier is
530        required; when more than one is supplied, `type` wins over `schema_key`,
531        which wins over `config`.
532        Owner resolution follows a priority order: if `team` is supplied the object
533        is team-owned; if `user` is supplied it is owned by that user; if `agent` is
534        supplied it is agent-owned; otherwise the object is owned by the authenticated
535        user. Pass `system: true` explicitly to force system ownership this requires
536        elevated API credentials and returns 403 if the caller lacks permission.
537        If the schema declares a `row_key` (and optionally a `sort_key`), you may
538        pass `upsert: true` to update an existing object at that key instead of
539        receiving a 409 Conflict. The response status is `200` on an update and
540        `201` on a new create.
541
542        Args:
543            input: Request body.
544            input.acl: Access control list for the custom object. Supports explicit `read` and `write` grants to users, teams, organizations, organization roles, agents, or everyone.
545            input.agent: Agent user ID to set as the object owner. Used when neither `team` nor `user` is supplied.
546            input.config: Config ID (`cfg_...`) that resolves to the target schema. Provide one of `type`, `schema_key`, or `config`.
547            input.expires_at: Absolute expiry time in RFC 3339 format. Pass null to clear; omit to leave unchanged on update.
548            input.fields: Key-value map of field values for the new object. Must conform to the schema's field definitions. Omit to create an object with all fields at their default or null values.
549            input.org: Organization ID (`org_...`) to associate with the object. Typically required for system-owned objects.
550            input.schema_key: Legacy alias for `type` (schema `lookup_key`). Prefer `type` on new clients. Provide one of `type`, `schema_key`, or `config`.
551            input.system: When `true`, creates a system-owned object with no team, user, or agent owner. Requires elevated API credentials; returns 403 if the caller lacks permission.
552            input.team: Team ID (`team_...`) to set as the object owner. When supplied, takes priority over `user` and `agent`.
553            input.type: Schema type identifier (`lookup_key`) that defines the object's shape and validation rules. Preferred over the legacy `schema_key` / `config` aliases.
554            input.upsert: When `true` and the schema declares a `row_key`, updates the existing object at that key for the same owner instead of returning 409 Conflict. Returns HTTP 200 on update and 201 on create.
555            input.user: User ID (`user_...`) to set as the object owner. Used when neither `team` nor a higher-priority owner is set.
556
557        Returns:
558            The created (or upserted) custom object.
559        """
560        return await self._http.request(
561            "/api/v1/custom_objects",
562            method="POST",
563            body=input,
564            response_type=CustomObject,
565        )

Create a custom object Creates a new custom object of the given schema type and returns the persisted object. The caller must be authenticated and authorized to create objects of the specified type. Identify the schema with type (preferred), or the legacy aliases schema_key (lookup key) / config (config ID). Exactly one identifier is required; when more than one is supplied, type wins over schema_key, which wins over config. Owner resolution follows a priority order: if team is supplied the object is team-owned; if user is supplied it is owned by that user; if agent is supplied it is agent-owned; otherwise the object is owned by the authenticated user. Pass system: true explicitly to force system ownership this requires elevated API credentials and returns 403 if the caller lacks permission. If the schema declares a row_key (and optionally a sort_key), you may pass upsert: true to update an existing object at that key instead of receiving a 409 Conflict. The response status is 200 on an update and 201 on a new create.

Arguments:
  • input: Request body.
  • input.acl: Access control list for the custom object. Supports explicit read and write grants to users, teams, organizations, organization roles, agents, or everyone.
  • input.agent: Agent user ID to set as the object owner. Used when neither team nor user is supplied.
  • input.config: Config ID (cfg_...) that resolves to the target schema. Provide one of type, schema_key, or config.
  • input.expires_at: Absolute expiry time in RFC 3339 format. Pass null to clear; omit to leave unchanged on update.
  • input.fields: Key-value map of field values for the new object. Must conform to the schema's field definitions. Omit to create an object with all fields at their default or null values.
  • input.org: Organization ID (org_...) to associate with the object. Typically required for system-owned objects.
  • input.schema_key: Legacy alias for type (schema lookup_key). Prefer type on new clients. Provide one of type, schema_key, or config.
  • input.system: When true, creates a system-owned object with no team, user, or agent owner. Requires elevated API credentials; returns 403 if the caller lacks permission.
  • input.team: Team ID (team_...) to set as the object owner. When supplied, takes priority over user and agent.
  • input.type: Schema type identifier (lookup_key) that defines the object's shape and validation rules. Preferred over the legacy schema_key / config aliases.
  • input.upsert: When true and the schema declares a row_key, updates the existing object at that key for the same owner instead of returning 409 Conflict. Returns HTTP 200 on update and 201 on create.
  • input.user: User ID (user_...) to set as the object owner. Used when neither team nor a higher-priority owner is set.
Returns:

The created (or upserted) custom object.

async def patch( self, input: CustomObjectPatchInput) -> CustomObjectPatchResponse:
567    async def patch(self, input: CustomObjectPatchInput) -> CustomObjectPatchResponse:
568        """
569        Apply numeric patch ops to a custom object
570        Applies numeric patch ops (`increment`, `max`, `min`, `set_if_newer` with
571        dotted `path`s) atomically to a custom object and returns the updated
572        object along with per-op results. The authenticated viewer must have
573        permission to modify the object.
574        Address the row in one of two ways: by `object` ID (`cobj_...`), or by
575        `schema` + `row_key` (with optional `sort_key` for schemas that declare
576        one). The keyed form resolves the row for the same owner the create
577        contract would use and, when no row exists yet, creates it from
578        `create_with` merged over the key fields before applying the ops so an
579        aggregator's first call creates the counter and later calls increment it.
580        A racing create resolves to the same row instead of a duplicate.
581        Pass `idempotency_key` to make retries safe: a retry with the same key and
582        ops replays the stored result without re-applying the write (survives
583        server restarts); reusing a key with different ops returns 409.
584
585        Args:
586            input: Request body.
587            input.agent: Agent user ID owning the keyed row. At most one owner selector may be present.
588            input.create_with: Field values used to create the row when the keyed form finds no existing row. Merged over the key fields before validation; ignored by the `object` form.
589            input.idempotency_key: Client-supplied deduplication key for this patch. A retry with the same key and the same ops replays the stored result without re-applying the write (survives server restarts); reusing a key with different ops returns 409.
590            input.object: Custom object ID (`cobj_...`) to patch. Exactly one of `object` or `schema` + `row_key` is required.
591            input.ops: Numeric patch ops to apply in order (e.g. `[%{"op" => "increment", "path" => "count", "by" => 1}]`). Supported ops: `increment` (`by`), `max`/`min` (`value`), `set_if_newer` (`value`, `fence_path`, `fence`).
592            input.row_key: Row key naming the row within `schema` (e.g. a counter name). Requires `schema`.
593            input.schema: Schema type identifier (`lookup_key`) for the keyed form. Requires `row_key`.
594            input.sort_key: Sort-key segments partitioning rows within the `row_key` bucket. Only meaningful for schemas that declare a `sort_key`.
595            input.team: Team ID (`tem_...`) owning the keyed row. Defaults to the viewer's owner like the create contract.
596            input.user: User ID (`usr_...`) owning the keyed row. At most one owner selector may be present.
597
598        Returns:
599            Successful response
600        """
601        return await self._http.request(
602            "/api/v1/custom_objects/patch",
603            method="POST",
604            body=input,
605            response_type=CustomObjectPatchResponse,
606        )

Apply numeric patch ops to a custom object Applies numeric patch ops (increment, max, min, set_if_newer with dotted paths) atomically to a custom object and returns the updated object along with per-op results. The authenticated viewer must have permission to modify the object. Address the row in one of two ways: by object ID (cobj_...), or by schema + row_key (with optional sort_key for schemas that declare one). The keyed form resolves the row for the same owner the create contract would use and, when no row exists yet, creates it from create_with merged over the key fields before applying the ops so an aggregator's first call creates the counter and later calls increment it. A racing create resolves to the same row instead of a duplicate. Pass idempotency_key to make retries safe: a retry with the same key and ops replays the stored result without re-applying the write (survives server restarts); reusing a key with different ops returns 409.

Arguments:
  • input: Request body.
  • input.agent: Agent user ID owning the keyed row. At most one owner selector may be present.
  • input.create_with: Field values used to create the row when the keyed form finds no existing row. Merged over the key fields before validation; ignored by the object form.
  • input.idempotency_key: Client-supplied deduplication key for this patch. A retry with the same key and the same ops replays the stored result without re-applying the write (survives server restarts); reusing a key with different ops returns 409.
  • input.object: Custom object ID (cobj_...) to patch. Exactly one of object or schema + row_key is required.
  • input.ops: Numeric patch ops to apply in order (e.g. [%{"op" => "increment", "path" => "count", "by" => 1}]). Supported ops: increment (by), max/min (value), set_if_newer (value, fence_path, fence).
  • input.row_key: Row key naming the row within schema (e.g. a counter name). Requires schema.
  • input.schema: Schema type identifier (lookup_key) for the keyed form. Requires row_key.
  • input.sort_key: Sort-key segments partitioning rows within the row_key bucket. Only meaningful for schemas that declare a sort_key.
  • input.team: Team ID (tem_...) owning the keyed row. Defaults to the viewer's owner like the create contract.
  • input.user: User ID (usr_...) owning the keyed row. At most one owner selector may be present.
Returns:

Successful response

async def delete( self, object: str) -> CustomObjectDeleteResponse:
608    async def delete(self, object: str) -> CustomObjectDeleteResponse:
609        """
610        Delete a custom object
611        Permanently deletes the custom object identified by `object`. The caller
612        must be authenticated and have permission to delete the object.
613        On success, returns a confirmation payload containing the deleted object's
614        ID so callers can confirm the deletion without a follow-up fetch.
615        Attempting to delete an object that does not exist or has already been
616        deleted returns 404.
617
618        Args:
619            object: Custom object ID (`cobj_...`) of the object to delete.
620
621        Returns:
622            Successful response
623        """
624        return await self._http.request(
625            f"/api/v1/custom_objects/{object}",
626            method="DELETE",
627            response_type=CustomObjectDeleteResponse,
628        )

Delete a custom object Permanently deletes the custom object identified by object. The caller must be authenticated and have permission to delete the object. On success, returns a confirmation payload containing the deleted object's ID so callers can confirm the deletion without a follow-up fetch. Attempting to delete an object that does not exist or has already been deleted returns 404.

Arguments:
  • object: Custom object ID (cobj_...) of the object to delete.
Returns:

Successful response

async def get( self, object: str, *, type: str | None = None) -> archastro.platform.types.common.CustomObject:
630    async def get(self, object: str, *, type: str | None = None) -> CustomObject:
631        """
632        Retrieve a custom object
633        Returns a single custom object identified by its ID. The authenticated viewer
634        must have visibility access to the object.
635        Returns 404 if the object does not exist, has been deleted, or is not
636        visible to the viewer.
637
638        Args:
639            object: Custom object ID (`cobj_...`) to retrieve.
640            type: Schema type identifier (`lookup_key`) of the object. Optional; used for routing context only.
641
642        Returns:
643            The requested custom object.
644        """
645        query: dict[str, object] = {}
646        if type is not None:
647            query["type"] = type
648        return await self._http.request(
649            f"/api/v1/custom_objects/{object}",
650            query=query,
651            response_type=CustomObject,
652        )

Retrieve a custom object Returns a single custom object identified by its ID. The authenticated viewer must have visibility access to the object. Returns 404 if the object does not exist, has been deleted, or is not visible to the viewer.

Arguments:
  • object: Custom object ID (cobj_...) to retrieve.
  • type: Schema type identifier (lookup_key) of the object. Optional; used for routing context only.
Returns:

The requested custom object.

async def replace( self, object: str, input: CustomObjectReplaceInput) -> CustomObjectReplaceResponse:
654    async def replace(
655        self, object: str, input: CustomObjectReplaceInput
656    ) -> CustomObjectReplaceResponse:
657        """
658        Update a custom object
659        Updates the fields of an existing custom object and returns the updated
660        object along with its new version number. The authenticated viewer must have
661        permission to modify the object.
662        You may supply `fields` (a full or partial key-value map to merge into the
663        object), `field_ops` (granular array operations per field), `acl`, or any
664        compatible combination. The same field name must not appear in both
665        `fields` and `field_ops`, which returns 422. Returns 404 if the object does
666        not exist or has been deleted.
667        Use `expected_version` for optimistic concurrency: if the object's current
668        `aggregate_version` does not match, the request returns 409 and does not
669        retry the caller write. Omit it to keep the existing OCC merge retry.
670
671        Args:
672            object: Custom object ID (`cobj_...`) to update.
673            input: Request body.
674            input.acl: Updated access control list. Supports full replacement via `grants` or targeted `add`/`remove` operations.
675            input.expected_version: Version number the caller expects to be current. If the object's actual current version does not match, the request returns 409 to signal a concurrent modification. Omit to skip optimistic locking and keep the existing OCC merge retry.
676            input.expires_at: Absolute expiry time in RFC 3339 format. Pass null to clear; omit to leave unchanged on update.
677            input.field_ops: Granular array operations to apply per field (e.g. append, prepend, remove). A field must not appear in both `fields` and `field_ops`.
678            input.fields: Key-value map of field values to merge into the object. Only the supplied keys are affected.
679            input.idempotency_key: Client-supplied deduplication key for this write. A retry with the same key and the same body replays the stored result without re-applying the write (survives server restarts); reusing a key with a different body returns 409.
680            input.type: Schema type identifier (`lookup_key`) of the object. Optional; used for routing context only.
681
682        Returns:
683            Successful response
684        """
685        return await self._http.request(
686            f"/api/v1/custom_objects/{object}",
687            method="PUT",
688            body=input,
689            response_type=CustomObjectReplaceResponse,
690        )

Update a custom object Updates the fields of an existing custom object and returns the updated object along with its new version number. The authenticated viewer must have permission to modify the object. You may supply fields (a full or partial key-value map to merge into the object), field_ops (granular array operations per field), acl, or any compatible combination. The same field name must not appear in both fields and field_ops, which returns 422. Returns 404 if the object does not exist or has been deleted. Use expected_version for optimistic concurrency: if the object's current aggregate_version does not match, the request returns 409 and does not retry the caller write. Omit it to keep the existing OCC merge retry.

Arguments:
  • object: Custom object ID (cobj_...) to update.
  • input: Request body.
  • input.acl: Updated access control list. Supports full replacement via grants or targeted add/remove operations.
  • input.expected_version: Version number the caller expects to be current. If the object's actual current version does not match, the request returns 409 to signal a concurrent modification. Omit to skip optimistic locking and keep the existing OCC merge retry.
  • input.expires_at: Absolute expiry time in RFC 3339 format. Pass null to clear; omit to leave unchanged on update.
  • input.field_ops: Granular array operations to apply per field (e.g. append, prepend, remove). A field must not appear in both fields and field_ops.
  • input.fields: Key-value map of field values to merge into the object. Only the supplied keys are affected.
  • input.idempotency_key: Client-supplied deduplication key for this write. A retry with the same key and the same body replays the stored result without re-applying the write (survives server restarts); reusing a key with a different body returns 409.
  • input.type: Schema type identifier (lookup_key) of the object. Optional; used for routing context only.
Returns:

Successful response

class CustomObjectResource:
693class CustomObjectResource:
694    def __init__(self, http: SyncHttpClient):
695        self._http = http
696
697    def list(
698        self,
699        *,
700        type: str | None = None,
701        schema_key: str | None = None,
702        field_filters: dict[str, Any] | None = None,
703        system_only: bool | None = None,
704        order_by_field: str | None = None,
705        row_key: str | None = None,
706        sort_key: builtins.list[str] | None = None,
707        keys: builtins.list[dict[str, Any]] | None = None,
708        team: builtins.list[str] | None = None,
709        user: builtins.list[str] | None = None,
710        agent: builtins.list[str] | None = None,
711        org: builtins.list[str] | None = None,
712        query: str | None = None,
713        search: str | None = None,
714        page: int | None = None,
715        updated_since: datetime | None = None,
716        page_size: int | None = None,
717        include_count: bool | None = None,
718    ) -> CustomObjectListResponse:
719        """
720        List custom objects
721        Returns a paginated list of custom objects visible to the authenticated
722        viewer, ordered by creation time descending. Results span all ownership
723        types (team-owned, user-owned, agent-owned, and system-owned) that the
724        viewer has access to.
725        Filter by schema type with `type` (preferred) or the legacy alias
726        `schema_key`. Use the `row_key` param to perform an exact-match partition
727        lookup. You may additionally supply `sort_key` to narrow within that
728        partition `sort_key` requires `row_key` and the request returns 400 if
729        `sort_key` is provided alone. Owner filters (`team`, `user`, `agent`,
730        `org`) are additive: each accepts an array of IDs (or a single ID, which
731        is wrapped) and returns objects matching any of the supplied values.
732        When `query` is supplied, results are ranked by full-text relevance
733        (descending `ts_rank`) rather than creation time. The legacy `search`
734        param performs a case-insensitive substring match and is retained for
735        developer-namespace clients.
736
737        Args:
738            type: Schema type identifier (`lookup_key`) to filter by. Only objects of this type are returned. Alias of `schema_key`; either name is accepted.
739            schema_key: Legacy alias for `type`. Prefer `type` on new clients. When both are supplied, `type` wins.
740            field_filters: JSON containment predicates on fields, applied before pagination and counting.
741            system_only: Only system-owned objects (no user, team, agent or thread owner). Visibility is unchanged.
742            order_by_field: Top-level JSON field for descending text order, with ID tie-breaker. Full-text relevance takes precedence.
743            row_key: Exact `row_key` value to match. When supplied, only objects with this partition key are returned.
744            sort_key: One or more `sort_key` values to match within the `row_key` partition. Requires `row_key` to be set.
745            keys: JSON-encoded array of up to 100 objects with required string row_key and optional string-array sort_key. Missing or empty sort_key selects the whole partition. Mutually exclusive with row_key and sort_key. Pagination applies globally across all matched partitions.
746            team: One or more team IDs (`team_...`) to filter by owning team. Returns objects owned by any of the supplied teams.
747            user: One or more user IDs (`user_...`) to filter by owning user. Returns objects owned by any of the supplied users.
748            agent: One or more agent IDs to filter by owning agent. Returns objects owned by any of the supplied agents.
749            org: One or more organization IDs (`org_...`) to filter by. Typically used by admins to query system-owned objects in a specific org.
750            query: Full-text search string matched against the schema's configured search fields. When supplied, results are ordered by relevance score descending instead of creation time descending.
751            search: Case-insensitive substring search applied across the schema type and serialized field values. Deprecated prefer `query` for full-text search. Retained for developer-namespace clients.
752            page: Page number to retrieve (1-indexed). Defaults to `1`.
753            updated_since: Include only objects updated at or after this ISO 8601 timestamp. Applies before pagination and counting.
754            page_size: Number of objects per page. Defaults to `25`; maximum is `100`.
755            include_count: Include total_entries and total_pages (default true). When false, totals are null, has_next uses one extra row, and pages beyond the end return an empty list without clamping. The page offset must fit PostgreSQL's signed 64-bit integer range.
756
757        Returns:
758            Paginated list of custom objects matching the supplied filters.
759        """
760        query: dict[str, object] = {}
761        if type is not None:
762            query["type"] = type
763        if schema_key is not None:
764            query["schema_key"] = schema_key
765        if field_filters is not None:
766            query["field_filters"] = field_filters
767        if system_only is not None:
768            query["system_only"] = system_only
769        if order_by_field is not None:
770            query["order_by_field"] = order_by_field
771        if row_key is not None:
772            query["row_key"] = row_key
773        if sort_key is not None:
774            query["sort_key"] = sort_key
775        if keys is not None:
776            query["keys"] = keys
777        if team is not None:
778            query["team"] = team
779        if user is not None:
780            query["user"] = user
781        if agent is not None:
782            query["agent"] = agent
783        if org is not None:
784            query["org"] = org
785        if query is not None:
786            query["query"] = query
787        if search is not None:
788            query["search"] = search
789        if page is not None:
790            query["page"] = page
791        if updated_since is not None:
792            query["updated_since"] = updated_since
793        if page_size is not None:
794            query["page_size"] = page_size
795        if include_count is not None:
796            query["include_count"] = include_count
797        return self._http.request(
798            "/api/v1/custom_objects",
799            query=query,
800            response_type=CustomObjectListResponse,
801        )
802
803    def create(self, input: CustomObjectCreateInput) -> CustomObject:
804        """
805        Create a custom object
806        Creates a new custom object of the given schema type and returns the
807        persisted object. The caller must be authenticated and authorized to create
808        objects of the specified type.
809        Identify the schema with `type` (preferred), or the legacy aliases
810        `schema_key` (lookup key) / `config` (config ID). Exactly one identifier is
811        required; when more than one is supplied, `type` wins over `schema_key`,
812        which wins over `config`.
813        Owner resolution follows a priority order: if `team` is supplied the object
814        is team-owned; if `user` is supplied it is owned by that user; if `agent` is
815        supplied it is agent-owned; otherwise the object is owned by the authenticated
816        user. Pass `system: true` explicitly to force system ownership this requires
817        elevated API credentials and returns 403 if the caller lacks permission.
818        If the schema declares a `row_key` (and optionally a `sort_key`), you may
819        pass `upsert: true` to update an existing object at that key instead of
820        receiving a 409 Conflict. The response status is `200` on an update and
821        `201` on a new create.
822
823        Args:
824            input: Request body.
825            input.acl: Access control list for the custom object. Supports explicit `read` and `write` grants to users, teams, organizations, organization roles, agents, or everyone.
826            input.agent: Agent user ID to set as the object owner. Used when neither `team` nor `user` is supplied.
827            input.config: Config ID (`cfg_...`) that resolves to the target schema. Provide one of `type`, `schema_key`, or `config`.
828            input.expires_at: Absolute expiry time in RFC 3339 format. Pass null to clear; omit to leave unchanged on update.
829            input.fields: Key-value map of field values for the new object. Must conform to the schema's field definitions. Omit to create an object with all fields at their default or null values.
830            input.org: Organization ID (`org_...`) to associate with the object. Typically required for system-owned objects.
831            input.schema_key: Legacy alias for `type` (schema `lookup_key`). Prefer `type` on new clients. Provide one of `type`, `schema_key`, or `config`.
832            input.system: When `true`, creates a system-owned object with no team, user, or agent owner. Requires elevated API credentials; returns 403 if the caller lacks permission.
833            input.team: Team ID (`team_...`) to set as the object owner. When supplied, takes priority over `user` and `agent`.
834            input.type: Schema type identifier (`lookup_key`) that defines the object's shape and validation rules. Preferred over the legacy `schema_key` / `config` aliases.
835            input.upsert: When `true` and the schema declares a `row_key`, updates the existing object at that key for the same owner instead of returning 409 Conflict. Returns HTTP 200 on update and 201 on create.
836            input.user: User ID (`user_...`) to set as the object owner. Used when neither `team` nor a higher-priority owner is set.
837
838        Returns:
839            The created (or upserted) custom object.
840        """
841        return self._http.request(
842            "/api/v1/custom_objects",
843            method="POST",
844            body=input,
845            response_type=CustomObject,
846        )
847
848    def patch(self, input: CustomObjectPatchInput) -> CustomObjectPatchResponse:
849        """
850        Apply numeric patch ops to a custom object
851        Applies numeric patch ops (`increment`, `max`, `min`, `set_if_newer` with
852        dotted `path`s) atomically to a custom object and returns the updated
853        object along with per-op results. The authenticated viewer must have
854        permission to modify the object.
855        Address the row in one of two ways: by `object` ID (`cobj_...`), or by
856        `schema` + `row_key` (with optional `sort_key` for schemas that declare
857        one). The keyed form resolves the row for the same owner the create
858        contract would use and, when no row exists yet, creates it from
859        `create_with` merged over the key fields before applying the ops so an
860        aggregator's first call creates the counter and later calls increment it.
861        A racing create resolves to the same row instead of a duplicate.
862        Pass `idempotency_key` to make retries safe: a retry with the same key and
863        ops replays the stored result without re-applying the write (survives
864        server restarts); reusing a key with different ops returns 409.
865
866        Args:
867            input: Request body.
868            input.agent: Agent user ID owning the keyed row. At most one owner selector may be present.
869            input.create_with: Field values used to create the row when the keyed form finds no existing row. Merged over the key fields before validation; ignored by the `object` form.
870            input.idempotency_key: Client-supplied deduplication key for this patch. A retry with the same key and the same ops replays the stored result without re-applying the write (survives server restarts); reusing a key with different ops returns 409.
871            input.object: Custom object ID (`cobj_...`) to patch. Exactly one of `object` or `schema` + `row_key` is required.
872            input.ops: Numeric patch ops to apply in order (e.g. `[%{"op" => "increment", "path" => "count", "by" => 1}]`). Supported ops: `increment` (`by`), `max`/`min` (`value`), `set_if_newer` (`value`, `fence_path`, `fence`).
873            input.row_key: Row key naming the row within `schema` (e.g. a counter name). Requires `schema`.
874            input.schema: Schema type identifier (`lookup_key`) for the keyed form. Requires `row_key`.
875            input.sort_key: Sort-key segments partitioning rows within the `row_key` bucket. Only meaningful for schemas that declare a `sort_key`.
876            input.team: Team ID (`tem_...`) owning the keyed row. Defaults to the viewer's owner like the create contract.
877            input.user: User ID (`usr_...`) owning the keyed row. At most one owner selector may be present.
878
879        Returns:
880            Successful response
881        """
882        return self._http.request(
883            "/api/v1/custom_objects/patch",
884            method="POST",
885            body=input,
886            response_type=CustomObjectPatchResponse,
887        )
888
889    def delete(self, object: str) -> CustomObjectDeleteResponse:
890        """
891        Delete a custom object
892        Permanently deletes the custom object identified by `object`. The caller
893        must be authenticated and have permission to delete the object.
894        On success, returns a confirmation payload containing the deleted object's
895        ID so callers can confirm the deletion without a follow-up fetch.
896        Attempting to delete an object that does not exist or has already been
897        deleted returns 404.
898
899        Args:
900            object: Custom object ID (`cobj_...`) of the object to delete.
901
902        Returns:
903            Successful response
904        """
905        return self._http.request(
906            f"/api/v1/custom_objects/{object}",
907            method="DELETE",
908            response_type=CustomObjectDeleteResponse,
909        )
910
911    def get(self, object: str, *, type: str | None = None) -> CustomObject:
912        """
913        Retrieve a custom object
914        Returns a single custom object identified by its ID. The authenticated viewer
915        must have visibility access to the object.
916        Returns 404 if the object does not exist, has been deleted, or is not
917        visible to the viewer.
918
919        Args:
920            object: Custom object ID (`cobj_...`) to retrieve.
921            type: Schema type identifier (`lookup_key`) of the object. Optional; used for routing context only.
922
923        Returns:
924            The requested custom object.
925        """
926        query: dict[str, object] = {}
927        if type is not None:
928            query["type"] = type
929        return self._http.request(
930            f"/api/v1/custom_objects/{object}",
931            query=query,
932            response_type=CustomObject,
933        )
934
935    def replace(self, object: str, input: CustomObjectReplaceInput) -> CustomObjectReplaceResponse:
936        """
937        Update a custom object
938        Updates the fields of an existing custom object and returns the updated
939        object along with its new version number. The authenticated viewer must have
940        permission to modify the object.
941        You may supply `fields` (a full or partial key-value map to merge into the
942        object), `field_ops` (granular array operations per field), `acl`, or any
943        compatible combination. The same field name must not appear in both
944        `fields` and `field_ops`, which returns 422. Returns 404 if the object does
945        not exist or has been deleted.
946        Use `expected_version` for optimistic concurrency: if the object's current
947        `aggregate_version` does not match, the request returns 409 and does not
948        retry the caller write. Omit it to keep the existing OCC merge retry.
949
950        Args:
951            object: Custom object ID (`cobj_...`) to update.
952            input: Request body.
953            input.acl: Updated access control list. Supports full replacement via `grants` or targeted `add`/`remove` operations.
954            input.expected_version: Version number the caller expects to be current. If the object's actual current version does not match, the request returns 409 to signal a concurrent modification. Omit to skip optimistic locking and keep the existing OCC merge retry.
955            input.expires_at: Absolute expiry time in RFC 3339 format. Pass null to clear; omit to leave unchanged on update.
956            input.field_ops: Granular array operations to apply per field (e.g. append, prepend, remove). A field must not appear in both `fields` and `field_ops`.
957            input.fields: Key-value map of field values to merge into the object. Only the supplied keys are affected.
958            input.idempotency_key: Client-supplied deduplication key for this write. A retry with the same key and the same body replays the stored result without re-applying the write (survives server restarts); reusing a key with a different body returns 409.
959            input.type: Schema type identifier (`lookup_key`) of the object. Optional; used for routing context only.
960
961        Returns:
962            Successful response
963        """
964        return self._http.request(
965            f"/api/v1/custom_objects/{object}",
966            method="PUT",
967            body=input,
968            response_type=CustomObjectReplaceResponse,
969        )
CustomObjectResource(http: archastro.platform.runtime.http_client.SyncHttpClient)
694    def __init__(self, http: SyncHttpClient):
695        self._http = http
def list( self, *, type: str | None = None, schema_key: str | None = None, field_filters: dict[str, typing.Any] | None = None, system_only: bool | None = None, order_by_field: str | None = None, row_key: str | None = None, sort_key: list[str] | None = None, keys: list[dict[str, typing.Any]] | None = None, team: list[str] | None = None, user: list[str] | None = None, agent: list[str] | None = None, org: list[str] | None = None, query: str | None = None, search: str | None = None, page: int | None = None, updated_since: datetime.datetime | None = None, page_size: int | None = None, include_count: bool | None = None) -> archastro.platform.types.common.CustomObjectListResponse:
697    def list(
698        self,
699        *,
700        type: str | None = None,
701        schema_key: str | None = None,
702        field_filters: dict[str, Any] | None = None,
703        system_only: bool | None = None,
704        order_by_field: str | None = None,
705        row_key: str | None = None,
706        sort_key: builtins.list[str] | None = None,
707        keys: builtins.list[dict[str, Any]] | None = None,
708        team: builtins.list[str] | None = None,
709        user: builtins.list[str] | None = None,
710        agent: builtins.list[str] | None = None,
711        org: builtins.list[str] | None = None,
712        query: str | None = None,
713        search: str | None = None,
714        page: int | None = None,
715        updated_since: datetime | None = None,
716        page_size: int | None = None,
717        include_count: bool | None = None,
718    ) -> CustomObjectListResponse:
719        """
720        List custom objects
721        Returns a paginated list of custom objects visible to the authenticated
722        viewer, ordered by creation time descending. Results span all ownership
723        types (team-owned, user-owned, agent-owned, and system-owned) that the
724        viewer has access to.
725        Filter by schema type with `type` (preferred) or the legacy alias
726        `schema_key`. Use the `row_key` param to perform an exact-match partition
727        lookup. You may additionally supply `sort_key` to narrow within that
728        partition `sort_key` requires `row_key` and the request returns 400 if
729        `sort_key` is provided alone. Owner filters (`team`, `user`, `agent`,
730        `org`) are additive: each accepts an array of IDs (or a single ID, which
731        is wrapped) and returns objects matching any of the supplied values.
732        When `query` is supplied, results are ranked by full-text relevance
733        (descending `ts_rank`) rather than creation time. The legacy `search`
734        param performs a case-insensitive substring match and is retained for
735        developer-namespace clients.
736
737        Args:
738            type: Schema type identifier (`lookup_key`) to filter by. Only objects of this type are returned. Alias of `schema_key`; either name is accepted.
739            schema_key: Legacy alias for `type`. Prefer `type` on new clients. When both are supplied, `type` wins.
740            field_filters: JSON containment predicates on fields, applied before pagination and counting.
741            system_only: Only system-owned objects (no user, team, agent or thread owner). Visibility is unchanged.
742            order_by_field: Top-level JSON field for descending text order, with ID tie-breaker. Full-text relevance takes precedence.
743            row_key: Exact `row_key` value to match. When supplied, only objects with this partition key are returned.
744            sort_key: One or more `sort_key` values to match within the `row_key` partition. Requires `row_key` to be set.
745            keys: JSON-encoded array of up to 100 objects with required string row_key and optional string-array sort_key. Missing or empty sort_key selects the whole partition. Mutually exclusive with row_key and sort_key. Pagination applies globally across all matched partitions.
746            team: One or more team IDs (`team_...`) to filter by owning team. Returns objects owned by any of the supplied teams.
747            user: One or more user IDs (`user_...`) to filter by owning user. Returns objects owned by any of the supplied users.
748            agent: One or more agent IDs to filter by owning agent. Returns objects owned by any of the supplied agents.
749            org: One or more organization IDs (`org_...`) to filter by. Typically used by admins to query system-owned objects in a specific org.
750            query: Full-text search string matched against the schema's configured search fields. When supplied, results are ordered by relevance score descending instead of creation time descending.
751            search: Case-insensitive substring search applied across the schema type and serialized field values. Deprecated prefer `query` for full-text search. Retained for developer-namespace clients.
752            page: Page number to retrieve (1-indexed). Defaults to `1`.
753            updated_since: Include only objects updated at or after this ISO 8601 timestamp. Applies before pagination and counting.
754            page_size: Number of objects per page. Defaults to `25`; maximum is `100`.
755            include_count: Include total_entries and total_pages (default true). When false, totals are null, has_next uses one extra row, and pages beyond the end return an empty list without clamping. The page offset must fit PostgreSQL's signed 64-bit integer range.
756
757        Returns:
758            Paginated list of custom objects matching the supplied filters.
759        """
760        query: dict[str, object] = {}
761        if type is not None:
762            query["type"] = type
763        if schema_key is not None:
764            query["schema_key"] = schema_key
765        if field_filters is not None:
766            query["field_filters"] = field_filters
767        if system_only is not None:
768            query["system_only"] = system_only
769        if order_by_field is not None:
770            query["order_by_field"] = order_by_field
771        if row_key is not None:
772            query["row_key"] = row_key
773        if sort_key is not None:
774            query["sort_key"] = sort_key
775        if keys is not None:
776            query["keys"] = keys
777        if team is not None:
778            query["team"] = team
779        if user is not None:
780            query["user"] = user
781        if agent is not None:
782            query["agent"] = agent
783        if org is not None:
784            query["org"] = org
785        if query is not None:
786            query["query"] = query
787        if search is not None:
788            query["search"] = search
789        if page is not None:
790            query["page"] = page
791        if updated_since is not None:
792            query["updated_since"] = updated_since
793        if page_size is not None:
794            query["page_size"] = page_size
795        if include_count is not None:
796            query["include_count"] = include_count
797        return self._http.request(
798            "/api/v1/custom_objects",
799            query=query,
800            response_type=CustomObjectListResponse,
801        )

List custom objects Returns a paginated list of custom objects visible to the authenticated viewer, ordered by creation time descending. Results span all ownership types (team-owned, user-owned, agent-owned, and system-owned) that the viewer has access to. Filter by schema type with type (preferred) or the legacy alias schema_key. Use the row_key param to perform an exact-match partition lookup. You may additionally supply sort_key to narrow within that partition sort_key requires row_key and the request returns 400 if sort_key is provided alone. Owner filters (team, user, agent, org) are additive: each accepts an array of IDs (or a single ID, which is wrapped) and returns objects matching any of the supplied values. When query is supplied, results are ranked by full-text relevance (descending ts_rank) rather than creation time. The legacy search param performs a case-insensitive substring match and is retained for developer-namespace clients.

Arguments:
  • type: Schema type identifier (lookup_key) to filter by. Only objects of this type are returned. Alias of schema_key; either name is accepted.
  • schema_key: Legacy alias for type. Prefer type on new clients. When both are supplied, type wins.
  • field_filters: JSON containment predicates on fields, applied before pagination and counting.
  • system_only: Only system-owned objects (no user, team, agent or thread owner). Visibility is unchanged.
  • order_by_field: Top-level JSON field for descending text order, with ID tie-breaker. Full-text relevance takes precedence.
  • row_key: Exact row_key value to match. When supplied, only objects with this partition key are returned.
  • sort_key: One or more sort_key values to match within the row_key partition. Requires row_key to be set.
  • keys: JSON-encoded array of up to 100 objects with required string row_key and optional string-array sort_key. Missing or empty sort_key selects the whole partition. Mutually exclusive with row_key and sort_key. Pagination applies globally across all matched partitions.
  • team: One or more team IDs (team_...) to filter by owning team. Returns objects owned by any of the supplied teams.
  • user: One or more user IDs (user_...) to filter by owning user. Returns objects owned by any of the supplied users.
  • agent: One or more agent IDs to filter by owning agent. Returns objects owned by any of the supplied agents.
  • org: One or more organization IDs (org_...) to filter by. Typically used by admins to query system-owned objects in a specific org.
  • query: Full-text search string matched against the schema's configured search fields. When supplied, results are ordered by relevance score descending instead of creation time descending.
  • search: Case-insensitive substring search applied across the schema type and serialized field values. Deprecated prefer query for full-text search. Retained for developer-namespace clients.
  • page: Page number to retrieve (1-indexed). Defaults to 1.
  • updated_since: Include only objects updated at or after this ISO 8601 timestamp. Applies before pagination and counting.
  • page_size: Number of objects per page. Defaults to 25; maximum is 100.
  • include_count: Include total_entries and total_pages (default true). When false, totals are null, has_next uses one extra row, and pages beyond the end return an empty list without clamping. The page offset must fit PostgreSQL's signed 64-bit integer range.
Returns:

Paginated list of custom objects matching the supplied filters.

def create( self, input: CustomObjectCreateInput) -> archastro.platform.types.common.CustomObject:
803    def create(self, input: CustomObjectCreateInput) -> CustomObject:
804        """
805        Create a custom object
806        Creates a new custom object of the given schema type and returns the
807        persisted object. The caller must be authenticated and authorized to create
808        objects of the specified type.
809        Identify the schema with `type` (preferred), or the legacy aliases
810        `schema_key` (lookup key) / `config` (config ID). Exactly one identifier is
811        required; when more than one is supplied, `type` wins over `schema_key`,
812        which wins over `config`.
813        Owner resolution follows a priority order: if `team` is supplied the object
814        is team-owned; if `user` is supplied it is owned by that user; if `agent` is
815        supplied it is agent-owned; otherwise the object is owned by the authenticated
816        user. Pass `system: true` explicitly to force system ownership this requires
817        elevated API credentials and returns 403 if the caller lacks permission.
818        If the schema declares a `row_key` (and optionally a `sort_key`), you may
819        pass `upsert: true` to update an existing object at that key instead of
820        receiving a 409 Conflict. The response status is `200` on an update and
821        `201` on a new create.
822
823        Args:
824            input: Request body.
825            input.acl: Access control list for the custom object. Supports explicit `read` and `write` grants to users, teams, organizations, organization roles, agents, or everyone.
826            input.agent: Agent user ID to set as the object owner. Used when neither `team` nor `user` is supplied.
827            input.config: Config ID (`cfg_...`) that resolves to the target schema. Provide one of `type`, `schema_key`, or `config`.
828            input.expires_at: Absolute expiry time in RFC 3339 format. Pass null to clear; omit to leave unchanged on update.
829            input.fields: Key-value map of field values for the new object. Must conform to the schema's field definitions. Omit to create an object with all fields at their default or null values.
830            input.org: Organization ID (`org_...`) to associate with the object. Typically required for system-owned objects.
831            input.schema_key: Legacy alias for `type` (schema `lookup_key`). Prefer `type` on new clients. Provide one of `type`, `schema_key`, or `config`.
832            input.system: When `true`, creates a system-owned object with no team, user, or agent owner. Requires elevated API credentials; returns 403 if the caller lacks permission.
833            input.team: Team ID (`team_...`) to set as the object owner. When supplied, takes priority over `user` and `agent`.
834            input.type: Schema type identifier (`lookup_key`) that defines the object's shape and validation rules. Preferred over the legacy `schema_key` / `config` aliases.
835            input.upsert: When `true` and the schema declares a `row_key`, updates the existing object at that key for the same owner instead of returning 409 Conflict. Returns HTTP 200 on update and 201 on create.
836            input.user: User ID (`user_...`) to set as the object owner. Used when neither `team` nor a higher-priority owner is set.
837
838        Returns:
839            The created (or upserted) custom object.
840        """
841        return self._http.request(
842            "/api/v1/custom_objects",
843            method="POST",
844            body=input,
845            response_type=CustomObject,
846        )

Create a custom object Creates a new custom object of the given schema type and returns the persisted object. The caller must be authenticated and authorized to create objects of the specified type. Identify the schema with type (preferred), or the legacy aliases schema_key (lookup key) / config (config ID). Exactly one identifier is required; when more than one is supplied, type wins over schema_key, which wins over config. Owner resolution follows a priority order: if team is supplied the object is team-owned; if user is supplied it is owned by that user; if agent is supplied it is agent-owned; otherwise the object is owned by the authenticated user. Pass system: true explicitly to force system ownership this requires elevated API credentials and returns 403 if the caller lacks permission. If the schema declares a row_key (and optionally a sort_key), you may pass upsert: true to update an existing object at that key instead of receiving a 409 Conflict. The response status is 200 on an update and 201 on a new create.

Arguments:
  • input: Request body.
  • input.acl: Access control list for the custom object. Supports explicit read and write grants to users, teams, organizations, organization roles, agents, or everyone.
  • input.agent: Agent user ID to set as the object owner. Used when neither team nor user is supplied.
  • input.config: Config ID (cfg_...) that resolves to the target schema. Provide one of type, schema_key, or config.
  • input.expires_at: Absolute expiry time in RFC 3339 format. Pass null to clear; omit to leave unchanged on update.
  • input.fields: Key-value map of field values for the new object. Must conform to the schema's field definitions. Omit to create an object with all fields at their default or null values.
  • input.org: Organization ID (org_...) to associate with the object. Typically required for system-owned objects.
  • input.schema_key: Legacy alias for type (schema lookup_key). Prefer type on new clients. Provide one of type, schema_key, or config.
  • input.system: When true, creates a system-owned object with no team, user, or agent owner. Requires elevated API credentials; returns 403 if the caller lacks permission.
  • input.team: Team ID (team_...) to set as the object owner. When supplied, takes priority over user and agent.
  • input.type: Schema type identifier (lookup_key) that defines the object's shape and validation rules. Preferred over the legacy schema_key / config aliases.
  • input.upsert: When true and the schema declares a row_key, updates the existing object at that key for the same owner instead of returning 409 Conflict. Returns HTTP 200 on update and 201 on create.
  • input.user: User ID (user_...) to set as the object owner. Used when neither team nor a higher-priority owner is set.
Returns:

The created (or upserted) custom object.

def patch( self, input: CustomObjectPatchInput) -> CustomObjectPatchResponse:
848    def patch(self, input: CustomObjectPatchInput) -> CustomObjectPatchResponse:
849        """
850        Apply numeric patch ops to a custom object
851        Applies numeric patch ops (`increment`, `max`, `min`, `set_if_newer` with
852        dotted `path`s) atomically to a custom object and returns the updated
853        object along with per-op results. The authenticated viewer must have
854        permission to modify the object.
855        Address the row in one of two ways: by `object` ID (`cobj_...`), or by
856        `schema` + `row_key` (with optional `sort_key` for schemas that declare
857        one). The keyed form resolves the row for the same owner the create
858        contract would use and, when no row exists yet, creates it from
859        `create_with` merged over the key fields before applying the ops so an
860        aggregator's first call creates the counter and later calls increment it.
861        A racing create resolves to the same row instead of a duplicate.
862        Pass `idempotency_key` to make retries safe: a retry with the same key and
863        ops replays the stored result without re-applying the write (survives
864        server restarts); reusing a key with different ops returns 409.
865
866        Args:
867            input: Request body.
868            input.agent: Agent user ID owning the keyed row. At most one owner selector may be present.
869            input.create_with: Field values used to create the row when the keyed form finds no existing row. Merged over the key fields before validation; ignored by the `object` form.
870            input.idempotency_key: Client-supplied deduplication key for this patch. A retry with the same key and the same ops replays the stored result without re-applying the write (survives server restarts); reusing a key with different ops returns 409.
871            input.object: Custom object ID (`cobj_...`) to patch. Exactly one of `object` or `schema` + `row_key` is required.
872            input.ops: Numeric patch ops to apply in order (e.g. `[%{"op" => "increment", "path" => "count", "by" => 1}]`). Supported ops: `increment` (`by`), `max`/`min` (`value`), `set_if_newer` (`value`, `fence_path`, `fence`).
873            input.row_key: Row key naming the row within `schema` (e.g. a counter name). Requires `schema`.
874            input.schema: Schema type identifier (`lookup_key`) for the keyed form. Requires `row_key`.
875            input.sort_key: Sort-key segments partitioning rows within the `row_key` bucket. Only meaningful for schemas that declare a `sort_key`.
876            input.team: Team ID (`tem_...`) owning the keyed row. Defaults to the viewer's owner like the create contract.
877            input.user: User ID (`usr_...`) owning the keyed row. At most one owner selector may be present.
878
879        Returns:
880            Successful response
881        """
882        return self._http.request(
883            "/api/v1/custom_objects/patch",
884            method="POST",
885            body=input,
886            response_type=CustomObjectPatchResponse,
887        )

Apply numeric patch ops to a custom object Applies numeric patch ops (increment, max, min, set_if_newer with dotted paths) atomically to a custom object and returns the updated object along with per-op results. The authenticated viewer must have permission to modify the object. Address the row in one of two ways: by object ID (cobj_...), or by schema + row_key (with optional sort_key for schemas that declare one). The keyed form resolves the row for the same owner the create contract would use and, when no row exists yet, creates it from create_with merged over the key fields before applying the ops so an aggregator's first call creates the counter and later calls increment it. A racing create resolves to the same row instead of a duplicate. Pass idempotency_key to make retries safe: a retry with the same key and ops replays the stored result without re-applying the write (survives server restarts); reusing a key with different ops returns 409.

Arguments:
  • input: Request body.
  • input.agent: Agent user ID owning the keyed row. At most one owner selector may be present.
  • input.create_with: Field values used to create the row when the keyed form finds no existing row. Merged over the key fields before validation; ignored by the object form.
  • input.idempotency_key: Client-supplied deduplication key for this patch. A retry with the same key and the same ops replays the stored result without re-applying the write (survives server restarts); reusing a key with different ops returns 409.
  • input.object: Custom object ID (cobj_...) to patch. Exactly one of object or schema + row_key is required.
  • input.ops: Numeric patch ops to apply in order (e.g. [%{"op" => "increment", "path" => "count", "by" => 1}]). Supported ops: increment (by), max/min (value), set_if_newer (value, fence_path, fence).
  • input.row_key: Row key naming the row within schema (e.g. a counter name). Requires schema.
  • input.schema: Schema type identifier (lookup_key) for the keyed form. Requires row_key.
  • input.sort_key: Sort-key segments partitioning rows within the row_key bucket. Only meaningful for schemas that declare a sort_key.
  • input.team: Team ID (tem_...) owning the keyed row. Defaults to the viewer's owner like the create contract.
  • input.user: User ID (usr_...) owning the keyed row. At most one owner selector may be present.
Returns:

Successful response

def delete( self, object: str) -> CustomObjectDeleteResponse:
889    def delete(self, object: str) -> CustomObjectDeleteResponse:
890        """
891        Delete a custom object
892        Permanently deletes the custom object identified by `object`. The caller
893        must be authenticated and have permission to delete the object.
894        On success, returns a confirmation payload containing the deleted object's
895        ID so callers can confirm the deletion without a follow-up fetch.
896        Attempting to delete an object that does not exist or has already been
897        deleted returns 404.
898
899        Args:
900            object: Custom object ID (`cobj_...`) of the object to delete.
901
902        Returns:
903            Successful response
904        """
905        return self._http.request(
906            f"/api/v1/custom_objects/{object}",
907            method="DELETE",
908            response_type=CustomObjectDeleteResponse,
909        )

Delete a custom object Permanently deletes the custom object identified by object. The caller must be authenticated and have permission to delete the object. On success, returns a confirmation payload containing the deleted object's ID so callers can confirm the deletion without a follow-up fetch. Attempting to delete an object that does not exist or has already been deleted returns 404.

Arguments:
  • object: Custom object ID (cobj_...) of the object to delete.
Returns:

Successful response

def get( self, object: str, *, type: str | None = None) -> archastro.platform.types.common.CustomObject:
911    def get(self, object: str, *, type: str | None = None) -> CustomObject:
912        """
913        Retrieve a custom object
914        Returns a single custom object identified by its ID. The authenticated viewer
915        must have visibility access to the object.
916        Returns 404 if the object does not exist, has been deleted, or is not
917        visible to the viewer.
918
919        Args:
920            object: Custom object ID (`cobj_...`) to retrieve.
921            type: Schema type identifier (`lookup_key`) of the object. Optional; used for routing context only.
922
923        Returns:
924            The requested custom object.
925        """
926        query: dict[str, object] = {}
927        if type is not None:
928            query["type"] = type
929        return self._http.request(
930            f"/api/v1/custom_objects/{object}",
931            query=query,
932            response_type=CustomObject,
933        )

Retrieve a custom object Returns a single custom object identified by its ID. The authenticated viewer must have visibility access to the object. Returns 404 if the object does not exist, has been deleted, or is not visible to the viewer.

Arguments:
  • object: Custom object ID (cobj_...) to retrieve.
  • type: Schema type identifier (lookup_key) of the object. Optional; used for routing context only.
Returns:

The requested custom object.

def replace( self, object: str, input: CustomObjectReplaceInput) -> CustomObjectReplaceResponse:
935    def replace(self, object: str, input: CustomObjectReplaceInput) -> CustomObjectReplaceResponse:
936        """
937        Update a custom object
938        Updates the fields of an existing custom object and returns the updated
939        object along with its new version number. The authenticated viewer must have
940        permission to modify the object.
941        You may supply `fields` (a full or partial key-value map to merge into the
942        object), `field_ops` (granular array operations per field), `acl`, or any
943        compatible combination. The same field name must not appear in both
944        `fields` and `field_ops`, which returns 422. Returns 404 if the object does
945        not exist or has been deleted.
946        Use `expected_version` for optimistic concurrency: if the object's current
947        `aggregate_version` does not match, the request returns 409 and does not
948        retry the caller write. Omit it to keep the existing OCC merge retry.
949
950        Args:
951            object: Custom object ID (`cobj_...`) to update.
952            input: Request body.
953            input.acl: Updated access control list. Supports full replacement via `grants` or targeted `add`/`remove` operations.
954            input.expected_version: Version number the caller expects to be current. If the object's actual current version does not match, the request returns 409 to signal a concurrent modification. Omit to skip optimistic locking and keep the existing OCC merge retry.
955            input.expires_at: Absolute expiry time in RFC 3339 format. Pass null to clear; omit to leave unchanged on update.
956            input.field_ops: Granular array operations to apply per field (e.g. append, prepend, remove). A field must not appear in both `fields` and `field_ops`.
957            input.fields: Key-value map of field values to merge into the object. Only the supplied keys are affected.
958            input.idempotency_key: Client-supplied deduplication key for this write. A retry with the same key and the same body replays the stored result without re-applying the write (survives server restarts); reusing a key with a different body returns 409.
959            input.type: Schema type identifier (`lookup_key`) of the object. Optional; used for routing context only.
960
961        Returns:
962            Successful response
963        """
964        return self._http.request(
965            f"/api/v1/custom_objects/{object}",
966            method="PUT",
967            body=input,
968            response_type=CustomObjectReplaceResponse,
969        )

Update a custom object Updates the fields of an existing custom object and returns the updated object along with its new version number. The authenticated viewer must have permission to modify the object. You may supply fields (a full or partial key-value map to merge into the object), field_ops (granular array operations per field), acl, or any compatible combination. The same field name must not appear in both fields and field_ops, which returns 422. Returns 404 if the object does not exist or has been deleted. Use expected_version for optimistic concurrency: if the object's current aggregate_version does not match, the request returns 409 and does not retry the caller write. Omit it to keep the existing OCC merge retry.

Arguments:
  • object: Custom object ID (cobj_...) to update.
  • input: Request body.
  • input.acl: Updated access control list. Supports full replacement via grants or targeted add/remove operations.
  • input.expected_version: Version number the caller expects to be current. If the object's actual current version does not match, the request returns 409 to signal a concurrent modification. Omit to skip optimistic locking and keep the existing OCC merge retry.
  • input.expires_at: Absolute expiry time in RFC 3339 format. Pass null to clear; omit to leave unchanged on update.
  • input.field_ops: Granular array operations to apply per field (e.g. append, prepend, remove). A field must not appear in both fields and field_ops.
  • input.fields: Key-value map of field values to merge into the object. Only the supplied keys are affected.
  • input.idempotency_key: Client-supplied deduplication key for this write. A retry with the same key and the same body replays the stored result without re-applying the write (survives server restarts); reusing a key with a different body returns 409.
  • input.type: Schema type identifier (lookup_key) of the object. Optional; used for routing context only.
Returns:

Successful response