> ## 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.

# Create an offboarding access selection intent

> Create the OFFBOARDING_ACCESS_SELECTION task of an offboarding: which of the leaver accounts are removed. Left out, the selection lists every account of the leaver, checked unless the published SaaS rule keeps it. `idps` are the email provider accounts (Google Workspace, Microsoft 365): what happens to the account (`accountAction`) and who receives its files and emails; `apps` are the other SaaS accounts. An entry with `selected: false` is kept. From `getEmployeeSaasIdentities` of the leaver: `saasId` is the `companySaasApplicationId`, `identityId` the `saasApplicationUserId`. Returns the intent `id`, its `taskId` and the `ticketId` holding it. The task cannot be marked done by hand: `updateTaskStatus` refuses it with `TaskLockedByTypeError`, and it completes when the intent executes. The offboarding opens this task itself (`createOffboarding`); its `intentId` is on the task (`getTicket`). Create one only for a step the offboarding did not open. `createTicket` and `createTask` cannot make a typed task. Refused with `OFFBOARDING_NOT_FOUND`, `PARENT_TICKET_NOT_FOUND`, `PARENT_TICKET_IS_TYPED` or `PARENT_TICKET_IS_A_TASK` (pass the untyped ticket instead), `OFFBOARDING_NOT_OPEN`, `ACCOUNT_NOT_HELD_BY_LEAVER`, `IDP_NOT_EMAIL_PROVIDER`, `APP_IS_EMAIL_PROVIDER`, `DEPROVISIONING_STRATEGY_NOT_AVAILABLE`, `TRANSFER_TARGET_NOT_FOUND`.

Key: WriteScope: Company


## OpenAPI

````yaml https://api.getprimo.com/openapi.json post /offboarding-access-selection-intents
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:
    post:
      tags:
        - Offboardings
      summary: Create an offboarding access selection intent
      description: >-
        Create the OFFBOARDING_ACCESS_SELECTION task of an offboarding: which of
        the leaver accounts are removed. Left out, the selection lists every
        account of the leaver, checked unless the published SaaS rule keeps it.
        `idps` are the email provider accounts (Google Workspace, Microsoft
        365): what happens to the account (`accountAction`) and who receives its
        files and emails; `apps` are the other SaaS accounts. An entry with
        `selected: false` is kept. From `getEmployeeSaasIdentities` of the
        leaver: `saasId` is the `companySaasApplicationId`, `identityId` the
        `saasApplicationUserId`. Returns the intent `id`, its `taskId` and the
        `ticketId` holding it. The task cannot be marked done by hand:
        `updateTaskStatus` refuses it with `TaskLockedByTypeError`, and it
        completes when the intent executes. The offboarding opens this task
        itself (`createOffboarding`); its `intentId` is on the task
        (`getTicket`). Create one only for a step the offboarding did not open.
        `createTicket` and `createTask` cannot make a typed task. Refused with
        `OFFBOARDING_NOT_FOUND`, `PARENT_TICKET_NOT_FOUND`,
        `PARENT_TICKET_IS_TYPED` or `PARENT_TICKET_IS_A_TASK` (pass the untyped
        ticket instead), `OFFBOARDING_NOT_OPEN`, `ACCOUNT_NOT_HELD_BY_LEAVER`,
        `IDP_NOT_EMAIL_PROVIDER`, `APP_IS_EMAIL_PROVIDER`,
        `DEPROVISIONING_STRATEGY_NOT_AVAILABLE`, `TRANSFER_TARGET_NOT_FOUND`.
      operationId: createOffboardingAccessSelectionIntent
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOffboardingAccessSelectionIntentBody'
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OffboardingAccessSelectionIntent_Output'
components:
  schemas:
    CreateOffboardingAccessSelectionIntentBody:
      type: object
      properties:
        idps:
          description: The email provider accounts (Google Workspace, Microsoft 365)
          anyOf:
            - type: array
              items:
                type: object
                properties:
                  companySaasApplicationId:
                    type: string
                    pattern: ^[a-f\d]{24}$
                  saasApplicationUserId:
                    description: The leaver account in that app
                    type: string
                    pattern: ^[a-f\d]{24}$
                  selected:
                    description: Whether the account is removed; false keeps it
                    default: true
                    type: boolean
                  accountAction:
                    description: What happens to the mailbox account
                    type: string
                    enum:
                      - SUSPEND
                      - DELETE
                      - DO_NOTHING
                  fileTransferTarget:
                    description: Who receives the leaver's files; null for nobody
                    anyOf:
                      - type: object
                        properties:
                          type:
                            description: >-
                              MANAGER: the leaver's manager at execution; USER:
                              `employeeId`
                            type: string
                            enum:
                              - MANAGER
                              - USER
                          employeeId:
                            description: Required with USER
                            anyOf:
                              - type: string
                                pattern: ^[a-f\d]{24}$
                              - type: 'null'
                        required:
                          - type
                      - type: 'null'
                  emailForwardingTarget:
                    description: Who receives the leaver's emails; null for nobody
                    anyOf:
                      - type: object
                        properties:
                          type:
                            description: >-
                              MANAGER: the leaver's manager at execution; USER:
                              `employeeId`
                            type: string
                            enum:
                              - MANAGER
                              - USER
                          employeeId:
                            description: Required with USER
                            anyOf:
                              - type: string
                                pattern: ^[a-f\d]{24}$
                              - type: 'null'
                        required:
                          - type
                      - type: 'null'
                required:
                  - companySaasApplicationId
                  - saasApplicationUserId
                  - accountAction
            - type: 'null'
        apps:
          description: The other SaaS accounts
          anyOf:
            - type: array
              items:
                type: object
                properties:
                  companySaasApplicationId:
                    type: string
                    pattern: ^[a-f\d]{24}$
                  saasApplicationUserId:
                    description: The leaver account in that app
                    type: string
                    pattern: ^[a-f\d]{24}$
                  selected:
                    description: Whether the account is removed; false keeps it
                    default: true
                    type: boolean
                  keptByRuleReason:
                    description: >-
                      Why the published SaaS rule keeps the account, when it
                      does
                    anyOf:
                      - type: string
                      - type: 'null'
                required:
                  - companySaasApplicationId
                  - saasApplicationUserId
            - type: 'null'
        offboardingId:
          description: The offboarding this step belongs to, from `getOffboardings`
          type: string
          pattern: ^[a-f\d]{24}$
        parentTicketId:
          description: >-
            The ticket to hold the task. Defaults to the offboarding ticket;
            never a typed task.
          anyOf:
            - type: string
              pattern: ^[a-f\d]{24}$
            - type: 'null'
      required:
        - offboardingId
    OffboardingAccessSelectionIntent_Output:
      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
  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.