Skip to content
  • Auto
  • Light
  • Dark
Get Started

Create Grant Task

Create Grant Task
client.Tasks.NewGrantTask(ctx, body) (*ExpandedarrayTaskViewTaskViewTaskNewGrantTaskResponse, error)
post/api/v1/task/grant

Create a grant task

Parameters
bodyAppEntitlementIDfieldAppIDfieldAppUserIDfieldDescriptionfieldEmergencyAccessfieldExpandMaskfieldGrantDurationfieldIdentityUserIDfieldSourcefieldTaskNewGrantTaskParams
Hide ParametersShow Parameters
AppEntitlementIDfield
param.Field[string]

The ID of the app entitlement to grant access to.

AppIDfield
param.Field[string]

The ID of the app that is associated with the entitlement.

AppUserIDfield
optional
param.Field[string]

The ID of the app user to grant access for. This field and identityUserId cannot both be set for a given request.

Descriptionfield
optional
param.Field[string]

The description of the request.

EmergencyAccessfield
optional
param.Field[bool]

Boolean stating whether or not the task is marked as emergency access.

ExpandMaskfield
optional
param.Field[PathsarrayTaskExpandMask]

The task expand mask is an array of strings that specifes the related objects the requester wishes to have returned when making a request where the expand mask is part of the input. Use '*' to view all possible responses.

GrantDurationfield
optional
param.Field[string]
formatduration
IdentityUserIDfield
optional
param.Field[string]

The ID of the user associated with the app user we are granting access for. This field cannot be set if appUserID is also set.

Sourcefield
optional
param.Field[ExternalURLstringIntegrationIDstringRequestIDstringTaskGrantSource]

The TaskGrantSource message tracks which external URL was the source of the specificed grant ticket.

Returns
TaskNewGrantTaskResponsestruct

The TaskServiceCreateGrantResponse returns a task view which has a task including JSONPATHs to the expanded items in the expanded array.

Hide ParametersShow Parameters
Expandedarray
optional

List of serialized related objects.

Hide ParametersShow Parameters
Typestring
optional

The type of the serialized message.

TaskViewAccessReviewPathstringAppPathstringAppUserPathstringCreatedByUserPathstringEntitlementsPathstringIdentityUserPathstringInsightsPathstringStepApproversPathstringTaskTaskViewTaskUserPathstringTaskView
optional

Contains a task and JSONPATH expressions that describe where in the expanded array related objects are located. This view can be used to display a fully-detailed dashboard of task information.

Request example Go
package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/-go"
  "github.com/stainless-sdks/-go/option"
)

