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

# Patch an account

> Updates an account's status and/or status reasons.



## OpenAPI

````yaml patch /v2/accounts/{id}
openapi: 3.1.0
info:
  title: StackOne
  description: The documentation for the StackOne API
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.stackone.com
security: []
tags:
  - name: Accounts
    description: View and manage linked accounts.
  - name: Connector Profiles
    description: View and manage connector profiles for the project.
  - name: Connectors
    description: Retrieve metadata for connectors.
  - name: Webhooks
    description: Configure and manage webhooks.
  - name: Data Sync
    description: View data-sync configs, schedules, and runs.
paths:
  /v2/accounts/{id}:
    patch:
      tags:
        - Accounts
      summary: Patch an account
      description: Updates an account's status and/or status reasons.
      operationId: patch_account
      parameters:
        - name: id
          required: true
          in: path
          description: The unique identifier of the account.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchAccountDto'
      responses:
        '200':
          description: The account was updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountDetailResource'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
        '401':
          description: Unauthorized access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenResponse'
        '404':
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
        '408':
          description: The request has timed out.
          headers:
            Retry-After:
              description: A time in seconds after which the request can be retried.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestTimedOutResponse'
        '409':
          description: Conflict with current state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConflictResponse'
        '422':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntityResponse'
        '429':
          description: Too many requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequestsResponse'
        '500':
          description: Server error while executing the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
        '501':
          description: This functionality is not implemented.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotImplementedResponse'
        '502':
          description: Bad gateway error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadGatewayResponse'
      security:
        - basic: []
