Skip to content

Commit d7b9291

Browse files
refactor(api): align API key audit surface with browser sibling (KERNEL-1350)
1 parent 5f8b852 commit d7b9291

3 files changed

Lines changed: 12 additions & 11 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 120
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-1f10598afa01d76d22b0ed63685248f482f74c9353cffe1d3e4a3d38da7716cf.yml
3-
openapi_spec_hash: 8936f458bfa681b709e459ca1cc76fb5
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-e8afdbeac9332cf79200c2eb873e532104fd0a7472b08e63cde6c857a87cf0c3.yml
3+
openapi_spec_hash: 2525caf30dffbdd83c83948201f11a52
44
config_hash: 03c7e57f268c750e2415831662e95969

src/resources/api-keys.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,6 @@ export interface APIKey {
154154
* project name is unavailable.
155155
*/
156156
project_name: string | null;
157-
158-
/**
159-
* Derived lifecycle status of the API key. `active` means usable. `expired` means
160-
* past its expires_at. `deleted` means it was deleted (soft-deleted) and can no
161-
* longer authenticate. Deleted takes precedence over expired.
162-
*/
163-
status: 'active' | 'expired' | 'deleted';
164157
}
165158

166159
export namespace APIKey {
@@ -226,8 +219,8 @@ export interface APIKeyUpdateParams {
226219

227220
export interface APIKeyListParams extends OffsetPaginationParams {
228221
/**
229-
* When true, include deleted (soft-deleted) API keys in the results for audit
230-
* purposes. Defaults to false, which returns only live keys.
222+
* Deprecated: use status=all instead. When true, include deleted (soft-deleted)
223+
* API keys in the results for audit purposes.
231224
*/
232225
include_deleted?: boolean;
233226

@@ -246,6 +239,13 @@ export interface APIKeyListParams extends OffsetPaginationParams {
246239
* Sort direction for API keys.
247240
*/
248241
sort_direction?: 'asc' | 'desc';
242+
243+
/**
244+
* Filter API keys by status. "active" returns keys that are not deleted (default;
245+
* expired-but-not-deleted keys are still included), "deleted" returns only
246+
* soft-deleted keys, "all" returns both.
247+
*/
248+
status?: 'active' | 'deleted' | 'all';
249249
}
250250

251251
export interface APIKeyRotateParams {

tests/api-resources/api-keys.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ describe('resource apiKeys', () => {
9090
query: 'query',
9191
sort_by: 'created_at',
9292
sort_direction: 'asc',
93+
status: 'active',
9394
},
9495
{ path: '/_stainless_unknown_path' },
9596
),

0 commit comments

Comments
 (0)