func main() {
  client := conductoronesdk.NewClient(
    option.WithAPIKey("My API Key"),
  )
  response, err := client.Tasks.NewGrantTask(context.TODO(), conductoronesdk.TaskNewGrantTaskParams{
    AppEntitlementID: "appEntitlementId",
    AppID: "appId",
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Expanded)
}
200 Example
{
  "taskView": {
    "task": {
      "insightIds": [
        "string"
      ],
      "origin": "TASK_ORIGIN_UNSPECIFIED",
      "policy": {
        "current": {
          "accept": {
            "acceptMessage": "acceptMessage"
          },
          "approval": {
            "approval": {
              "agent": {
                "agentMode": "APPROVAL_AGENT_MODE_UNSPECIFIED",
                "agentUserId": "agentUserId",
                "instructions": "instructions",
                "policyIds": [
                  "string"
                ]
              },
              "allowedReassignees": [
                "string"
              ],
              "allowReassignment": true,
              "appOwners": {
                "allowSelfApproval": true
              },
              "entitlementOwners": {
                "allowSelfApproval": true,
                "fallback": true,
                "fallbackUserIds": [
                  "string"
                ]
              },
              "escalation": {
                "escalationComment": "escalationComment",
                "expiration": "expiration",
                "reassignToApprovers": {
                  "approverIds": [
                    "string"
                  ]
                },
                "replacePolicy": {
                  "policyId": "policyId"
                }
              },
              "escalationEnabled": true,
              "expression": {
                "allowSelfApproval": true,
                "expressions": [
                  "string"
                ],
                "fallback": true,
                "fallbackUserIds": [
                  "string"
                ]
              },
              "group": {
                "allowSelfApproval": true,
                "appGroupId": "appGroupId",
                "appId": "appId",
                "fallback": true,
                "fallbackUserIds": [
                  "string"
                ]
              },
              "manager": {
                "allowSelfApproval": true,
                "fallback": true,
                "fallbackUserIds": [
                  "string"
                ]
              },
              "requireApprovalReason": true,
              "requireDenialReason": true,
              "requireReassignmentReason": true,
              "requiresStepUpProviderId": "requiresStepUpProviderId",
              "resourceOwners": {
                "allowSelfApproval": true,
                "fallback": true,
                "fallbackUserIds": [
                  "string"
                ]
              },
              "self": {
                "fallback": true,
                "fallbackUserIds": [
                  "string"
                ]
              },
              "users": {
                "allowSelfApproval": true,
                "userIds": [
                  "string"
                ]
              },
              "webhook": {
                "webhookId": "webhookId"
              }
            },
            "approved": {},
            "denied": {},
            "escalationInstance": {
              "alreadyEscalated": true,
              "escalationComment": "escalationComment",
              "expiresAt": "2019-12-27T18:11:19.117Z",
              "reassignToApprovers": {
                "approverIds": [
                  "string"
                ]
              },
              "replacePolicy": {
                "policyId": "policyId"
              }
            },
            "reassigned": {},
            "reassignedByError": {},
            "restarted": {},
            "skipped": {}
          },
          "policyGenerationId": "policyGenerationId",
          "provision": {
            "cancelled": {
              "cancelledAt": "2019-12-27T18:11:19.117Z",
              "cancelledByUserId": "cancelledByUserId"
            },
            "completed": {
              "completedAt": "2019-12-27T18:11:19.117Z",
              "entitlements": [
                {
                  "appEntitlementId": "appEntitlementId",
                  "appId": "appId"
                }
              ],
              "userId": "userId"
            },
            "errored": {
              "description": "description",
              "errorCode": "errorCode",
              "erroredAt": "2019-12-27T18:11:19.117Z"
            },
            "externalTicketId": "externalTicketId",
            "externalTicketProvisionerConfigId": "externalTicketProvisionerConfigId",
            "notificationId": "notificationId",
            "provision": {
              "assigned": true,
              "provisionPolicy": {
                "connector": {
                  "account": {
                    "config": {
                      "foo": "bar"
                    },
                    "connectorId": "connectorId",
                    "doNotSave": {},
                    "saveToVault": {
                      "vaultIds": [
                        "string"
                      ]
                    },
                    "schemaId": "schemaId"
                  },
                  "defaultBehavior": {
                    "connectorId": "connectorId"
                  },
                  "deleteAccount": {
                    "connectorId": "connectorId"
                  }
                },
                "delegated": {
                  "appId": "appId",
                  "entitlementId": "entitlementId",
                  "implicit": true
                },
                "externalTicket": {
                  "appId": "appId",
                  "connectorId": "connectorId",
                  "externalTicketProvisionerConfigId": "externalTicketProvisionerConfigId",
                  "instructions": "instructions"
                },
                "manual": {
                  "instructions": "instructions",
                  "userIds": [
                    "string"
                  ]
                },
                "unconfigured": {},
                "webhook": {
                  "webhookId": "webhookId"
                }
              },
              "provisionTarget": {
                "appEntitlementId": "appEntitlementId",
                "appId": "appId",
                "appUserId": "appUserId",
                "grantDuration": "grantDuration"
              }
            },
            "reassignedByError": {},
            "skipped": {},
            "state": "PROVISION_INSTANCE_STATE_UNSPECIFIED",
            "webhookId": "webhookId",
            "webhookInstanceId": "webhookInstanceId"
          },
          "reject": {
            "rejectMessage": "rejectMessage"
          },
          "wait": {
            "commentOnFirstWait": "commentOnFirstWait",
            "commentOnTimeout": "commentOnTimeout",
            "condition": {
              "condition": "condition"
            },
            "name": "name",
            "skipped": {},
            "startedWaitingAt": "2019-12-27T18:11:19.117Z",
            "state": "WAIT_INSTANCE_STATE_UNSPECIFIED",
            "succeeded": {
              "succeededAt": "2019-12-27T18:11:19.117Z"
            },
            "timedOut": {
              "timedOutAt": "2019-12-27T18:11:19.117Z"
            },
            "timeout": "2019-12-27T18:11:19.117Z",
            "timeoutDuration": "timeoutDuration"
          }
        },
        "policy": {
          "description": "description",
          "displayName": "displayName",
          "policySteps": {
            "foo": {
              "steps": [
                {
                  "accept": {
                    "acceptMessage": "acceptMessage"
                  },
                  "approval": {
                    "agent": {
                      "agentMode": "APPROVAL_AGENT_MODE_UNSPECIFIED",
                      "agentUserId": "agentUserId",
                      "instructions": "instructions",
                      "policyIds": [
                        "string"
                      ]
                    },
                    "allowedReassignees": [
                      "string"
                    ],
                    "allowReassignment": true,
                    "appOwners": {
                      "allowSelfApproval": true
                    },
                    "entitlementOwners": {
                      "allowSelfApproval": true,
                      "fallback": true,
                      "fallbackUserIds": [
                        "string"
                      ]
                    },
                    "escalation": {
                      "escalationComment": "escalationComment",
                      "expiration": "expiration",
                      "reassignToApprovers": {
                        "approverIds": [
                          "string"
                        ]
                      },
                      "replacePolicy": {
                        "policyId": "policyId"
                      }
                    },
                    "escalationEnabled": true,
                    "expression": {
                      "allowSelfApproval": true,
                      "expressions": [
                        "string"
                      ],
                      "fallback": true,
                      "fallbackUserIds": [
                        "string"
                      ]
                    },
                    "group": {
                      "allowSelfApproval": true,
                      "appGroupId": "appGroupId",
                      "appId": "appId",
                      "fallback": true,
                      "fallbackUserIds": [
                        "string"
                      ]
                    },
                    "manager": {
                      "allowSelfApproval": true,
                      "fallback": true,
                      "fallbackUserIds": [
                        "string"
                      ]
                    },
                    "requireApprovalReason": true,
                    "requireDenialReason": true,
                    "requireReassignmentReason": true,
                    "requiresStepUpProviderId": "requiresStepUpProviderId",
                    "resourceOwners": {
                      "allowSelfApproval": true,
                      "fallback": true,
                      "fallbackUserIds": [
                        "string"
                      ]
                    },
                    "self": {
                      "fallback": true,
                      "fallbackUserIds": [
                        "string"
                      ]
                    },
                    "users": {
                      "allowSelfApproval": true,
                      "userIds": [
                        "string"
                      ]
                    },
                    "webhook": {
                      "webhookId": "webhookId"
                    }
                  },
                  "provision": {
                    "assigned": true,
                    "provisionPolicy": {
                      "connector": {
                        "account": {
                          "config": {
                            "foo": "bar"
                          },
                          "connectorId": "connectorId",
                          "doNotSave": {},
                          "saveToVault": {
                            "vaultIds": [
                              "string"
                            ]
                          },
                          "schemaId": "schemaId"
                        },
                        "defaultBehavior": {
                          "connectorId": "connectorId"
                        },
                        "deleteAccount": {
                          "connectorId": "connectorId"
                        }
                      },
                      "delegated": {
                        "appId": "appId",
                        "entitlementId": "entitlementId",
                        "implicit": true
                      },
                      "externalTicket": {
                        "appId": "appId",
                        "connectorId": "connectorId",
                        "externalTicketProvisionerConfigId": "externalTicketProvisionerConfigId",
                        "instructions": "instructions"
                      },
                      "manual": {
                        "instructions": "instructions",
                        "userIds": [
                          "string"
                        ]
                      },
                      "unconfigured": {},
                      "webhook": {
                        "webhookId": "webhookId"
                      }
                    },
                    "provisionTarget": {
                      "appEntitlementId": "appEntitlementId",
                      "appId": "appId",
                      "appUserId": "appUserId",
                      "grantDuration": "grantDuration"
                    }
                  },
                  "reject": {
                    "rejectMessage": "rejectMessage"
                  },
                  "wait": {
                    "commentOnFirstWait": "commentOnFirstWait",
                    "commentOnTimeout": "commentOnTimeout",
                    "condition": {
                      "condition": "condition"
                    },
                    "name": "name",
                    "timeoutDuration": "timeoutDuration"
                  }
                }
              ]
            }
          },
          "policyType": "POLICY_TYPE_UNSPECIFIED",
          "postActions": [
            {
              "certifyRemediateImmediately": true
            }
          ],
          "reassignTasksToDelegates": true,
          "rules": [
            {
              "condition": "condition",
              "policyKey": "policyKey"
            }
          ]
        }
      },
      "recommendation": "INSIGHT_RECOMMENDATION_UNSPECIFIED",
      "type": {
        "certify": {},
        "grant": {
          "source": {
            "externalUrl": "externalUrl",
            "integrationId": "integrationId",
            "requestId": "requestId"
          }
        },
        "offboarding": {},
        "revoke": {
          "source": {
            "expired": {
              "expiredAt": "2019-12-27T18:11:19.117Z"
            },
            "nonUsage": {
              "expiresAt": "2019-12-27T18:11:19.117Z",
              "lastLogin": "2019-12-27T18:11:19.117Z"
            },
            "request": {
              "requestUserId": "requestUserId"
            },
            "review": {
              "accessReviewId": "accessReviewId",
              "certTicketId": "certTicketId"
            }
          }
        }
      }
    }
  }
}