archastro.platform.v1.resources.sandboxes

  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: 8afcca499218
  4
  5from __future__ import annotations
  6
  7from datetime import datetime
  8from typing import Required, TypedDict
  9
 10from ...runtime.http_client import HttpClient, SyncHttpClient
 11from ...types.common import Sandbox, SandboxKey
 12
 13
 14class SandboxCreateInput(TypedDict, total=False):
 15    "Create a sandbox"
 16
 17    expires_at: datetime | None
 18    'Optional eval sandbox expiry in ISO 8601 format. Must be paired with `purpose: "eval"`.'
 19    name: Required[str]
 20    "Human-readable display name for the sandbox."
 21    org: str | None
 22    "Organization ID (`org_...`) to scope the sandbox to. Defaults to the authenticated viewer's organization when omitted."
 23    purpose: str | None
 24    'Optional sandbox purpose marker. Only `"eval"` is accepted, and it must be paired with `expires_at`.'
 25    slug: Required[str]
 26    "URL-safe identifier for the sandbox. Must be unique within the app."
 27
 28
 29class SandboxKeysInput(TypedDict, total=False):
 30    "Create a sandbox key"
 31
 32    type: str | None
 33    'Key type. One of `"publishable"` or `"secret"`. Defaults to `"publishable"`.'
 34
 35
 36class AsyncSandboxResource:
 37    def __init__(self, http: HttpClient):
 38        self._http = http
 39
 40    async def create(self, input: SandboxCreateInput) -> Sandbox:
 41        """
 42        Create a sandbox
 43        Creates a new sandbox for the caller's app. A sandbox is an isolated environment
 44        that can hold its own set of API keys, allowing you to test integrations without
 45        affecting production data.
 46        The caller must authenticate with app-scoped credentials. Org-scoped viewers
 47        may create sandboxes for their organization; developers and all-powerful
 48        callers may create app-level or org-scoped sandboxes. If `org` is supplied the
 49        sandbox is scoped to that organization; otherwise it defaults to the
 50        authenticated viewer's organization.
 51        Remote-eval sandboxes may set `purpose: "eval"` with `expires_at` at creation;
 52        TTL is the sole cleanup mechanism for those sandboxes. Returns the new sandbox
 53        with the auto-issued publishable key use the create key endpoint to issue
 54        secret keys.
 55
 56        Args:
 57            input: Request body.
 58            input.expires_at: Optional eval sandbox expiry in ISO 8601 format. Must be paired with `purpose: "eval"`.
 59            input.name: Human-readable display name for the sandbox.
 60            input.org: Organization ID (`org_...`) to scope the sandbox to. Defaults to the authenticated viewer's organization when omitted.
 61            input.purpose: Optional sandbox purpose marker. Only `"eval"` is accepted, and it must be paired with `expires_at`.
 62            input.slug: URL-safe identifier for the sandbox. Must be unique within the app.
 63
 64        Returns:
 65            The newly created sandbox.
 66        """
 67        return await self._http.request(
 68            "/api/v1/sandboxes",
 69            method="POST",
 70            body=input,
 71            response_type=Sandbox,
 72        )
 73
 74    async def delete(self, sandbox: str) -> None:
 75        """
 76        Delete a sandbox
 77        Soft-deletes the specified sandbox. The sandbox is marked deleted and
 78        immediately hidden from list/get queries; all of its active keys are revoked.
 79        Hard deletion (child data cascade) is scheduled immediately via the background
 80        sandbox deletion worker the same path used for developer-app soft-delete.
 81        The caller must authenticate with app-scoped credentials and be allowed to
 82        modify the sandbox. Returns 204 on success. If the sandbox is missing or
 83        already deleted, a 404 is returned.
 84
 85        Args:
 86            sandbox: Sandbox ID (`dsb_...`) of the sandbox to delete.
 87
 88        Returns:
 89            Empty response with HTTP 204 status on successful deletion.
 90        """
 91        await self._http.request(f"/api/v1/sandboxes/{sandbox}", method="DELETE")
 92
 93    async def get(self, sandbox: str) -> Sandbox:
 94        """
 95        Retrieve a sandbox
 96        Returns the sandbox identified by `sandbox` that belongs to the caller's app.
 97        The response includes the sandbox's associated keys (without full secret key
 98        values full keys are only available at creation time).
 99        The caller must authenticate with app-scoped credentials. Org members may view
100        their org's sandboxes; developers and all-powerful callers may view app-level
101        and org-scoped sandboxes in their app. Returns 404 if the sandbox does not
102        exist or is not visible to the caller.
103
104        Args:
105            sandbox: Sandbox ID (`dsb_...`) to retrieve.
106
107        Returns:
108            The requested sandbox.
109        """
110        return await self._http.request(f"/api/v1/sandboxes/{sandbox}", response_type=Sandbox)
111
112    async def keys(self, sandbox: str, input: SandboxKeysInput) -> SandboxKey:
113        """
114        Create a sandbox key
115        Issues a new API key for the specified sandbox. Keys can be either
116        `"publishable"` (safe to embed in client-side code) or `"secret"` (server-side
117        only). The full key value is returned in the `full_key` field. Secret values
118        are never retrievable again store them securely immediately. Publishable
119        values remain available as `key_value` when retrieving the sandbox.
120        The caller must authenticate with app-scoped credentials and be able to
121        modify the sandbox (org members for org sandboxes; developers / all-powerful
122        for app-level). If the sandbox does not belong to the caller's app or is not
123        visible, a 404 is returned. Multiple active keys per sandbox are supported;
124        revoke individual keys with the revoke key endpoint.
125
126        Args:
127            sandbox: Sandbox ID (`dsb_...`). The key is created for this sandbox.
128            input: Request body.
129            input.type: Key type. One of `"publishable"` or `"secret"`. Defaults to `"publishable"`.
130
131        Returns:
132            The newly created sandbox key, including the one-time `full_key` value.
133        """
134        return await self._http.request(
135            f"/api/v1/sandboxes/{sandbox}/keys",
136            method="POST",
137            body=input,
138            response_type=SandboxKey,
139        )
140
141
142class SandboxResource:
143    def __init__(self, http: SyncHttpClient):
144        self._http = http
145
146    def create(self, input: SandboxCreateInput) -> Sandbox:
147        """
148        Create a sandbox
149        Creates a new sandbox for the caller's app. A sandbox is an isolated environment
150        that can hold its own set of API keys, allowing you to test integrations without
151        affecting production data.
152        The caller must authenticate with app-scoped credentials. Org-scoped viewers
153        may create sandboxes for their organization; developers and all-powerful
154        callers may create app-level or org-scoped sandboxes. If `org` is supplied the
155        sandbox is scoped to that organization; otherwise it defaults to the
156        authenticated viewer's organization.
157        Remote-eval sandboxes may set `purpose: "eval"` with `expires_at` at creation;
158        TTL is the sole cleanup mechanism for those sandboxes. Returns the new sandbox
159        with the auto-issued publishable key use the create key endpoint to issue
160        secret keys.
161
162        Args:
163            input: Request body.
164            input.expires_at: Optional eval sandbox expiry in ISO 8601 format. Must be paired with `purpose: "eval"`.
165            input.name: Human-readable display name for the sandbox.
166            input.org: Organization ID (`org_...`) to scope the sandbox to. Defaults to the authenticated viewer's organization when omitted.
167            input.purpose: Optional sandbox purpose marker. Only `"eval"` is accepted, and it must be paired with `expires_at`.
168            input.slug: URL-safe identifier for the sandbox. Must be unique within the app.
169
170        Returns:
171            The newly created sandbox.
172        """
173        return self._http.request(
174            "/api/v1/sandboxes",
175            method="POST",
176            body=input,
177            response_type=Sandbox,
178        )
179
180    def delete(self, sandbox: str) -> None:
181        """
182        Delete a sandbox
183        Soft-deletes the specified sandbox. The sandbox is marked deleted and
184        immediately hidden from list/get queries; all of its active keys are revoked.
185        Hard deletion (child data cascade) is scheduled immediately via the background
186        sandbox deletion worker the same path used for developer-app soft-delete.
187        The caller must authenticate with app-scoped credentials and be allowed to
188        modify the sandbox. Returns 204 on success. If the sandbox is missing or
189        already deleted, a 404 is returned.
190
191        Args:
192            sandbox: Sandbox ID (`dsb_...`) of the sandbox to delete.
193
194        Returns:
195            Empty response with HTTP 204 status on successful deletion.
196        """
197        self._http.request(f"/api/v1/sandboxes/{sandbox}", method="DELETE")
198
199    def get(self, sandbox: str) -> Sandbox:
200        """
201        Retrieve a sandbox
202        Returns the sandbox identified by `sandbox` that belongs to the caller's app.
203        The response includes the sandbox's associated keys (without full secret key
204        values full keys are only available at creation time).
205        The caller must authenticate with app-scoped credentials. Org members may view
206        their org's sandboxes; developers and all-powerful callers may view app-level
207        and org-scoped sandboxes in their app. Returns 404 if the sandbox does not
208        exist or is not visible to the caller.
209
210        Args:
211            sandbox: Sandbox ID (`dsb_...`) to retrieve.
212
213        Returns:
214            The requested sandbox.
215        """
216        return self._http.request(f"/api/v1/sandboxes/{sandbox}", response_type=Sandbox)
217
218    def keys(self, sandbox: str, input: SandboxKeysInput) -> SandboxKey:
219        """
220        Create a sandbox key
221        Issues a new API key for the specified sandbox. Keys can be either
222        `"publishable"` (safe to embed in client-side code) or `"secret"` (server-side
223        only). The full key value is returned in the `full_key` field. Secret values
224        are never retrievable again store them securely immediately. Publishable
225        values remain available as `key_value` when retrieving the sandbox.
226        The caller must authenticate with app-scoped credentials and be able to
227        modify the sandbox (org members for org sandboxes; developers / all-powerful
228        for app-level). If the sandbox does not belong to the caller's app or is not
229        visible, a 404 is returned. Multiple active keys per sandbox are supported;
230        revoke individual keys with the revoke key endpoint.
231
232        Args:
233            sandbox: Sandbox ID (`dsb_...`). The key is created for this sandbox.
234            input: Request body.
235            input.type: Key type. One of `"publishable"` or `"secret"`. Defaults to `"publishable"`.
236
237        Returns:
238            The newly created sandbox key, including the one-time `full_key` value.
239        """
240        return self._http.request(
241            f"/api/v1/sandboxes/{sandbox}/keys",
242            method="POST",
243            body=input,
244            response_type=SandboxKey,
245        )
class SandboxCreateInput(typing.TypedDict):
15class SandboxCreateInput(TypedDict, total=False):
16    "Create a sandbox"
17
18    expires_at: datetime | None
19    'Optional eval sandbox expiry in ISO 8601 format. Must be paired with `purpose: "eval"`.'
20    name: Required[str]
21    "Human-readable display name for the sandbox."
22    org: str | None
23    "Organization ID (`org_...`) to scope the sandbox to. Defaults to the authenticated viewer's organization when omitted."
24    purpose: str | None
25    'Optional sandbox purpose marker. Only `"eval"` is accepted, and it must be paired with `expires_at`.'
26    slug: Required[str]
27    "URL-safe identifier for the sandbox. Must be unique within the app."

