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

# Update address

> Send only the fields to change. Send `default: true` to make this the default address, or `default: false` to stop it being the default. `null` counts as `false`. Leave `default` out to keep it as it is.




## OpenAPI

````yaml specs/accounts-v1.yaml PATCH /addresses/{id}
openapi: 3.1.0
info:
  title: Atlas Accounts API
  version: 1.0.0
  description: ''
servers:
  - url: https://api.atlas.kitchen/accounts/v1
    description: Accounts API
security:
  - channelId: []
    sessionId: []
tags:
  - name: Introduction
    description: >
      The Accounts API lets a diner sign in on your storefront, then read and
      manage their own account with the merchant: profile, saved addresses, past
      orders, points and wallet promotions.


      It uses the same `X-Channel-Id` and `X-Session-Id` headers as the
      [Storefront API](/connect/storefront-api/authentication). Signing in
      attaches the diner to the session, so the Storefront API cart can use and
      earn their points.


      Everything here belongs to one merchant. The channel decides the merchant,
      and the merchant's point program for the channel's brand decides the
      points. The same diner can have different balances with different
      merchants.
  - name: Sign in
    description: Request a one-time code and sign the diner in.
  - name: Profile
    description: The signed-in diner's details.
  - name: Addresses
    description: Delivery addresses the signed-in diner has saved.
  - name: Orders
    description: The signed-in diner's past orders with this merchant.
  - name: Loyalty
    description: The signed-in diner's points and wallet promotions.
paths:
  /addresses/{id}:
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
    patch:
      tags:
        - Addresses
      summary: Update address
      description: >
        Send only the fields to change. Send `default: true` to make this the
        default address, or `default: false` to stop it being the default.
        `null` counts as `false`. Leave `default` out to keep it as it is.
      operationId: updateAddress
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/AddressInput'
                - type: object
                  properties:
                    default:
                      type: boolean
            example:
              notes: Call on arrival
              default: false
      responses:
        '200':
          description: The updated address
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Address'
              example:
                id: 3
                line1: 5 Straits View
                line2: '#12-01'
                postal_code: '018935'
                notes: Call on arrival
                longitude: 103.8536
                latitude: 1.2789
                default: false
        '401':
          $ref: '#/components/responses/NotSignedIn'
        '403':
          $ref: '#/components/responses/NotVerified'
        '404':
          description: The diner has no address with this ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  schemas:
    AddressInput:
      type: object
      properties:
        line1:
          type: string
          description: Required when adding an address
        line2:
          type: string
        postal_code:
          type: string
        notes:
          type: string
          description: Delivery instructions for the rider
        latitude:
          type: number
        longitude:
          type: number
    Address:
      type: object
      properties:
        id:
          type: integer
        line1:
          type: string
        line2:
          type:
            - string
            - 'null'
        postal_code:
          type:
            - string
            - 'null'
        notes:
          type:
            - string
            - 'null'
        longitude:
          type:
            - number
            - 'null'
        latitude:
          type:
            - number
            - 'null'
        default:
          type: boolean
    Error:
      type: object
      properties:
        type:
          type: string
          example: Invalid Parameter
        message:
          type: string
        details:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
              message:
                type: string
  responses:
    NotSignedIn:
      description: No diner is signed in on this session, or the session ID is invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            type: Unauthorized
            message: >-
              You did not provide valid credentials for this request. Please
              check your request and try again.
            details:
              - field: login
                message: You have to be logged in to process this request.
    NotVerified:
      description: >-
        The diner hasn't verified their mobile number yet. Sign them in with a
        code to verify it.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            type: Forbidden
            message: >-
              You do not have permission to process this request. Please check
              your credentials or contact support if the issue persists.
            details:
              - field: mobile_number
                message: >-
                  Your mobile number is not verified. Verify your mobile number
                  first before managing your account.
    ValidationError:
      description: A field is invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    channelId:
      type: apiKey
      in: header
      name: X-Channel-Id
      description: Merchant storefront identifier. Provided during onboarding.
    sessionId:
      type: apiKey
      in: header
      name: X-Session-Id
      description: >-
        Diner session identifier from the Storefront API's `GET /channel`. Log
        in returns a new one.

````

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