API ReferenceManagementInbound Apps
POST
/v1/mgmt/thirdparty/consents/create

Authorization

Descope Project ID and Management Key
AuthorizationBearer <token>

Project ID:Management Key as bearer token.

In: header

Request Body

application/json

appId*string

The third party application ID

Length1 <= length <= 10000
userId*string

The ID of the user who granted the consent

Length1 <= length
scopes?array<string>
string

The consented scopes, each defined by the application, including all of its mandatory scopes

Itemsitems <= 1000
tenantId?string

Optional tenant the consent is bound to. The user must be a member of this tenant

expireTime?integer

Optional expiration time of the consent, in seconds since the epoch. Zero means the consent never expires

Formatint32

Create a user consent for a third party application, using a valid management key. Use it to migrate consents a user already granted elsewhere, so the user is not asked to consent again. The scopes are added to any existing consent of the user for the same application and tenant. The consent is validated like one granted on the consent screen: every scope must be defined by the application, the mandatory scopes of the application must be included (all of its scopes when it does not allow partial scopes), and the user must hold the roles and permissions the scopes map to. Consents of agentic applications cannot be created.

curl -X POST "https://api.descope.com/v1/mgmt/thirdparty/consents/create" \  -H "Content-Type: application/json" \  -d '{    "appId": "string",    "userId": "string"  }'
{  "consent": {    "id": "string",    "appId": "string",    "userId": "string",    "scopes": [      "string"    ],    "grantedBy": "string",    "createdTime": 0,    "tenantId": "string",    "ExpireTime": 0,    "modifiedTime": 0,    "authMethod": "string",    "blocked": true  }}
export interface Response {consent?: ThirdPartyApplicationConsent}export interface ThirdPartyApplicationConsent {id: stringappId: stringuserId?: stringscopes?: string[]grantedBy?: stringcreatedTime?: numbertenantId?: stringExpireTime?: numbermodifiedTime?: number/** * Empty for an explicit consent, "idJag" for an identity recorded by a Cross-App Access exchange, which cannot be revoked */authMethod?: string/** * True when an admin blocked this "idJag" identity, so the user's ID-JAG exchanges for the application are rejected with invalid_grant */blocked?: boolean}
Was this helpful?