Create a sandbox

expires_at: datetime.datetime | None

Optional eval sandbox expiry in ISO 8601 format. Must be paired with purpose: "eval".

name: Required[str]

Human-readable display name for the sandbox.

org: str | None

Organization ID (org_...) to scope the sandbox to. Defaults to the authenticated viewer's organization when omitted.

purpose: str | None

Optional sandbox purpose marker. Only "eval" is accepted, and it must be paired with expires_at.

slug: Required[str]

URL-safe identifier for the sandbox. Must be unique within the app.

class SandboxKeysInput(typing.TypedDict):
30class SandboxKeysInput(TypedDict, total=False):
31    "Create a sandbox key"
32
33    type: str | None
34    'Key type. One of `"publishable"` or `"secret"`. Defaults to `"publishable"`.'

Create a sandbox key

type: str | None

Key type. One of "publishable" or "secret". Defaults to "publishable".

class AsyncSandboxResource:
 37class AsyncSandboxResource:
 38    def __init__(self, http: HttpClient):
 39        self._http = http
 40
 41    async def create(self, input: SandboxCreateInput) -> Sandbox:
 42        """
 43        Create a sandbox
 44        Creates a new sandbox for the caller's app. A sandbox is an isolated environment
 45        that can hold its own set of API keys, allowing you to test integrations without
 46        affecting production data.
 47        The caller must authenticate with app-scoped credentials. Org-scoped viewers
 48        may create sandboxes for their organization; developers and all-powerful
 49        callers may create app-level or org-scoped sandboxes. If `org` is supplied the
 50        sandbox is scoped to that organization; otherwise it defaults to the
 51        authenticated viewer's organization.
 52        Remote-eval sandboxes may set `purpose: "eval"` with `expires_at` at creation;
 53        TTL is the sole cleanup mechanism for those sandboxes. Returns the new sandbox
 54        with the auto-issued publishable key use the create key endpoint to issue
 55        secret keys.
 56
 57        Args:
 58            input: Request body.
 59            input.expires_at: Optional eval sandbox expiry in ISO 8601 format. Must be paired with `purpose: "eval"`.
 60            input.name: Human-readable display name for the sandbox.
 61            input.org: Organization ID (`org_...`) to scope the sandbox to. Defaults to the authenticated viewer's organization when omitted.
 62            input.purpose: Optional sandbox purpose marker. Only `"eval"` is accepted, and it must be paired with `expires_at`.
 63            input.slug: URL-safe identifier for the sandbox. Must be unique within the app.
 64
 65        Returns:
 66            The newly created sandbox.
 67        """
 68        return await self._http.request(
 69            "/api/v1/sandboxes",
 70            method="POST",
 71            body=input,
 72            response_type=Sandbox,
 73        )
 74
 75    async def delete(self, sandbox: str) -> None:
 76        """
 77        Delete a sandbox
 78        Soft-deletes the specified sandbox. The sandbox is marked deleted and
 79        immediately hidden from list/get queries; all of its active keys are revoked.
 80        Hard deletion (child data cascade) is scheduled immediately via the background
 81        sandbox deletion worker the same path used for developer-app soft-delete.
 82        The caller must authenticate with app-scoped credentials and be allowed to
 83        modify the sandbox. Returns 204 on success. If the sandbox is missing or
 84        already deleted, a 404 is returned.
 85
 86        Args:
 87            sandbox: Sandbox ID (`dsb_...`) of the sandbox to delete.
 88
 89        Returns:
 90            Empty response with HTTP 204 status on successful deletion.
 91        """
 92        await self._http.request(f"/api/v1/sandboxes/{sandbox}", method="DELETE")
 93
 94    async def get(self, sandbox: str) -> Sandbox:
 95        """
 96        Retrieve a sandbox
 97        Returns the sandbox identified by `sandbox` that belongs to the caller's app.
 98        The response includes the sandbox's associated keys (without full secret key
 99        values full keys are only available at creation time).
100        The caller must authenticate with app-scoped credentials. Org members may view
101        their org's sandboxes; developers and all-powerful callers may view app-level
102        and org-scoped sandboxes in their app. Returns 404 if the sandbox does not
103        exist or is not visible to the caller.
104
105        Args:
106            sandbox: Sandbox ID (`dsb_...`) to retrieve.
107
108        Returns:
109            The requested sandbox.
110        """
111        return await self._http.request(f"/api/v1/sandboxes/{sandbox}", response_type=Sandbox)
112
113    async def keys(self, sandbox: str, input: SandboxKeysInput) -> SandboxKey:
114        """
115        Create a sandbox key
116        Issues a new API key for the specified sandbox. Keys can be either
117        `"publishable"` (safe to embed in client-side code) or `"secret"` (server-side
118        only). The full key value is returned in the `full_key` field. Secret values
119        are never retrievable again store them securely immediately. Publishable
120        values remain available as `key_value` when retrieving the sandbox.
121        The caller must authenticate with app-scoped credentials and be able to
122        modify the sandbox (org members for org sandboxes; developers / all-powerful
123        for app-level). If the sandbox does not belong to the caller's app or is not
124        visible, a 404 is returned. Multiple active keys per sandbox are supported;
125        revoke individual keys with the revoke key endpoint.
126
127        Args:
128            sandbox: Sandbox ID (`dsb_...`). The key is created for this sandbox.
129            input: Request body.
130            input.type: Key type. One of `"publishable"` or `"secret"`. Defaults to `"publishable"`.
131
132        Returns:
133            The newly created sandbox key, including the one-time `full_key` value.
134        """
135        return await self._http.request(
136            f"/api/v1/sandboxes/{sandbox}/keys",
137            method="POST",
138            body=input,
139            response_type=SandboxKey,
140        )
AsyncSandboxResource(http: archastro.platform.runtime.http_client.HttpClient)
38    def __init__(self, http: HttpClient):
39        self._http = http
async def create( self, input: SandboxCreateInput) -> archastro.platform.types.common.Sandbox:
41    async def create(self, input: SandboxCreateInput) -> Sandbox:
42        """
43        Create a sandbox
44        Creates a new sandbox for the caller's app. A sandbox is an isolated environment
45        that can hold its own set of API keys, allowing you to test integrations without
46        affecting production data.
47        The caller must authenticate with app-scoped credentials. Org-scoped viewers
48        may create sandboxes for their organization; developers and all-powerful
49        callers may create app-level or org-scoped sandboxes. If `org` is supplied the
50        sandbox is scoped to that organization; otherwise it defaults to the
51        authenticated viewer's organization.
52        Remote-eval sandboxes may set `purpose: "eval"` with `expires_at` at creation;
53        TTL is the sole cleanup mechanism for those sandboxes. Returns the new sandbox
54        with the auto-issued publishable key use the create key endpoint to issue
55        secret keys.
56
57        Args:
58            input: Request body.
59            input.expires_at: Optional eval sandbox expiry in ISO 8601 format. Must be paired with `purpose: "eval"`.
60            input.name: Human-readable display name for the sandbox.
61            input.org: Organization ID (`org_...`) to scope the sandbox to. Defaults to the authenticated viewer's organization when omitted.
62            input.purpose: Optional sandbox purpose marker. Only `"eval"` is accepted, and it must be paired with `expires_at`.
63            input.slug: URL-safe identifier for the sandbox. Must be unique within the app.
64
65        Returns:
66            The newly created sandbox.
67        """
68        return await self._http.request(
69            "/api/v1/sandboxes",
70            method="POST",
71            body=input,
72            response_type=Sandbox,
73        )

