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

# Archive account

> Archives an account and releases all associated resources.

**Warning**: This action will:
- Release all phone numbers associated with the account
- Deactivate all campaigns
- Make the account unusable for sending messages

This operation is irreversible. If you need to send SMS in the future, you will need to re-register new phone numbers and campaigns.




## OpenAPI

````yaml DELETE /accounts/{id}
openapi: 3.1.1
info:
  title: Surge
  version: '1.0'
servers:
  - url: https://api.surge.app
security:
  - authorization: []
paths:
  /accounts/{id}:
    delete:
      tags:
        - Accounts
      summary: Archive an account
      description: >
        Archives an account and releases all associated resources.


        **Warning**: This action will:

        - Release all phone numbers associated with the account

        - Deactivate all campaigns

        - Make the account unusable for sending messages


        This operation is irreversible. If you need to send SMS in the future,
        you will need to re-register new phone numbers and campaigns.
      operationId: ArchiveAccount
      parameters:
        - in: path
          name: id
          required: true
          schema:
            description: The ID of the account to archive.
            example: acct_01jpqjvfg9enpt7pyxd60pcmxj
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Account'
          description: Archived account
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Error
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Surge from '@surgeapi/node';


            const client = new Surge({
              apiKey: process.env['SURGE_API_KEY'], // This is the default and can be omitted
            });


            const account = await
            client.accounts.archive('acct_01jpqjvfg9enpt7pyxd60pcmxj');


            console.log(account.id);
        - lang: Python
          source: |-
            import os
            from surge import Surge

            client = Surge(
                api_key=os.environ.get("SURGE_API_KEY"),  # This is the default and can be omitted
            )
            account = client.accounts.archive(
                "acct_01jpqjvfg9enpt7pyxd60pcmxj",
            )
            print(account.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/surge-go\"\n\t\"github.com/stainless-sdks/surge-go/option\"\n)\n\nfunc main() {\n\tclient := surge.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\taccount, err := client.Accounts.Archive(context.TODO(), \"acct_01jpqjvfg9enpt7pyxd60pcmxj\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", account.ID)\n}\n"
        - lang: Ruby
          source: |-
            require "surge_api"

            surge = SurgeAPI::Client.new(api_key: "My API Key")

            account = surge.accounts.archive("acct_01jpqjvfg9enpt7pyxd60pcmxj")

            puts(account)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Surge\Client;

            use Surge\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('SURGE_API_KEY') ?: 'My API
            Key');


            try {
              $account = $client->accounts->archive('acct_01jpqjvfg9enpt7pyxd60pcmxj');

              var_dump($account);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
components:
  schemas:
    Account:
      description: Response containing account information.
      example:
        brand_name: DT Precision Auto
        id: acct_01jpqjvfg9enpt7pyxd60pcmxj
        name: 'Account #2840 - DT Precision Auto'
        organization:
          address:
            country: US
            line1: 2640 Huron St
            line2: null
            locality: Los Angeles
            name: DT Precision Auto
            postal_code: '90065'
            region: CA
          contact:
            email: dom@dtprecisionauto.com
            first_name: Dominic
            last_name: Toretto
            phone_number: '+13235556439'
            title: other
            title_other: Owner
          country: US
          email: dom@dtprecisionauto.com
          identifier: '123456789'
          identifier_type: ein
          industry: automotive
          mobile_number: '+13235556439'
          regions_of_operation:
            - usa_and_canada
          registered_name: DT Precision Auto LLC
          stock_exchange: null
          stock_symbol: null
          type: llc
          website: https://dtprecisionauto.com
        time_zone: America/Los_Angeles
      properties:
        brand_name:
          description: >-
            The name by which the people this account communicates with know it.
            If not provided, this will match the name field.
          nullable: true
          type: string
        id:
          description: The account ID
          type: string
        name:
          description: >-
            The name of the account that will be visible for your internal
            organizational purposes. This will also be the default public-facing
            brand name unless you also set a `brand_name`, but otherwise the
            account name will never be displayed anywhere outside of Surge HQ,
            and may include your ID for the account or anything else that may
            help you.
          type: string
        organization:
          $ref: '#/components/schemas/Organization'
        time_zone:
          description: >-
            This is the time zone in which the account is headquartered. This
            time zone may be used for compliance with TCPA restrictions on when
            messages may be sent.
          example: America/Los_Angeles
          nullable: true
          type: string
      required:
        - brand_name
        - id
        - name
        - organization
        - time_zone
      title: Account
      type: object
    ErrorResponse:
      description: An error response
      example:
        error:
          message: The requested resource could not be found.
          type: not_found
      properties:
        error:
          $ref: '#/components/schemas/Error'
      required:
        - error
      title: ErrorResponse
      type: object
    Organization:
      description: The legal entity on whose behalf the account will be operated.
      properties:
        address:
          description: The address of the organization's headquarters.
          properties:
            country:
              description: >-
                The two character ISO 3166 country code. If none is provided,
                the organization's country code will be used.
              nullable: true
              type: string
            line1:
              description: >-
                The first line of the address, typically the number and street
                name
              nullable: true
              type: string
            line2:
              description: >-
                The second line of the address if needed, typically an apartment
                or suite number
              nullable: true
              type: string
            locality:
              description: The city or locality
              nullable: true
              type: string
            name:
              description: >-
                The name to which any mail should be addressed. If none is
                provided, this will default to the organization's
                registered_name
              nullable: true
              type: string
            postal_code:
              description: The postal code
              nullable: true
              type: string
            region:
              description: The state or region
              nullable: true
              type: string
          required:
            - name
            - line1
            - line2
            - locality
            - region
            - postal_code
            - country
          type: object
        contact:
          description: >-
            An object representing an individual who can be contacted if the
            carriers have any questions about the business.
          properties:
            email:
              description: >-
                An email address at which the individual can be reached.
                Typically an email using the same domain name as the website URL
                will be preferred (e.g. with a website domain of
                `https://dtprecisionauto.com`, an email like
                `dom@dtprecisionauto.com` will be preferred over one like
                `dom@anothergarage.com` or `dom.toretto@gmail.com`)
              format: email
              nullable: true
              type: string
            first_name:
              description: The first name (or given name) of the individual
              nullable: true
              type: string
            last_name:
              description: The last name (or family name) of the individual
              nullable: true
              type: string
            phone_number:
              description: >-
                A phone number at which the individual can be reached (E.164
                format)
              nullable: true
              type: string
            title:
              description: The job title of the individual.
              enum:
                - ceo
                - cfo
                - director
                - gm
                - vp
                - general_counsel
                - other
              nullable: true
              type: string
            title_other:
              description: >-
                If `other` is provided for the `title` field, this field should
                be used to provide the title of the individual
              nullable: true
              type: string
          required:
            - email
            - first_name
            - last_name
            - phone_number
            - title
            - title_other
          type: object
        country:
          description: >-
            The two character ISO 3166 country code for the country in which the
            organization is headquartered.
          nullable: true
          type: string
        email:
          description: >-
            For publicly traded companies, an email for a representative of the
            company to whom a verification email will be sent. This must be an
            email on the same domain as the company's website (e.g. with a
            website domain of `https://dtprecisionauto.com`, the email must use
            the same `@dtprecisionauto.com`)
          format: email
          nullable: true
          type: string
        identifier:
          description: >-
            The value of the identifier whose type is specified in the
            identifier_type field. For EIN, can be formatted with or without the
            hyphen. For CBN, must be exactly 9 digits.
          nullable: true
          type: string
        identifier_type:
          description: >-
            The type of identifier being provided for the organization. Use
            "ein" for US businesses or "cbn" for Canadian businesses.
          enum:
            - ein
            - cbn
          nullable: true
          type: string
        industry:
          description: The industry in which the organization operates.
          enum:
            - agriculture
            - automotive
            - banking
            - construction
            - consumer
            - education
            - electronics
            - energy
            - engineering
            - fast_moving_consumer_goods
            - financial
            - fintech
            - food_and_beverage
            - government
            - healthcare
            - hospitality
            - insurance
            - jewelry
            - legal
            - manufacturing
            - media
            - not_for_profit
            - oil_and_gas
            - online
            - professional_services
            - raw_materials
            - real_estate
            - religion
            - retail
            - technology
            - telecommunications
            - transportation
            - travel
          nullable: true
          type: string
        mobile_number:
          description: >-
            For sole proprietors, this must be a valid US or Canadian mobile
            phone number to which a verification text message will be sent.
            (E.164 format)
          nullable: true
          type: string
        regions_of_operation:
          description: An array of regions in which the organization operates.
          items:
            enum:
              - africa
              - asia
              - australia
              - europe
              - latin_america
              - usa_and_canada
            type: string
          nullable: true
          type: array
        registered_name:
          description: >-
            The legal name of the organization as registered with the IRS or
            other relevant authorities. For some applications, this will be
            matched against government records and should include all
            punctuation and everything else as well.
          nullable: true
          type: string
        stock_exchange:
          description: >-
            For publicly traded companies, this is the exchange on which the
            company's stock is traded.
          enum:
            - amex
            - amx
            - asx
            - b3
            - bme
            - bse
            - fra
            - icex
            - jpx
            - jse
            - krx
            - lon
            - nasdaq
            - none
            - nyse
            - nse
            - omx
            - other
            - sehk
            - sgx
            - sse
            - sto
            - swx
            - szse
            - tsx
            - twse
            - vse
          nullable: true
          type: string
        stock_symbol:
          description: >-
            For publicly traded companies, the ticker symbol for the company's
            stock
          nullable: true
          type: string
        type:
          description: The type of organization
          enum:
            - co_op
            - government
            - llc
            - non_profit
            - partnership
            - private_corporation
            - public_corporation
            - sole_proprietor
          nullable: true
          type: string
        website:
          description: >-
            The URL of the website for this organization. The website should be
            publicly available, clearly reflect the organization's purpose, and
            the URL should start with `https://`
          nullable: true
          type: string
      required:
        - address
        - contact
        - country
        - email
        - identifier
        - identifier_type
        - industry
        - mobile_number
        - regions_of_operation
        - registered_name
        - stock_exchange
        - stock_symbol
        - type
        - website
      title: Organization
      type: object
    Error:
      description: An error response
      example:
        message: The requested resource was not found.
        type: not_found
      properties:
        detail:
          additionalProperties: true
          description: Additional details about the error.
          type: object
        message:
          description: A human-readable error message.
          example: The requested resource was not found.
          type: string
        type:
          description: A unique error code.
          example: not_found
          type: string
      required:
        - type
        - message
      title: Error
      type: object
  securitySchemes:
    authorization:
      bearerFormat: Surge API token
      scheme: bearer
      type: http

````