openapi: 3.0.3

info:
  title: Actions (Matters)
  description: "For retrieving and updating Matters. To create a new Matter please refer to the *actioncreate* endpoint. For historical reasons Matters are referred to as *actions* in this version of the API. For information of how to construct requests utilising fieldsets, sorting, paging, filters, and '*includes*', please refer to the API Developer Portal. E&OE."
  version: "1.0"

externalDocs:
  description: API Developer Portal - Constructing API Requests
  url: https://docs.actionstep.com/api-requests/

paths:
  '/actions':
    get:
      description: Returns a collection of Matters. For information on how to construct requests filtering by various properties on a Matter please refer to the API Developer Portal.
      tags:
        - Actions
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedActions'

  '/actions/{id}':
    get:
      description: Returns a single Matter.
      tags:
        - Actions
      parameters:
        - name: id
          in: path
          description: Unique identifier for a Matter.
          required: true
          schema:
            type: integer
            format: int32
          example: 113
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Action'

    patch:
      description: Update the properties of a Matter.
      tags:
        - Actions
      parameters:
        - name: id
          in: path
          description: Unique identifier for a Matter.
          required: true
          schema:
            type: integer
            format: int32
          example: 113
      requestBody:
        $ref: '#/components/requestBodies/UpdateAction'
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Action'

components:
  schemas:
    PagedActions:
      type: object
      properties:
        actions:
          type: array
          items:
            $ref: '#/components/schemas/Action'
        meta:
          $ref: '#/components/schemas/PageMetaData'

    PageMetaData:
      type: object
      properties:
        paging:
          $ref: '#/components/schemas/PagingData'

    PagingData:
      type: object
      properties:
        actions:
          $ref: '#/components/schemas/ActionPageData'

    ActionPageData:
      type: object
      properties:
        recordCount:
          description: The total number of Matters returned by the underlying query.
          type: integer
          example: 360
        pageCount:
          description: The total number of pages generated by the underlying query.
          type: integer
          example: 8
        page:
          description: The page number for this page of Matters.
          type: integer
          example: 2
        pageSize:
          description: Page size.
          type: integer
          example: 50
        prevPage:
          description: A URL to the previous page of Matters.
          type: string
          example: https://ap-southeast-2.actionstep.com/api/rest/actions?page=1
        nextPage:
          description: A URL to the next page of Matters.
          type: string
          example: https://ap-southeast-2.actionstep.com/api/rest/actions?page=3

    Action:
      type: object
      properties:
        id:
          description: Unique identifier for the Matter.
          example: 113
          type: integer
        name:
          description: Name of the Matter.
          example: Purchase of property at 222 Beach Road.
          type: string
        reference:
          description: Matter reference.
          example: AB8383/GD
          type: string
        priority:
          description: Matter priority.
          example: 2
          type: integer
        status:
          description: Matter status.
          enum:
            - Active
            - Inactive
            - Template
            - Closed
          example: Active
          type: string
        statusTimestamp:
          description: Timestamp when the status was last updated.
          example: 2022-05-03T20:49:15+12:00
          format: timestamp
          type: string
        isBillableOverride:
          description: Flag to indicate if the Matter billing can be overridden, True (T) or False (F).
          example: F
          type: string
        createdTimestamp:
          description: Timestamp when the Matter was created.
          example: 2022-04-03T20:32:15+12:00
          format: timestamp
          type: string
        modifiedTimestamp:
          description: Timestamp when the Matter was last modified.
          example: 2022-05-03T20:49:15+12:00
          format: timestamp
          type: string
        isDeleted:
          description: Flag to indicate if the Matter is deleted, True (T) or False (F).
          example: F
          type: string
        deletedBy:
          description: The Actionstep User who deleted the Matter.
          example: Mocke, Rogan
          type: string
        deletedTimestamp:
          description: Timestamp when the Matter was deleted.
          example: null
          format: timestamp
          type: string
        isFavorite:
          description: Flag to indicate if the Matter has been marked as a favourite, True (T) or False (F).
          example: F
          type: string
        overrideBillingStatus:
          description: Billing status if Matter billing has been overridden.
          enum:
            - Active
            - Closed
          example: Active
          type: string
        lastAccessTimestamp:
          description: Timestamp when the Matter was last accessed.
          example: 2022-05-03T20:49:15+12:00
          format: timestamp
          type: string
        importExternalReference:
          description: Reference data typically used when importing data from an external source.
          example: null
          type: string
        amlReviewStatus:
          description: Anti-Money Laundering (AML) review status.
          enum:
            - Not required
            - Not started
            - In progress
            - Complete
            - Delayed
            - None
          example: In progress
          default: None
          type: string
        bannerText:
          description: An information message displayed as a banner on Matter and Time Keeping screens.
          example: Pay attention to the settlement date
          type: string
        links:
          $ref: '#/components/schemas/ActionsLinks'

    ActionsLinks:
      type: object
      properties:
        assignedTo:
          description: Unique identifier of the user to whom the Matter is assigned.
          example: 39
          type: integer
        division:
          description: Unique identifier of the division owning the Matter.
          example: 4
          type: integer
        actionType:
          description: Unique identifier of the Matter type.
          example: 6
          type: integer
        primaryParticipants:
          description: Unique identifiers of the primary participants to the Matter.
          example: [56, 60]
          type: integer
        step:
          description: Unique identifier of the current workflow step applicable to the Matter.
          example: 21--2
          type: string
        billSettings:
          description: Unique identifier of the bill settings applicable to the Matter.
          example: 2
          type: integer
        relatedActions:
          description: Unique identifiers for any related Matters.
          example: [216]
          type: integer

    UpdateAction:
      type: object
      properties:
        name:
          description: Name of the Matter.
          example: Purchase of property at 222 Beach Road.
          type: string
        reference:
          description: Matter reference.
          example: AB8383/GD
          type: string
        priority:
          description: Matter priority.
          example: 2
          type: integer
        status:
          description: Matter status.
          enum:
            - Active
            - Inactive
            - Template
            - Closed
          example: Active
          type: string
        isBillableOverride:
          description: Is override billable, True (T) or False (F).
          example: F
          type: string
        overrideBillingStatus:
          description: Override the billing status.
          enum:
            - Active
            - Closed
          example: Active
          type: string
        importExternalReference:
          description: Reference data typically used when importing data from an external source.
          example: null
          type: string
        amlReviewStatus:
          description: Anti-Money Laundering (AML) review status.
          enum:
            - Not required
            - Not started
            - In progress
            - Complete
            - Delayed
            - None
          example: In progress
          default: None
          type: string
        bannerText:
          description: An information message displayed as a banner on Matter and Time Keeping screens.
          example: Pay attention to the settlement date
          type: string
        links:
          $ref: '#/components/schemas/UpdateActionLinks'

    UpdateActionLinks:
      type: object
      properties:
        assignedTo:
          description: Unique identifier of the user to whom the Matter is assigned.
          example: 39
          type: integer
        division:
          description: Unique identifier of the division owning the Matter.
          example: 4
          type: integer

  requestBodies:
    UpdateAction:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateAction'
