> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getprimo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Execute an offboarding access selection intent

> Carry out an access selection: opens one SAAS_PROVISIONING (DEPROVISION) task per selected account under the offboarding ticket, run now or at `scheduleDate`, and completes the OFFBOARDING_ACCESS_SELECTION task. Removing an account is real and can delete its data (`accountAction: DELETE`). An account the ticket already removes, or one gone since, is skipped and named in a comment on the task. Each account task then runs on its own; a manual app waits for an admin to mark it done. Safe to retry: an intent executed earlier answers `outcome: ALREADY_EXECUTED` and does nothing again. Refused with `INTENT_NOT_FOUND`, `TICKET_CLOSED`, `TICKET_SCHEDULED` before a scheduled task wakes up, `EXECUTION_IN_PROGRESS`, `OFFBOARDING_NOT_OPEN`, `OFFBOARDING_HAS_NO_TICKET`, `NO_ACCOUNT_SELECTED`.

Key: WriteScope: Company


## OpenAPI

````yaml https://api.getprimo.com/openapi.json post /offboarding-access-selection-intents/{intentId}/execute
openapi: 3.1.1
info:
  title: Public API - BETA
  description: Read docs on https://docs.getprimo.com/
  version: '1.0'
  contact: {}
servers:
  - url: https://api.getprimo.com
security:
  - apikey: []
tags: []
paths:
  /offboarding-access-selection-intents/{intentId}/execute:
    post:
      tags:
        - Offboardings
      summary: Execute an offboarding access selection intent
      description: >-
        Carry out an access selection: opens one SAAS_PROVISIONING (DEPROVISION)
        task per selected account under the offboarding ticket, run now or at
        `scheduleDate`, and completes the OFFBOARDING_ACCESS_SELECTION task.
        Removing an account is real and can delete its data (`accountAction:
        DELETE`). An account the ticket already removes, or one gone since, is
        skipped and named in a comment on the task. Each account task then runs
        on its own; a manual app waits for an admin to mark it done. Safe to
        retry: an intent executed earlier answers `outcome: ALREADY_EXECUTED`
        and does nothing again. Refused with `INTENT_NOT_FOUND`,
        `TICKET_CLOSED`, `TICKET_SCHEDULED` before a scheduled task wakes up,
        `EXECUTION_IN_PROGRESS`, `OFFBOARDING_NOT_OPEN`,
        `OFFBOARDING_HAS_NO_TICKET`, `NO_ACCOUNT_SELECTED`.
      operationId: executeOffboardingAccessSelectionIntent
      parameters:
        - name: intentId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExecuteOffboardingAccessSelectionIntentBody'
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ExecuteOffboardingAccessSelectionIntentResult_Output
components:
  schemas:
    ExecuteOffboardingAccessSelectionIntentBody:
      type: object
      properties:
        scheduleDate:
          description: When the account removals run; they run now without one
          anyOf:
            - type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            - type: 'null'
    ExecuteOffboardingAccessSelectionIntentResult_Output:
      type: object
      properties:
        outcome:
          type: string
          description: >-
            ALREADY_EXECUTED: an earlier call did the work, nothing was done
            again
          enum:
            - EXECUTED
            - ALREADY_EXECUTED
        intent:
          type: object
          properties:
            id:
              type: string
              description: Intent id, to pass to its update and execute tools
            taskId:
              description: The typed task that tracks this step
              anyOf:
                - type: string
                - type: 'null'
            ticketId:
              description: >-
                The ticket holding that task, usually the offboarding ticket.
                Null if it could not be read back.
              anyOf:
                - type: string
                - type: 'null'
            offboardingId:
              type: string
            executedAt:
              description: When the intent executed; null until then
              anyOf:
                - type: string
                  format: date-time
                  pattern: >-
                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                - type: 'null'
            idps:
              type: array
              items:
                type: object
                properties:
                  companySaasApplicationId:
                    type: string
                  saasApplicationUserId:
                    type: string
                  selected:
                    type: boolean
                  accountAction:
                    type: string
                    enum:
                      - SUSPEND
                      - DELETE
                      - DO_NOTHING
                  fileTransferTarget:
                    anyOf:
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - MANAGER
                              - USER
                          employeeId:
                            anyOf:
                              - type: string
                              - type: 'null'
                        required:
                          - type
                          - employeeId
                        additionalProperties: false
                      - type: 'null'
                  emailForwardingTarget:
                    anyOf:
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - MANAGER
                              - USER
                          employeeId:
                            anyOf:
                              - type: string
                              - type: 'null'
                        required:
                          - type
                          - employeeId
                        additionalProperties: false
                      - type: 'null'
                required:
                  - companySaasApplicationId
                  - saasApplicationUserId
                  - selected
                  - accountAction
                  - fileTransferTarget
                  - emailForwardingTarget
                additionalProperties: false
            apps:
              type: array
              items:
                type: object
                properties:
                  companySaasApplicationId:
                    type: string
                  saasApplicationUserId:
                    type: string
                  selected:
                    type: boolean
                  keptByRuleReason:
                    anyOf:
                      - type: string
                      - type: 'null'
                required:
                  - companySaasApplicationId
                  - saasApplicationUserId
                  - selected
                  - keptByRuleReason
                additionalProperties: false
          required:
            - id
            - taskId
            - ticketId
            - offboardingId
            - executedAt
            - idps
            - apps
          additionalProperties: false
      required:
        - outcome
        - intent
      additionalProperties: false
  securitySchemes:
    apikey:
      scheme: bearer
      bearerFormat: API key
      type: http
      description: >-
        Use your Primo API key in the Authorization header as `Bearer
        <API_KEY>`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.