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

# Update a delivery

> Update the fields of a delivery that the request sets; omitted fields keep their current values. Setting <code>status</code> to <code>pickedUp</code> records when the delivery was picked up, and a picked up delivery cannot move back to <code>pending</code>. A <code>comment</code> sent as <code>null</code> or empty is cleared. A new photo in <code>media</code> replaces the current one, and an empty <code>media</code> removes it. With bearer token authentication, the user must be an administrator who can manage deliveries in the delivery's location. <h3>OAuth</h3>Required scopes: <code>deliveries</code>



## OpenAPI

````yaml /assets/openapi.json patch /deliveries/v1/{deliveryId}
openapi: 3.0.2
info:
  title: Spacebring
  version: 1.0.0
  termsOfService: https://www.spacebring.com/terms
servers:
  - url: https://api.spacebring.com
security: []
paths:
  /deliveries/v1/{deliveryId}:
    patch:
      tags:
        - Deliveries
      summary: Update a delivery
      description: >-
        Update the fields of a delivery that the request sets; omitted fields
        keep their current values. Setting <code>status</code> to
        <code>pickedUp</code> records when the delivery was picked up, and a
        picked up delivery cannot move back to <code>pending</code>. A
        <code>comment</code> sent as <code>null</code> or empty is cleared. A
        new photo in <code>media</code> replaces the current one, and an empty
        <code>media</code> removes it. With bearer token authentication, the
        user must be an administrator who can manage deliveries in the
        delivery's location. <h3>OAuth</h3>Required scopes:
        <code>deliveries</code>
      operationId: patchDelivery
      parameters:
        - in: path
          name: deliveryId
          required: true
          description: The ID of the delivery.
          schema:
            type: string
            format: uuid
        - in: header
          name: spacebring-network-id
          schema:
            type: string
            format: uuid
          required: false
          description: >-
            The id of the network. Required when using bearer token
            authentication
      requestBody:
        $ref: '#/components/requestBodies/patchDelivery'
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseError'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseError'
      security:
        - BasicAuth: []
        - OAuth2:
            - deliveries
components:
  requestBodies:
    patchDelivery:
      content:
        application/json:
          schema:
            type: object
            properties:
              delivery:
                type: object
                properties:
                  comment:
                    description: >-
                      Comment about the delivery for the customer, such as the
                      carrier or how to handle the item.
                    nullable: true
                    type: string
                    maxLength: 1000
                  media:
                    maxItems: 1
                    type: array
                    items:
                      type: object
                      properties:
                        key:
                          type: string
                          description: >-
                            Storage key of the media file, as returned by the
                            media upload endpoint.
                      required:
                        - key
                    description: >-
                      Photo of the delivery, replacing the current one. Pass an
                      empty array to remove it. The url is generated
                      server-side.
                  customer:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: >-
                          ID of the customer the delivery is for. The customer
                          must belong to the delivery's location.
                      type:
                        type: string
                        enum:
                          - company
                          - user
                        description: Whether the customer is a person or a whole company.
                    required:
                      - id
                      - type
                    description: >-
                      The customer the delivery is for: a person's customer ID
                      with type user, or a company's with type company.
                  status:
                    type: string
                    enum:
                      - pending
                      - pickedUp
                    description: >-
                      The new status of the delivery. 'pickedUp' records when
                      the delivery was picked up. A picked up delivery cannot
                      move back to 'pending'.
            required:
              - delivery
      required: true
  schemas:
    responseError:
      type: object
      properties:
        message:
          type: string
        type:
          type: string
  securitySchemes:
    BasicAuth:
      type: http
      description: >-
        See our [authentication
        documentation](https://www.spacebring.com/docs/developer/api/authentication#basic-authentication)
        for how to authorize your requests
      scheme: basic
    OAuth2:
      type: oauth2
      description: >-
        See our [authentication
        documentation](https://www.spacebring.com/docs/developer/api/authentication#oauth2)
        for how to authorize your requests
      flows:
        authorizationCode:
          authorizationUrl: https://oauth2.spacebring.com/api/oauth2/authorize
          tokenUrl: https://oauth2.spacebring.com/api/oauth2/token
          refreshUrl: https://oauth2.spacebring.com/api/oauth2/token
          scopes:
            benefits.readonly: Read benefits and applications
            benefits: Read and write benefits and applications
            campaigns.readonly: Read campaigns
            campaigns: Read and write campaigns
            checkIns.readonly: Read check-ins
            checkIns: Read and write check-ins
            community.readonly: Read community companies and memberships
            community: Read and write community companies and memberships
            deliveries.readonly: Read deliveries
            deliveries: Read and write deliveries
            events.readonly: Read events and tickets
            events: Read and write events and tickets
            feed.readonly: Read feed posts
            feed: Read and write feed posts
            invoices.readonly: Read contracts, credit notes, discounts and invoices
            invoices: Read and write contract, credit notes, discounts and invoices
            locations.readonly: Read locations
            locations: Read and write locations
            plans.readonly: Read plans
            plans: Read and write plans
            resources.readonly: Read resources and bookings
            resources: Read and write resources and bookings
            subscriptions.readonly: Read subscriptions
            subscriptions: Read and write subscriptions
            shop.readonly: Read products and orders
            shop: Read and write products and orders
            support.readonly: Read support tickets
            support: Read and write support tickets
            transactions.readonly: Read transactions
            transactions: Read and write transactions
            visitors.readonly: Read visitors
            visitors: Read and write visitors

````

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