Create a sandbox Creates a new sandbox for the caller's app. A sandbox is an isolated environment that can hold its own set of API keys, allowing you to test integrations without affecting production data. The caller must authenticate with app-scoped credentials. Org-scoped viewers may create sandboxes for their organization; developers and all-powerful callers may create app-level or org-scoped sandboxes. If org is supplied the sandbox is scoped to that organization; otherwise it defaults to the authenticated viewer's organization. Remote-eval sandboxes may set purpose: "eval" with expires_at at creation; TTL is the sole cleanup mechanism for those sandboxes. Returns the new sandbox with the auto-issued publishable key use the create key endpoint to issue secret keys.

Arguments:
  • input: Request body.
  • input.expires_at: Optional eval sandbox expiry in ISO 8601 format. Must be paired with purpose: "eval".
  • input.name: Human-readable display name for the sandbox.
  • input.org: Organization ID (org_...) to scope the sandbox to. Defaults to the authenticated viewer's organization when omitted.
  • input.purpose: Optional sandbox purpose marker. Only "eval" is accepted, and it must be paired with expires_at.
  • input.slug: URL-safe identifier for the sandbox. Must be unique within the app.
Returns:

The newly created sandbox.

async def delete(self, sandbox: str) -> None:
75    async def delete(self, sandbox: str) -> None:
76        """
77        Delete a sandbox
78        Soft-deletes the specified sandbox. The sandbox is marked deleted and
79        immediately hidden from list/get queries; all of its active keys are revoked.
80        Hard deletion (child data cascade) is scheduled immediately via the background
81        sandbox deletion worker the same path used for developer-app soft-delete.
82        The caller must authenticate with app-scoped credentials and be allowed to
83        modify the sandbox. Returns 204 on success. If the sandbox is missing or
84        already deleted, a 404 is returned.
85
86        Args:
87            sandbox: Sandbox ID (`dsb_...`) of the sandbox to delete.
88
89        Returns:
90            Empty response with HTTP 204 status on successful deletion.
91        """
92        await self._http.request(f"/api/v1/sandboxes/{sandbox}", method="DELETE")

