@archastro/sdk
    Preparing search index...
    Index

    Constructors

    Methods

    Constructors

    Methods

    • 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. 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.

      Parameters

      • input: {
            agent?: string;
            fields: Record<string, unknown>;
            org?: string;
            system?: boolean;
            team?: string;
            type: string;
            upsert?: boolean;
            user?: string;
        }

        Request body.

        • Optionalagent?: string

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

        • fields: Record<string, unknown>

          Key-value map of field values for the new object. Must conform to the schema's field definitions.

        • Optionalorg?: string

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

        • Optionalsystem?: boolean

          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.

        • Optionalteam?: string

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

        • type: string

          Schema type identifier (lookup_key) that defines the object's shape and validation rules.

        • Optionalupsert?: boolean

          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.

        • Optionaluser?: string

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

      Returns Promise<CustomObject>

      The created (or upserted) custom object.

    • 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.

      Parameters

      • object: string

        Custom object ID (cobj_...) of the object to delete.

      Returns Promise<{ deleted: boolean; id: string }>

      Successful response

    • 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.

      Parameters

      • object: string

        Custom object ID (cobj_...) to retrieve.

      • Optionalparams: { type?: string }

        Query parameters.

        • Optionaltype?: string

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

      Returns Promise<CustomObject>

      The requested custom object.

    • List custom objects Returns a paginated list of custom objects of the given schema type that are 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. 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 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.

      Parameters

      • Optionalparams: {
            agent?: string[];
            org?: string[];
            page?: number;
            pageSize?: number;
            query?: string;
            rowKey?: string;
            sortKey?: string[];
            team?: string[];
            type?: string;
            user?: string[];
        }

        Query parameters.

        • Optionalagent?: string[]

          One or more agent IDs to filter by owning agent. Returns objects owned by any of the supplied agents.

        • Optionalorg?: string[]

          One or more organization IDs (org_...) to filter by. Typically used by admins to query system-owned objects in a specific org.

        • Optionalpage?: number

          Page number to retrieve (1-indexed). Defaults to 1.

        • OptionalpageSize?: number

          Number of objects per page. Defaults to 25; maximum is 100.

        • Optionalquery?: string

          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.

        • OptionalrowKey?: string

          Exact row_key value to match. When supplied, only objects with this partition key are returned.

        • OptionalsortKey?: string[]

          One or more sort_key values to match within the row_key partition. Requires row_key to be set.

        • Optionalteam?: string[]

          One or more team IDs (team_...) to filter by owning team. Returns objects owned by any of the supplied teams.

        • Optionaltype?: string

          Schema type identifier (lookup_key) to filter by. Only objects of this type are returned.

        • Optionaluser?: string[]

          One or more user IDs (user_...) to filter by owning user. Returns objects owned by any of the supplied users.

      Returns Promise<CustomObjectListResponse>

      Paginated list of custom objects matching the supplied filters.

    • 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), or both — but the same field name must not appear in both, which returns 422. Returns 404 if the object does not exist or has been deleted.

      Parameters

      • object: string

        Custom object ID (cobj_...) to update.

      • input: {
            field_ops?: Record<string, unknown>;
            fields: Record<string, unknown>;
            type?: string;
        }

        Request body.

        • Optionalfield_ops?: Record<string, unknown>

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

        • fields: Record<string, unknown>

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

        • Optionaltype?: string

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

      Returns Promise<
          {
              data: {
                  created_at?: string;
                  fields?: Record<string, unknown>;
                  id: string;
                  org?: string;
                  row_key?: string;
                  sandbox?: string;
                  schema_type?: string;
                  team?: string;
                  updated_at?: string;
                  user?: string;
                  version?: number;
              };
              meta?: Record<string, unknown>;
          },
      >

      Successful response