---
title: "Generate scoped temporary credentials for a workspace"
method: POST
path: "/workspaces/{id}/credentials/generate"
tags: ["Workspaces"]
---

# Generate scoped temporary credentials for a workspace

`POST /workspaces/{id}/credentials/generate`

Resolves the workspace storage path, then generates path-scoped temporary credentials

## Path parameters

- `id` string, required

## Request body

- GithubComActiveloopaiDeeplakeApiInternalCredentialsGenerateRequest
  - `expiration` integer — seconds, default 3600
  - `mode` string — "read", "write", "readwrite"
  - `path` string

## Response `200`

OK

- GithubComActiveloopaiDeeplakeApiInternalCredentialsGeneratedCredentials
  - `creds` object
  - `expiration` number

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `500` — Internal Server Error

---

[API](https://skmtc.net/deeplake/apis/deeplake-api.md) · [All operations](https://skmtc.net/deeplake/apis/deeplake-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/deeplake/deeplake-api/revisions/e16ed11d991c/schema)