Delete a sandbox Soft-deletes the specified sandbox. The sandbox is marked deleted and immediately hidden from list/get queries; all of its active keys are revoked. Hard deletion (child data cascade) is scheduled immediately via the background sandbox deletion worker the same path used for developer-app soft-delete. The caller must authenticate with app-scoped credentials and be allowed to modify the sandbox. Returns 204 on success. If the sandbox is missing or already deleted, a 404 is returned.

Arguments:
  • sandbox: Sandbox ID (dsb_...) of the sandbox to delete.
Returns:

Empty response with HTTP 204 status on successful deletion.

async def get(self, sandbox: str) -> archastro.platform.types.common.Sandbox:
 94    async def get(self, sandbox: str) -> Sandbox:
 95        """
 96        Retrieve a sandbox
 97        Returns the sandbox identified by `sandbox` that belongs to the caller's app.
 98        The response includes the sandbox's associated keys (without full secret key
 99        values full keys are only available at creation time).
100        The caller must authenticate with app-scoped credentials. Org members may view
101        their org's sandboxes; developers and all-powerful callers may view app-level
102        and org-scoped sandboxes in their app. Returns 404 if the sandbox does not
103        exist or is not visible to the caller.
104
105        Args:
106            sandbox: Sandbox ID (`dsb_...`) to retrieve.
107
108        Returns:
109            The requested sandbox.
110        """
111        return await self._http.request(f"/api/v1/sandboxes/{sandbox}", response_type=Sandbox)

