Skip to main content

Subscription Permissions

Return permission from options() to require a permission the user's subscription tier must grant. The check runs before the minimum balance and before any credits are deducted. Without a user, /submit, /execute and /stream fail with a 401; without the permission, with a 403 and nothing is charged:

{
"status": "error",
"reason": "permission_required",
"message": "A subscription tier granting pro_model is required to call this workflow",
"details": { "missing_permissions": ["pro_model"] }
}
@Executor("example-task")
export class ExampleExecutor implements TaskExecutor {

async options(exampleCommand: ExampleCommand): Promise<TaskOptions> {
return {
monetization: { toolId: 'example_tool_id' },
permission: 'pro_model',
}
}
}

The permission is checked only for the com.picsart.studio app; other apps run the task without it. It is checked for the workflow called directly, not for sub-tasks it invokes.

/options does not fail without the permission — it quotes. The response reports the answer as hasPermission, and lists what is missing as missingPermissions when it is false:

{
"monetization": { "toolId": "example_tool_id" },
"credits": 12,
"permission": "pro_model",
"hasPermission": false,
"missingPermissions": ["pro_model"]
}

Both fields are absent when no permission applies. hasPermission is false for a request without a user.

Preflight required

permission only takes effect when the task has enablePreflight: true.