Deployments.ai Docs
Apps

Grant an organization member viewer or editor on an app

PUT /v1/apps/{appId}/grants/{principalId} · SDK putAppGrant · CLI deployments app-grant set

PUT
/v1/apps/{appId}/grants/{principalId}

Requires apps:write; admits human callers.

Authorization

platformBearer
headerAuthorizationBearer <token>

Platform bearer credential accepted as an opaque API key or JWT.

Path Parameters

appId*string
Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$
principalId*string
Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$

Header Parameters

x-deployments-environment*string
Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$
idempotency-key*string
Length1 <= length <= 512

Request Body

application/json
  1. body
role*string
Value in"viewer""editor"

Response Body

AppGrantResponse

application/json
  1. response
appId*string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
createdAt*string
Match^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$
Formatdate-time
grantedBy*string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
principalId*string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
role*string
Value in"viewer""editor"
updatedAt*string
Match^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$
Formatdate-time
curl -X PUT "https://example.com/v1/apps/string/grants/string" \  -H "x-deployments-environment: string" \  -H "idempotency-key: string" \  -H "Content-Type: application/json" \  -d '{    "role": "viewer"  }'
{  "appId": "string",  "createdAt": "2019-08-24T14:15:22Z",  "grantedBy": "string",  "principalId": "string",  "role": "viewer",  "updatedAt": "2019-08-24T14:15:22Z"}