Retrieve a sandbox Returns the sandbox identified by sandbox that belongs to the caller's app. The response includes the sandbox's associated keys (without full secret key values full keys are only available at creation time). The caller must authenticate with app-scoped credentials. Org members may view their org's sandboxes; developers and all-powerful callers may view app-level and org-scoped sandboxes in their app. Returns 404 if the sandbox does not exist or is not visible to the caller.

Arguments:
  • sandbox: Sandbox ID (dsb_...) to retrieve.
Returns:

The requested sandbox.

async def keys( self, sandbox: str, input: SandboxKeysInput) -> archastro.platform.types.common.SandboxKey:
113    async def keys(self, sandbox: str, input: SandboxKeysInput) -> SandboxKey:
114        """
115        Create a sandbox key
116        Issues a new API key for the specified sandbox. Keys can be either
117        `"publishable"` (safe to embed in client-side code) or `"secret"` (server-side
118        only). The full key value is returned in the `full_key` field. Secret values
119        are never retrievable again store them securely immediately. Publishable
120        values remain available as `key_value` when retrieving the sandbox.
121        The caller must authenticate with app-scoped credentials and be able to
122        modify the sandbox (org members for org sandboxes; developers / all-powerful
123        for app-level). If the sandbox does not belong to the caller's app or is not
124        visible, a 404 is returned. Multiple active keys per sandbox are supported;
125        revoke individual keys with the revoke key endpoint.
126
127        Args:
128            sandbox: Sandbox ID (`dsb_...`). The key is created for this sandbox.
129            input: Request body.
130            input.type: Key type. One of `"publishable"` or `"secret"`. Defaults to `"publishable"`.
131
132        Returns:
133            The newly created sandbox key, including the one-time `full_key` value.
134        """
135        return await self._http.request(
136            f"/api/v1/sandboxes/{sandbox}/keys",
137            method="POST",
138            body=input,
139            response_type=SandboxKey,
140        )

