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