components:
  schemas:
    PatchAccountDto:
      type: object
      properties:
        status:
          description: The new status of the account.
          x-speakeasy-unknown-values: allow
          nullable: true
          allOf:
            - $ref: '#/components/schemas/StatusType'
        status_reasons:
          description: >-
            The reasons explaining the new status. Replaces the existing
            reasons.
          nullable: true
          type: array
          items:
            $ref: '#/components/schemas/PatchStatusReasonDto'
    AccountDetailResource:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the account.
        connector_key:
          type: string
          description: >-
            The connector/provider key this account connects to (e.g.
            `workday`). Always present; the full connector object requires
            `?expand=connector`.
        connector:
          description: >-
            The connector this account uses. Only present when requested via
            `?expand=connector`.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ConnectorResource'
        connector_profile_id:
          type: string
          description: >-
            The identifier of the connector profile this account is linked to.
            Only present when requested via `?expand=connector_profile`.
          nullable: true
        connector_profile_label:
          type: string
          description: >-
            The connector profile label: the connector profile name, appended
            with the authentication label (e.g. `Acme | Production`). Only
            present when requested via `?expand=connector_profile`.
          nullable: true
        last_request:
          type: string
          format: date-time
          description: >-
            When the account last made a request. Only present when requested
            via `?expand=last_request`.
          nullable: true
        actions:
          description: >-
            The account's connector action catalog, each flagged with whether it
            is enabled for the connector profile. Only present when requested
            via `?expand=actions`.
          nullable: true
          type: array
          items:
            $ref: '#/components/schemas/AccountActionResource'
        status:
          type: string
          enum:
            - active
            - inactive
            - suspended
            - archived
            - expired
            - error
          description: The current status of the account.
          x-speakeasy-unknown-values: allow
        status_reasons:
          description: Reasons explaining the current status.
          type: array
          items:
            $ref: '#/components/schemas/StatusReasonResource'
        owner_id:
          type: string
          description: The account owner's identifier in the provider's system.
        name:
          type: string
          description: The account owner's name in the provider's system.
        owner_username:
          type: string
          description: The end-user identifier within the owner, if any.
          nullable: true
        type:
          type: string
          description: The account type (e.g. `production` or `test`).
        created_at:
          type: string
          format: date-time
          description: When the account was created.
        updated_at:
          type: string
          format: date-time
          description: When the account was last updated.
        connected_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            When the account was connected to its integration; `null` if
            unknown.
        expires_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            When the account expires (test accounts only); `null` for
            production.
      required:
        - id
        - connector_key
        - status
        - status_reasons
        - owner_id
        - name
        - type
        - created_at
        - updated_at
        - connected_at
        - expires_at
    BadRequestResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 400
        message:
          type: string
          description: Error message
          example: Bad Request
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
        data:
          description: Error details
          nullable: true
          allOf:
            - $ref: '#/components/schemas/UnifiedError'
        provider_errors:
          description: List of provider-specific errors
          nullable: true
          type: array
          items:
            $ref: '#/components/schemas/ProviderError'
      required:
        - statusCode
        - message
        - timestamp
    UnauthorizedResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 401
        message:
          type: string
          description: Error message
          example: Unauthorized
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    ForbiddenResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 403
        message:
          type: string
          description: Error message
          example: Forbidden resource
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    NotFoundResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 404
        message:
          type: string
          description: Error message
          example: Not Found
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    RequestTimedOutResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 408
        message:
          type: string
          description: Error message
          example: Request timed out
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    ConflictResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 409
        message:
          type: string
          description: Error message
          example: Conflict
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    UnprocessableEntityResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 422
        message:
          type: string
          description: Error message
          example: Unprocessable Entity
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    TooManyRequestsResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 429
        message:
          type: string
          description: Error message
          example: Too many requests
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    InternalServerErrorResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 500
        message:
          type: string
          description: Error message
          example: Internal server error
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    NotImplementedResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 501
        message:
          type: string
          description: Error message
          example: Not Implemented
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    BadGatewayResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 502
        message:
          type: string
          description: Error message
          example: Bad Gateway
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    StatusType:
      type: string
      enum:
        - active
        - inactive
        - suspended
        - archived
        - expired
        - error
        - unmapped_value
        - null
    PatchStatusReasonDto:
      type: object
      properties:
        code:
          description: A machine-readable status code.
          x-speakeasy-unknown-values: allow
          nullable: true
          allOf:
            - $ref: '#/components/schemas/StatusCode'
        description:
          type: string
          description: A human-readable explanation of the status.
          nullable: true
        timestamp:
          type: string
          format: date-time
          description: When this reason was recorded.
      required:
        - timestamp
    ConnectorResource:
      type: object
      properties:
        key:
          type: string
          description: The connector key (e.g. `workday`).
        name:
          type: string
          description: The human-readable connector name (e.g. `SAP SuccessFactors`).
          nullable: true
        logo_url:
          type: string
          description: The URL of the connector's logo.
        categories:
          description: The categories the connector belongs to (e.g. `["hris"]`).
          type: array
          items:
            type: string
        version:
          type: string
          description: The resolved connector version.
          nullable: true
        owner:
          type: string
          description: The owner of the connector.
      required:
        - key
        - logo_url
        - categories
        - owner
    AccountActionResource:
      type: object
      properties:
        id:
          type: string
          description: The action identifier (e.g. `list_employees`).
        label:
          type: string
          description: The human-readable action label (e.g. `List Employees`).
        description:
          type: string
          description: A short description of what the action does.
        tags:
          description: The tags categorising the action.
          type: array
          items:
            type: string
        enabled:
          type: boolean
          description: >-
            Whether the action is enabled for this account's connector profile.
            Disabled actions are still listed but cannot be used.
        sync_available:
          type: boolean
          description: >-
            Whether a synced variant of this action is available for the
            account's connector profile.
      required:
        - id
        - label
        - description
        - tags
        - enabled
        - sync_available
    StatusReasonResource:
      type: object
      properties:
        code:
          description: A machine-readable status code.
          x-speakeasy-unknown-values: allow
          nullable: true
          allOf:
            - $ref: '#/components/schemas/StatusCode'
        description:
          type: string
          description: A human-readable explanation of the status.
          nullable: true
        timestamp:
          type: string
          format: date-time
          description: When this reason was recorded.
      required:
        - timestamp
    UnifiedError:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 400
          nullable: true
        message:
          type: string
          description: Error message
          example: Bad Request
          nullable: true
        headers:
          type: object
          description: Response headers
          example:
            content-type: application/json
            x-request-id: 5678c28b211dace4e0a0f9171e6b88c5
          nullable: true
    ProviderError:
      type: object
      properties:
        status:
          type: number
          description: HTTP status code of the provider error
          example: 400
          nullable: true
        url:
          type: string
          description: URL that caused the error
          example: https://api.provider.com/v1/resource
          nullable: true
        raw:
          type: object
          description: Raw error response from the provider
          example:
            message: Invalid input parameters
          nullable: true
        headers:
          type: object
          description: Response headers
          example:
            content-type: application/json
            x-request-id: 5678c28b211dace4e0a0f9171e6b88c5
          nullable: true
    StatusCode:
      type: string
      enum:
        - ACCOUNT_TOKEN_REFRESH_FAILURE
        - ACCOUNT_DELETED
        - ACCOUNT_DISABLED
        - INTEGRATION_INACTIVE
        - MONITORING_ERROR
        - CONNECTOR_UNAVAILABLE
        - unmapped_value
        - null
      description: A machine-readable status code.
  securitySchemes:
    basic:
      type: http
      scheme: basic

````