Create a sandbox key Issues a new API key for the specified sandbox. Keys can be either "publishable" (safe to embed in client-side code) or "secret" (server-side only). The full key value is returned in the full_key field. Secret values are never retrievable again store them securely immediately. Publishable values remain available as key_value when retrieving the sandbox. The caller must authenticate with app-scoped credentials and be able to modify the sandbox (org members for org sandboxes; developers / all-powerful for app-level). If the sandbox does not belong to the caller's app or is not visible, a 404 is returned. Multiple active keys per sandbox are supported; revoke individual keys with the revoke key endpoint.

Arguments:
  • sandbox: Sandbox ID (dsb_...). The key is created for this sandbox.
  • input: Request body.
  • input.type: Key type. One of "publishable" or "secret". Defaults to "publishable".
Returns:

The newly created sandbox key, including the one-time full_key value.

class SandboxResource:
143class SandboxResource:
144    def __init__(self, http: SyncHttpClient):
145        self._http = http
146
147    def create(self, input: SandboxCreateInput) -> Sandbox:
148        """
149        Create a sandbox
150        Creates a new sandbox for the caller's app. A sandbox is an isolated environment
151        that can hold its own set of API keys, allowing you to test integrations without
152        affecting production data.
153        The caller must authenticate with app-scoped credentials. Org-scoped viewers
154        may create sandboxes for their organization; developers and all-powerful
155        callers may create app-level or org-scoped sandboxes. If `org` is supplied the
156        sandbox is scoped to that organization; otherwise it defaults to the
157        authenticated viewer's organization.
158        Remote-eval sandboxes may set `purpose: "eval"` with `expires_at` at creation;
159        TTL is the sole cleanup mechanism for those sandboxes. Returns the new sandbox
160        with the auto-issued publishable key use the create key endpoint to issue
161        secret keys.
162
163        Args:
164            input: Request body.
165            input.expires_at: Optional eval sandbox expiry in ISO 8601 format. Must be paired with `purpose: "eval"`.
166            input.name: Human-readable display name for the sandbox.
167            input.org: Organization ID (`org_...`) to scope the sandbox to. Defaults to the authenticated viewer's organization when omitted.
168            input.purpose: Optional sandbox purpose marker. Only `"eval"` is accepted, and it must be paired with `expires_at`.
169            input.slug: URL-safe identifier for the sandbox. Must be unique within the app.
170
171        Returns:
172            The newly created sandbox.
173        """
174        return self._http.request(
175            "/api/v1/sandboxes",
176            method="POST",
177            body=input,
178            response_type=Sandbox,
179        )
180
181    def delete(self, sandbox: str) -> None:
182        """
183        Delete a sandbox
184        Soft-deletes the specified sandbox. The sandbox is marked deleted and
185        immediately hidden from list/get queries; all of its active keys are revoked.
186        Hard deletion (child data cascade) is scheduled immediately via the background
187        sandbox deletion worker the same path used for developer-app soft-delete.
188        The caller must authenticate with app-scoped credentials and be allowed to
189        modify the sandbox. Returns 204 on success. If the sandbox is missing or
190        already deleted, a 404 is returned.
191
192        Args:
193            sandbox: Sandbox ID (`dsb_...`) of the sandbox to delete.
194
195        Returns:
196            Empty response with HTTP 204 status on successful deletion.
197        """
198        self._http.request(f"/api/v1/sandboxes/{sandbox}", method="DELETE")
199
200    def get(self, sandbox: str) -> Sandbox:
201        """
202        Retrieve a sandbox
203        Returns the sandbox identified by `sandbox` that belongs to the caller's app.
204        The response includes the sandbox's associated keys (without full secret key
205        values full keys are only available at creation time).
206        The caller must authenticate with app-scoped credentials. Org members may view
207        their org's sandboxes; developers and all-powerful callers may view app-level
208        and org-scoped sandboxes in their app. Returns 404 if the sandbox does not
209        exist or is not visible to the caller.
210
211        Args:
212            sandbox: Sandbox ID (`dsb_...`) to retrieve.
213
214        Returns:
215            The requested sandbox.
216        """
217        return self._http.request(f"/api/v1/sandboxes/{sandbox}", response_type=Sandbox)
218
219    def keys(self, sandbox: str, input: SandboxKeysInput) -> SandboxKey:
220        """
221        Create a sandbox key
222        Issues a new API key for the specified sandbox. Keys can be either
223        `"publishable"` (safe to embed in client-side code) or `"secret"` (server-side
224        only). The full key value is returned in the `full_key` field. Secret values
225        are never retrievable again store them securely immediately. Publishable
226        values remain available as `key_value` when retrieving the sandbox.
227        The caller must authenticate with app-scoped credentials and be able to
228        modify the sandbox (org members for org sandboxes; developers / all-powerful
229        for app-level). If the sandbox does not belong to the caller's app or is not
230        visible, a 404 is returned. Multiple active keys per sandbox are supported;
231        revoke individual keys with the revoke key endpoint.
232
233        Args:
234            sandbox: Sandbox ID (`dsb_...`). The key is created for this sandbox.
235            input: Request body.
236            input.type: Key type. One of `"publishable"` or `"secret"`. Defaults to `"publishable"`.
237
238        Returns:
239            The newly created sandbox key, including the one-time `full_key` value.
240        """
241        return self._http.request(
242            f"/api/v1/sandboxes/{sandbox}/keys",
243            method="POST",
244            body=input,
245            response_type=SandboxKey,
246        )
SandboxResource(http: archastro.platform.runtime.http_client.SyncHttpClient)
144    def __init__(self, http: SyncHttpClient):
145        self._http = http
def create( self, input: SandboxCreateInput) -> archastro.platform.types.common.Sandbox:
147    def create(self, input: SandboxCreateInput) -> Sandbox:
148        """
149        Create a sandbox
150        Creates a new sandbox for the caller's app. A sandbox is an isolated environment
151        that can hold its own set of API keys, allowing you to test integrations without
152        affecting production data.
153        The caller must authenticate with app-scoped credentials. Org-scoped viewers
154        may create sandboxes for their organization; developers and all-powerful
155        callers may create app-level or org-scoped sandboxes. If `org` is supplied the
156        sandbox is scoped to that organization; otherwise it defaults to the
157        authenticated viewer's organization.
158        Remote-eval sandboxes may set `purpose: "eval"` with `expires_at` at creation;
159        TTL is the sole cleanup mechanism for those sandboxes. Returns the new sandbox
160        with the auto-issued publishable key use the create key endpoint to issue
161        secret keys.
162
163        Args:
164            input: Request body.
165            input.expires_at: Optional eval sandbox expiry in ISO 8601 format. Must be paired with `purpose: "eval"`.
166            input.name: Human-readable display name for the sandbox.
167            input.org: Organization ID (`org_...`) to scope the sandbox to. Defaults to the authenticated viewer's organization when omitted.
168            input.purpose: Optional sandbox purpose marker. Only `"eval"` is accepted, and it must be paired with `expires_at`.
169            input.slug: URL-safe identifier for the sandbox. Must be unique within the app.
170
171        Returns:
172            The newly created sandbox.
173        """
174        return self._http.request(
175            "/api/v1/sandboxes",
176            method="POST",
177            body=input,
178            response_type=Sandbox,
179        )

