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

# Update a plan's resource state



## OpenAPI

````yaml /openapi.yaml put /agencies/{agencyId}/plans/{planId}/resources/{resourceId}/state
openapi: 3.0.3
info:
  title: Kardinal ARO API
  version: 2.55.0
  description: This document specifies the REST API of Kardinal ARO v2.
  contact:
    url: https://kardinal.ai/
    email: contact@kardinal.ai
servers:
  - url: /api/v2
security:
  - access_token: []
tags:
  - name: Authenticate
    description: How to authenticate, and manage the access and refresh tokens.
  - name: Plan
    description: How to create, retrieve, update and delete plans.
  - name: Resource
    description: How to create, retrieve, update and delete resources in a plan.
  - name: Order
    description: How to create, retrieve, update and delete orders in a plan.
  - name: SimplePlan
    description: How to create a plan through the use of a simple plan.
paths:
  /agencies/{agencyId}/plans/{planId}/resources/{resourceId}/state:
    parameters:
      - $ref: '#/components/parameters/agencyId'
      - $ref: '#/components/parameters/planId'
      - $ref: '#/components/parameters/resourceId'
    put:
      tags:
        - Resource
      summary: Update a plan's resource state
      operationId: putPlanResourceState
      parameters:
        - $ref: '#/components/parameters/force'
      requestBody:
        description: The State to update.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/State'
      responses:
        '200':
          description: State response updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopedState'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/NotAuthenticated'
        '403':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    agencyId:
      name: agencyId
      description: The agency id.
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/AgencyId'
    planId:
      name: planId
      description: The plan id.
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/RegexIdValidation'
    resourceId:
      name: resourceId
      description: The resource id.
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/RegexIdValidation'
    force:
      name: force
      description: >-
        If true, on an archived item, the requested action will be forced and
        the item will be unarchived.
      in: query
      schema:
        type: boolean
        default: false
  schemas:
    State:
      type: object
      properties:
        mode:
          $ref: '#/components/schemas/ResourceMode'
        assignments:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/AssignmentStop'
              - $ref: '#/components/schemas/AssignmentBegin'
              - $ref: '#/components/schemas/AssignmentBreak'
              - $ref: '#/components/schemas/AssignmentEnd'
          description: >-
            [TO_VALIDATE] Believed to list manually forced stop/break
            assignments for the resource. Needs confirmation.
      description: >-
        [TO_VALIDATE] Believed to describe a resource's manual-mode state. Needs
        confirmation.
    EnvelopedState:
      type: object
      properties:
        item:
          $ref: '#/components/schemas/State'
        agencyId:
          $ref: '#/components/schemas/AgencyId'
        planId:
          $ref: '#/components/schemas/PlanId'
        planVersion:
          $ref: '#/components/schemas/PlanVersion'
      description: '[TO_VALIDATE] Description pending review by a Kardinal engineer.'
    AgencyId:
      description: The agency id.
      readOnly: true
      example: LND_Agency-42
      allOf:
        - $ref: '#/components/schemas/RegexPrefixedIdValidation'
    RegexIdValidation:
      type: string
      description: >-
        At least one character among those allowed: unaccented alpha-numeric
        characters, "-", ".", "_", "~", ":", "@", "!", "$", ",".
      pattern: ^[a-zA-Z0-9-._~:@!$,]+$
    ResourceMode:
      type: string
      enum:
        - free
        - fixed
      default: free
      description: '[TO_VALIDATE] Description pending review by a Kardinal engineer.'
    AssignmentStop:
      description: >-
        The beginTime is set to arrivalTime if not setted. If the stopId is the
        id of an alternative, arrivalTime, beginTime, and departureTime cannot
        be set and the chosen alternative stop is optimized by the solver.
      type: object
      properties:
        type:
          type: string
          enum:
            - stop
          description: '[TO_VALIDATE] Description pending review by a Kardinal engineer.'
        status:
          $ref: '#/components/schemas/AssignmentStatus'
        stopId:
          $ref: '#/components/schemas/RegexIdValidation'
        arrivalTime:
          $ref: '#/components/schemas/DateTime'
        beginTime:
          $ref: '#/components/schemas/DateTime'
        departureTime:
          $ref: '#/components/schemas/DateTime'
      required:
        - stopId
    AssignmentBegin:
      type: object
      properties:
        type:
          type: string
          enum:
            - begin
          description: '[TO_VALIDATE] Description pending review by a Kardinal engineer.'
        status:
          $ref: '#/components/schemas/AssignmentStatus'
        departureTime:
          $ref: '#/components/schemas/DateTime'
      required:
        - type
        - departureTime
      description: '[TO_VALIDATE] Description pending review by a Kardinal engineer.'
    AssignmentBreak:
      type: object
      properties:
        type:
          type: string
          enum:
            - break
          description: '[TO_VALIDATE] Description pending review by a Kardinal engineer.'
        status:
          $ref: '#/components/schemas/AssignmentStatus'
        arrivalTime:
          $ref: '#/components/schemas/DateTime'
        departureTime:
          $ref: '#/components/schemas/DateTime'
      required:
        - type
        - arrivalTime
        - departureTime
      description: '[TO_VALIDATE] Description pending review by a Kardinal engineer.'
    AssignmentEnd:
      type: object
      properties:
        type:
          type: string
          enum:
            - end
          description: '[TO_VALIDATE] Description pending review by a Kardinal engineer.'
        status:
          $ref: '#/components/schemas/AssignmentStatus'
        arrivalTime:
          $ref: '#/components/schemas/DateTime'
      required:
        - type
        - arrivalTime
      description: '[TO_VALIDATE] Description pending review by a Kardinal engineer.'
    PlanId:
      description: The plan id.
      readOnly: true
      example: plan-AB
      allOf:
        - $ref: '#/components/schemas/RegexIdValidation'
    PlanVersion:
      type: integer
      description: The plan version.
      readOnly: true
      minimum: 1
      example: 42
    EnvelopedErrors:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
      description: '[TO_VALIDATE] Description pending review by a Kardinal engineer.'
    RegexPrefixedIdValidation:
      type: string
      description: An id beginning with a prefix and an underscore.
      pattern: ^[A-Z]{3,6}_[a-zA-Z0-9-._~:@!$,]+$
    AssignmentStatus:
      type: string
      enum:
        - fixed
        - assigned
      default: fixed
      description: '[TO_VALIDATE] Description pending review by a Kardinal engineer.'
    DateTime:
      type: string
      description: >-
        A full calendar date time, expressed in the ISO8601 **date** format:
        YYYY-MM-DDThh:mm:ssZ.
      example: '2019-11-15T12:34:56Z'
    Error:
      type: object
      readOnly: true
      properties:
        code:
          type: string
          description: '[TO_VALIDATE] Description pending review by a Kardinal engineer.'
        message:
          type: string
          description: '[TO_VALIDATE] Description pending review by a Kardinal engineer.'
        properties:
          $ref: '#/components/schemas/ErrorProperties'
      required:
        - message
        - code
      description: '[TO_VALIDATE] Description pending review by a Kardinal engineer.'
    ErrorProperties:
      type: object
      additionalProperties:
        type: string
      description: '[TO_VALIDATE] Description pending review by a Kardinal engineer.'
  responses:
    BadRequest:
      description: >-
        The server could not understand the request due to invalid content (bad
        syntax, bad format, bad values, etc).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EnvelopedErrors'
    NotAuthenticated:
      description: The caller is not authenticated.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EnvelopedErrors'
    Unauthorized:
      description: The caller is not authorized to perform this action.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EnvelopedErrors'
    NotFound:
      description: The specified resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EnvelopedErrors'
    InternalServerError:
      description: An internal server error has occurred.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EnvelopedErrors'
  securitySchemes:
    access_token:
      type: http
      scheme: bearer
      bearerFormat: JWT

````