---
title: "Link an organization secret to a project"
method: PUT
path: "/v1/apps/{appId}/org-secrets/{secretName}"
tags: ["Secrets"]
deprecated: true
---

# Link an organization secret to a project

`PUT /v1/apps/{appId}/org-secrets/{secretName}`

## Request

- Base URL: `https://api.spice.ai`
- URL: `https://api.spice.ai/v1/apps/{appId}/org-secrets/{secretName}`
- Auth: HTTP bearer

> **Deprecated.**

Legacy alias of `/v1/projects/{projectId}/org-secrets/{secretName}`. Projects were previously called apps. Makes the named organization secret available to the project at deploy time. Linking a secret that is already linked changes nothing. The project's own secrets are not changed; a project secret with the same name takes precedence.

## Path parameters

- `appId` integer, required
- `secretName` string, required

## Headers

- `X-Org-Name` string

## Response `200`

The secret was already linked

- Secret
  - `id` integer: Unique identifier for the secret
  - `name` string: Name of the secret
  - `value` string: Always masked with asterisks
  - `created_at` string, date-time: Timestamp when the secret was created
  - `updated_at` string, date-time: Timestamp when the secret was last updated

## Other responses

- `201`: The secret was linked
- `400`: Invalid project ID or secret name
- `401`: Unauthorized
- `403`: Insufficient scope (requires secrets:write) or the viewer role
- `404`: Project or organization secret not found
- `409`: The project already links the maximum of 1000 organization secrets (code: `org_secret_link_limit`)
- `429`: Another link change is in progress for this project. Try again.
- `500`: Internal server error
- `503`: Failed to link the organization secret. Try again.

---

[API](https://skmtc.dev/spice/apis/spice-cloud-control-plane-api.md) - [All operations](https://skmtc.dev/spice/apis/spice-cloud-control-plane-api/llms.txt) - [OpenAPI document](https://skmtc.dev/spice/apis/spice-cloud-control-plane-api/revisions/5f3b75dd847d?raw)