Create a sandbox Creates a new sandbox for the caller's app. A sandbox is an isolated environment that can hold its own set of API keys, allowing you to test integrations without affecting production data. The caller must authenticate with app-scoped credentials. Org-scoped viewers may create sandboxes for their organization; developers and all-powerful callers may create app-level or org-scoped sandboxes. If org is supplied the sandbox is scoped to that organization; otherwise it defaults to the authenticated viewer's organization. Remote-eval sandboxes may set purpose: "eval" with expires_at at creation; TTL is the sole cleanup mechanism for those sandboxes. Returns the new sandbox with the auto-issued publishable key use the create key endpoint to issue secret keys.

Arguments:
  • input: Request body.
  • input.expires_at: Optional eval sandbox expiry in ISO 8601 format. Must be paired with purpose: "eval".
  • input.name: Human-readable display name for the sandbox.
  • input.org: Organization ID (org_...) to scope the sandbox to. Defaults to the authenticated viewer's organization when omitted.
  • input.purpose: Optional sandbox purpose marker. Only "eval" is accepted, and it must be paired with expires_at.
  • input.slug: URL-safe identifier for the sandbox. Must be unique within the app.
Returns:

The newly created sandbox.

def delete(self, sandbox: str) -> None:
181    def delete(self, sandbox: str) -> None:
182        """
183        Delete a sandbox
184        Soft-deletes the specified sandbox. The sandbox is marked deleted and
185        immediately hidden from list/get queries; all of its active keys are revoked.
186        Hard deletion (child data cascade) is scheduled immediately via the background
187        sandbox deletion worker the same path used for developer-app soft-delete.
188        The caller must authenticate with app-scoped credentials and be allowed to
189        modify the sandbox. Returns 204 on success. If the sandbox is missing or
190        already deleted, a 404 is returned.
191
192        Args:
193            sandbox: Sandbox ID (`dsb_...`) of the sandbox to delete.
194
195        Returns:
196            Empty response with HTTP 204 status on successful deletion.
197        """
198        self._http.request(f"/api/v1/sandboxes/{sandbox}", method="DELETE")

Delete a sandbox Soft-deletes the specified sandbox. The sandbox is marked deleted and immediately hidden from list/get queries; all of its active keys are revoked. Hard deletion (child data cascade) is scheduled immediately via the background sandbox deletion worker the same path used for developer-app soft-delete. The caller must authenticate with app-scoped credentials and be allowed to modify the sandbox. Returns 204 on success. If the sandbox is missing or already deleted, a 404 is returned.

Arguments:
  • sandbox: Sandbox ID (dsb_...) of the sandbox to delete.
Returns:

Empty response with HTTP 204 status on successful deletion.

def get(self, sandbox: str) -> archastro.platform.types.common.Sandbox:
200    def get(self, sandbox: str) -> Sandbox:
201        """
202        Retrieve a sandbox
203        Returns the sandbox identified by `sandbox` that belongs to the caller's app.
204        The response includes the sandbox's associated keys (without full secret key
205        values full keys are only available at creation time).
206        The caller must authenticate with app-scoped credentials. Org members may view
207        their org's sandboxes; developers and all-powerful callers may view app-level
208        and org-scoped sandboxes in their app. Returns 404 if the sandbox does not
209        exist or is not visible to the caller.
210
211        Args:
212            sandbox: Sandbox ID (`dsb_...`) to retrieve.
213
214        Returns:
215            The requested sandbox.
216        """
217        return self._http.request(f"/api/v1/sandboxes/{sandbox}", response_type=Sandbox)

Retrieve a sandbox Returns the sandbox identified by sandbox that belongs to the caller's app. The response includes the sandbox's associated keys (without full secret key values full keys are only available at creation time). The caller must authenticate with app-scoped credentials. Org members may view their org's sandboxes; developers and all-powerful callers may view app-level and org-scoped sandboxes in their app. Returns 404 if the sandbox does not exist or is not visible to the caller.

Arguments:
  • sandbox: Sandbox ID (dsb_...) to retrieve.
Returns:

The requested sandbox.

def keys( self, sandbox: str, input: SandboxKeysInput) -> archastro.platform.types.common.SandboxKey:
219    def keys(self, sandbox: str, input: SandboxKeysInput) -> SandboxKey:
220        """
221        Create a sandbox key
222        Issues a new API key for the specified sandbox. Keys can be either
223        `"publishable"` (safe to embed in client-side code) or `"secret"` (server-side
224        only). The full key value is returned in the `full_key` field. Secret values
225        are never retrievable again store them securely immediately. Publishable
226        values remain available as `key_value` when retrieving the sandbox.
227        The caller must authenticate with app-scoped credentials and be able to
228        modify the sandbox (org members for org sandboxes; developers / all-powerful
229        for app-level). If the sandbox does not belong to the caller's app or is not
230        visible, a 404 is returned. Multiple active keys per sandbox are supported;
231        revoke individual keys with the revoke key endpoint.
232
233        Args:
234            sandbox: Sandbox ID (`dsb_...`). The key is created for this sandbox.
235            input: Request body.
236            input.type: Key type. One of `"publishable"` or `"secret"`. Defaults to `"publishable"`.
237
238        Returns:
239            The newly created sandbox key, including the one-time `full_key` value.
240        """
241        return self._http.request(
242            f"/api/v1/sandboxes/{sandbox}/keys",
243            method="POST",
244            body=input,
245            response_type=SandboxKey,
246        )

Create a sandbox key Issues a new API key for the specified sandbox. Keys can be either "publishable" (safe to embed in client-side code) or "secret" (server-side only). The full key value is returned in the full_key field. Secret values are never retrievable again store them securely immediately. Publishable values remain available as key_value when retrieving the sandbox. The caller must authenticate with app-scoped credentials and be able to modify the sandbox (org members for org sandboxes; developers / all-powerful for app-level). If the sandbox does not belong to the caller's app or is not visible, a 404 is returned. Multiple active keys per sandbox are supported; revoke individual keys with the revoke key endpoint.

Arguments:
  • sandbox: Sandbox ID (dsb_...). The key is created for this sandbox.
  • input: Request body.
  • input.type: Key type. One of "publishable" or "secret". Defaults to "publishable".
Returns:

The newly created sandbox key, including the one-time full_key value.